Changes between Initial Version and Version 1 of TipAndDoc/VM/network/ping


Ignore:
Timestamp:
Jun 25, 2009 5:19:36 AM (15 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TipAndDoc/VM/network/ping

    v1 v1  
     1[[PageOutline]] 
     2 
     3 = 到達テスト = 
     4 * wiki:TipAndDoc/network/vmtest#networkmap のネットワークを使用 
     5 * <eth0> などとなっているのはデフォルトゲートウェイを示す 
     6 
     7 * VMを使ったせいか、おかしな挙動が見られたので注意 => [#unexpected] 
     8   * 実機で追試が必要? 
     9 
     10 = パケットロスするケース = 
     11 == inner-BB -> router -> centos-outer -> WAN == 
     12 * パケット経路 
     13   1. inner-BB:<eth0> 
     14   1. router:eth2 
     15   1. router:<eth0> 
     16   1. centos-outer:eth1 
     17   1. centos-outer:<eth0> -> WAN 
     18 
     19 * ubuntu-inner-BB:~$ ping 10.0.0.20 -c 1 
     20{{{ 
     21PING 10.0.0.20 (10.0.0.20) 56(84) bytes of data. 
     22 
     23--- 10.0.0.20 ping statistics --- 
     241 packets transmitted, 0 received, 100% packet loss, time 0ms 
     25}}} 
     26   1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 
     27{{{ 
     2818:09:56.550982 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 
     29}}} 
     30   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 
     31{{{ 
     3218:09:56.719082 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 
     33}}} 
     34   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     35{{{ 
     3618:09:56.719179 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 
     37}}} 
     38   1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth1 
     39{{{ 
     4018:09:56.864853 IP 10.2.0.10 > 10.0.0.20: ICMP echo request, id 45848, seq 1, length 64 
     41}}} 
     42   1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth0 
     43{{{ 
     4418:09:56.865503 IP 10.0.0.20 > 10.2.0.10: ICMP echo reply, id 45848, seq 1, length 64 
     45}}} 
     46 
     47 == centos-inner -> WAN == 
     48 * パケット経路 
     49   1. centos-inner:<eth0> -> WAN 
     50 
     51 * centos-inner ~]$ ping 10.0.0.10 -c 1 
     52{{{ 
     53PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data. 
     54 
     55--- 10.0.0.10 ping statistics --- 
     561 packets transmitted, 0 received, 100% packet loss, time 0ms 
     57}}} 
     58   1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth0 
     59{{{ 
     6020:07:51.313947 IP 192.168.50.110 > 10.0.0.10: ICMP echo request, id 44813, seq 1, length 64 
     61}}} 
     62 
     63 == centos-outer -> WAN == 
     64 * パケット経路 
     65   1. centos-outer:<eth0> -> WAN 
     66 
     67 * centos-outer ~]$ ping 10.1.0.110 -c 1 
     68{{{ 
     69PING 10.1.0.110 (10.1.0.110) 56(84) bytes of data. 
     70 
     71--- 10.1.0.110 ping statistics --- 
     721 packets transmitted, 0 received, 100% packet loss, time 0ms 
     73}}} 
     74   1. centos-outer ~]$ sudo tcpdump -p -n icmp -i eth0 
     75{{{ 
     7620:17:30.551763 IP 192.168.40.20 > 10.1.0.110: ICMP echo request, id 48141, seq 1, length 64 
     77}}} 
     78 
     79 == ubuntu-outer -> router -> centos-inner -> WAN == 
     80 * パケット経路 
     81   1. ubuntu-outer:<eth1> 
     82   1. router:<eth0> 
     83   1. router:eth1 
     84   1. centos-inner:eth1 
     85   1. centos-inner:<eth0> -> WAN 
     86 
     87 * ubuntu-outer:~$ ping 10.1.0.110 -c 1 
     88{{{ 
     89PING 10.1.0.110 (10.1.0.110) 56(84) bytes of data. 
     90 
     91--- 10.1.0.110 ping statistics --- 
     921 packets transmitted, 0 received, 100% packet loss, time 0ms 
     93}}} 
     94   1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 
     95{{{ 
     9620:29:41.465087 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 
     97}}} 
     98   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     99{{{ 
     10020:29:41.471692 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 
     101}}} 
     102   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 
     103{{{ 
     10420:29:41.481482 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 
     105}}} 
     106   1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth1 
     107{{{ 
     10820:29:41.437276 IP 10.0.0.10 > 10.1.0.110: ICMP echo request, id 31255, seq 1, length 64 
     109}}} 
     110   1. centos-inner ~]$ sudo tcpdump -p -n icmp -i eth0 
     111{{{ 
     11220:29:41.438220 IP 10.1.0.110 > 10.0.0.10: ICMP echo reply, id 31255, seq 1, length 64 
     113}}} 
     114 
     115 = 正常なケース = 
     116 == ubuntu-inner-BB <= ubuntu-router => ubuntu-outer == 
     117 * パケット経路 
     118   1. inner-BB:<eth0> 
     119   1. router:eth2 
     120   1. router:<eth0> 
     121   1. ubuntu-outer:<eth1> 
     122   1. ubuntu-outer:<eth1> 
     123   1. router:<eth0> 
     124   1. router:eth2 
     125   1. inner-BB:<eth0> 
     126  
     127 * ubuntu-inner-BB:~$ ping 10.0.0.10 -c 1 
     128{{{ 
     129PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data. 
     13064 bytes from 10.0.0.10: icmp_seq=1 ttl=63 time=10.0 ms 
     131 
     132--- 10.0.0.10 ping statistics --- 
     1331 packets transmitted, 1 received, 0% packet loss, time 0ms 
     134rtt min/avg/max/mdev = 10.017/10.017/10.017/0.000 ms 
     135}}} 
     136   1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 
     137{{{ 
     13818:04:53.003357 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 
     13918:04:53.013360 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 
     140}}} 
     141   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 
     142{{{ 
     14318:04:53.180070 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 
     14418:04:53.180372 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 
     145}}} 
     146   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     147{{{ 
     14818:04:53.180105 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 
     14918:04:53.180366 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 
     150}}} 
     151   1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 
     152{{{ 
     15318:04:53.177594 IP 10.2.0.10 > 10.0.0.10: ICMP echo request, id 35352, seq 1, length 64 
     15418:04:53.177684 IP 10.0.0.10 > 10.2.0.10: ICMP echo reply, id 35352, seq 1, length 64 
     155}}} 
     156 
     157 == 違う経路で帰ってくるケース == 
     158 === ubuntu-outer <= ubuntu-router => ubuntu-inner-AB === 
     159 * パケット経路 
     160   1. ubuntu-outer:<eth1> 
     161   1. router:<eth0> 
     162   1. router:eth1 
     163   1. inner-AB:eth0 
     164   1. inner-AB:<eth1> 
     165   1. router:eth2 
     166   1. router:<eth0> 
     167   1. ubuntu-outer:<eth1> 
     168  
     169 * ubuntu-outer:~$ ping 10.1.0.30 -c 1 
     170{{{ 
     171PING 10.1.0.30 (10.1.0.30) 56(84) bytes of data. 
     17264 bytes from 10.1.0.30: icmp_seq=1 ttl=63 time=36.8 ms 
     173 
     174--- 10.1.0.30 ping statistics --- 
     1751 packets transmitted, 1 received, 0% packet loss, time 0ms 
     176rtt min/avg/max/mdev = 36.889/36.889/36.889/0.000 ms 
     177}}} 
     178   1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 
     179{{{ 
     18020:36:54.692467 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 
     18120:36:54.712537 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 
     182}}} 
     183   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     184{{{ 
     18520:36:54.699054 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 
     18620:36:54.718482 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 
     187}}} 
     188   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 
     189{{{ 
     19020:36:54.711750 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 
     191}}} 
     192   1. ubuntu-inner-AB:~$ sudo tcpdump -p -n icmp -i eth0 
     193{{{ 
     19420:36:54.703190 IP 10.0.0.10 > 10.1.0.30: ICMP echo request, id 45847, seq 1, length 64 
     195}}} 
     196   1. ubuntu-inner-AB:~$ sudo tcpdump -p -n icmp -i eth1 
     197{{{ 
     19820:36:54.706993 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 
     199}}} 
     200   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 
     201{{{ 
     20220:36:54.718451 IP 10.1.0.30 > 10.0.0.10: ICMP echo reply, id 45847, seq 1, length 64 
     203}}} 
     204 
     205 == おかしな挙動 == #unexpected 
     206 * 指定したIPがバインドされたNICを通らずに通信されている 
     207  
     208 === ubuntu-outer <= ubuntu-router => inner-AA === 
     209 * inner-AA:eth1 = 10.1.0.20 なので、eth1を通るはずなのにeth0を通っている 
     210 
     211 * ubuntu-outer:~$ ping 10.1.0.20 -c 1 
     212{{{ 
     213PING 10.1.0.20 (10.1.0.20) 56(84) bytes of data. 
     21464 bytes from 10.1.0.20: icmp_seq=1 ttl=63 time=25.5 ms 
     215 
     216--- 10.1.0.20 ping statistics --- 
     2171 packets transmitted, 1 received, 0% packet loss, time 0ms 
     218rtt min/avg/max/mdev = 25.532/25.532/25.532/0.000 ms 
     219}}} 
     220   1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 
     221{{{ 
     22220:14:02.893113 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 
     22320:14:02.914912 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 
     224}}} 
     225   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     226{{{ 
     22720:14:02.900364 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 
     22820:14:02.920840 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 
     229}}} 
     230   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth1 
     231{{{ 
     23220:14:02.900768 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 
     23320:14:02.920824 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 
     234}}} 
     235   1. ubuntu-inner-AA:~$ sudo tcpdump -p -n icmp -i eth0 
     236{{{ 
     23720:14:02.888999 IP 10.0.0.10 > 10.1.0.20: ICMP echo request, id 60438, seq 1, length 64 
     23820:14:02.906825 IP 10.1.0.20 > 10.0.0.10: ICMP echo reply, id 60438, seq 1, length 64 
     239}}} 
     240 
     241 === ubuntu-outer <= ubuntu-router => inner-BB === 
     242 * inner-BB:eth1 = 10.2.0.20 なので、eth1を通るはずなのにeth0を通っている 
     243 
     244 * ubuntu-outer:~$ ping 10.2.0.20 -c 1 
     245{{{ 
     246PING 10.2.0.20 (10.2.0.20) 56(84) bytes of data. 
     24764 bytes from 10.2.0.20: icmp_seq=1 ttl=63 time=26.0 ms 
     248 
     249--- 10.2.0.20 ping statistics --- 
     2501 packets transmitted, 1 received, 0% packet loss, time 0ms 
     251rtt min/avg/max/mdev = 26.001/26.001/26.001/0.000 ms 
     252}}} 
     253   1. ubuntu-outer:~$ sudo tcpdump -p -n icmp -i eth1 
     254{{{ 
     25521:46:14.403188 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 
     25621:46:14.419804 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 
     257}}} 
     258   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth0 
     259{{{ 
     26021:46:14.409977 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 
     26121:46:14.424457 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 
     262}}} 
     263   1. ubuntu-router:~$ sudo tcpdump -p -n icmp -i eth2 
     264{{{ 
     26521:46:14.423153 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 
     26621:46:14.424369 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 
     267}}} 
     268   1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 
     269{{{ 
     27021:46:14.417399 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 57113, seq 1, length 64 
     27121:46:14.434352 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 57113, seq 1, length 64 
     272}}} 
     273 
     274 ==== (仮想NICからケーブルを)物理的に切断してみる ==== 
     275 * VMのNICから(仮想的に)LANケーブルを切断する 
     276 
     277 * ubuntu-outer:~$ ping 10.2.0.20 
     278{{{ 
     279PING 10.2.0.20 (10.2.0.20) 56(84) bytes of data. 
     280 
     281(snip) 
     282 
     28364 bytes from 10.2.0.20: icmp_seq=18 ttl=63 time=2.41 ms 
     28464 bytes from 10.2.0.20: icmp_seq=19 ttl=63 time=4.53 ms 
     28564 bytes from 10.2.0.20: icmp_seq=20 ttl=63 time=1.42 ms 
     28664 bytes from 10.2.0.20: icmp_seq=21 ttl=63 time=2.76 ms 
     28764 bytes from 10.2.0.20: icmp_seq=33 ttl=63 time=1.07 ms 
     28864 bytes from 10.2.0.20: icmp_seq=34 ttl=63 time=1.21 ms 
     289 
     290--- 10.2.0.20 ping statistics --- 
     29134 packets transmitted, 23 received, 32% packet loss, time 33009ms 
     292rtt min/avg/max/mdev = 0.635/2.304/4.539/0.935 ms 
     293}}} 
     294   1. 途中、eth1を切断してもpingは通り続けた 
     295   1. eth0を切断するとpacket lost 
     296   1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth0 
     297{{{ 
     29822:07:09.562788 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 18, length 64 
     29922:07:10.574025 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 19, length 64 
     30022:07:10.574061 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 19, length 64 
     30122:07:11.571686 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 20, length 64 
     30222:07:11.571709 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 20, length 64 
     30322:07:12.572202 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 21, length 64 
     30422:07:12.572225 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 21, length 64 
     30522:07:24.572056 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 33, length 64 
     30622:07:24.572299 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 33, length 64 
     30722:07:25.572061 IP 10.0.0.10 > 10.2.0.20: ICMP echo request, id 38682, seq 34, length 64 
     30822:07:25.572149 IP 10.2.0.20 > 10.0.0.10: ICMP echo reply, id 38682, seq 34, length 64 
     309}}} 
     310   * eth1をダウンさせても変わらず 
     311     1. ubuntu-inner-BB:~$ sudo tcpdump -p -n icmp -i eth1 
     312{{{ 
     313tcpdump: bind: Network is down 
     314}}} 
     315     1. ubuntu-inner-BB:~$ ifconfig eth1 
     316{{{ 
     317eth1      Link encap:Ethernet  HWaddr 00:0c:29:ZZ:ZZ:ZZ 
     318          inet addr:10.2.0.20  Bcast:10.2.255.255  Mask:255.255.0.0 
     319}}} 
     320       * 何故かIPがバインドされたまま 
     321 
     322 * VMで同じセグメント(仮想HUB)にNICを繋げているせい?