如何 ping 计算机/服务器并分别获取传输和接收时间,而不是获取一个往返时间。我正在使用 hrping,我可以从本地网络上的计算机获取传输和接收时间。
D:\Portable\hrping>hrping 192.168.1.1 -M
This is hrPING v5.07.1148 by cFos Software GmbH -- http://www.cfos.de
Source address is 192.168.1.17; using ICMP timestamp, ID=801c
Pinging 192.168.1.1 [192.168.1.1]
with 0 bytes data (40 bytes IP):
From 192.168.1.1: bytes=40 seq=0001 TTL=64 ID=62f3 time=0.626ms tx=1ms rx=0ms
From 192.168.1.1: bytes=40 seq=0002 TTL=64 ID=62f4 time=0.923ms tx=1ms rx=0ms
From 192.168.1.1: bytes=40 seq=0003 TTL=64 ID=62f5 time=0.336ms tx=1ms rx=-1ms
From 192.168.1.1: bytes=40 seq=0004 TTL=64 ID=62f6 time=0.320ms tx=1ms rx=-1ms
Packets: sent=4, rcvd=4, error=0, lost=0 (0.0% loss) in 1.502086 sec
RTTs in ms: min/avg/max/dev: 0.320 / 0.551 / 0.923 / 0.246
Bandwidth in kbytes/sec: sent=0.106, rcvd=0.106
但它不适用于互联网上的任何东西。
D:\Portable\hrping>hrping google.com -M
This is hrPING v5.07.1148 by cFos Software GmbH -- http://www.cfos.de
Source address is 192.168.1.17; using ICMP timestamp, ID=082b
Pinging google.com [172.217.16.238]
with 0 bytes data (40 bytes IP):
Timeout waiting for seq=0001
Timeout waiting for seq=0002
Timeout waiting for seq=0003
Timeout waiting for seq=0004
Packets: sent=4, rcvd=0, error=0, lost=4 (100.0% loss) in 1.503945 sec
RTTs in ms: min/avg/max/dev: 0.000 / 0.000 / 0.000 / 0.000
Bandwidth in kbytes/sec: sent=0.106, rcvd=0.000
我从 hrping 收到此消息,并设置了防火墙规则。仍然一无所有。
hrPing did not get any replies. This might be due to a firewall setting.
If you use Windows firewall with default settings, you need to add a rule to
allow hrPing full incoming ICMP traffic:
Go to Control Panel, Windows Firewall and click on Advanced settings on the
left. A new dialog appears: on its left pane right-click 'Inbound Rules' and
select 'New rule...' In the following wizard select 'Custom', click Next,
select 'All programs', click Next, select 'ICMPv4' as 'Protocol type', click
Next 4 times and enter 'hrPing' as 'Name' and click 'Finish'.
Don't forget to disable or delete this rule when you no longer need it!
您很可能正在 ping 已禁用 ICMP ping 的网络。许多网络出于安全考虑禁用 ping,例如防止 ping 泛滥。谷歌就是这样一家公司。
尝试 ping amazon.com 和 yahoo.com,因为它们目前允许 ping。
hrping -M
使用 ICMP Timestamp Request数据包而不是通常的 Echo Request。许多管理员将他们的服务器配置为只允许非常有限的 ICMP 请求类型列表——他们通常允许 ICMP Echo(每个人都将其与“ping”相关联),而没有其他任何东西。
因此,虽然 hrPing 的消息是正确的,这可能是防火墙问题,但问题出在另一端的防火墙上,您真的对此无能为力 - 除了尝试 ping 其他东西。
(例如,“superuser.com”确实回答了时间戳请求,而“google.com”根本不回答。我下载 hrPing 的“cfos.de”网站也回答了时间戳请求,但方式有点奇怪。 )