Fact-checked by Grok 2 weeks ago

Internet Control Message Protocol

The Internet Control Message Protocol (ICMP) is a supporting in the (IP) suite that enables hosts and gateways to send error messages and operational information about IP processing, without providing data delivery guarantees, which are handled by higher-layer protocols. Defined in RFC 792 for IPv4, ICMP uses the basic IP header with a protocol number of 1 and includes message types such as Echo Request (type 8) and Echo Reply (type 0) for diagnostics, Destination Unreachable (type 3) for error reporting, and Source Quench (type 4) for congestion control. Every IP module must implement ICMP to facilitate and feedback on issues like unreachable destinations or time-exceeded datagrams. For IPv6, an adapted version known as ICMPv6 (defined in RFC 4443) serves similar functions but integrates more deeply with IPv6 features, using a Next Header value of 58 and supporting additional capabilities like and messaging. ICMPv6 error messages include Destination Unreachable (type 1), Packet Too Big (type 2), and Time Exceeded (type 3), while informational messages comprise Echo Request (type 128) and Echo Reply (type 129). Unlike ICMP for IPv4, ICMPv6 is mandatory in all IPv6 nodes and uses the IPv6 pseudo-header in its checksum calculation to enhance integrity. ICMP plays a crucial role in network diagnostics, exemplified by tools like (which relies on Echo messages) and traceroute (which uses Time Exceeded messages), enabling administrators to detect connectivity issues, measure latency, and identify routing problems across IP networks. However, to prevent loops, ICMP does not generate messages in response to other ICMP messages, and implementations must handle potential security risks such as spoofing by rate-limiting or filtering. Over time, extensions to ICMP have addressed evolving needs, including environmental data reporting in ICMPv6 and enhanced authentication mechanisms, but its core remains focused on lightweight control and error signaling rather than reliable transport.

Overview

Purpose and Role

The Internet Control Message Protocol (ICMP) serves as a supporting within the (IP) suite, designed to convey control and error messages between network devices without involving the . It enables IP modules in hosts and gateways to report issues encountered during processing, such as transmission failures or suboptimal , thereby facilitating the maintenance of the communication environment. Unlike transport protocols, ICMP operates exclusively at the network layer to provide feedback mechanisms that enhance IP's functionality, but it does not guarantee end-to-end reliability or data delivery. ICMP's primary functions include reporting errors in datagram handling, querying the status of network connectivity, and supporting diagnostic activities to troubleshoot network issues. For instance, it allows devices to notify senders of problems like datagram fragmentation failures or redirects, helping to optimize traffic flow without altering the core transmission process. A key diagnostic role is exemplified by testing, where ICMP echo messages are used to verify if a destination is accessible, forming the basis for tools like that measure round-trip times and detect connectivity disruptions. These functions ensure that networks can self-diagnose and adapt to anomalies, promoting overall stability. Distinguishing ICMP from transport-layer protocols such as or , it focuses solely on network-layer control and does not establish connections or segment data for reliable delivery; instead, it embeds messages within datagrams to alert about processing errors or environmental conditions. Practical use cases include generating "Destination Unreachable" messages when a target host or cannot be located, which informs the sender to cease transmission attempts, or issuing "Source Quench" messages to signal excessive load, prompting the source to temporarily reduce its datagram rate and alleviate . By limiting its scope to these ancillary roles, ICMP complements IP's model without introducing overhead from transport semantics.

History and Standards

The Internet Control Message Protocol (ICMP) was developed in 1981 by as a key component of the early TCP/IP protocol suite under the Internet Program, which facilitated the transition of the to a broader architecture. This effort addressed the need for error reporting and diagnostic mechanisms in IP-based networks, building on prior testing and protocol evolution. The initial specification for ICMP in IPv4 was outlined in RFC 792, published in September 1981, which defined its message types and formats for host-to-host datagram error reporting and queries. Subsequent refinements came in RFC 1122 (October 1989), which established requirements for hosts implementing ICMP, emphasizing mandatory support and clarification of behaviors like echo responses. Further updates in RFC 1812 (June 1995) addressed router requirements, mandating specific ICMP handling for forwarding decisions and deprecating the generation of Source Quench messages by routers due to their limited effectiveness in congestion control. In 2012, RFC 6633 formally deprecated the use of ICMP Source Quench messages across transport protocols, citing their ineffectiveness, unfairness in congestion signaling, and obsolescence in favor of modern mechanisms like , thereby updating 792, 1122, and 1812. For IPv6, ICMP was extended as in 4443 (March 2006), providing equivalent functionality tailored to while excluding Source Quench and integrating additional features for neighbor discovery. These standards have solidified ICMP's enduring role in diagnostics, from early validation to contemporary network troubleshooting tools like and .

