Transport and networkLayer 3RFC 792
ICMP: ping and errors
The network's way of saying "are you there?" and "something went wrong".
Ports and use: Carried inside IP (protocol 1)
In one sentenceICMP carries small control messages, such as ping requests and replies, and error reports from routers.
Think of it like thisIt is knocking on a door to check someone is home, or a postman leaving a note saying "no such address".
Watch it happen
3 steps and 2 byte-by-byte decodes. Use the buttons or the arrow keys. Hover or focus a field to find its bytes.
- Your laptop
- Router
- Server
- Echo request (ping)Your laptop to Router
- The router forwards itRouter to Server
- Echo replyServer to Your laptop
Step 1 of 3 Echo request (ping)
Your laptop → Router
Your laptop sends an echo request. It is an IP packet with protocol number 1, so it has no port numbers.
Echo request 16 bytes
08 00 66 68 00 01 00 01 abcdefgh
| Field | Bytes | What it means |
|---|---|---|
| Type | 08 | Type 8 is "echo request": please answer. |
| Code | 00 | Extra detail for the type. Zero here. |
| Checksum | 66 68 | Detects damage in the message. |
| Identifier | 00 01 | Lets the sender match replies to its own requests. |
| Sequence number | 00 01 | Counts the pings: 1, 2, 3 and so on. |
| Data | abcdefgh | Any bytes can go here. The reply returns them unchanged. |
Step 2 of 3 The router forwards it
Router → Server
Like any other packet, the router passes it on and lowers the time to live by one.
Step 3 of 3 Echo reply
Server → Your laptop
The server copies the data back with type 0. Ping measures the time between sending and receiving this.
Echo reply 16 bytes
00 00 6e 68 00 01 00 01 abcdefgh
| Field | Bytes | What it means |
|---|---|---|
| Type | 00 | Type 0 is "echo reply": here is your data back. |
| Code | 00 | Extra detail for the type. Zero here. |
| Checksum | 6e 68 | Detects damage in the message. |
| Identifier | 00 01 | Lets the sender match replies to its own requests. |
| Sequence number | 00 01 | Counts the pings: 1, 2, 3 and so on. |
| Data | abcdefgh | The same bytes you sent, copied back. |
Where you meet it
- The ping command checks whether a computer is reachable and how long a round trip takes.
- Traceroute uses "time exceeded" messages from each router to map the path.
- Routers report "destination unreachable" and "packet too big" with ICMP.
Common mistakes
- Concluding a server is down because it does not answer ping. Many servers and firewalls block it on purpose.
- Blocking all ICMP, which can break path MTU discovery and cause strange slowness.
- Reading a high first ping time as a problem. It often includes a one-off lookup.
- Treating ping time as the speed of your internet connection. It only measures delay.
Try it yourself
Run these on your own computer and compare the output with the lesson above.
ping -c 4 1.1.1.1Sends four echo requests (use -n 4 on Windows).traceroute 1.1.1.1Uses ICMP errors to list each router.
Addresses and values in the examples are made up for teaching (the 203.0.113.x range is reserved for documentation). Real traffic carries more options and details. Check the standard named above for the full rules.