Chapter 09 ICMP
Problems of IP Unreliable connectionless service Best effort service IP datagrams are discarded If destination is not found If TTL becomes 0 If reassembly timer expires Cannot acquire status information from routers and other hosts ICMP (Internet Control Message Protocol) supplements those problems
ICMP Functions 1. Error Reporting: when an IP datagram is discarded at routers or hosts, ICMP sends a report to the original source host Error correction is performed at higher layer 2. Query: Acquire status of routers or hosts
ICMP Functions (Cont d) 1. Error Reporting Source Host ICMP IP Router IP ICMP IP 2. Query Host Router ICMP Query Response ICMP
ICMP Error Report Message
ICMP Error Report Messages ICMP messages are encapsulated in IP datagram to be sent to the source Hence not reliable Extract information of discarded IP datagram Header: identifier of datagram First 8 bytes of data field : identifier of end process (port number and sequence number of TCP or UDP) ICMP IP DLL
Destination-unreachable message When an IP datagram is discarded because it cannot be delivered at router or host Type: type of ICMP message Code field : cause of discard 0/1 : Hardware fault 2 3 : Higher layer problem : No available port (application is not running) 4 : When Don t Fragment=1 but routing is not possible without fragmentation Checksum: error detection over all fields including header and data
Source Quench Message When an IP datagram is discarded due to congestion (overflow at the receiving queue at router or host) IP does not support flow control function Use to suppress the source host sending packets Source host may send IP datagrams too fast Source quench messages are sent to all source hosts whose datagrams are discarded Possibility that IP datagrams from innocent low rate host are discarded No mechanism for recovering speed after congestion is resolved
Time Exceeded Message When an IP datagram is discarded because Timeout=0 or TTL=0 TTL=0 IP datagram cannot be forwarded Timeout=0 Fragments do not arrive at the destination within specified time
Parameter Problem Message When an IP datagram is discarded due to error in IP datagram field or header parameter Missing or ambiguous field Problem in option
Redirection Message When a router receives a misdelivered IP datagram Router R1 requests the source host to update the corresponding entry of its routing table by sending a redirection message R1 forwards IP datagram to R2 instead of discarding
ICMP Query Message
Echo Request/Reply Used to check operation of IP protocol Identifier - ID of requesting process Sequence number associate echo request and reply Ping command provide statistical information by sending multiple echo requests
Timestamp Request/Reply Used to measure round trip time of IP datagram between two systems Based on Greenwich standard time - elapsed time from midnight (msec unit) Source sends a Timestamp Request packet Destination sends a Timestamp Reply packet
Calculation of Round Trip Time 46 46 59 60 Original timestamp current time Other two fields 0 Original timestamp Original timestamp of Timestamp Request packet Receive timestamp receiving time of Timestamp Request packet Transmit timestamp sending time of Timestamp Reply packet Sending time = time at the receiver - original timestamp = 59 46 = 13ms Receiving time = time at the sender transmit timestamp = 67 60 = 7ms Round trip time = 13 + 7 = 20ms
Example $ ping mail.adelphia.net PING mail.adelphia.net (68.168.78.100) 56(84) bytes of data. 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=0 ttl=48 time=85.4 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=1 ttl=48 time=84.6 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=2 ttl=48 time=84.9 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=3 ttl=48 time=84.3 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=4 ttl=48 time=84.5 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=5 ttl=48 time=z84.7 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=6 ttl=48 time=84.6 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=7 ttl=48 time=84.7 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=8 ttl=48 time=84.4 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=9 ttl=48 time=84.2 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=10 ttl=48 time=84.9 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=11 ttl=48 time=84.6 ms 64 bytes from mail.adelphia.net (68.168.78.100): icmp_seq=12 ttl=48 time=84.5 ms --- mail.adelphia.net ping statistics --- 14 packets transmitted, 13 received, 7% packet loss, time 13129ms rtt min/avg/max/mdev = 84.207/84.694/85.469 $ traceroute mhhe.com traceroute to mhhe.com (198.45.24.104), 30 hops max, 38 byte packets 1 Dcore.fhda.edu (153.18.31.254) 1.025 ms 0.892 ms 0.880 ms 2 Ddmz.fhda.edu (153.18.251.40) 2.141 ms 2.159 ms 2.103 ms 3 Cinic.fhda.edu (153.18.253.126) 2.159 ms 2.050 ms 1.992 ms... 16 * * * 17 * * *...
ICMP Structure Input module: process ICMP messages passed from IP Output module: generate ICMP messages by request of higher layer or IP protocol
ICMP Input Module Receive: an ICMP packet from the IP layer 1. If(the type defines an error message other than a redirection) 1. Inform the appropriate source protocol about the situation. 2. If(the type defines a redirection) 1. Modify the routing table. 3. If(the type is any of the request messages) ; Echo or Timestamp Request 1. Create a reply. 2. Send the reply. 4. If(the type is one of the reply messages) 1. Extract information in the data section of the packet. 2. Deliver extracted information to the process that requested it. ;
ICMP Output Module Receive: a demand 1. If(the demand is an error message from IP) 1. Create the error report message 2. If(the demand is redirection at a router) 1. Create a redirection message 3. If(the demand defines a request from upper layer) 1. Create a request message. 4. If(the demand is a request message from IP) 1. Create a reply message. 5. Send the message.