Protocol Fundamentals

Integration with IP

The Internet Control Message Protocol (ICMP) operates as an integral component of the (IP) suite, with its messages encapsulated directly within IP datagrams to facilitate error reporting and diagnostic functions at the network layer. In IPv4 networks, ICMP messages are transported using IP datagrams where the Protocol field in the is set to 1, as assigned by the (IANA). Similarly, for IPv6, this value is 58 for messages. This encapsulation ensures that ICMP leverages the IP layer's routing and delivery mechanisms without requiring a separate transport protocol, allowing ICMP to interact seamlessly with IP processing on hosts and routers. ICMP error messages are generated only in response to issues encountered with IP datagrams carrying higher-layer protocols or non-ICMP payloads, adhering to strict rules to prevent infinite loops or message storms. Specifically, no ICMP error messages are produced for errors in other ICMP messages themselves, as this would lead to an endless regress of error notifications about errors. Additionally, ICMP errors are not generated for broadcast or datagrams to avoid network-wide . These rules ensure stability by limiting error propagation solely to IP traffic that warrants corrective feedback. In the typical processing flow, when a router or host receives an datagram, it first inspects the for validity, such as checking the (TTL) field or destination address. If an error condition is detected—such as an unreachable destination or TTL expiration—the device generates an appropriate , which is then encapsulated in a new datagram and sent back to the source extracted from the original datagram's header. Otherwise, the datagram is forwarded toward its destination or passed to upper layers for local delivery. This integration allows IP implementations to provide feedback on delivery failures without disrupting the core forwarding path. To mitigate potential denial-of-service risks from excessive ICMP generation, routers and hosts must implement , such as capping the transmission rate of ICMP messages to no more than a configurable threshold (e.g., one per second per destination), as recommended in standards for IP routers. ICMP also plays a critical role in handling IP fragmentation and reassembly challenges. In IPv4, when a router cannot forward a due to its size exceeding the outgoing link's (MTU) and the Don't Fragment (DF) bit is set, it discards the and sends an ICMP Destination Unreachable message (Type 3, Code 4) to inform the source of the MTU limit, enabling ; in IPv6, the equivalent is an Packet Too Big message (Type 2). During reassembly at the destination host, if the timer for fragment collection expires before all pieces arrive, the host generates an ICMP Time Exceeded message—in IPv4, Type 11 Code 1; in IPv6, Type 3 Code 1—to notify the source of the reassembly failure. These mechanisms provide essential signals for optimizing packet sizes and detecting fragmentation-related issues without requiring end-to-end coordination beyond IP.

Message Types Classification

ICMP messages are broadly classified into two primary categories: error messages and query (or informational) messages. Error messages report issues encountered during the processing or delivery of IP datagrams, such as a host or network being unreachable, thereby aiding in fault diagnosis by notifying the originating of the problem. Query messages, in contrast, facilitate network diagnostics by allowing a sender to request specific responses from a target node, enabling tests of , timing, or details. The Type in the ICMP header, occupying the first octet, identifies the message category, with values ranging from 0 to 255 assigned to specific functions across both classes. The adjacent , in the second octet, specifies subtypes or additional details for a given type, such as distinguishing between network unreachable ( 0) and host unreachable ( 1) within the Destination Unreachable message. This structure allows for precise signaling without overlapping interpretations. Error messages adhere to strict constraints to provide actionable context while avoiding amplification or loops. Each must encapsulate the full of the offending along with at least the first 64 bits (8 bytes) of its original data, enabling the recipient to correlate the error with the specific packet. Furthermore, implementations must not generate error messages in response to other ICMP errors, broadcast or multicast datagrams, or fragments beyond the first, ensuring controlled propagation. Query messages exhibit symmetry through paired request-response formats, where a request prompts a targeted reply that mirrors key elements like identifiers and data. For example, an Echo Request (Type 8) elicits an Echo Reply (Type 0) that returns the original payload intact, verifying connectivity. This bidirectional design supports diagnostic utilities without requiring asymmetric handling. Among query types, the Information Request (Type 15) and Information Reply (Type 16) are obsolete, as they were intended for determining masks but have been deprecated in favor of more robust mechanisms like Echo messages for similar purposes. Modern implementations should neither generate nor process these types to align with evolved network standards.

