Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message...

24
Internet Control Message Protocol (ICMP)

Transcript of Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message...

Page 1: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Internet Control Message Protocol (ICMP)

Page 2: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Objective

IP and ICMP Why need ICMP? ICMP Message Format ICMP fields Examples:

» Ping» Traceroute

Page 3: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP and IP

Page 4: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Why ICMP?

IP provides an unreliable, connectionless datagram delivery service.

Datagram travels from gateway to gateway until it reaches the destination host’s network, where it would be sent directly.

Question is: What happens if a gateway cannot route or deliver a datagram or if the gateway detects an unusual condition like network congestion?

Page 5: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Why ICMP? (cont.)

What mechanisms are there in TCP/IP suite for a gateway to inform the sender about an error in the IP Datagram deliver?

How do gateways use the mechanism to report delivery problems and how do hosts use it to test whether or not destinations are reachable?

Page 6: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Why ICMP? (cont.)

In a connectionless system each gateway operates autonomously, routing or delivering datagrams without any coordination from the sender.

When the system works well there is nothing to worry.

Murphy’s Law: If things can go wrong, they will.

Page 7: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Why ICMP? (cont.)

The designers separated such a mechanism from IP to simplify the main-stream IP.

The special-purpose mechanism --- Internet Control Message Protocol (ICMP) --- is considered a required part of IP and must be included in every IP implementation.

How do these ICMP messages travel? of course using IP services

Page 8: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Why ICMP? (cont.)

The destination of an ICMP message is not an application program or user, but the IP software on that machine.

The ICMP allows gateways to send error or control messages to other gateways or hosts; ICMP provides communication between the IP software on one machine and the IP software on another.

Page 9: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Error Reporting vs. Error Correction

ICMP only reports error conditions to the original source; the source must relate errors to individual application programs and take action to correct the problem.

ICMP reports problems to the original source even if they are due to misbehaving intermediate gateways. This is due to the format of the IP header that has information about the source and destination and not the record of path.

Page 10: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Message Format

8-bit integer message TYPE that identifies the message

8-bit CODE field that provides further information about the message type

16-bit CHECKSUM field (additive checksum covering the ICMP part of the message one’s complement sum of all 16-bit words in the header beginning with checksum of zero)

Page 11: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Message Encapsulation

ICMP DATA

DATAGRAM DATA AREA

FRAME DATA AREA

HEADER

HEADER

HEADER

Physical layer

Page 12: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Message Types

0 Echo Reply

3 Destination Unreachable

4 Source Quench

5 Redirect (change a route)

8 Echo Request

11 Time Exceeded for a Datagram

12 Parameter Problem on a Datagram

Page 13: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Message Types (cont.)

13 Timestamp Request

14 Timestamp Reply

15 Information Request (obsolete)

16 Information Reply (obsolete)

17 Address Mask Request

18 Address Mask Reply

Page 14: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Echo Request/Echo Reply

Testing Destination Reachability and Status A debugging aid for network managers: echo

request and echo reply (ping command) Echo Request and Reply Message Format

TYPE 8 for request TYPE 0 for reply

Page 15: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Formats (cont.)

Reports of Unreachable DestinationsUnreachability of what?

Code Value Meaning========= ================0 network unreachable1 host unreachable2 protocol unreachable3 port unreachable

Page 16: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Formats (cont.)

4 fragmentation needed and DF set

5 source route failed

6 destination network unknown

7 destination host unknown

8 source host isolated

9 communication with destination network administratively prohibited

10 communication with destination host administratively prohibited

Page 17: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Congestion and Datagram Flow Control

Usually, congested gateways send one source quench message for every datagram that they discard.

A source quench message is a request for the source to reduce its current rate of datagram transmission.

No reversal of ICMP source quench request. A host lowers the rate at which it sends on the receipt of a source quench messages; it then gradually increases the rate as long as no further source quench are received.

Page 18: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Source Quench Format

Type (4) Code (0) Checksum

Unused, must be zero

Internet Header + First 64 bits of datagram

...

Sent each time a datagram is discarded

Page 19: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Redirect Message

Type (5) Code (0-3) Checksum

Gateway Internet Address

Internet Header + First 64 bits of datagram

...

Page 20: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Redirect Message

If Host A sends a packet destined to net3 to R2 Then1. R2 relays the packet to R1 2. R2 sends ICMP redirect message to Host A 3. A should update its Routing Table with the entry (Network ID:net3; Next Hop: R1)

net1 net2net3

R1 R2Host A

Page 21: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

ICMP Time Exceeded message

sent whenever a datagram is discarded because TTL reached zero, using Type 11- Code 0

sent when time set to collect fragments belonging to a particular packet expires, using Type 11 - Code 1

Page 22: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Clock Synchronization and Transit Time Estimation

A machine can obtain time from another machine, using timestamp request message.

Time stamp is a 32-bit quantity representing m-seconds elapsed since midnight. The receiving machine responds with timestamp reply message, which contains originate, receive, and transmit timestamps, with proper request-reply message association.

Page 23: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Obtaining a Subnet Mask

A host can send an address mask request message to a gateway and receive address mask reply message. Such a message can be sent directly or broadcast, using type 17 for request 18 for reply, and code 0

Page 24: Internet Control Message Protocol (ICMP). Objective l IP and ICMP l Why need ICMP? l ICMP Message Format l ICMP fields l Examples: »Ping »Traceroute.

Utilities that Use ICMP

PING: sends ICMP Echo Requests and monitors ICMP Echo Replies

TraceRoute: Sends a sequence of ICMP Echo Requests with increasing TTL values starting from 1 and monitors the ICMP Time Exceeded Messages (reported by routers along the path to destination) or ICMP Echo Reply from destination