简述
网络延迟用的最多的是基于icmp
协议的ping
,但是对于一些禁止ping
的服务端将不起作用,这个时候如果我们想要测试网络延迟那么可以使用tcping
工具;此工具的原理和他的名字一样是基于tcp协议的,通过tcp的三次握手实现;
安装
Centos:
yum install tcptraceroute bc -y
wget -O tcping https://soft.mengclaw.com/Bash/TCP-PING
chmod +x tcping
mv tcping /usr/bin
Windows:
windows的tcping和linux下的不是同一个软件,但是基础的使用方式差不多,具体看下帮助信息,下载地址如下:
https://download.elifulkerson.com//files/tcping/0.39/tcping.exe
使用
[root@192.168.128.129 ~]# ./tcping
tcpping v1.7 Richard van den Berg <richard@vdberg.org>
Usage: tcping [-d] [-c] [-C] [-w sec] [-q num] [-x count] ipaddress [port]
-d print timestamp before every result
-c print a columned result line
-C print in the same format as fping's -C option
-w wait time in seconds (defaults to 3)
-r repeat every n seconds (defaults to 1)
-x repeat n times (defaults to unlimited)
See also: man tcptraceroute
demo:
[root@192.168.128.128 ~]# tcping baidu.com 443
traceroute to shein.com (35.166.139.52), 255 hops max, 60 byte packets
seq 0: tcp response from ec2-35-166-139-52.us-west-2.compute.amazonaws.com (35.166.139.52) <syn,ack> 2.964 ms
traceroute to shein.com (35.166.139.52), 255 hops max, 60 byte packets
seq 1: tcp response from ec2-35-166-139-52.us-west-2.compute.amazonaws.com (35.166.139.52) <syn,ack> 3.065 ms
traceroute to shein.com (35.166.139.52), 255 hops max, 60 byte packets
seq 2: tcp response from ec2-35-166-139-52.us-west-2.compute.amazonaws.com (35.166.139.52) <syn,ack> 2.683 ms
traceroute to shein.com (35.166.139.52), 255 hops max, 60 byte packets