Ping Protocol: Request and Response Message Explained
Advertisement
This page delves into the fundamentals of the ping protocol, an essential part of the ICMP (Internet Control Message Protocol) family. We’ll explore its purpose and dissect a typical Ping Request and Ping Response message, examining the various fields they contain.
The ping protocol is primarily used to verify network connectivity between two IP-enabled systems. By sending a ping from a source PC to a destination PC, you can determine whether the destination is reachable. The communication medium between the PCs can be wired (cable) or wireless. This check is applicable across diverse network types, including LAN, WAN, WLAN, WiMAX, GSM, CDMA, LTE, and others.
As the figure illustrates, the ping protocol operates through a request-response mechanism. The Ping Request originates from the source PC and is directed towards the destination PC. Upon receiving the request, the destination PC sends back a Ping Response to the originating source PC.
The table below provides a detailed example of a typical Ping Request and Ping Response, outlining the different fields involved. Crucially, in an ideal scenario without errors, the data portion of the Ping Request is copied verbatim and echoed back in the Ping Response by the destination PC. The protocol described here adheres to the IPv4 standard.
Byte position | Description | Ping Request (Received), Hex | Ping Response (Transmitted), Hex |
---|---|---|---|
1-6 | Destination MAC address | 00 A0 C9 E7 31 45 | 00 A0 C9 22 89 56 |
7-12 | Source MAC address | 00 A0 C9 22 89 56 | 00 A0 C9 E7 31 45 |
13-14 | Type | 08 00 | 08 00 |
15 | Version | 45 | 45 |
16 | Type of service | 00 | 00 |
17-18 | Length of packet including IP header | 00 3C | 00 3C |
19-20 | Unique ID | 4F 00 | 4F 00 |
21-22 | Offset | 00 00 | 00 00 |
23 | TTL (Time To Live) | 20 | 20 |
24 | Protocol | 01 | 01 |
25-26 | Checksum of IP header | EF 16 | EF 16 |
27-30 | IP source address | AC 12 02 47 | AC 12 02 3F |
31-34 | IP Destination address | AC 12 02 3F | AC 12 02 47 |
35-36 | Type: Request Code | 08 00 | 00 00 |
37-38 | ICMP checksum | 3E 5C | 46 5C |
39-40 | ID | 01 00 | 01 00 |
41-42 | Sequence Number | 0E 00 | 0E 00 |
43-74 | 32 bytes of data for pinging | Constant 32 hex bytes | Constant 32 hex bytes (same as col. 3) |