Standards/Ethernet/Ping
From UIT
Revision as of 10:32, 7 March 2016 by Francois.corthay (Talk | contribs)
|
Frame examples
Ping echo request
Typing in a terminal:
ping -c 1 -s 10 -p 0102 192.168.2.128
creates the frame:
00 0c 29 7d ae c7 00 50 56 c0 00 08 08 00 45 00 00 26 ba 96 00 00 40 01 3a 6f c0 a8 02 01 c0 a8 02 80 08 00 ee dd 12 04 00 00 56 dd 33 e1 00 01 6b 5c 01 02
This frame contains the Ethernet header, with destination and source MAC addresses and IP Ethertype (0800
):
00 0c 29 7d ae c7 00 50 56 c0 00 08 08 00
the IP header with protocol 01
:
45 00 00 26 ba 96 00 00 40 01 3a 6f c0 a8 02 01 c0 a8 02 80
an ICMP header with echo request (0800
) type:
08 00 ee dd 12 04 00 00
and 10 bytes data:
56 dd 33 e1 00 01 6b 5c 01 02
The first 8 data bytes provide an identifier and a sequence number. The last 2 bytes come from the pattern requested in the ping command.
Ping echo reply
The previous echo request receives as answer:
00 50 56 c0 00 08 00 0c 29 7d ae c7 08 00 45 00 00 26 fa 0b 00 00 80 01 ba f9 c0 a8 02 80 c0 a8 02 01 00 00 f6 dd 12 04 00 00 56 dd 33 e1 00 01 6b 5c 01 02
The ICMP header now has echo reply code (0000
).
It provides the same data as the echo request message.