Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICMP : Internet Control Message Protocol. Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions.

Similar presentations


Presentation on theme: "ICMP : Internet Control Message Protocol. Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions."— Presentation transcript:

1 ICMP : Internet Control Message Protocol

2 Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions that require attention. ICMP messages are usually acted on by either IP layer or the higher layer protocol. IP header (20 byte)ICMP message IP datagram

3 ICMP Message The first 4 bytes have the same format for all messages, but the remainder differs from one message to the next. (contents depends on type and code) 8-bit type8-bit code16-bit checksum 0 7 8 15 16 31

4 ICMP Message Types typeDescription 0Echo Reply EchoQuery 3Destination UnreachableError 4Source QuenchError 5RedirectError 8Echo Request EchoQuery 9Router AdvertisementQuery 10Router SolicitationQuery 11Time ExceededError 12Parameter ProblemQuery 13Timestamp RequestQuery 14Timestamp ReplyQuery 17Address Mask RequestQuery 18Address Mask ReplyReply codeDescription 0Network Unreachable 1Host Unreachable 2Protocol Unreachable 3Port Unreachable 4Fragmentation Needed and DF set 5Source Route Failed 6Destination Network Unknown 7Destination Host Unknown 8Source Host Isolated 9Network Administratively Prohibited 10Destination Host Administratively Prohibited 11Network Unreachable For TOS 12Host Unreachable For TOS 13Communication Administratively Prohibited 14Host Precedence Violation 15Precedence Cutoff in Effect

5 ICMP Echo Request and Reply ICMP echo is a message to send and receive the specified echo data packet between two TCP/IP nodes. 0 7 8 15 16 31 Echo data (variable length) Type(0 or 8)Code(0) identifier checksum sequence number

6 ICMP Addr Mask Request and Reply The ICMP Address mask request is intended for a diskless system to obtain its subnet mask at bootstrap time. 0 7 8 15 16 31 32-bit subnet mask Type(17 or 18)Code(0) identifier checksum sequence number

7 ICMP Addr Mask We can write a simple program that issues an ICMP address mask request and prints all replies. % icmpaddrmask 140.252.13.63 Received mask = ffffffe0, from 140.252.13.33 Received mask = ffffffe0, from 140.252.13.35 Received mask = ffff0000, from 140.252.13.34

8 ICMP Timestamp Request and Reply The ICMP timestamp request allows a system to query another for the current time. The recommended value to be returned is the number of milliseconds since midnight, Coordinated Universal Time (UTC). 0 7 8 15 16 31 32-bit originate timestamp Type(13 or 14)Code(0) identifier checksum sequence number 32-bit receive timestamp 32-bit transmit timestamp

9 ICMP Timestamp Request and Reply The requestor fills in the originate timestamp and sends the request. The replying system fills in the receive timestamp when it receives the request. The transmit timestamp when it send the reply. 0 7 8 15 16 31 32-bit originate timestamp Type(13 or 14)Code(0) identifier checksum sequence number 32-bit receive timestamp 32-bit transmit timestamp

10 ICMP Unreachable Message It is an error message sent back to the transmission origin when the packet cannot be sent to service. It is likely to reply from a machine on the way of routing (router), and it might reply from the machine (target host). 0 7 8 15 16 31 Unused (must be 0) Type(3)Code(0-15)checksum IP header + first 8 bytes of original IP datagram data

11 ICMP Message Types codeDescription 0Network Unreachable 1Host Unreachable 2Protocol Unreachable 3Port Unreachable 4Fragmentation Needed and DF set 5Source Route Failed 6Destination Network Unknown 7Destination Host Unknown 8Source Host Isolated 9Network Administratively Prohibited 10Destination Host Administratively Prohibited 11Network Unreachable For TOS 12Host Unreachable For TOS 13Communication Administratively Prohibited 14Host Precedence Violation 15Precedence Cutoff in Effect

12 Exercises If your system provides the netstat command, use it to see what types of ICMP messages are received and sent.

13 Ping Program

14 Introduction The name “ping” is taken from the sonar operation to locate objects. The program sends an ICMP echo request message to a host, expecting an ICMP echo reply to be returned. Ping also measures the round-trip time to the host, giving us some indication of how “far away” that host is.

15 (1) (2) (3)

16 Ping Options - optionsdescription -tPing the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -aResolve addresses to hostnames. -n countNumber of echo requests to send. -l sizeSend buffer size -fSet Don't Fragment flag in packet. -i TTLTime To Live. -v TOSType Of Service. -r countRecord route for count hops. -s countTimestamp for count hops. -j host-listLoose source route along host-list. -k host-listStrict source route along host-list. -w timeoutTimeout in milliseconds to wait for each reply.

17 Ping HOST A 192.168.1.1 HOST B 192.168.1.2 Please return the sent data. I return the data as it is. - Reply from 192.168.1.2 : bytes = 32 time < 10ms TTL = 128 - Ping 192.168.1.2

18 Format of ICMP message We call the ping program that sends the echo requests the client, and the host being pinged the server. 0 7 8 15 16 31 Optional data Type(0 or 8)Code(0) identifier checksum sequence number

19 From the result The network communication with the object host must be normal.  Own host's network setting and operation.  The object host's network setting and operation.  Setting and operation of network/router. Network performance  The throughput of the network can guess from the display of statistics.

20 Case of failure The routing to Internet Protocol address cannot be done. C:\>ping 192.168.10.1 Pinging 192.168.10.1 with 32 bytes of data: Reply from 203.100.100.49: Destination net unreachable. Reply from 203.100.100.49: Destination net unreachable. Reply from 203.100.100.49: Destination net unreachable. :

21 Case of failure Loop by routing setting mistake. C:\>ping 150.224.XXX.XXX Pinging 150.224.XXX.XXX with 32 bytes of data: Reply from 130.XXX.76.17: TTL expired in transit. Reply from 130.XXX.76.17: TTL expired in transit. Reply from 130.XXX.76.17: TTL expired in transit. Reply from 130.XXX.76.17: TTL expired in transit. Ping statistics for 150.224.XXX.XXX: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms

22 Case of failure Failure of host name resolution. The host's stop. C:\>ping www.unknown.net Unknown host www.unknown.net. C:\>ping host1.example.net Pinging host1.example.net [211.XXX.XXX.190] with 32 bytes of data: Request timed out. Request timed out. :

23 Summary The ping program is the basic connectivity test between two systems running TCP/IP.  It uses the ICMP echo request and echo reply messages and does not use a transport layer. Ping also let us examine and use the IP record route option.

24 Exercises Calculate the RTT if the SLIP link between bsdi and slip is set to 9600 bits/sec. Assume the default of 56 bytes of data.

25 IP ICMP Echo Request Echo Reply Normal Access Destination unreachable Because of router Couldn’t find Host X, router send a Error Message HOST A HOST B HOST Y HOST X

26 ICMP Message Types When an ICMP error message is sent, the message always contains the IP header and the first 8 bytes of the IP datagram that caused the ICMP error to be generated. This lets the receiving ICMP module associate the message with one particular protocol and one particular user process.

27 ICMP Message Types An ICMP error message is never generated in response to  An ICMP error message  A datagram destined to an IP broadcast address or an IP multicast address.  A datagram sent as a link-layer broadcast.  A fragment other than the first.  A datagram whose source address does not define a single host.


Download ppt "ICMP : Internet Control Message Protocol. Introduction ICMP is often considered part of the IP layer. It communicates error messages and other conditions."

Similar presentations


Ads by Google