ping 返回的TTL数值代表什么?

 1 [root@standby ~]# dig @202.106.0.20 www.iqiyi.com
2
3 ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6 <<>> @202.106.0.20 www.iqiyi.com
4 ; (1 server found)
5 ;; global options: +cmd
6 ;; Got answer:
7 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22053
8 ;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0
9
10 ;; QUESTION SECTION:
11 ;www.iqiyi.com. IN A
12
13 ;; ANSWER SECTION:
14 www.iqiyi.com. 7 IN CNAME static.dns.iqiyi.com.
15 static.dns.iqiyi.com. 6 IN A 111.206.13.65
16 static.dns.iqiyi.com. 6 IN A 111.206.13.63
17 static.dns.iqiyi.com. 6 IN A 111.206.13.61
18 static.dns.iqiyi.com. 6 IN A 111.206.13.64
19 static.dns.iqiyi.com. 6 IN A 111.206.13.62
20 static.dns.iqiyi.com. 6 IN A 111.206.13.66
21
22 ;; Query time: 6 msec
23 ;; SERVER: 202.106.0.20#53(202.106.0.20)
24 ;; WHEN: Thu Sep 15 17:25:09 2016
25 ;; MSG SIZE rcvd: 152

查看一共经历几跳路由

 1 [root@standby ~]# traceroute www.iqiyi.com
2 traceroute to www.iqiyi.com (111.206.13.63), 30 hops max, 60 byte packets
3 1 localhost (192.168.1.1) 2.924 ms 2.662 ms 2.429 ms
4 2 * * *
5 3 61.148.174.189 (61.148.174.189) 3.744 ms 3.555 ms 7.079 ms
6 4 124.65.58.237 (124.65.58.237) 6.910 ms 6.263 ms 6.062 ms
7 5 61.51.115.106 (61.51.115.106) 5.852 ms 5.635 ms 5.420 ms
8 6 bt-211-046.bta.net.cn (202.106.211.46) 6.722 ms 8.319 ms 8.019 ms
9 7 111.206.13.63 (111.206.13.63) 7.183 ms 3.643 ms 6.609 ms
10 [root@standby ~]#

查看返回的TTL

1 [root@standby ~]# ping www.iqiyi.com
2 PING static.dns.iqiyi.com (111.206.13.63) 56(84) bytes of data.
3 64 bytes from 111.206.13.63: icmp_seq=1 ttl=58 time=7.56 ms
4 64 bytes from 111.206.13.63: icmp_seq=2 ttl=58 time=9.46 ms
5 ^C
6 --- static.dns.iqiyi.com ping statistics ---
7 2 packets transmitted, 2 received, 0% packet loss, time 1957ms
8 rtt min/avg/max/mdev = 7.569/8.516/9.464/0.951 ms
9 [root@standby ~]#

64 - 6 = 58



已知经过6跳路由,那么我们尝试设置ttl为6进行试验:

1 [root@standby ~]# ping -c 3 -t 6 www.iqiyi.com
2 PING static.dns.iqiyi.com (111.206.13.66) 56(84) bytes of data.
3 From bt-211-046.bta.net.cn (202.106.211.46) icmp_seq=1 Time to live exceeded
4 From bt-211-046.bta.net.cn (202.106.211.46) icmp_seq=2 Time to live exceeded
5 From bt-211-046.bta.net.cn (202.106.211.46) icmp_seq=3 Time to live exceeded
6
7 --- static.dns.iqiyi.com ping statistics ---
8 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2017ms

已知经过6跳路由,那么我们尝试设置ttl为7进行试验:

 1 [root@standby ~]# ping -c 3 -t 7 www.iqiyi.com
2 PING static.dns.iqiyi.com (111.206.13.65) 56(84) bytes of data.
3 64 bytes from 111.206.13.65: icmp_seq=1 ttl=58 time=6.25 ms
4 64 bytes from 111.206.13.65: icmp_seq=2 ttl=58 time=12.1 ms
5 64 bytes from 111.206.13.65: icmp_seq=3 ttl=58 time=5.23 ms
6
7 --- static.dns.iqiyi.com ping statistics ---
8 3 packets transmitted, 3 received, 0% packet loss, time 2008ms
9 rtt min/avg/max/mdev = 5.233/7.885/12.167/3.057 ms
10 [root@standby ~]#

最新文章

  1. NSString,NSArray,NSNumber等类的继承问题
  2. w3m常用快捷键
  3. NSISの堆栈操作
  4. WPF自定义控件(三)——Window
  5. Triangle - POJ 2954(求三角形内的格子点的个数)
  6. Flashback version/Transaction Query,FlashbackTable
  7. 11-UIKit(Storyboard、View的基本概念、绘制图形、UIBezierPath)
  8. hdu1255(线段树——矩形面积交)
  9. python开发_tkinter_小球完全弹性碰撞游戏
  10. LLVM小结
  11. 使用PHP和HTML5 FormData实现无刷新文件上传教程
  12. 开源软件:NoSql数据库 - 图数据库 Cassandra
  13. P4717 【模板】快速沃尔什变换
  14. [python] RRT快速拓展随机树
  15. SVN创建分支/合并分支/切换分支
  16. 内置函数id,返回内存地址
  17. CSU 1817 Bones’s Battery Submit(二分+Floyd)
  18. Egret IDE中搜索,过滤文件,只搜索.ts
  19. FAFU 1395
  20. 批量去重URL地址并剔除打不开网址

热门文章

  1. Docker安装指定版本
  2. Docker(二十七)-Docker 清理占用的磁盘空间
  3. git worktree 是什么及其使用场景
  4. codeforces116B
  5. mysql test== 坑
  6. IDEA常见设置
  7. Leetcode 217.存在重复元素 By Python
  8. 【BZOJ2246】[SDOI2011]迷宫探险(搜索,动态规划)
  9. 【BZOJ1876】[SDOI2009]SuperGCD(数论,高精度)
  10. 洛谷 P3989 [SHOI2013]阶乘字符串 解题报告