Chapter 8 ICMP Echo Request (PING)
Download
Report
Transcript Chapter 8 ICMP Echo Request (PING)
TCP/IP Error Message
Chapter 8
Some conditions that must be met for host to host communication over
an internetwork:
• a default gateway must be properly configured on the hosts and
local network
• intermediary devices, such as routers, must be present on the
network and have knowledge of how to reach the destination
network.
• the IP addresses of hosts must be in the same network or subnet
as their respective gateway devices
4/2/2016
Page 1
TCP/IP Error Message
Chapter 8
IP is an unreliable method for delivery of network data. It is a best effort
delivery.
Nothing in IP basic design allows it to notify the sender that a data
transmission has failed.
Internet Control Message Protocol (ICMP) is a component of TCP/IP that
addresses this basic limitation.
NOTE:
• ICMP does not overcome the unreliability issues in IP
• reliability must be provided by upper layer protocols, if it is needed.
ICMP is an error reporting protocol for IP.
4/2/2016
Page 2
TCP/IP Error Message
Chapter 8
If ICMP fails, it does not produce ICMP error messages.
If a route is down, such as a serial connection between routers so that
the destination network is unreachable, the router will send ICMP host
unreachable message to the source.
Hence when a router doesn’t have the information to a destination, it:
• sends ICMP message of designation unreachable to the source
• drops the datagram
• No further ICMP messages will be sent as a result of this
transaction
4/2/2016
Page 3
Chapter 8
ICMP Echo Request (PING)
4/2/2016
Page 4
Test Reachability
Chapter 8
Use the PING command to test reachability
PING sends echo request message to the destination
The destination responds with echo reply message
The messages are indicated in the type field (8 bits) of the ICMP message.
4/2/2016
Page 5
Chapter 8
ICMP Echo Request (PING)
4/2/2016
Page 6
Excessively Long Routes
Chapter 8
To keep ICMP from routing an infinite number of times it has a Time-ToLive (TTL) timer.
The TTL value is defined by the routing protocol – RIP, hop count 15.
As the ICMP goes through each router the TTL is decremented, and when
it reaches zero, the datagram is discarded.
4/2/2016
Page 7
Chapter 8
ICMP Echo Request (PING)
4/2/2016
Page 8
Chapter 8
ICMP Echo Request (PING)
4/2/2016
Page 9
Echo Message
Chapter 8
All ICMP messages format start with these fields:
1.
type
2.
code
3.
checksum
For ICMP echo request and echo reply, there are two unique fields:
1.
identifier
2.
sequence
These two fields are used to match the echo request with the echo
reply.
4/2/2016
Page 10
Chapter 8
ICMP Request/Reply Message
• ICMP messages have special formats.
Type
Code
Checksum
Identifier
Sequence
Number
Data
• All ICMP message formats start with these same three
fields:
– Type - indicates the type of ICMP message being sent
– Code - indicates the reason the packet could not be delivered
– Checksum - used to verify the integrity of the data
0
1
2 3 4 5
Type (8 bits)
6
7
8
9
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Code (8 bits)
IMCP Header Checksum (16 bits)
Identifier (16 bits)
Sequence Number (16 bits)
Optional Data (variable length)
4/2/2016
Page 11
Unreachable Message
Chapter 8
If a packet can not reach it’s destination, then ICMP sends a destination
unreachable message. The code value in the ICMP datagram is 0.
Other reasons for destination unreachable
• packet fragmentation from Token Ring to Ethernet
• FTP or Web services are unavailable
• non-existent IP address
• default gateway may not be configured correctly
• destination device may be disconnected from its network
• router’s interface is down
Some examples of code values:
0 = network unreachable
1 = host unreachable
2 = protocol unreachable
3 = port unreachable
4/2/2016
Page 12
ICMP Codes
4/2/2016
Chapter 8
Page 13
Chapter 8
Miscellaneous Error Reporting
If there is an error in the header of a datagram, to be delivered to it’s
destination, ICMP has a type value of 12; code value of 0, and a pointer
field indicating the octet of the datagram that produced the error.
4/2/2016
Page 14
ICMP Control Messages
Chapter 8
Since IP has no built-in method to provide information or control
messages why a datagram can’t be delivered, ICMP performs these
functions.
Unlike error messages, control messages are not the results of lost
packets or error conditions which occur during packet transmission.
Instead, they are used to inform hosts of conditions such as network
congestion or the existence of a better gateway.
Some examples of control messages are:
0 = echo reply
3 = destination unreachable
5 = redirect/change request
8 = echo request
11 = time exceeded
12 = parameter problem
4/2/2016
Page 15
Control Messages /
Chapter 8
Redirect Change Request
•Redirect/Change request can only be initiated by a gateway.
•The gateway is the ethernet port address that a host uses to get to the
network.
•In some cases the host has a ‘hard’ coded gateway.
•
Host B sends a packet to
Host C on network 10.0.0.0/8.
•
Since Host B is not directly
connected to the same
network, it forwards the
packet to its default gateway,
Router A.
•
Host C
Router B
Router A
Router A finds the correct
route to network 10.0.0.0/8
by looking into its route
table.
Host B
(continued)
4/2/2016
Page 16
Control Messages /
Chapter 8
Redirect Change Request
•
•
It determines that the
path to the network is
back through the same
interface that the request
to forward the packet
came from.
It forwards the packet and
sends an ICMP
redirect/change request
to Host B telling it to use
Router B as the gateway
to forward all future
requests to network
10.0.0.0/8.
Host C
Router A
Router B
Host B
4/2/2016
Page 17
Control Messages /
Chapter 8
Redirect Change Request
To disable redirect messages on a router interface:
RouterA(config-if)# no ip redirects
4/2/2016
Page 18
Control Messages
ICMP Time Stamp
Chapter 8
The TCP/IP protocol suite allows systems to connect over vast distances.
Each individual networks might provide it’s own synchronization.
ICMP timestamp request can be used. There is a timestamp request &
reply.
This ICMP message contain the originate, receive and transmit
timestamps to calculate the correct timing. This is used to request the
current time of the remote host, and gather information needed to
estimate the transit time across the network.
However, the Network Time Protocol (NTP) at the upper layers of the
TCP/IP is a more reliable manner.
4/2/2016
Page 19
Control Message
Request and Reply
Chapter 8
ICMP request & reply messages are considered obsolete.
Protocols such as BOOTP and DHCP now provide the service of
providing a network number.
4/2/2016
Page 20
Control Message
Address Mask Request
Chapter 8
This ICMP message is replied to a host by a router.
The reply contains the 32-bit mask for the subnet from which the
request was received.
4/2/2016
Page 21
Control Message
Chapter 8
Router Discovery Message
If a host is missing a default gateway, it can generate an ICMP router
solicitation message.
Message is sent via multicast. A local router will respond with the gateway
address.
The router discovery process begins when a host requires a default
gateway IP address.
The router advertisement & solicitation messages are used during the
ICMP router discovery process.
4/2/2016
Page 22
Congestion and
Flow Control Messages
Chapter 8
If a host encounters congestion because of difference in bandwidth, an
ICMP source-quench message can be sent to ask senders to reduce the
rate at which they are transmitting traffic.
Hence, for the source-quench message
• a host can send the message
• a gateway may send the message
• message tells the sending device to slow down
4/2/2016
Page 23