Tuesday, June 24, 2014

Internetworking with TCP/IP Notes (Chapter 9)

Chapter 9 Internet Protocol: Error and Control Messages (ICMP)

9.1 The Internet Control Message Protocol
The Internet Control Message Protocol allows routers to send error or control messages back to the source of a datagram that caused a problem. ICMP messages are not usually delivered to applications. ICMP messages are sent to Internet Protocol software on the source computer.

9.2 Error Reporting vs Error Correction

When a datagram causes an error, ICMP can only report the error condition back to the original source of the datagram; the source must relate the error to an individual application program or take other action to correct the problem.

9.3 ICMP Message Delivery
ICMP messages travel across the internet in the payload area of IP datagrams. Because each ICMP message travels in an IP datagram, two levels of encapsulation are required.
Each ICMP message travels across an internet in the payload portion of an IP datagram, which itself travels across an underlying network in the payload portion of a frame. IPv4 uses the PROTOCOL field in the datagram header as a type field. When an ICMP message is carried in the payload area of an IPv6 datagram, the NEXT HEADER field of the header that is previous to the ICMP message contains 58.

9.4 Conceptual Layering
Although each ICMP message is encapsulated in an IP datagram, ICMP is not considered a higher-level protocol. Instead, ICMP is a required part of IP, which means ICMP is classified as a Layer 3 protocol.ICMP must send error reports to the original source, so an ICMP message must travel across multiple underlying networks to reach its final destination. Thus, ICMP messages cannot be delivered by a Layer 2 transport alone.

9.5 ICMP Messgae Format
The standards define two sets of ICMP messages: a set for IPv4 and a larger set for IPv6. In both versions of IP, each ICMP message has its own format. However, all ICMP messages begin with the same three fields.


An ICMP message begins with an 8-bit integer ICMP message TYPE field. The TYPE field identifies the specific ICMP message that follows.

An 8-bit CODE field in an ICMP message provides further information about the message type. The third field in each ICMP message consists of a 16-bi tCHECKSUM that is computed over the entire ICMP message.

The message body in an ICMP message depends entirely on the ICMP type. However, for ICMP messages that report an error, the message body always includes the header plus additional octets from the datagram that caused the problem.

9.6 Example ICMP Message Types Used with IPv4 and IPv6

ICMPv4 message types and the meaning of each.
Values not listed are unassigned or reserved.

Famous ICMPv4 type are 0&8 (ping), 3 (unreachable), 5 (redirect), 11(TTL)


ICMPv6 message types and the meaning of each.
Values not listed are unassigned or reserved.

IPv6 incorporates three major subsystems into ICMP: the Neighbor Discovery Protocol, Multicast support and IP mobility. ICMP messages have been defined for each of the subsystems.

9.7 Echo Request and Reply Message FormatBoth IPv4 and IPv6 use a single format for all ICMP Echo Request and Echo Reply messages.

For IPv4, the TYPE is 8 in a request and 0in a reply. For IPv6, the TYPE is 128 in a request and 129in a reply. For any value in the TYPE field, the CODE is zero (i.e., echo requests and replies do not use the code field). Fields IDENTIFIER and SEQUENCE NUMBER are used by the sender to match replies to requests. A receiving ICMP does not interpret the two fields, but does return the same values in the reply that were found in the request.

The field labeled OPTIONAL DATA is a variable length field that contains data to be returned to the sender. An echo reply always returns exactly the same data as was received in the request.

9.8 Reports of Unreachable Destinations
Whenever an error prevents a router from forwarding or delivering a datagram, the router sends an ICMPdestination unreachablemessage back to the source and then drops(i.e., discards) the datagram. Both IPv4 and IPv6 use the same format for destination unreachable messages.





Although they use the same message format, the way IPv4 and IPv6 interpret fields in the message differs slightly. IPv4 sets the TYPEto 3, and IPv6 sets the TYPEto 1. The CODE field contains an integer that further describes the problem; codes for IPv4 and IPv6 differ.

The CODE values for an ICMP destination unreachable message.

9.9 ICMP Error Reports regarding Fragmentation
IPv4 sends a destination unreachable message with the CODE field set to 4 andIPv6 sends a packet too big message, which has a TYPE field of 2. In IPv4, router can fragment the packet but it is prohibited to do this when the DF bit is set.

The reason IPv6 defines a separate ICMP message to report fragmentation problems as routers are always prohibited from fragmenting an IPv6 datagram.  A key part of path

MTU discovery involves receiving information about the MTU of remote networks.

9.10 Route Change Requests from Routers
When a router detects a host using a nonoptimal first hop, the router sends the host an ICMP redirect message that instructs the host to change its forwarding table. The router also forwards the original datagram on to its destination.

The message begins with the requisite TYPE, CODE, and CHECKSUM fields. The message further contains two pieces of information: the IP address of a router to use as a first hop and the destination address that caused the problem. The message formats differ.

An IPv4 redirect message contains the 32-bit IPv4 
address of a router followed by the prefix of the datagram that was incorrectly forwarded. 

An IPv6 redirect message contains the IPv6 address of a router and the IPv6 destination address that should be forwarded through the router.

As a general rule, routers only send ICMP redirect requests to hosts and not to other routers.

9.11 Detecting Circular or Excessively Long Routes
A router does not merely discard a datagram that has exceed its hop limit. Instead, a router takes the further action of sending the source an ICMPtime exceededmessage.

ICMP uses the CODE field in a time exceeded message to explain the nature of the timeout being reported as below figure.



9.12 Reporting other problems
When a router or host finds problems with a datagram not covered by previous ICMP error messages (e.g., an incorrect datagram header), it sends a parameter problem message to the original source.


No comments:

Post a Comment