RFC 777
Internet Control Message Protocol
Internet Control Message Protocol ๐
okay bestie, let's talk about RFC 777 ๐ It's from the Network Working Group, written by J. Postel at ISI in April 1981. It's giving old-school internet OG energy ๐ง It updates IENs 109, 128 and RFC 760, so it's basically a glow-up on those.
Introduction
okay so the Internet Protocol (IP) [1] handles host-to-host datagram service in a system of connected networks called the Catenet [2] ๐ธ The devices that connect those networks are called Gateways. They talk to each other for control purposes using the Gateway to Gateway Protocol (GGP) [3,4] ๐ซถ Sometimes a gateway or destination host has to chat with a source host, like to report an error in datagram processing. That's where this protocol comes in: the Internet Control Message Protocol (ICMP) ๐ ICMP uses IP's basic support as if it were a higher level protocol, but honestly it's actually an integral part of IP, so every IP module MUST implement it ๐
ICMP messages get sent in a bunch of situations ๐ฆ For example: when a datagram can't reach its destination, when a gateway doesn't have the buffering capacity to forward a datagram, and when a gateway can direct the host to send traffic on a shorter route ๐
Real talk: IP is not designed to be absolutely reliable ๐ These control messages exist to give feedback about problems in the communication environment, not to make IP reliable. There are still no guarantees that a datagram gets delivered or that a control message gets returned ๐ญ Some datagrams may vanish without any report of their loss. So if reliable communication is needed, the higher level protocols that use IP MUST implement their own reliability procedures โจ
ICMP messages usually report errors in datagram processing. To avoid the infinite regress of messages about messages about messages (ugh, the spiral ๐), no ICMP messages are sent about ICMP messages ๐
Message Formats
ICMP messages get sent using the basic IP header ๐ The first octet of the datagram's data portion is an ICMP type field, and its value decides the format of the rest of the data ๐ Any field labeled "unused" is reserved for later extensions and MUST be zero when sent, but receivers SHOULD NOT check these fields ๐ซฃ Unless an individual format description says otherwise, the internet header fields look like this:
- Version:
4๐ - IHL: the internet header length in 32-bit words ๐ธ
- Type of Service:
0โจ - Total Length: the length of the internet header and data in octets ๐ฆ
- Identification, Flags, Fragment Offset: used in fragmentation, see [1] ๐ง
- Time to Live: the time to live in seconds. This field gets decremented at each machine that processes the datagram, so the value SHOULD be at least as great as the number of gateways this datagram will traverse ๐
- Protocol:
ICMP = 1๐ - Header Checksum: the 16 bit one's complement of the one's complement sum of all 16 bit words in the header. To compute it, the checksum field SHOULD be zero ๐ Also, this checksum MAY be replaced in the future ๐ฎ
- Source Address: the address of the gateway or host composing the ICMP message. Unless otherwise noted, this can be any of a gateway's addresses ๐
- Destination Address: the address of the gateway or host the message should be sent to ๐
Destination Unreachable Message ๐ซ
Here's the layout for this one ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Internet Header + 64 bits of Original Data Datagram |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields:
- Destination Address: the source network and address from the original datagram's data ๐งญ
ICMP Fields:
- Type:
3๐ซ - Code:
0 = net unreachable;๐1 = host unreachable;๐2 = protocol unreachable;๐ฎ3 = port unreachable;๐ช4 = fragmentation needed and DF set.โ๏ธ
- Internet Header + 64 bits of Data Datagram: the internet header plus the first 64 bits of the original datagram's data. The host uses this data to match the message to the right process ๐ฏ If a higher level protocol uses port numbers, they're assumed to be in the first 64 data bits of the original datagram's data ๐ข
Description:
Okay so if the gateway's routing tables say the network in the datagram's internet destination field is unreachable (like the distance to the network is infinity), the gateway sends a destination unreachable message to the internet source host of the datagram ๐ช๏ธ Also, on some networks the gateway MAY be able to determine if the internet destination host is unreachable, and gateways on those networks MAY send destination unreachable messages to the source host when that happens ๐ค
If the IP module in the destination host can't deliver the datagram because the indicated protocol module or process port isn't active, the destination host MAY send a destination unreachable message to the source host ๐ญ
Another case: a datagram has to be fragmented so a gateway can forward it, but the Don't Fragment flag is on. In this situation the gateway MUST discard the datagram and return a destination unreachable message ๐ โโ๏ธ๐
Time Exceeded Message โณ
Here's the layout ๐ฆ
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Internet Header + 64 bits of Original Data Datagram |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields:
- Destination Address: the source network and address from the original datagram's data ๐งญ
ICMP Fields:
- Type:
11๐ฐ๏ธ - Code:
0 = time to live exceeded in transit;๐1 = fragment reassembly time exceeded.๐งฉ
- Internet Header + 64 bits of Data Datagram: the internet header plus the first 64 bits of the original datagram's data. The host uses this data to match the message to the right process ๐ฏ If a higher level protocol uses port numbers, they're assumed to be in the first 64 data bits of the original datagram's data ๐ข
Description:
If a gateway processing a datagram finds the time to live field is zero, it MUST discard the datagram ๐๏ธ The gateway MAY also notify the source host with a time exceeded message ๐ฃ
If a host reassembling a fragmented datagram can't finish the reassembly because fragments are missing within its time limit, it discards the datagram, and it MAY send a time exceeded message ๐งต bestie, the timer really said no ๐ญ
Parameter Problem Message ๐ง
Here's the layout ๐
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Parameter | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Internet Header + 64 bits of Original Data Datagram |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields:
- Destination Address: the source network and address from the original datagram's data ๐งญ
ICMP Fields:
- Type:
12๐ - Code:
0 = problem with option.โ ๏ธ
- Parameter: if code = 0, the IP option type ๐ท๏ธ
- Internet Header + 64 bits of Data Datagram: the internet header plus the first 64 bits of the original datagram's data. The host uses this data to match the message to the right process ๐ฏ If a higher level protocol uses port numbers, they're assumed to be in the first 64 data bits of the original datagram's data ๐ข
Description:
If a gateway or host processing a datagram finds a problem with the header parameters that stops it from finishing the processing, it MUST discard the datagram ๐จ One potential source of this problem is an option that isn't implemented, or incorrect arguments in an option ๐ The gateway or host MAY also notify the source host with a parameter problem message ๐
Source Quench Message ๐
Here's the layout ๐ซง
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Internet Header + 64 bits of Original Data Datagram |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields:
- Destination Address: the source network and address of the original datagram's data ๐งญ
ICMP Fields:
- Type:
4๐ซง - Internet Header + 64 bits of Data Datagram: the internet header plus the first 64 bits of the original datagram's data. The host uses this data to match the message to the right process ๐ฏ If a higher level protocol uses port numbers, they're assumed to be in the first 64 data bits of the original datagram's data ๐ข
Description:
A gateway MAY discard internet datagrams if it doesn't have the buffer space needed to queue them for output to the next network on the route to the destination network ๐ชฃ If a gateway discards a datagram, it MAY send a source quench message to the internet source host of the datagram. A destination host MAY also send a source quench message if datagrams arrive too fast to be processed ๐โโ๏ธ๐จ The source quench message is basically a request asking the host to cut back the rate at which it sends traffic to the internet destination ๐ The gateway MAY send a source quench message for every message it discards ๐ฏ๏ธ When a source host gets a source quench message, it SHOULD cut back the rate at which it sends traffic to the specified destination, and it keeps that up until it no longer receives source quench messages from the gateway. Then the source host can gradually increase the rate at which it sends traffic to the destination, until it gets source quench messages again ๐
The gateway or host MAY send the source quench message when it approaches its capacity limit, instead of waiting until the capacity is exceeded ๐ฆ This means the data datagram that triggered the source quench message may still get delivered ๐ซ
Redirect Message ๐
okay bestie, the redirect message is a gateway politely tapping a host on the shoulder to say "hey, there's a shortcut ๐ฆ" Here's the layout:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Gateway Internet Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Internet Header + 64 bits of Original Data Datagram |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields โจ
Destination Address
The source network and address of the original datagram's data. ๐
ICMP Fields ๐
Type
5 ๐ธ
Code
0= Redirect datagrams for the Network.1= Redirect datagrams for the Host.2= Redirect datagrams for the Type of Service and Network.3= Redirect datagrams for the Type of Service and Host.
Gateway Internet Address
Address of the gateway to which traffic for the network specified in the internet destination network field of the original datagram's data should be sent. ๐ง
Internet Header + 64 bits of Data Datagram
The internet header plus the first 64 bits of the original datagram's data. This data is used by the host to match the message to the appropriate process. If a higher level protocol uses port numbers, they are assumed to be in the first 64 data bits of the original datagram's data. ๐ฅ
Description
Okay, the story goes like this ๐ A gateway, G1, receives an internet datagram from a host on a network the gateway is attached to. G1 checks its routing table and gets the address of the next gateway, G2, on the route to the datagram's internet destination network, X. If G2 and the host (identified by the internet source address of the datagram) are on the same network, a redirect message gets sent to the host. The redirect message advises the host to send its traffic for network X directly to gateway G2, because that's a shorter path to the destination. Meanwhile, the gateway still forwards the original datagram's data to its internet destination. Main character energy, literally. ๐
Echo or Echo Reply Message ๐
the echo and echo reply pair is giving ping-pong vibes ๐ Here's the header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data ...
+-+-+-+-+-
IP Fields โจ
Addresses
The address of the source in an echo message will be the destination of the echo reply message. To form an echo reply message, the source and destination addresses are simply reversed. ๐ฆ
IP Fields ๐
Type
8for echo message;0for echo reply message.
Description
The data received in the echo message must be returned in the echo reply message. No skipping, no editing, just send it right back ๐
Timestamp or Timestamp Reply Message โญ
timestamps are the ultimate receipts ๐งพ Here's the header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | unused |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originate Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Receive Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Transmit Timestamp |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Fields โจ
Addresses
The address of the source in a timestamp message will be the destination of the timestamp reply message. To form a timestamp reply message, the source and destination addresses are simply reversed. ๐
IP Fields ๐
Type
13for timestamp message;14for timestamp reply message.
Description
The data received (a timestamp) in the message is returned in the reply together with an additional timestamp. The timestamp is 32 bits of milliseconds since midnight UT. One use of these timestamps is described by Mills [5]. โฐ๐ซถ
Summary of Message Types ๐ธ
here's the cheat sheet, bestie ๐
0 Echo Reply
3 Destination Unreachable
4 Source Quench
5 Redirect
8 Echo
11 Time Exceeded
12 Parameter Problem
13 Timestamp
14 Timestamp Reply
References ๐
- [1] Postel, J., ed., "DOD Standard Internet Protocol", IEN 128, RFC 760, USC/Information Sciences Institute, NTIS ADA079730, January 1980. Appears in: Computer Communication Review, Special Interest Group on Data Communications, ACM, V.10, N.4, October 1980.
- [2] Cerf, V., "The Catenet Model for Internetworking," Information Processing Techniques Office, Defense Advanced Research Projects Agency, IEN 48, July 1978.
- [3] Strazisar, V., "Gateway Routing: An Implementation Specification", IEN 30, Bolt Beranek and Newman, April 1979.
- [4] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek and Newman, August 1979.
- [5] Mills, D., "DCNET Internet Clock Service," RFC 778, COMSAT Laboratories, April 1981. ๐ฆ
๐ฆ where this page comes from
- ietf: rfc777 1981-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms