1 / 32

Chapter 9

Chapter 9. Internet Control Message Protocol (ICMP). About ICMP(Internet Control Message Protocol) : RFC 792[ Postel 1981b] The IP provides an unreliable and connectionless datagram delivery.

tonya
Download Presentation

Chapter 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 9 Internet Control Message Protocol (ICMP)

  2. About ICMP(Internet Control Message Protocol) : RFC 792[ Postel 1981b] TheIP provides an unreliable and connectionless datagram delivery. The IP protocol is a best-effort delivery service that deliverers a datagram from its original source to its final destination. The IP protocol has no error-reporting or error-correcting mechanism. It has two deficiencies: lake of error control, and lake of assistance mechanism. The Internet Control Message Protocol(ICMP) has been designed to compensate for the above two deficiencies. It is a companion to the IP protocol. ICMP(Internet Control Protocol)

  3. Figure 9-1 Position of ICMP in the network layer

  4. ICMP itself is a network layer protocol. However, its message are not passed directly to the data link layer as would be expected. Instead, the message are first encapsulated inside IP datagram before going to the lower layer. Figure 9-2 ICMP encapsulation

  5. 9.1 TYPE OF MESSAGE • ICMP messages are divided into two broad categories: error-reporting message and query messages. • The error-reporting messages report problems that a router or host(destination) may encounter when it processes an IP packet. • The query messages help a host or a network manager get specific information from a router or another host. Figure 9-3 ICMP messages

  6. 9.1 TYPE OF MESSAGE.. ICMP(Internet Control Protocol)

  7. 9.2 MESSAGE FORMAT An ICMP message has an 8-byte header and a variable-size data section. The first four bytes are common to all. General format of the header is different for each message type. The code field specifies the reason for the particular message type. The last common field is the checksum field. The rest of the header is specific for each message type. The data section in err message carries information for finding the original packet which caused the error. In query messages, the data section carries extra information based on the type of the query. ICMP(Internet Control Protocol)

  8. Figure 9-4 General format of ICMP messages

  9. 9.3 ERROR REPORTING ICMP always reports error message to the original source. Five types of errors are handled: destination unreachable Source quench Time exceeded Parameter problem Redirection ICMP(Internet Control Protocol) Figure 9-5 Error-reporting messages

  10. 9.3 ERROR REPORTING.. The following are important point about ICMP error messages: No ICMP error message will be generated in response to a datagram carrying an ICMP error message. No ICMP error message will be generated for a fragmented datagram that is not the first fragment. No ICMP error message will be generated for a datagram having a multicast address. No ICMP error message will be generated for a datagram having a special address such as 127.0.0.0 or 0.0.0.0. ICMP(Internet Control Protocol)

  11. All error messages contain a data section that include the IP header original datagram plus the first eight bytes of data in that datagram. Figure 9-6 Contents of data field for the error messages.

  12. Destination Unreachable When a router cannot route a datagram or a host cannot deliver a datagram, the datagram is discarded and the router or the host sends a destination unreachable message back to the source host that initiated the datagram. Figure 9-7 Destination unreachable format

  13. Destination Unreachable The code field for this for this type specifies the reason for discarding the datagram: Code 0: The network is unreachable. Code 1: The host is unreachable. Code 2: The protocol is unreachable. Code 3: The port is unreachable. Code 4: Fragmentation is required, but the DF(do not fragment)field of the datagram ha been set. Code 5: Source routing cannot be accomplished. Code 6: The destination network is unknown. Code 7: The destination host is unknown. Code 8: The source host is isolated. Code 9: Communication with the destination network is administratively prohibited. ICMP(Internet Control Protocol)

  14. Destination Unreachable Code 10: Communication with the destination host is administratively prohibited. Code 11: The network is unreachable for the specified type of service. Code 12: The host is unreachable for the specified type of service. Code 13: The host is unreachable because the administration has put a filter on it. Code 14: The host is unreachable because the host precedence is violated. Code 15: The host is unreachable because its precedence was cut off. Destination-unreachable messages with codes 2 or 3 can be created only by the destination host. Other destination-unreachable messages can be created only by routers. A router cannot detect all problems that prevent the delivery of a packet. ICMP(Internet Control Protocol)

  15. Source Quench IP does not have a flow-control mechanism embedded in the protocol. The lake of flow control can create a major problem in the operation. Of IP: congestion. A source-quench message informs the source that a datagram has been discarded due to congestion in a router or the destination host. The source must slow down the sending of datagrams until the congestions is relieved. One source-quench message should be sent for each datagram is discarded due to congestion. ICMP(Internet Control Protocol) Figure 9-8 Source-quench format

  16. ICMP(Internet Control Protocol) • Time Exceeded • The time-exceeded message is generated in two cases; • First: Whenever a router receives a datagram whose time-to-live field has the value of zero, it • discards the datagram and sends a time-exceeded message to the original source. • Second: When the final destination does not receive all of the fragments in a set time, it discards • the received fragments and send a time-exceeded message to the original source. • In a time-exceeded message, • Code 0 : It is used only by routers to show that the value of the time-to-live field is zero. • Code 1: It is used only by the destination host to show that not all of the fragments have • arrived within a set time. Figure 9-9 Time-exceeded message format

  17. ICMP(Internet Control Protocol) • Parameter Problem • Parameter-problem message can be created by a router or the destination host. • The code field in this case specifies the reason for discarding the datagram and shows exactly what has failed: • In a parameter-problem message, • Code 0 : There is error or ambiguity in one of the header fields. In this case, the value in the • pointer field points to the byte with the problem. • Code 1: The required part of an option is missing. In this case, the pointer is not used. Figure 9-10 Parameter-problem message format.

  18. ICMP(Internet Control Protocol) Redirection A host usually starts with a small routing table that is gradually augmented and updated. One of the tools to accomplish this is the redirection message. A redirection message is sent from a router to a host on the same local network. Figure 9-11 Redirection concept Routing table is updated

  19. ICMP(Internet Control Protocol) • The code field for redirection message narrows down the redirection: • Code 0: Redirection for the network-specific route. • Code 1: Redirection for host-specific route. • Code 2: Redirection for network-specific route base on the specific type of service. • Code 3: Redirection for host-specific route base on the specific type of service. Figure 9-12 Redirection message format.

  20. 9.4 QUERY In addition to error reporting, ICMP can also diagnose some network problem. This is accomplished through the query message, a group of four different pairs of messages. Note that originally two other types of message (information request and information reply) were defined, but they are now obsolete. They were designed to allow a host to get its Internet address at startup; RARP, BOOTP ICMP(Internet Control Protocol) Figure 9-13 Query messages

  21. Echo Request and Reply Network manager and user utilize this pair of message to identify network problems. The combination of echo-request and echo-reply messages determines whether two systems(hosts or router) can communicate with each other. An echo-request message can be sent a host or router. An echo-reply message is sent by the host or router which receives an echo-request message. Echo-request and echo-reply massage can be used by network managers to check the operation of the IP protocol. Echo-request and echo-reply massage can test the reachability of a host. This is usually done by invoking the ping command. ICMP(Internet Control Protocol) Figure 9-14 Echo-request and echo-reply messages

  22. Timestamp Request and Reply Two machines (host or routers) can use the timestamp-request and timestamp-reply message to determine the round-trip time need for an IP datagram to travel between them. It can also be used to synchronize the clock in two machines. The source creates a timestamp-request message. The source fills the original timestamp field with the Universal Time shown by its clock at departure time. The other two timestamp fields are filled zeros. The destination creates a timestamp-reply message. The destination copies the original timestamp value from the request message into the same field its reply message. It fills the receive timestamp field with the Universal Time shown by its clock at the time the request was received. It fills the transmit timestamp field with the Universal Time shown by its clock at the time the reply message departs. ICMP(Internet Control Protocol)

  23. Timestamp Request and Reply.. ICMP(Internet Control Protocol) • Timestamp-request and timestamp-reply messages can be used to measure the round-trip time • between a source and a destination machine even if there clocks are not synchronized. • The timestamp-request and timestamp-reply messages can be used to synchronize two clocks in • two machines if the exact one-way time duration is known.

  24. Figure 9-15 Timestamp-request and timestamp-reply message format

  25. Address Mask Request and Reply To obtain mask, a host sends an address-mask-request message to a router on the LAN. If the host knows the address of the router It sends the request directly to the router. If it does not know  Broadcasts the message. The address-mask field is filled with zeros in the request message. When the router sends the address-mask reply back to the host, this field contains the actual mask. Another way to get subnet mask information is through the use of the BOOTP protocol. ICMP(Internet Control Protocol) Figure 9-16 Mask-request and mask-reply message format.

  26. Router Solicitation and Advertisement Router Solicitation message A host can broadcast (or multicast) a router-solicitation message. The router or routers that receive the solicitation message broadcast their routing information using the router-advertisement message. ICMP(Internet Control Protocol) Figure 9-17 Router-solicitation message format

  27. Router Solicitation and Advertisement .. Router Advertisement message Each router entry in the advertisement contains at least two fields: The router address The address preference level.: It is zero  That router is considered the default router. ICMP(Internet Control Protocol) Figure 9-18 Router-advertisement message format

  28. 9.5 CHECKSUM In ICMP the checksum is calculated over the entire message (header and data). Checksum Calculation The sender follows these steps using one’s complement arithmetic: The checksum field is set zero. The sum of all the 16-bit words(header and data) is calculated. The sum is complemented to get the checksum. The checksum is stored in the checksum field. Checksum Testing The sender follows these steps using one’s complement arithmetic: The sum of all word (header and data) is calculated. The sum is complemented. If the result obtained in step 2 is 10 0s, the message is accepted; otherwise, it is rejected. ICMP(Internet Control Protocol)

  29. Figure 9-19 Example of checksum calculation

  30. 9.6 ICMP DESIGN In this design, the ICMP package is made of two modules: an input module and an output module. ICMP(Internet Control Protocol) Figure 9-20 ICMP design

  31. Input Module Receive: an ICMP packet from the IP layer. If (the type is any of the three request types) Create a reply Send the reply. If (the type is a router solicitation) If (station is a router) Create a router advertisement. Send the advertisement. If (the type is one of the three reply message or router advertisement) Extract information in the data section of the packet. Deliver extracted information to the process that request it. If (the type defines a redirection) Modify the routing table. If (the type defines an error message other than a redirection) Inform the appropriate source protocol about the situation. Return. ICMP(Internet Control Protocol)

  32. Output Module Receive: a demand If (the demand defines an error message) If (the demand is from IP) If (the demand is forbidden) Return If (the type defines a redirection message) If (the station is not a router) Return Create the error message using the type, the code, and the IP packet. If (the demand defines a request or solicitation) Create a request or solicitation message Send the message. Return. ICMP(Internet Control Protocol)

More Related