Introduction IP provides best-effort delivery. Delivery problems can be ignored by IP; datagrams can be “dropped on the floor.” The Internet Control Message Protocol (ICMP) provides an error-reporting mechanism for other types of errors.
Error Detection The internet layer (IP) can detect a variety of errors: checksum errors (but in the header only!) TTL expiration no available route to the destination network inability to deliver to the destination host (e.g., no ARP reply) The internet layer discards datagrams with problems. Some (e.g. those with a checksum error) - cannot trigger error messages, because the source is unknown.
Error Reporting Some errors can be reported: The router sends a message back to the source in a datagram. The message contains information about the problem. The message, as expected, is encapsulated in an IP datagram.
Types of Messages The Internet Control Message Protocol (ICMP) defines error and informational messages. Error messages: Source quench – tells source to slow down because of congestion Time exceeded – a datagram’s TTL expired Destination unreachable – there is no route to the destination Redirect – router reports that its use is inappropriate Fragmentation required – a datagram would need to be fragmented Informational messages: Echo request/reply – used with the ping program Address mask request/reply Router discovery
Summary The internet layer (IP) provides best-effort delivery of datagrams. It may choose to report errors for some problems. The ICMP protocol provides the mechanism by which such error messages are communicated.
ICMP Message Transport ICMP messages are encapsulated in IP datagrams: ICMP messages are sent in response to incoming datagrams with problems. An ICMP message is not sent for an ICMP message.
ICMP and Reachability An internet host B is said to be reachable from another host A if datagrams can be delivered from A to B. The ping program tests reachability – it sends a datagram from A to B that B echoes back to A. Ping uses the ICMP echo request and echo reply messages. The Internet layer includes code to reply to incoming ICMP echo request messages.
ICMP and Internet Routes The list of all routers on the path from A to B is called the route from A to B traceroute uses UDP to a non-existent port and TTL field to find a route using an expanding ring search It sends ICMP echo messages with increasing TTL values. A router that decrements a TTL value to 0 sends an ICMP time exceeded message in response, with that router's address as the source address in the message. The first message, with a TTL value of 1, gets to the first router, which discards the message and sends the time exceeded reply. The next message, with a TTL value of 2, gets through the first router to the second router. The procedure continues until a message from the destination is received. traceroute must accommodate varying network delays. It must also accommodate dynamically changing routes.
ICMP and Path MTU Discovery Fragmentation should be avoided, if possible. How can a source configure outgoing datagrams to avoid fragmentation? The source determines the path MTU – the smallest network MTU on the path from the source to the destination. The source probes the path using IP datagrams with the don't fragment flag set. A router responds with the ICMP fragmentation required message if it would be required to fragment a datagram marked with the don’t fragment flag. The source sends smaller and smaller probes until the destination is reached.
ICMP and Router Discovery A router can fail, causing a “black-hole” or isolating a host from the internet. The ICMP router discovery message is used to find new router. A host can broadcast a request for router announcements to auto-configure its default route. A host can broadcast this request if a router fails. A router can broadcast advertisement of its existence when it is first connected.
ICMP Redirect Messages A default route may cause an extra hop in a path. A router that forwards a datagram on the interface where the datagram was received sends an ICMP redirect message. The host installs the new route with the correct router’s address as the next hop.