error and control an ip datagram travels from node to node on the way to its destination each router...

30
Error and Control • An IP datagram travels from node to node on the way to its destination • Each router operates autonomously • Failures or problems may occur or develop along the way to a destination Destinations may not be reachable Referenced host may not have the appropriate application running The Time to Live field may decrement to 0 before reaching destination

Upload: magnus-joseph

Post on 05-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Error and Control

• An IP datagram travels from node to node on the way to its destination

• Each router operates autonomously• Failures or problems may occur or develop

along the way to a destination Destinations may not be reachable Referenced host may not have the

appropriate application running The Time to Live field may decrement to 0

before reaching destination

Page 2: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Error and Control• To assist with such situations a protocol

was included within the IP module

• Internet Control Message Protocol (ICMP)

• Routers and hosts can report certain conditions back to the source of the original datagram

• This is strictly a reporting mechanism to the source of the datagram that triggered the condition

Page 3: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

ICMP

• The ICMP protocol is documented in RFC792 (1981)

• ICMP messages are themselves encapsulated as IP datagrams

• ICMP messages may themselves encounter reportable conditions

• By convention, when ICMP datagrams encounter normally reportable conditions, these are not sent

• The reporting of conditions are not mandatory

Page 4: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

ICMP

• No ICMP message is sent for a fragment datagram except for the first fragment

• No ICMP message is sent if source is a multicast address

• No ICMP message is sent to special addresses, such as 127.0.0.0

Page 5: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Position of ICMP in the network layer

Page 6: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Encapsulation of ICMP packet

Page 7: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

ICMP messages

Page 8: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

General format of ICMP messages

Page 9: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Error-reporting messages

Page 10: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Contents of data field for error messages

Page 11: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Destination-unreachable format

Common Codes

0 Network Unreachable (router)

1 Host Unreachable (router)

2 Protocol (IP) Unreachable (host)

3 Port Unreachable (host)

4 Fragmentation required, NOFRAG bit set (router)

5 Source Route failed (router)

Page 12: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Source-quench format

• Routers may become congested and traffic may backup

• If there is no buffer for an incoming datagram the router discards the datagram and sends a Source Quench ICMP to the source host

• A source Quench ICMP is sent for every datagram discarded

• Source must reduce rate of traffic

• There is no indication sent when rate can again be increased

• Source host can later gradually increase traffic

Page 13: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Time-exceeded message format

Code 0 : Time to Live field has decremented to 0

A Time exceeded ICMP is sent to the source host and datagram discarded

This is sent by a router

Code 1: When all fragments of an original datagram do not arrive at a destination within a certain time, all fragments are discarded and an ICMP Time exceed message sent to source host

(by host)

Page 14: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Parameter-problem message format

• Code 0: Problem exists in the basic IP header

• Code 1: Problem exits in an Options field

• Pointer points to the first byte where error is detected

• When a parameter problem is detected, datagram is discarded and this ICMP message is sent

• This message may be created by a router or a host

Page 15: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Host Routing Table

• Each host start with some minimal routing table• In the simplest case, it contains the address of a

default router• As time goes on, this table can be augmented as

more information becomes available• For example, the defined default router may not

always be the best choice for a destination• The occurs when more than one router is connected

to the same network• When this occurs, a router may send a redirection

message to the host to notify it of the better choice

Page 16: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Redirection concept

Page 17: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Redirection message format

Code 0: Network specificCode 1: Host specific Code 2: Network specific (specified service)Code 3: Host specific (specified service)Note: This is sent by a router to a host on

the same local network

Page 18: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Query messages

Page 19: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Echo Request/Reply

• A host or a router may send an Echo Request

• When a host or router receives an Echo Request it should send the same message to the source of the request as a Reply

• This is essentially what the command PING does

• This is a useful diagnostic to verify reachability of a destination

Page 20: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Echo-request and echo-reply message format

Ping command can use ICMP Request/Reply

Page 21: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Timestamp-request and timestamp-reply message format

• Time values are in milliseconds since midnight Universal Time (UT)

• UT is the same as Greenwich Mean Time (GMT)

Page 22: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Timestamp Request/Reply

• Originate timestamp set by the source of datagram, other values set to 0

• Receive timestamp set by destination when datagram received

• Transmit timestamp set when destination sends reply• When reply arrives at source, time of reply noted

Sending time = Receive – OriginateReceive time = Reply – Transmit

Round trip = Sending time + Receive time

• The round trip time is accurate even if the two clocks are not synchronized

Page 23: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Timestamp Request/Reply• Synchronizing clocks using timestamp request/reply

One-way time = Round-trip/2Time difference = Receive – (Originate + One-way)

• Example

Originate timestamp =46Receive timestamp = 59Transmit timestamp = 60Reply timestamp = 67

Sending time = 59 – 46 = 13 Receive time = 67 – 60 = 7 Round-trip = 13 + 7 = 20

Time difference = 59 – (46 + 10) = 3

Page 24: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Mask-request and mask-reply message format

• Purpose is for a host to obtain the mask associated with its IP address

• Host sends this request to a router on the local network

• If host does not know the address of the router it broadcasts this request

• Router responds with the mask for this network

• Not really used today

• BOOTP and DHCP used instead

Page 25: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Router solicitation message format

• Purpose is to allow a host to discover routers on the local network

• Even if it has a default gateway configured, this is a way to discover others connected to the local network

• A host broadcasts this message

• Routers will reply with advertisement messages

Page 26: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Router advertisement message format

• May be sent even when not solicited by a request

• Advertisement is broadcast on the local network

Page 27: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

ICMP Checksum

• An ICMP message contains a Checksum much like an IP header

• The Checksum calculation is the same as previously described

• The Checksum covers the entire ICMP message, the header and the data

Page 28: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

ICMP package

Page 29: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Traceroute

• Command that attempts to track the path a datagram takes to its destination

• Traceroute uses ICMP and the TTL field in the IP header

• When TTL decrements to 0 ICMP Time Exceeded message sent to host

• ICMP message contains IP address of router generating message

Page 30: Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur

Traceroute

• Traceroute sends datagram with TTL = 1• First router sends ICMP Time Exceeded• Traceroute next sends datagram with TTL =2• Second router sends ICMP Time Exceeded• This continues until destination reached• Each step logs a hop to the destination• Notes:

Path of subsequent datagrams not guaranteed to be the same each time

Some routers along the way may not respond