如何验证ping数据包的返回时间是否正确

巧克力腹肌 2012-03-15 07:09:40
今天面试,技术总监问了我这样一个问题:ping命令返回的时间怎么验证它是否正确?

C:\Documents and Settings\Administrator>ping www.baidu.com

Pinging www.a.shifen.com [119.75.217.56] with 32 bytes of data:

Reply from 119.75.217.56: bytes=32 time=18ms TTL=45
Reply from 119.75.217.56: bytes=32 time=20ms TTL=45
Reply from 119.75.217.56: bytes=32 time=19ms TTL=45
Reply from 119.75.217.56: bytes=32 time=135ms TTL=45

Ping statistics for 119.75.217.56:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 18ms, Maximum = 135ms, Average = 48ms

如何验证粗体部分的时间是否正确
...全文
350 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
巧克力腹肌 2012-03-16
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 opl_ha 的回复:]

验证么, 那就在本机端口捕获ping的发送和收到的ICMP数据包并计时,然后对比呗
[/Quote]
谢谢楼上的回来,这下我明白问我问题那个总监啥意思了,唉,当时有提示我,只怪我反应不过来,当时被吓傻了。
opl_ha 2012-03-16
  • 打赏
  • 举报
回复
验证么, 那就在本机端口捕获ping的发送和收到的ICMP数据包并计时,然后对比呗
willstart 2012-03-16
  • 打赏
  • 举报
回复
用wireshark抓包

695

社区成员

发帖
与我相关
我的任务
社区描述
提出问题
其他 技术论坛(原bbs)
社区管理员
  • community_281
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