1 Internet Networking Spring 2002 Tutorial 4 ICMP (Internet Control Message Protocol)
2 ICMP - Introduction Defined in RFCs 792/1122 Allow routers to send error or control messages to other router or hosts Considered as a required part of IP layer –Although implemented above IP layer Not making IP service more reliable, but provide feedback about network problems Destination of ICMP packets is ICMP software module on another machine
3 Typical Network Error and Control Cases Reporting errors: –Unreachable destination (network, host, port) –Traffic overrun on router (congestion) –Detecting Circular or excessively long routes Information exchanging: –Testing destination reachability –Clock synchronization –Discovering the local router
4 Errors During Sending ICMP Message ICMP messages are routed as usual packets – There is no additional reliability or priority Thus, error messages themselves may be lost or discarded New ICMP error message is not generated for: –ICMP error messages (however, may be generated for ICMP queries) –Fragment other than the first –Broadcast or Multicast messages
5 ICMP Packet Encapsulation Frame Header IP Header ICMP Header ICMP Data Frame Data Area Datagram Data Area
6 ICMP Header Structure TYPE field identifies type of service –There are 15 different values for the TYPE field CODE - further specifies some types of services CHECKSUM - for discovering errors. –Same algorithm as in IP checksum –Covers the entire ICMP message TypeCodeChecksum
7 ICMP Data Content of DATA depends on TYPE and CODE fields In case of an error, DATA field contains IP header and 8 first bytes of a datagram that caused the problem –In hope to help for the Receiver to determine what caused the problem
8 ICMP Message Types Type FieldICMP Message Type 0Echo Reply 3Destination Unreachable 4Source Quench 5Redirect (change a route) 8Echo Request 9Router Advertisement 10 Router Solicitation 11 Time Exceeded for a Datagram
9 ICMP Message Types (cont.) Type FieldICMP Message Type 12Parameter Problem on a Datagram 13Timestamp Request 14Timestamp Reply 15Information Request (obsolete) 16Information Reply (obsolete) 17Address Mask Request 18 Address Mask Reply
10 Source Quench Message Congestion will occur if a router gets datagrams in faster rate than it can process. In such cases router must discards some of the arriving datagrams It sends then ICMP “source quench” message to report congestion to the original source A source quench message is a request for the source to reduce its current rate of datagram transmission
11 Source Quench Message There is no ICMP message to reverse the effect of a source quench Type (4)Code (0)Checksum Unused (Must be zero) IP header + first 8 bytes of datagram Source Quench Message Format
12 Clock Synchronization ICMP timestamp request allows a system to query another for the current time Type (13 or 14)Code (0)Checksum bit originate timestamp ICMP Timestamp Request and Reply Message Format 32-bit receive timestamp 32-bit transmit timestamp IdentifierSequence number
13 Clock Synchronization The requestor fills in the originate timestamp and sends the request –Timestamp values are in milliseconds past midnight The replying system fills in receive timestamp when it receives the request and transmit timestamp when it sends the reply Example: sun % icmptime gemini orig = , recv = , xmit = rtt = 247 ms, difference = ms
14 MTU Discovering When a router get a datagram that requires fragmentation, but the IP header fragment flag is turned on, than the router drop the packet and sends ICMP unreachable error - Fragmentation Required to the sender Newer router also returns next hop MTU value that caused the packet dropping, insides of ICMP message Type (3)Code (4)Checksum IP header + first 8 bytes of datagram Unused (must be 0)MTU of next-hop network
15 MTU Discovering Algorithm: –We send packets with don’t fragment bit set –The size of the first packet we send will be equal the MTU of the outgoing interface –Whenever we receive an ICMP “can’t fragment” error we will reduce the size of the packet: If the router sending ICMP error, returns MTU that caused the drop than we will use this value Otherwise we we will try the next smallest MTU (RFC defines only a limited number of MTUs)
16 Ping Program A program for checking if host is alive –Exists in most Operation Systems Sends ICMP message of type Echo Request Receiver answers with ICMP messages of type Echo Reply Enables also to see the Round Trip Time from a sender to a destination
17 Ping (Example)
18 Traceroute Program Lets see the route that IP datagrams follow from one host to another –There is no guaranty that two that two consecutive IP datagrams from the same source to the same destination follow the same route, but most of the time they do Sends a sequence of datagrams with TTL set to 1,2,etc. These datagrams are UDP packets sent to some unused port.
19 Traceroute Program (cont.) When intermediate router receives a packet with TTL=1 it throws the packet and sends back ICMP “time exceeded” message In such way we can discover all routers in the was between source and destination The process finishes, when a destination host gets the packet and sends back ICMP “port unreachable” message Many sites now put firewalls that don’t give traceroute/ping packets get through
20 Traceroute (Example)
21 Traceroute (Example) traceroute from ack.berkeley.edu to 1 vlan206.inr-203-eva.Berkeley.EDU ( ) ms ms ms 2 vlan210.inr-202-doecev.Berkeley.EDU ( ) ms ms ms 3 gigE3-0.inr-000-eva.Berkeley.EDU ( ) ms ms ms 4 pos3-0.c2-berk-gsr.Berkeley.EDU ( ) ms ms ms 5 SUNV--BERK.POS.calren2.net ( ) ms ms ms 6 Abilene--QSV.POS.calren2.net ( ) ms ms ms 7 losa-snva.abilene.ucaid.edu ( ) ms ms ms 8 hstn-losa.abilene.ucaid.edu ( ) ms ms ms 9 atla-hstn.abilene.ucaid.edu ( ) ms ms ms 10 ipls-atla.abilene.ucaid.edu ( ) ms ms ms 11 ILAN-Abeline.ilan.net.il ( ) ms ms ms 12 chi-gp3-fe-i2.ilan.net.il ( ) ms ms ms 13 tau-gp2-s0.ilan.net.il ( ) ms ms ms 14 tau-gp1-fe-i2.ilan.net.il ( ) ms ms ms 15 technion-gp1-mag.ilan.net.il ( ) ms ms ms