Message Format

Header Fields

The ICMP header consists of a fixed 8-byte structure that precedes any variable data in the message. The first field is the Type, an 8-bit unsigned that identifies the category of the ICMP message, such as 3 for Destination Unreachable. The second field is the , also an 8-bit unsigned , which provides further specification for the Type, for example, Code 0 indicating a network unreachable condition within Type 3. The third field is the Checksum, a 16-bit field computed using one's complement arithmetic over the entire ICMP message, including the header and any data, with the field itself set to zero during calculation. If the message length is odd, the data is conceptually padded with a zero octet solely for computation; no is added to the transmitted message. Unlike transport-layer protocols such as or , the ICMP does not incorporate a pseudo-header from the layer; it solely covers the ICMP message content. The remaining 4 bytes of the header vary depending on the message Type; for instance, in Echo Request or Reply messages, they contain a 16-bit Identifier and a 16-bit Sequence Number to match requests with replies.

Payload Structure

The payload of an ICMP message follows the fixed 8-byte header and varies depending on the message type, providing context or diagnostic information without including transport-layer protocol details beyond what may incidentally appear in the original datagram's data. For error messages, such as Destination Unreachable or Time Exceeded, the payload consists of a 32-bit unused field, the original (typically 20 bytes, including any options), plus the first 8 bytes (64 bits) of the original datagram's data; this inclusion allows the recipient to associate the error with the specific network-layer context of the failed transmission, assuming higher-layer port numbers, if present, are captured within those initial data bytes. In contrast, query messages carry type-specific data tailored to their diagnostic purpose. For instance, the Timestamp message includes three 32-bit timestamps: originate (time of transmission), receive (time of processing), and transmit (time of reply generation), enabling measurements at the network layer. The Echo Request and Reply messages append optional data, which is echoed unchanged and can extend up to approximately 1,500 bytes to test path MTU limits, though the exact size is constrained by the encapsulating IP packet's (MTU). Other queries, like Information Request, include minimal fields such as a 16-bit identifier and sequence number without additional variable data. To ensure proper alignment and checksum computation, the payload requires no transmitted padding, though conceptual zero-padding is used if the total message length is odd during checksum calculation, as the header checksum covers the entire message in 16-bit words. Overall, the payload length is variable but limited such that the complete ICMP message, when encapsulated in an IP packet, does not exceed the path MTU minus the IP header size, typically allowing payloads up to 1,472 bytes on standard Ethernet links with a 1,500-byte MTU. This structure emphasizes network-layer diagnostics, excluding dedicated transport-layer headers to keep ICMP lightweight and focused on IP-layer error reporting and queries.

IPv4 Error Messages

Destination Unreachable

The Destination Unreachable message, designated as ICMP Type 3 in IPv4, notifies the source that an datagram cannot be delivered to its intended destination due to various failure conditions encountered during forwarding or final delivery. This error message is generated by either an intermediate router unable to forward the datagram or the destination unable to it, helping the sender diagnose and potentially recover from the issue. The message includes up to 16 specific codes (0-15) that pinpoint the exact reason for unreachability, with original codes defined in RFC 792 and additional ones specified in RFC 1122 to address evolving network requirements. Routers generate Destination Unreachable messages when they lack a route to the destination network (Code 0) or host (Code 1), when fragmentation is required but the Don't Fragment (DF) bit is set in the original (Code 4), or when a source route option cannot be followed (Code 5). Hosts produce these messages for protocol-related issues, such as an unsupported upper-layer (Code 2), or when no application is listening on the specified transport-layer , as commonly seen with packets (Code 3). Additional codes cover scenarios like unknown networks or hosts (Codes 6 and 7), administrative prohibitions on communication (Codes 9, 10, and 13), or (TOS)-related unreachability (Codes 11 and 12). Less common codes include source host isolation (Code 8), host precedence violations (Code 14), and precedence cutoffs (Code 15), which were introduced to handle policy-based restrictions and priority handling in early implementations. The full set of codes is maintained by IANA for consistency across implementations. To facilitate troubleshooting, the Destination Unreachable message carries a payload consisting of the original IP header (at least 20 bytes) plus the first 64 bits of the datagram's data portion, allowing the sender to inspect the problematic packet without needing to retransmit the entire contents. This inclusion enables applications to correlate the error with the specific transmission attempt. In practice, receipt of these messages influences application behavior, such as triggering retry mechanisms with alternative routes or endpoints, and informs dynamic routing protocols to update path selections for improved reliability. For instance, Code 4 is used in Path MTU Discovery, where the message includes the MTU of the next-hop network (RFC 1191), though firewalls sometimes filter these to prevent information leakage. Overall, these messages enhance network diagnostics without providing guaranteed delivery, as ICMP itself is unreliable.
CodeDescriptionReference
0Net UnreachableRFC 792
1Host UnreachableRFC 792
2 UnreachableRFC 792
3 UnreachableRFC 792
4Fragmentation Needed and DF SetRFC 792
5Source Route FailedRFC 792
6Destination Network UnknownRFC 1122
7Destination Host UnknownRFC 1122
8Source Host IsolatedRFC 1122
9Network Administratively ProhibitedRFC 1122
10Host Administratively ProhibitedRFC 1122
11Network Unreachable for TOSRFC 1122
12Host Unreachable for TOSRFC 1122
13Communication Administratively ProhibitedRFC 1122
14Host Precedence ViolationRFC 1122
15Precedence Cutoff in EffectRFC 1122

