Internet Control Message Protocol (ICMP)ICM… · Error-Reporting Messages 7. Error-Reporting...

Preview:

Citation preview

Internet Control Message Protocol (ICMP)

Chapter 9

Position of ICMP in Network Layer

2

ICMP Encapsulation

3

ICMP Messages

Error-reporting messages report problems that router or host may encounter

Query messages get specific information from router or another host

4

General Format of ICMP Messages

5

Contents of Data Field for Error Message

ICMP dataICMP data

6

ICMP always reports error messages to original source

No ICMP error message generated for: Datagram carrying ICMP error message Fragmented datagram Multicast datagram Datagram having special IP address (0.0.0.0

or 127.0.0.0)

Error-Reporting Messages

7

Error-Reporting Messages

8

Destination-Unreachable Message

Destination-unreachable message sent to source host when datagram is undeliverable

Code 0: Network unreachable Code 1: Host unreachable Code 2: Protocol unreachable Code 3: Port unreachable Code 4: Fragmentation required, but “do not fragment” is set Code 5: Source routing cannot be accomplished

9

Source-Quench Message

Source-quench message informs source that datagram has been discarded due to congestion in router or destination host

Source should slow down (quench) sending of datagrams until congestion is relieved

10

Time-Exceeded Message

Time-exceeded message generated when: Time-to-live value has reached zero Fragments of message have not arrived in a set time

11

Parameter-Problem Message

Parameter-problem message notifies host that there is a problem in header field of datagram

Code 0: Error in one of header fields Code 1: Required part of an option is missing

12

Redirection Message

IP packet 1

RM2

IP packet3

IP packet4

Redirection message sent to make routing table of host more efficient

Redirection message sent from router to host on the same local network

13

Routing Table

Flags – on/off switches (presence/absence) U (up): router is up and running G (gateway): destination is in another network H (host-specific): entry in network address field is host-specific

address D (added by redirection): routing info for this destination added

by ICMP redirection message M (modified by redirection): routing info for this destination

modified by ICMP redirection message

14

Redirection Message

Code 0: Redirection for network-specific route Code 1: Redirection for host-specific route Code 2: Redirection for network-specific route based on TOS Code 3: Redirection for host-specific route based on TOS

15

Query Messages

16

Echo-Request and Echo-Reply Message

Echo-request and echo-reply messages test connectivity between two systems

17

Timestamp-Request and Timestamp-Reply Message

Timestamp-request and timestamp-reply messages can: Determine round-trip time between two machines Synchronize two clocks in two machines

18

Timestamp-Request and Timestamp-Reply Message

Sending time = Receive timestamp - Original timestamp Receiving time = Returned time - Transmit time Round-trip time = Sending time + Receiving time

19

ping program uses ICMP echo request and echo reply messages to test reachability of host

Ping Tool

20

We can use ping utility with -R option to implement record route option.

Ping Tool

21

Traceroute program uses ICMP time exceeded and destination unreachable messages to trace route of packet from source to destination

Traceroute uses ICMP messages, TTL field in IP packet, and destination port number field in UDP packet to find route

Traceroute Tool

22

Traceroute program can be used to implement loose source routing.

-g option allows us to define routers to be visited, from source to destination.

Traceroute Tool

23

Traceroute program can be used to implement strict source routing.

-G option forces packet to visit routers defined in command line.

Traceroute Tool

24

Recommended