本文发表在 rolia.net 枫下论坛我做了一个测试:
在我的gateway的一个窗口ping:
ddai:506$ ping -s 3000 209.139.240.65
PING 209.139.240.65 (209.139.240.65): 3000 data bytes
3008 bytes from 209.139.240.65: icmp_seq=0 ttl=247 time=444.711 ms
--- 209.139.240.65 ping statistics ---
3 packets transmitted, 1 packets received, 66% packet loss
round-trip min/avg/max/std-dev = 444.711/444.711/444.711/0.000 ms
ddai:507$
在另外一个窗口运行tcpdump:
# tcpdump -n -i de0
tcpdump: listening on de0
21:27:32.908456 24.76.93.185 > 209.139.240.65: icmp: echo request (frag 47010:1480@0+)
21:27:32.909379 24.76.93.185 > 209.139.240.65: (frag 47010:1480@1480+)
21:27:32.909454 24.76.93.185 > 209.139.240.65: (frag 47010:48@2960)
21:27:33.345758 209.139.240.65 > 24.76.93.185: icmp: echo reply (frag 31697:1480@0+)
21:27:33.350621 209.139.240.65 > 24.76.93.185: (frag 31697:1480@1480+)
21:27:33.350704 209.139.240.65 > 24.76.93.185: (frag 31697:48@2960)
21:27:33.919947 24.76.93.185 > 209.139.240.65: icmp: echo request (frag 41360:1480@0+)
21:27:33.920877 24.76.93.185 > 209.139.240.65: (frag 41360:1480@1480+)
21:27:33.920949 24.76.93.185 > 209.139.240.65: (frag 41360:48@2960)
21:27:34.336092 209.139.240.65 > 24.76.93.185: icmp: echo reply (frag 31698:1480@0+)
21:27:34.336157 209.139.240.65 > 24.76.93.185: (frag 31698:48@2960)
21:27:34.340223 209.139.240.65 > 24.76.93.185: (frag 31698:1480@1480+)
21:27:34.926424 24.76.93.185 > 209.139.240.65: icmp: echo request (frag 38068:1480@0+)
21:27:34.927345 24.76.93.185 > 209.139.240.65: (frag 38068:1480@1480+)
21:27:34.927431 24.76.93.185 > 209.139.240.65: (frag 38068:48@2960)
21:27:35.367154 209.139.240.65 > 24.76.93.185: icmp: echo reply (frag 31699:1480@0+)
21:27:35.367224 209.139.240.65 > 24.76.93.185: (frag 31699:48@2960)
21:27:35.369376 209.139.240.65 > 24.76.93.185: (frag 31699:1480@1480+)
^C
18 packets received by filter
0 packets dropped by kernel
#
从上面的tcpdump的结果可以看到,所有的 Echo Request/Echo Reply 都被 frag 了,而且返回的 Echo Reply 包中,只有第一个的顺序是正确的,这个从ping的结果也可以看到,只有第一个 echo request 有返回的包。而这只是一个包被分成3个包的结果(我用的是3000),而你用8000的包,就会被分割成更多的包,这样out of order 的几率就大得多了,所以多半会 time out。更多精彩文章及讨论,请光临枫下论坛 rolia.net