Time Exceeded

The Time Exceeded message in ICMP, designated as Type 11, is generated to report when an 's lifetime expires either during transit through the network or at the destination host during reassembly. This message uses two specific codes: Code 0 indicates that the () field in the reached zero while the datagram was in transit, typically at a router; Code 1 signifies that the reassembly timer expired at the host due to incomplete fragment collection. Routers trigger a Code 0 Time Exceeded by decrementing the field by at least one upon processing a ; if it reaches zero, the is discarded to prevent indefinite circulation, and the is sent back to the original source address. At the host level, a Code 1 arises when fragments of a fail to arrive within the reassembly timeout period, leading to discard of the incomplete —provided the first fragment (with the original ) was received, as its absence prevents generation. The payload of the Time Exceeded consists of the unaltered from the discarded plus the first 64 bits (8 bytes) of its data, enabling the sender to identify the affected packet, such as by matching transport-layer port numbers. This mechanism is crucial for network diagnostics and reliability, as it not only averts infinite loops by enforcing a lifetime limit but also supports path discovery tools like , which incrementally increase values in probe packets to elicit sequential Time Exceeded responses revealing intermediate routers. Historically, the TTL field was originally defined as a time-based in seconds (up to 255 seconds maximum) to bound existence within the , but in practice, it evolved into a hop-count decrement due to uniform reduction at each router regardless of actual processing time.

IPv4 Query Messages

Echo Request and Reply

The Echo Request and Reply messages in ICMP provide a mechanism for testing the reachability of a host in IPv4 networks. An Echo Request, identified by ICMP type 8 and code 0, is sent from a source host to a destination, prompting the recipient to verify by responding with an Echo Reply. The Echo Reply, with type 0 and code 0, reverses the source and destination addresses from the request, recomputes the , and returns the original data unchanged. The message format for both Echo Request and Reply includes a standard ICMP header followed by specific fields. After the 8-byte ICMP header (type, code, and 16-bit checksum), the next fields are a 16-bit identifier and a 16-bit sequence number, which assist in matching requests with their corresponding replies, particularly in scenarios with multiple concurrent echoes. The identifier can be set to zero if not needed, and the sequence number increments for successive requests from the same source to aid ordering. Following these is an optional variable-length data payload, which is echoed back verbatim in the reply; this data often consists of filler bytes or implementation-specific content.
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      |          [Checksum](/page/Checksum)             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Identifier          |        Sequence Number        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Data ...
+-+-+-+-+-+-+-+-+-
In operation, a sending host generates an Echo Request packet encapsulated in an IPv4 , which the destination host processes upon receipt and responds to directly if it supports ICMP. The reply mirrors the request's data and control fields (except for type and addresses), enabling the sender to confirm one-way path viability by observing the round-trip. This process relies on the underlying IP delivery but offers no delivery guarantees, as ICMP messages can be dropped like any . The Echo mechanism forms the foundation for the ping utility, a widely used diagnostic tool that sends Echo Requests and measures the round-trip time (RTT) based on the local time of sending the request and receiving the reply to assess latency and packet loss. However, firewalls often block Echo Requests or Replies to mitigate reconnaissance or denial-of-service risks, potentially hindering diagnostics. Additionally, the basic Echo process lacks built-in authentication, making it vulnerable to spoofing where forged replies could mislead reachability tests.

Timestamp Request and Reply

