CSS Prepare

optional · CSS study notes

Internet Control Message Protocol (ICMP)

🧭

On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks


OSI Layer: Network Layer (L3)

Definition

ICMP (Internet Control Message Protocol) is a Network-layer protocol used by hosts and routers to report errors and exchange diagnostic/control information about IP packet processing. It reports problems, it does not carry user data, and is itself unreliable and best-effort — an ICMP message can be lost just like any other packet.

Classification of ICMP Messages

ICMP messages fall into two broad categories:

1. Error-Reporting Messages — sent when a router or host cannot process a packet correctly:

  • Destination Unreachable — the packet could not be delivered; sub-codes distinguish network unreachable, host unreachable, port unreachable, and protocol unreachable.
  • Time Exceeded — sent when a packet's TTL (Time To Live) reaches zero before reaching its destination (looping or too many hops), or when reassembly of fragments times out. This is exactly the mechanism traceroute exploits.
  • Parameter Problem — a router finds an ambiguous or missing field in the IP header that prevents further processing.
  • Source Quench (historical, now deprecated) — a router signalled a source to slow down when congested; superseded by transport-layer congestion control (TCP's own mechanisms).
  • Redirect — a router informs a host that a better route exists via a different next-hop router for a given destination.

2. Query (Informational) Messages — request/reply pairs used for diagnostics, not error conditions:

  • Echo Request / Echo Reply — the basis of the ping utility; tests reachability and measures round-trip time.
  • Timestamp Request / Reply — used to measure round-trip delay and roughly synchronise clocks (rarely used today).
  • Address Mask Request / Reply — allows a host to learn the subnet mask of its network (largely superseded by DHCP).
  • Router Solicitation / Advertisement — allows a host to discover routers on its local network.

Message Format

  • Every ICMP message is encapsulated directly within an IP packet's data field (ICMP is logically layered above IP but is considered an integral part of the IP layer, not a separate transport protocol).
  • Common header fields: Type (identifies the category, e.g., 0 = Echo Reply, 8 = Echo Request, 3 = Destination Unreachable, 11 = Time Exceeded), Code (sub-classifies the Type), Checksum, followed by type-specific data.

ICMPv6

  • The IPv6 equivalent, with an expanded role: it also handles Neighbor Discovery Protocol (NDP), which replaces IPv4's separate ARP protocol for mapping IP addresses to link-layer addresses, and supports SLAAC via Router Solicitation/Advertisement messages.

CSS Exam Angle

  • Always mention ping (Echo Request/Reply) and traceroute (Time Exceeded via decrementing TTL) as concrete tools — examiners like practical utility tied directly to theory.
  • Present the error vs query classification explicitly rather than listing message types with no structure — this is what separates a well-organised answer.
  • Mention that ICMP itself has no reliability guarantee and carries no user data — a common point candidates miss.
  • Note ICMPv6's expanded role (absorbing ARP's job via NDP) if the question is IPv6-flavoured.

Example

When a website is unreachable, a router along the path may send back an ICMP "Destination Unreachable" message, which is what causes browsers and the ping utility to show a connection-failure diagnostic instead of hanging indefinitely. Running traceroute to a distant server works because each router along the path sends back a Time Exceeded message as the packet's TTL is deliberately made to expire at each successive hop.

Likely Questions

  1. What is ICMP? Explain its role with examples such as ping and traceroute.
  2. Classify ICMP messages into error-reporting and query types with examples of each.
  3. How does traceroute use the Time Exceeded message and TTL field to map a network path?
  4. How does ICMPv6 differ from ICMP in IPv4?

📜 Past-Paper Questions & Structured Answers

Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.

2025 · Paper-II · Q1 item 18 · 1 mark

Question: ICMP’s primary purpose?

Answer: A — error reporting and diagnostics. Examples include Destination Unreachable, Time Exceeded, and Echo Request/Reply used by ping. ICMP reports problems; it does not itself retransmit application data. Source paper

Related MCQs: traffic estimation belongs with Overview of Networking; shortest-path algorithms belong with Internet Routing Protocols and Algorithms. They are not ICMP functions.