大家好,又见面了,我是你们的朋友全栈君。
Windows小工具tcping一、ping和tcping的区别1 指代不同1、ping:是Windows、Unix和Linux系统下的一个命令。ping也属于一个通信协议,是TCP/IP协议的一部分。通过ICMP协议发送报文到对方主机上任意一个60000以上的端口,然后获取对方主机的回复。2、tcping:是一种面向连接的、可靠的、基于字节流的传输层通信协议。使用TCP协议尝试与某一个端口建立连接,然后获取与对方主机建立一次连接的回复。
2 功能不同1、ping:利用“ping”命令可以检查网络是否连通,可以很好地帮助分析和判定网络故障。2、tcping:适用于支持多网络应用的分层协议层次结构。连接到不同但互连的计算机通信网络的主计算机中的进程之间依靠TCP提供可靠的通信服务。
3 特点不同1、ping:Ping发送一个ICMP即因特网信报控制协议;回声请求消息给目的地并报告是否收到所希望的ICMP回声。2、tcping:可以从较低级别的协议获得简单的,可能不可靠的数据报服务。原则上,TCP应该能够在从容硬线连接到分组交换或电路交换网络的各种通信系统之上操作。
二、tcping下载及使用方式1、tcping下载方式下载链接:https://www.php.cn/link/d6df8e50c3cc76ab487e51448cc1c57f
2、tcping使用方式仅下载tcping.exe程序,然后放入C:\Windows\System32
记得如果使用的是64位电脑,就要下载对应的tcping64.exe程序,放在目录中后,须改名为tcping.exe。
按下“win+r”打开cmd,输入:
tcping www.baidu.com 80
输入
tcping
C:\Users\sialee>tcping--------------------------------------------------------------tcping.exe by Eli FulkersonPlease see http://www.elifulkerson.com/projects/ for updates.--------------------------------------------------------------Usage: tcping [-flags] server-address [server-port]Usage (full): tcping [-t] [-d] [-i interval] [-n times] [-w ms] [-b n] [-r times] [-s] [-v] [-j] [-js size] [-4] [-6] [-c] [-g count] [-S source_address] [--file] [--tee filename] [-h] [-u] [--post] [--head] [--proxy-port port] [--proxy-server server] [--proxy-credentials username:password] [-f] server-address [server-port] -t : ping continuously until stopped via control-c -n 5 : for instance, send 5 pings -i 5 : for instance, ping every 5 seconds -w 0.5 : for instance, wait 0.5 seconds for a response -d : include date and time on each line -b 1 : enable beeps (1 for on-down, 2 for on-up, 3 for on-change, 4 for always) -r 5 : for instance, relookup the hostname every 5 pings -s : automatically exit on a successful ping -v : print version and exit -j : include jitter, using default rolling average -js 5 : include jitter, with a rolling average size of (for instance) 5. --tee : mirror output to a filename specified after '--tee' --append : Append to the --tee filename rather than overwriting it -4 : prefer ipv4 -6 : prefer ipv6 -c : only show an output line on changed state --file : treat the "server-address" as a filename instead, loop through file line by line Note: --file is incompatible with options such as -j and -c as it is looping through different targets Optionally accepts server-port. For example, "example.org 443" is valid. Alternately, use -p to force a port at command line for everything in the file. -g 5 : for instance, give up if we fail 5 times in a row -S _X_ : Specify source address _X_. Source must be a valid IP for the client computer. -p _X_ : Alternate method to specify port --fqdn : Print domain name on each line if available --ansi : Use ANSI color sequences (cygwin) --color: Use Windows color sequencesHTTP Options: -h : HTTP mode (use url without http:// for server-address) -u : include target URL on each line --post : use POST rather than GET (may avoid caching) --head : use HEAD rather than GET --proxy-server : specify a proxy server --proxy-port : specify a proxy port --proxy-credentials : specify 'Proxy-Authorization: Basic' header in format username:passwordDebug Options: -f : force tcping to send at least one byte --header : include a header with original args and date. Implied if using --tee. --block : use a 'blocking' socket to connect. This prevents -w from working and uses the default timeout (as long as 20 seconds in my case). However it can detect an actively refused connection vs a timeout. If you don't pass server-port, it defaults to 80.
对应的注释如下:
-t 持续发送数据包直到按Ctrl+C停止,可以用此命令进行持续测试。-n 5 一次发送5个数据包,默认一次发送4个:tcping -n 5 www.baidu.com 将对百度进行5次tcping,也可以使用其他数字。-i 5 每5秒发送一个数据包:tcping -i 5 www.baidu.com 每隔5秒对百度进行一次tcping,也可以使用其他数字或小数:tcping -i 0.5 www.baidu.com 每隔0.5秒对百度进行一次tcping。-w 0.5 tcping不通时的等待时间,tcping通则忽略此参数:tcping -w 0.5 www.baidu.com 如果tcping不通会等待0.5秒,默认tcping不通等待2秒,tcping通则忽略此参数。-d 在每行前面显示详细的日期和时间。-b 1-4 ping时会响铃,参数4会一直响铃:tcping -b 4 www.baidu.com 每显示一行内容就会响铃一次,默认会响铃4次。-r 5 每发送5个数据包重新查找主机一次(通过DNS或路由查找)。-s tcping通就立即退出。-v 显示版本信息。-j 使用默认的方法求ping的均值以减小波动,网络有一定的不稳定性,使用此参数可以减小波动。-js 5 使用5个实例求平均值以减小波动,使用这个参数系统会tcping 5次然后求出平均值作为一次结果显示,减小波动。--tee 将结果输出到指定位置:tcping --tee d:\test.txt 192.168.0.100 会将tcping的结果保存在d盘下的test文件中。-c 只显示状态变化的信息(tcping时间很短一般不会变化)。-g 5 失败5次就放弃(注意默认是80端口,端口未开放也算失败)。-h 以HTTP模式工作,可以测试主机是否提供HTTP服务。--post 为了保证自己计算机的安全,有些电脑禁止了别人ping,使用post/head参数可以增加tcping成功的概率。--head 增加tcping成功的概率。--proxy-server 指定代理服务:没有代理无法测试。--proxy-port 指定代理服务端口:没有代理无法测试。--proxy-credentials 使用代理的安全验证,需要输入用户名和密码:没有代理无法测试。-f 强制tcping命令至少发送一个字节(byte)。--file 从文件中获取tcping的目标:tcping --file d:\test.txt 在d盘下新建一个test文件,并输入所有要tcping的IP或域名,每行一个,然后执行命令,会依次tcping文件中指定的地址。--header 在头部显示时间和日期,与--tee显示的格式差不多。--block tcping不通的等待时间,默认是20秒(很长),可以将-w参数冲突掉:tcping --block www.baiu.com 网址不正确显然tcping不通,默认会等待2秒,但加了--block参数后每tcping一次会等待20秒:tcping -w 0.5 --block www.baiu.com 还是会等待20秒而不是0.5秒,因为--block会把-w参数冲突掉。有一个不明白的参数-u 显示目标的URL。
参考:https://www.php.cn/link/c57d4c50a6b5969e1244e60155863090
发布者:全栈程序员栈长,转载请注明出处:https://www.php.cn/link/d5b9f2fee8f809454c7727fd1466e3ec
以上就是Windows小工具 tcping的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号