The ICMP Timestamp Request and Timestamp Reply messages provide a mechanism for querying the processing delay at a remote and estimating transit times in IPv4 networks. These query messages, defined in the original ICMP specification, allow a sender to obtain timestamps from the receiver to facilitate diagnostics such as round-trip time (RTT) measurements or basic assessments. The Timestamp Request message uses ICMP Type 13, while the Timestamp Reply uses Type 14; both have 0. The message format includes a standard 8-byte ICMP header followed by a 20-byte consisting of an identifier, sequence number, and three 32-bit timestamps. The identifier and sequence number (each 16 bits) assist in matching requests with replies, though they may be set to zero if not needed. The timestamps represent milliseconds since midnight (UT) and include: the originate timestamp (time the sender last handled the before transmission), the receive timestamp (time the receiver first handled it upon arrival), and the transmit timestamp (time the receiver last handled it before sending the reply). If precise millisecond timing relative to midnight UT is unavailable, implementations may insert arbitrary values with the high-order bit set to indicate non-standard units. In operation, the sender records the local originate , sets the receive and transmit fields to zero in the Type 13 request, and transmits the . Upon receipt, the destination copies the originate unchanged, records the current time as the receive , processes the request, records the current time again as the transmit , reverses the source and destination addresses, changes the type to 14, recomputes the , and sends the reply. The sender then locally records the arrival time of the reply (denoted as t4) to complete the timing data. This process enables separation of transit components from . From the returned timestamps—originate (t1), receive (t2), and transmit (t3)—key metrics can be derived assuming synchronized clocks between hosts. The outbound transit time is approximated as t2 - t1, the inbound transit time as t4 - t3, and the remote host's processing delay as t3 - t2. The overall RTT is then (t2 - t1) + (t4 - t3) + (t3 - t2), or simply t4 - t1 for a direct measurement. These values support network diagnostics, such as identifying excessive processing delays indicative of host load or rudimentary clock offset estimation, as referenced in early time synchronization work. Historically intended for performance evaluation and time synchronization, Timestamp Request and Reply messages are rarely used in modern networks due to security concerns (e.g., potential disclosure of ) and the superiority of dedicated protocols like the Network Time Protocol (NTP) for accurate . Implementations often disable or filter these messages by default to mitigate risks, limiting their role to legacy diagnostics.

Information Request and Reply

