2013-10-21 04:35 PM
== 目次 == 1. 基本 2. Packet Size 3. Fragment |
本ドキュメントはNX-OSにおけるPINGの取り扱いに関して説明します。
また、本ドキュメントはNX-OS 6.1(2), IOS 12.2(58)SE2に基づいた内容となっています。
NX-OSはPINGの出力結果自体が従来のIOSとは異なります。NX-OSがLinux Based OSであることがこの差からも伺えます。
N7K# ping 192.168.8.3 PING 192.168.8.3 (192.168.8.3): 56 data bytes 64 bytes from 192.168.8.3: icmp_seq=0 ttl=254 time=2.321 ms 64 bytes from 192.168.8.3: icmp_seq=1 ttl=254 time=2.097 ms 64 bytes from 192.168.8.3: icmp_seq=2 ttl=254 time=6.082 ms 64 bytes from 192.168.8.3: icmp_seq=3 ttl=254 time=2.594 ms 64 bytes from 192.168.8.3: icmp_seq=4 ttl=254 time=2.096 ms
Cat3750#ping 192.168.8.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
NX-OSにおけるPINGのオプションは下記のものがあります。
N7K# ping 192.168.8.1 ? <CR> count Number of pings to send df-bit Enable do not fragment bit in IP header interval Wait interval seconds between sending each packet packet-size Packet size to send source Source IP address to use timeout Specify timeout interval vrf Display per-VRF information
これらやその他のオプションをIOSと簡単に比較した結果が下記の様になります。
Table1.1: NX-OSとIOSのPING差異一覧
NX-OS | IOS | 内容 |
---|---|---|
count [5] | repeat [5] | 送信する icmp packet の数 |
df-bit [off] | df-bit [off] | "Do Not Fragment Bit"の有効化。フラグメントの禁止。 |
interval [0] | icmp packet を送信する間隔 [sec] | |
packet-size [56] | size [100] | icmp packetの大きさ [byte] ※詳細後述 |
source | source | icmp packetの送信元IPを指定 |
timeout [2] | timeout [2] | icmp requestのtimeout時間 [sec] |
validate [off] | icmp checksum 確認の有効化 | |
data [0xABCD] | icmp datagramのパターン指定 | |
ping <IP> vrf | ping vrf <IP> | 使用するルーティングテーブル( vrf )の指定 |
ping <IP> | ping ip <IP> | IPv4 の PING |
ping6 <IP> | ping ipv6 <IP> | IPv6 の PING |
ping multicast <IP> <I/F> | ping <IP> | Multicast宛のPING ( NX-OSではbroadcastは不可 ) |
NX-OSにおけるPINGオプションの詳細は下記ドキュメントもご参照下さい。
- Cisco Nexus 7000 シリーズ NX-OS 基本コマンド リファレンス -
IOSにおけるPINGオプションの詳細は下記ドキュメントもご参照下さい。
- 拡張 ping および拡張 traceroute コマンドの使用方法 -
http://www.cisco.com/cisco/web/support/JP/100/1007/1007862_ext_ping_trace-j.html
下記の様に拡張PINGを実行した場合は、NX-OSにおける指定可能オプションが上記表と若干変わり、IOSとの差異がほぼ無くなります。
N7K# ping Vrf context to use [default] : No user input: using default context Target IP address or Hostname: 192.168.8.3 Repeat count [5] : 1 Datagram size [56] : 100 Timeout in seconds [2] : 1 Sending interval in seconds [0] : 1 Extended commands [no] : y Source address or interface : 192.168.8.1 Data pattern [0xabcd] : 0xaaaa Type of service [0] : 3 Set DF bit in IP header [no] : y Time to live [255] : 200 Loose, Strict, Record, Timestamp, Verbose [None] : verbose Loose, Strict, Record, Timestamp, Verbose [V] : Sweep range of sizes [no] : y <== 100-150 byteまで3byteおきにsizeを変更してPING実行 {Sweep} min size [100] : 100 {Sweep} max size [101] : 150 {Sweep} interval [1] : 3 Sending 17, [100..150]-bytes ICMP Echos to 192.168.8.3 Timeout is 1 seconds, data pattern is 0xAAAA 108 bytes from 192.168.8.3: icmp_seq=0 ttl=254 time=2.749 ms 111 bytes from 192.168.8.3: icmp_seq=1 ttl=254 time=2.542 ms 114 bytes from 192.168.8.3: icmp_seq=2 ttl=254 time=3.958 ms 117 bytes from 192.168.8.3: icmp_seq=3 ttl=254 time=12.716 ms 120 bytes from 192.168.8.3: icmp_seq=4 ttl=254 time=3.047 ms .......
NX-OSとIOSにおけるpacket sizeは表1.1にあるようにデフォルトでそれぞれ56 byte,100 byteとなっています。
このサイズの示す意味がNX-OSとIOSでは下記の様に異なります。
N7K# ping 192.168.8.3 packet-size 1000 count 1 PING 192.168.8.3 (192.168.8.3): 1000 data bytes 1008 bytes from 192.168.8.3: icmp_seq=0 ttl=254 time=2.98 ms--- 192.168.8.3 ping statistics --- 1 packets transmitted, 1 packets received, 0.00% packet loss round-trip min/avg/max = 2.98/2.979/2.98 ms
Cat3750#ping 192.168.8.1 size 1000 repeat 1 Type escape sequence to abort. Sending 1, 1000-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (1/1), round-trip min/avg/max = 8/8/8 ms
まず、PINGの出力結果の示すサイズはそれぞれ、
・NX-OS : 1008 bytes => ICMP header + ICMP data
・IOS : 1000-byte => IP header + ICMP header + ICMP data ( = IP packet )
を意味します。
次に各sizeオプションで指定した値はそれぞれ、
・NX-OSにおける指定 packet-size : ICMP data
・IOSにおける指定 size : IP header + ICMP header + ICMP data ( = IP packet )
を指定していることになります。
その為、同じ1000 byteを指定しても実際に送信されるpacketサイズは IP header + ICMP header の28 byte分の差が生じます。
図1:IPとICMPフォーマット
これを`debug ip icmp`により確認します。まずはIOSからのPINGです。
Cat3750#ping 192.168.8.1 size 1000 repeat 1 N7K# debug ip icmp ICMP packet debugging is on 2013 Oct 21 07:10:38.498781 netstack: [3927] (default) Rcvd packet on Ethernet3/5 (mbuf_prty 0): s=192.168.8.3, d=192.168.8.1, proto=1 (icmp), ICMP_ECHO, tos/dscp=0x0/0x0, ip_len=1000, id=0019, ttl=254 2013 Oct 21 07:10:38.498848 netstack: [3927] (default) Send packet (mbuf_prty 0): s=192.168.8.1, d=192.168.8.3, proto=1 (icmp), ICMP_ECHOREPLY, tos/dscp=0x0/0x0, ip_len=1000, id=0019, ttl=255 Cat3750#debug ip icmp ICMP packet debugging is on *Oct 21 07:10:38.748: ICMP: echo reply rcvd, src 192.168.8.1, dst 192.168.8.3, topology BASE, dscp 0 topoid 0
Nexus7000上のdebugでは ip_len より IP packet全体の大きさが1000 byteであることがわかります。Cat3750上のdebugではIP packetの大きさまでは表示されません。
次にNX-OSからのPINGです。
N7K# ping 192.168.8.3 packet-size 1000 count 1 N7K# debug ip icmpICMP packet debugging is on 2013 Oct 21 07:16:30.371183 netstack: [3927] (default) Send packet (mbuf_prty 0): s=192.168.8.1, d=192.168.8.3, proto=1 (icmp), ICMP_ECHO, tos/dscp=0x0/0x0, ip_len=1028, id=0000, ttl=255 2013 Oct 21 07:16:30.374241 netstack: [3927] (default) Rcvd packet on Ethernet3/5 (mbuf_prty 0): s=192.168.8.3, d=192.168.8.1, proto=1 (icmp), ICMP_ECHOREPLY, tos/dscp=0x0/0x0, ip_len=1028, id=0fb6, ttl=254
先程と同様にNexus7000のdebugの ip_len よりIP packet全体の大きさが1028 byteであることがわかります。
これを今度はethanalyzerにより確認します。ethanalyzerはNX-OS上で動作するWireshark(Ethereal) のコードに沿ったパケット・キャプチャ機能です。
IOSからのPINGではsizeオプションがIP packet全体( Total Length: 1000 )を指定しており、ICMP data部分( Data (972 bytes) )は1000 - 28 = 972 byteであることが分かります。
Cat3750#ping 192.168.8.1 size 1000 repeat 1
N7K# ethanalyzer local interface inband capture-filter "icmp" detail
Capturing on inband
Frame 1 (1046 bytes on wire, 1014 bytes captured)
< snip >
Ethernet II, Src: 00:18:73:6b:09:42 (00:18:73:6b:09:42), Dst: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Destination: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Source: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Type: IP (0x0800)
Internet Protocol, Src: 192.168.8.3 (192.168.8.3), Dst: 192.168.8.1 (192.168.8.1)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1000
Identification: 0x001e (30)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: ICMP (0x01)
Header checksum: 0x26a2 [correct]
Source: 192.168.8.3 (192.168.8.3)
Destination: 192.168.8.1 (192.168.8.1)
Internet Control Message Protocol
Type: 8 (Echo (ping) request)
Code: 0 ()
Checksum: 0xb298 [correct]
Identifier: 0x0006
Sequence number: 0 (0x0000)
Data (972 bytes)
Frame 2 (1046 bytes on wire, 1014 bytes captured)
< snip >
Ethernet II, Src: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41), Dst: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Destination: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Source: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Type: IP (0x0800)
Internet Protocol, Src: 192.168.8.1 (192.168.8.1), Dst: 192.168.8.3 (192.168.8.3)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1000
Identification: 0x001e (30)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: ICMP (0x01)
Header checksum: 0x26a2 [correct]
Source: 192.168.8.1 (192.168.8.1)
Destination: 192.168.8.3 (192.168.8.3)
Internet Control Message Protocol
Type: 0 (Echo (ping) reply)
Code: 0 ()
Checksum: 0xba98 [correct]
Identifier: 0x0006
Sequence number: 0 (0x0000)
Data (972 bytes)
NX-OSからのPINGではpacket-sizeオプションがICMP data部分( Data (1000 bytes) )を指定しており、IP packet全体( Total Length: 1028 )は1000 + 28 = 1028 byteであることが分かります。
N7KA# ping 192.168.8.3 packet-size 1000 count 1
N7K# ethanalyzer local interface inband capture-filter "icmp" detail
Capturing on inband
Frame 1 (1074 bytes on wire, 1042 bytes captured)
< snip >
Ethernet II, Src: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41), Dst: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Destination: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Source: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Type: IP (0x0800)
Internet Protocol, Src: 192.168.8.1 (192.168.8.1), Dst: 192.168.8.3 (192.168.8.3)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1028
Identification: 0x0fb6 (4022)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: ICMP (0x01)
Header checksum: 0x16ee [correct]
Source: 192.168.8.1 (192.168.8.1)
Destination: 192.168.8.3 (192.168.8.3)
Internet Control Message Protocol
Type: 8 (Echo (ping) request)
Code: 0 ()
Checksum: 0x9c35 [correct]
Identifier: 0xfa4e
Sequence number: 0 (0x0000)
Data (1000 bytes)
Frame 2 (1074 bytes on wire, 1042 bytes captured)
< snip >
Ethernet II, Src: 00:18:73:6b:09:42 (00:18:73:6b:09:42), Dst: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Destination: 00:1b:54:c2:b4:41 (00:1b:54:c2:b4:41)
Source: 00:18:73:6b:09:42 (00:18:73:6b:09:42)
Type: IP (0x0800)
Internet Protocol, Src: 192.168.8.3 (192.168.8.3), Dst: 192.168.8.1 (192.168.8.1)
Version: 4
Header length: 20 bytes
Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)
Total Length: 1028
Identification: 0x0fb6 (4022)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: ICMP (0x01)
Header checksum: 0x16ee [correct]
Source: 192.168.8.3 (192.168.8.3)
Destination: 192.168.8.1 (192.168.8.1)
Internet Control Message Protocol
Type: 0 (Echo (ping) reply)
Code: 0 ()
Checksum: 0xa435 [correct]
Identifier: 0xfa4e
Sequence number: 0 (0x0000)
Data (1000 bytes)
※上記のethanalyzerの出力結果は一部省略しています。
network機器においてMTUを超えるサイズのpacketはfragmentされ複数の小さなサイズのpacketに分割されます。
EthernetのdefaultのMTUは1500 byteである為、その境でfragmentの様子をethanalyzerを使用して確認します。
まずはIOSからのPINGです。IOSのPINGは「2. Packet Size」より、IP packet全体のサイズを指定する為、指定サイズが1501 byteのようにMTUより1 byteでも大きくなればfragmentされていることがわかります。
Cat3750#ping 192.168.8.1 size 1500 repeat 1
N7K# ethanalyzer local interface inband capture-filter "icmp"
Capturing on inband
2013-10-21 11:35:06.413366 192.168.8.3 -> 192.168.8.1 ICMP Echo (ping) request
2013-10-21 11:35:06.413749 192.168.8.1 -> 192.168.8.3 ICMP Echo (ping) reply
Cat3750#ping 192.168.8.1 size 1501 repeat 1
N7K# ethanalyzer local interface inband capture-filter "icmp"
Capturing on inband
2013-10-21 11:36:03.299679 192.168.8.3 -> 192.168.8.1 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0053)
2013-10-21 11:36:03.300922 192.168.8.3 -> 192.168.8.1 ICMP Echo (ping) request
2013-10-21 11:36:03.301264 192.168.8.1 -> 192.168.8.3 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0053)
2013-10-21 11:36:03.301300 192.168.8.1 -> 192.168.8.3 ICMP Echo (ping) reply
一方、NX-OSからのPINGでは、ICMP data部分のサイズを指定する為、packet-sizeをMTUサイズ以下の1500 byteに指定した場合でも下記の様にfragmentしてしまいます。
NX-OSでpacketサイズをMTU 1500 byte以下に抑える為には IP header + ICMP header = 28 byte を考慮した1472 byteを指定する必要があります。
N7K# ping 192.168.8.3 packet-size 1500 count 1
N7K# ethanalyzer local interface inband capture-filter "icmp"
Capturing on inband
2013-10-21 11:43:42.489602 192.168.8.1 -> 192.168.8.3 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0fc7)
2013-10-21 11:43:42.489625 192.168.8.1 -> 192.168.8.3 ICMP Echo (ping) request
2013-10-21 11:43:42.492620 192.168.8.3 -> 192.168.8.1 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0fc7)
2013-10-21 11:43:42.493864 192.168.8.3 -> 192.168.8.1 ICMP Echo (ping) reply
N7K# ping 192.168.8.3 packet-size 1473 count 1
N7K# ethanalyzer local interface inband capture-filter "icmp"
Capturing on inband
2013-10-21 11:44:54.074663 192.168.8.1 -> 192.168.8.3 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0fc8)
2013-10-21 11:44:54.075422 192.168.8.1 -> 192.168.8.3 ICMP Echo (ping) request
2013-10-21 11:44:54.077866 192.168.8.3 -> 192.168.8.1 IP Fragmented IP protocol (proto=ICMP 0x01, off=0, ID=0fc8)
2013-10-21 11:44:54.079110 192.168.8.3 -> 192.168.8.1 ICMP Echo (ping) reply
N7K# ping 192.168.8.3 packet-size 1472 count 1
N7K# ethanalyzer local interface inband capture-filter "icmp"
Capturing on inband
2013-10-21 11:45:36.100054 192.168.8.1 -> 192.168.8.3 ICMP Echo (ping) request
2013-10-21 11:45:36.102468 192.168.8.3 -> 192.168.8.1 ICMP Echo (ping) reply
上記例で、それぞれ df-bit をONにするとMTUサイズを超えるPINGがfailする様子も確認しておきます。
Cat3750#ping 192.168.8.1 size 1500 repeat 1 df-bit
Type escape sequence to abort.
Sending 1, 1500-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds:
Packet sent with the DF bit set
!
Success rate is 100 percent (1/1), round-trip min/avg/max = 1/1/1 ms
Cat3750#ping 192.168.8.1 size 1501 repeat 1 df-bit
Type escape sequence to abort.
Sending 1, 1501-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds:
Packet sent with the DF bit set
.
Success rate is 0 percent (0/1)
N7K# ping 192.168.8.3 packet-size 1472 count 1 df-bit
PING 192.168.8.3 (192.168.8.3): 1472 data bytes
1480 bytes from 192.168.8.3: icmp_seq=0 ttl=254 time=2.993 ms
--- 192.168.8.3 ping statistics ---
1 packets transmitted, 1 packets received, 0.00% packet loss
round-trip min/avg/max = 2.993/2.992/2.993 ms
N7K# ping 192.168.8.3 packet-size 1473 count 1 df-bit
PING 192.168.8.3 (192.168.8.3): 1473 data bytes
Request 0 timed out
--- 192.168.8.3 ping statistics ---
1 packets transmitted, 0 packets received, 100.00% packet loss
検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう
シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします
下記より関連するコンテンツにアクセスできます