Standards/Ethernet/Ping
(Difference between revisions)
(Created page with "{{TOC right}} == Frame example == Typing in a terminal: ping -c 1 -s 10 -p 0102 153.109.5.124 creates the frame: 34 17 eb c4 81 26 40 6c 8f 54 b8 79 08 00 45 00 00 26 2f ...") |
|||
Line 1: | Line 1: | ||
{{TOC right}} | {{TOC right}} | ||
− | == Frame | + | == Frame examples == |
+ | |||
+ | === Ping echo request === | ||
Typing in a terminal: | Typing in a terminal: | ||
− | ping -c 1 -s 10 -p 0102 | + | ping -c 1 -s 10 -p 0102 192.168.2.128 |
creates the frame: | creates the frame: | ||
− | + | 00 0c 29 7d ae c7 00 50 56 c0 00 08 08 00 45 00 | |
− | 00 26 | + | 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 [[Standards/Ethernet/Ethertype|Ethertype]] (<code>0800</code>): | ||
+ | |||
+ | 00 0c 29 7d ae c7 00 50 56 c0 00 08 08 00 | ||
+ | |||
+ | IP header with protocol <code>01</code>: | ||
+ | 45 00 | ||
+ | 00 26 ba 96 00 00 40 01 3a 6f c0 a8 02 01 c0 a8 | ||
+ | 02 80 | ||
+ | |||
+ | [https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Header ICMP header] with echo request (<code>0800</code>): | ||
+ | 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 (<code>0000</code>). | ||
+ | It provides the same data as the echo request message. | ||
+ | |||
+ | == ICMP header == |
Revision as of 10:31, 7 March 2016
|
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
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
ICMP header with echo request (0800
):
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.