The ICMP Information Request and Reply messages provide a basic mechanism for determining the network number of the sending host in IPv4 networks. Defined in the original ICMP specification, these query messages (Type 15 for Request and Type 16 for Reply, both with Code 0) were intended for bootstrapping network configuration but are now deprecated in favor of more robust protocols. The message format includes the standard 8-byte ICMP header followed by a 4-byte payload consisting of a 16-bit identifier and a 16-bit sequence number to match requests with replies. No additional data fields are present. In operation, the request is sent with the source and destination IP addresses set to zero (or the sender's IP in source), prompting the recipient to reply with the full IP addresses of the request's source and destination to convey the network number. The reply reverses the addresses, changes the type to 16, and recomputes the checksum. Due to security risks, such as exposing , and the availability of DHCP and other auto-configuration methods, messages are seldom implemented or enabled in contemporary systems and are considered obsolete.

ICMPv6 Specifics

Key Differences from IPv4

, defined as the companion for , employs the protocol number 58 in the IPv6 header's Next Header field, distinguishing it from ICMPv4's protocol number 1 in IPv4 headers. This integration extends to its role in supporting the IPv6 (NDP), where messages facilitate essential functions like address resolution and router discovery, unlike the separate in IPv4 environments. Furthermore, prohibits the generation of error messages for fragmented packets containing a Fragment Header with a non-zero Offset, as fragmentation is managed exclusively through extension headers at the source, shifting away from IPv4's router-level fragmentation and associated error reporting. The checksum computation incorporates a pseudo-header that includes the source and destination addresses, the packet length, and the Next Header value of 58, ensuring integrity verification that aligns with 's header structure and contrasts with ICMPv4's simpler excluding such pseudo-elements. Message types in are expanded and reorganized into two primary classes: types 0 through 127 for error messages, such as Destination Unreachable (type 1) and Packet Too Big (type 2), and types 128 through 255 for informational messages, including Request (type 128) and Reply (type 129), with mandatory implementation required for all nodes to support functionality. This structure provides greater flexibility for future extensions compared to ICMPv4's more limited type assignments. ICMPv6 eliminates certain IPv4-specific messages, notably omitting Address Mask Request and Reply (types 17 and 18 in ICMPv4), as IPv6 address configuration relies on NDP mechanisms rather than such queries. Redirect messages (type 137) in ICMPv6 are restricted to on-link destinations, informing only same-link hosts of better next-hop routers without the broader network scope possible in IPv4 redirects. These protocols were standardized in RFC 4443, published in March 2006, which obsoletes earlier specifications and establishes ICMPv6 as a Proposed Standard; subsequent mobility extensions, such as those for Mobile IPv6 including Home Agent Address Discovery Request and Reply (types 144 and 145), are detailed in RFC 6275 from July 2011.

Neighbor Discovery Messages

The Neighbor Discovery Protocol (NDP) in IPv6 utilizes specific ICMPv6 messages to enable hosts and routers on the same link to discover each other, resolve addresses, and maintain reachability information. These messages replace several IPv4 ARP and ICMP functions, providing an integrated mechanism for address autoconfiguration, router discovery, and neighbor management. NDP operates primarily through multicast communications on the local link, using ICMPv6 types 133 through 137. The five core NDP messages are as follows:
  • Router Solicitation (Type 133): Sent by hosts to promptly request Router Advertisements from neighboring routers, facilitating quick network configuration upon attachment. Hosts this message to the all-routers (FF02::2), typically including their source link-layer if known, with a of 255 to ensure link-local delivery.
  • Router Advertisement (Type 134): Routers use this message to announce their presence, link parameters, and prefixes periodically or in response to solicitations. It includes critical configuration data such as the router's lifetime (indicating ), current , reachable time (for unreachability detection), retransmission , and MTU; prefixes carry lifetimes for autoconfiguration. Sent with a of 255, it supports stateless autoconfiguration by specifying on-link and prefixes.
  • Neighbor Solicitation (Type 135): This message enables by querying the link-layer of a and detects duplicate addresses during autoconfiguration. A sends it as a to the (derived from the ) or if the is known, including the in the payload and optionally the sender's source link-layer ; the source may be unspecified for initial probes. The is set to 255.
  • Neighbor Advertisement (Type 136): Sent in response to Neighbor Solicitations or unsolicited to announce link-layer changes, this message confirms or provides the link-layer . It includes such as the Router (indicating if the sender is a router), Solicited (for responses), and Override (to update existing cache entries); the is specified, with the link-layer as an option. Responses are to the solicitor or for announcements, with a of 255.
  • Redirect (Type 137): Routers send this to inform a of a better next- for a specific destination, optimizing on the link. It includes the (better next-), destination (original ), and optionally the link-layer and a portion of the redirected packet header for verification; sent to the original sender with a of 255, it updates the destination cache.
Router discovery begins when a host joins a link by sending a Router Solicitation multicast, prompting routers to reply with Advertisements containing prefixes (for address assignment), MTU, and lifetimes (defining validity periods for prefixes and routes). Routers send unsolicited Advertisements at configurable intervals (default MinRtrAdvInterval of 0.33 × MaxRtrAdvInterval [no less than 3 seconds], default MaxRtrAdvInterval of 600 seconds) to maintain host awareness, enabling hosts to select default routers based on lifetimes and preferences. This process supports both stateful (e.g., ) and stateless autoconfiguration, ensuring hosts obtain valid addresses and routes without manual intervention. Neighbor discovery serves as the IPv6 equivalent of , performing address resolution and duplicate detection (DAD). To resolve a target's link-layer , a sends a Neighbor with the target's ; if no response arrives within the retransmission timer (default 1 second), the cache is updated upon receiving a Neighbor Advertisement. For DAD, a tentative owner sends a with an unspecified source to the solicited-node ; lack of response confirms uniqueness. Advertisements may be overridden if the Override flag is set, allowing updates to neighbor caches for or changes, with confirmed via periodic probes. NDP messages carry variable-length options in a Type-Length-Value (TLV) format, where each option consists of an 8-bit Type, 8-bit Length (in units of 8 octets), and variable Value, ensuring 64-bit for efficiency. Key options include Source Link-Layer Address (Type 1, sender's for ), Target Link-Layer Address (Type 2, target's MAC in responses), Prefix Information (Type 3, for on-link prefixes with lifetimes in Router Advertisements), Redirected Header (Type 4, partial for Redirect validation), and MTU (Type 5, link MTU in Advertisements). These options are padded if necessary to maintain and can appear in any order, allowing flexible extension of message content. Security in NDP addresses vulnerabilities like spoofing of routers or neighbors, which could lead to traffic redirection or denial-of-service. Basic protections include hop limit verification (must be 255 for link-local processing) and rate limiting, but these do not provide authentication. The SEcure Neighbor Discovery (SEND) protocol enhances security through cryptographic mechanisms, including Cryptographically Generated Addresses (CGAs) to bind addresses to public keys, RSA signatures for message integrity and sender authentication, and options like timestamps and nonces to prevent replays. SEND uses new NDP options (e.g., CGA Type 11, RSA Signature Type 12) without relying on IPsec, enabling verification of address ownership and router authorization via trust anchors, though deployment remains optional due to computational overhead.

Extensions and Applications

Path MTU Discovery

Path MTU Discovery (PMTUD) is a standardized mechanism that enables hosts to dynamically determine the (MTU) along a path, thereby avoiding which can degrade performance. The process relies on ICMP messages to signal when a packet exceeds the MTU of an intermediate router or link, allowing the sender to adjust packet sizes proactively. This technique is essential in modern networks where path MTUs vary due to diverse link technologies, ensuring efficient data transmission without unnecessary reassembly overhead at destinations. In IPv4, the sender initiates PMTUD by setting the Don't Fragment (DF) bit in the and starting with an assumed path MTU, often the MTU of the first-hop . If a router encounters a packet too large for its outgoing and cannot fragment it due to the DF bit, it discards the packet and returns an ICMP Destination Unreachable message with Type 3 and Code 4 (Fragmentation Needed). The ICMP message's includes the MTU of the router's next-hop , providing the sender with the necessary information to lower its path MTU estimate. For , the equivalent is an Packet Too Big message (Type 2), which also carries the next lower MTU in its , but prohibits fragmentation by routers and requires nodes to either support PMTUD or limit packets to the minimum link MTU of 1280 octets. Upon receiving such an ICMP message, the sender reduces the packet size accordingly and retransmits, repeating the process until packets traverse the path successfully. The adjustment algorithm typically employs either a binary search approach, where the sender probes with exponentially decreasing MTU values to converge quickly, or a constant decrease method that incrementally reduces the estimate by a fixed amount after each ICMP feedback. These methods, detailed in RFC 1191 for IPv4 and RFC 8201 for , balance probe efficiency with network stability, as excessive probing can increase . In environments like VPN tunnels or overlay networks, where encapsulation reduces effective MTU, per-path discovery is crucial, often requiring periodic re-probing to adapt to changes in or link conditions. PMTUD offers significant benefits by eliminating fragmentation overhead, which includes CPU-intensive reassembly at receivers and potential from incomplete fragments. This is particularly impactful in high-throughput scenarios, such as bulk data transfers, where fragmentation can halve effective due to duplicated headers. However, if firewalls or security policies block ICMP messages, PMTUD fails, forcing senders to fall back to conservative minimum MTUs: 576 bytes for IPv4 (including ) or 1280 bytes for IPv6. Such blackholing issues have prompted extensions like UDP-based probing in protocols such as , but core ICMP-driven PMTUD remains foundational for networking. To address blackholing caused by ICMP filtering, Datagram PMTUD (DPLPMTUD) was standardized in RFC 8899 (2020), using or probes for MTU discovery in environments where ICMP is blocked.

Deprecated Features

Several ICMP message types defined in early specifications have been formally deprecated due to their obsolescence, ineffectiveness, or replacement by more robust protocols. These deprecations reflect the evolution of network configuration and congestion management toward automated and secure mechanisms. The ICMP Source Quench message (Type 4) was originally intended for routers to notify sources of congestion by requesting reduced transmission rates. However, it proved ineffective and unfair for congestion control, as it could be easily forged and did not integrate well with modern (QoS) techniques. Its generation by routers was deprecated in 1995, and full deprecation for transport protocols occurred in 2012, with systems required to silently discard received messages. Better alternatives, such as (ECN), have since been standardized. Address Mask Request (Type 17) and Address Mask Reply (Type 18) messages allowed hosts to query and receive subnet mask information from gateways. These were formally deprecated in 2013 because their function has been superseded by the (DHCP), which provides comprehensive network configuration including subnet masks. Similarly, Information Request (Type 15) and Information Reply (Type 16) messages, used for basic host-to-host information exchange such as network numbers, were also deprecated for the same reason, as DHCP offers a more reliable and scalable alternative. ICMP Redirect messages (Type 5) enable routers to inform hosts of more optimal routes for specific destinations. While not fully deprecated in IPv4, Redirect messages (Type 137) are supported in (RFC 4861), though their use is often limited or disabled in implementations due to risks, particularly in multi-homed setups. As a result of these deprecations, modern systems are encouraged to ignore or filter these messages to enhance and efficiency, shifting reliance to for error reporting and higher-layer protocols like DHCP for configuration. This migration has streamlined ICMP usage, focusing on essential diagnostics while reducing legacy overhead.

References

  1. [1]
    RFC 792 - Internet Control Message Protocol - IETF Datatracker
    ICMP messages are sent using the basic IP header. The first octet of the data portion of the datagram is a ICMP type field; the value of this field determines ...
  2. [2]
  3. [3]
    RFC 1122 - Requirements for Internet Hosts - Communication Layers
    The Internet layer of host software MUST implement both IP and ICMP. See Section 3.3.7 for the requirements on support of IGMP. The host IP layer has two ...
  4. [4]
    RFC 1812 - Requirements for IP Version 4 Routers - IETF Datatracker
    1 Minimum Router Configuration There exists a minimum set of conditions that must be satisfied before a router may forward packets. · 2 Address and Prefix ...
  5. [5]
    RFC 6633 - Deprecation of ICMP Source Quench Messages
    This document formally deprecates the use of ICMP Source Quench messages by transport protocols, formally updating RFC 792, RFC 1122, and RFC 1812.Missing: 6635 | Show results with:6635
  6. [6]
    RFC 792: Internet Control Message Protocol
    To avoid the infinite regress of messages about messages etc., no ICMP messages are sent about ICMP messages. Also ICMP messages are only sent about errors ...
  7. [7]
    RFC 2463 - Internet Control Message Protocol (ICMPv6) for the ...
    This document specifies a set of Internet Control Message Protocol (ICMP) messages for use with version 6 of the Internet Protocol (IPv6).
  8. [8]
    RFC 1812: Requirements for IP Version 4 Routers
    o Recognizes error conditions and generates ICMP error and information messages as required. ... Routers MUST provide some mechanism for avoiding routing loops ...
  9. [9]
    Internet Control Message Protocol (ICMP) Parameters
    No readable text found in the HTML.<|control11|><|separator|>
  10. [10]
    RFC 791: Internet Protocol
    ### Summary of IP Time to Live (TTL) Field from RFC 791
  11. [11]
    ping | Microsoft Learn
    Nov 1, 2024 · Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) echo Request messages.
  12. [12]
    What is ICMP? | Internet Control Message Protocol - Cloudflare
    The ICMP echo-request and echo-reply messages are commonly used for the purpose of performing a ping. Unfortunately network attacks can exploit this process ...
  13. [13]
    5.11. Managing ICMP Requests | Red Hat Enterprise Linux | 7
    ICMP sends error messages. Firewalld can block ICMP requests to protect network info, but blocking can cause communication issues. Use `firewall-cmd` to manage ...
  14. [14]
    [PDF] Internet Protocol: ICMP Messages
    Message: Timestamp Request / Reply (cont.) ○ One-way and round-trip time calculation. ○ Sending time. = (RECEIVE TIMESTAMP) –. (ORIGINATE TIMESTAMP). ○ ...<|control11|><|separator|>
  15. [15]
    Block ICMP timestamp on FortiGate interfa... - the Fortinet Community!
    Jan 25, 2022 · Both ICMP Type 13 (Timestamp Request) and Type 14 (Timestamp Reply) are largely obsolete - they have been replaced by NTP (Network Time Protocol) ...
  16. [16]
    RFC 6275 - Mobility Support in IPv6 - IETF Datatracker
    RFC 6275 specifies Mobile IPv6, a protocol allowing nodes to remain reachable while moving in IPv6, using a home and care-of address.
  17. [17]
    RFC 4861 - Neighbor Discovery for IP version 6 (IPv6)
    This document specifies the Neighbor Discovery protocol for IP Version 6. IPv6 nodes on the same link use Neighbor Discovery to discover each other's presence.
  18. [18]
  19. [19]
  20. [20]
  21. [21]
  22. [22]
  23. [23]
  24. [24]
  25. [25]
  26. [26]
  27. [27]
  28. [28]
  29. [29]
  30. [30]
  31. [31]
  32. [32]
  33. [33]
    RFC 6918 - Formally Deprecating Some ICMPv4 Message Types
    RFC 6918 formally deprecates obsolete ICMPv4 message types, including Alternate Host Address (Type 6), Information Request (Type 15), and others.