ICMP ~ Welcome to Just Friend4U

Sunday, 25 May 2014

ICMP

This protocol discusses a mechanism that gateways and hosts use to communicate control or error information. The Internet protocol provides unreliable, connectionless datagram service, and that a datagram travels from gateway to gateway until it reaches one that can deliver it directly to its final destination. If a gateway cannot route or deliver a datagram, or if the gateway detects an unusual condition, like network congestion, that affects its ability to forward the datagram, it needs to instruct the original source to take action to avoid or correct the problem. The Internet Control Message Protocol allows gateways to send error or control messages to other gateways or hosts; ICMP provides communication between the Internet Protocol software on one machine and the Internet Protocol software on another. This is a special purpose message mechanism added by the designers to the TCP/IP protocols. This is to allow gateways in an internet to report errors or provide information about unexpected circumstances. The IP protocol itself contains nothing to help the sender test connectivity or learn about failures.

Error Reporting vs. Error Correction
ICMP only reports error conditions to the original source; the source must relate errors to individual application programs and take action to correct problems. It provides a way for gateway to report the error It does not fully specify the action to be taken for each possible error. ICMP is restricted to communicate with the original source but not intermediate sources.

ICMP Message Delivery
ICMP messages travel across the internet in the data portion of an IP datagram, which itself travels across the internet in the data portion of an IP datagram, which itself travels across each physical network in the data portion of a frame. Datagram’s carrying ICMP messages are routed exactly like datagram’s carrying information for users; there is no additional reliability or priority. An exception is made to the error handling procedures if an IP datagram carrying an ICMP messages are not generated for errors that result from datagram’s carrying ICMP error messages.

ICMP Message Format
It has three fields; an 8-bit integer message TYPE field that identifies the message, an 8-bit CODE field that provides further information about the message type, and a 16-bit CHECKSUM field(ICMP uses the same additive checksum algorithm as IP, but the ICMP checksum only covers the ICMP message).In addition , ICMP messages that report errors always include the header and first 64 data bits of the datagram causing the problem. The ICMP TYPE field defines the meaning of the message as well as its format.
The Types include:
TYPE FIELD                          ICMP MESSAGE TYPE

        0                                             ECHO REPLY
        3                                             DESTINATION UNREACHABLE
        4                                             SOURCE QUENCH
        5                                             REDIRECT(CHANGE A ROUTE)
        8                                             ECHO REQUEST
       11                                            TIME EXCEEDED FOR A DATAGRAM
       12                                            PARAMETER PROBLEM ON A DATAGRAM
       13                                            TIMESTAMP REQUEST
       14                                            TIMESTAMP REPLY
       15                                             INFORMATION REQUEST(OBSOLETE)
       16                                             INFORMATION REPLY(OBSOLETE)
       17                                            ADDRESS MASK REQUEST
       18                                            ADDRESS MASK REPLY TESTING DESTINATION 


Reachabilty and Status :
TCP/IP protocols provide facilities to help network managers or users identify network problems. One of the most frequently used debugging tools invokes the ICMP echo request and echo reply messages. A host or gateway sends an ICMP echo request message to a specified destination. Any machine that receives an echo request formulates an echo reply and returns to the original sender. The request contains an optional data area; the reply contains a copy of the data sent in the request. The echo request and associated reply can be used to test whether a destination is reachable and responding. Because both the request and reply travel in IP datagram’s, successful receipt of a reply verifies that major pieces of the transport system work.
1.1 : IP software on the source must route the datagram
2.2 : Intermediate gateways between the source and destination must be operating and must route datagram correctly.
3.3 : The destination machine must be running , and both ICMP and IP software must be working.
4.4 : Routes in gateways along the return path must be correct.


Echo Request and Reply
The field listed OPTIONAL DATA is a variable length field that contains data to be returned to the sender. An echo reply always returns exactly the same data as was received in the request. Fields IDENTIFIER and SEQUENCE NUMBER are used by the sender to match replies to request. The value of the TYPE field specifies whether the message is a request(8) or a reply(0).

Reports of Unreachable Destinations

The Code field in a destination unreachable message contains an integer that further describes th problem. Possible values are: 


CODE VALUE                                 MEANING

           0                                 NETWORK UNREACHABLE
           1                                 HOST UNREACHABLE
           2                                 PROTOCOL UNREACHABLE
           3                                 PORT UNREACHABLE
           4                                 FRAGMENTATION NEEDED AND DF SET
           5                                 SOURCE ROOT FAILED
           6                                DESTINATION NETWORK UNKNOWN
           7                                DESTINATION HOST UNKNOWN
           8                                 SOURCE HOST ISOLATED
           9                                COMMUNICATION WITH DESTINATION NETWORK ADMINISTRATIVELY PROHIBITED
         10                                COMMUNICATION WTTH DESTINATION HOST ADMINISTRATIVELY PROHIBITED
         11                                NETWORK UNREACHABLE FOR TYPE OF SERVICE
         12                                HOST UNREACHABLE FOR TYPE OF SERVICE

Whenever an error prevents a gateway from routing or delivering a datagram, the gateway sends a destination unreachable message back to the source and then drops the datagram. Network unreachable errors usually imply rotting failures ; host unreachable errors imply delivery failures. Because the message contains a short prefix of the datagram that caused the problem, the source will know exactly which address is unreachable. Destinations may be unreachable because hardware is temporarily out of service, because the sender specified a nonexistent destination address, or because the gateway does not have a route to the destination network. Although gateways send destination unreachable messages if they cannot route or deliver datagram’s, not all such errors can be detected. If the datagram contains the source route option with an incorrect route, it may trigger a source route failure message. If a gateway needs to fragment a datagram but the "don't fragment" bit is set, the gateway sends a fragmentation needed message back to the source.


Congestion and Datagram Flow Control:
Gateways cannot reserve memory or communication resources in advance of receiving datagram’s because IP is connectionless. The result is, gateways can overrun with traffic, a condition known as congestion. Congestion arises due to two reasons:
  1. A high speed computer may be able to generate traffic faster than a network can transfer it .
  2. If many computers simultaneously need to send datagram’s through a single gateway , the gateway can experience congestion, even though no single source causes the problem.
When datagram’s arrive too quickly for a host or a gateway to process, it enquires them in memory temporarily. If the traffic continues, the host or gateway eventually exhausts memory and must discard additional datagram’s that arrive. A machine uses ICMP source quench messages to relieve congestion. A source quench message is a request for the source to reduce its current rate of datagram transmission. There are no ICMP messages to reverse the effect of a source quench.

 Source Quench: 
Source quench messages have a field that contains a datagram prefix in addition to the usual ICMP TYPE, CODE, CHECKSUM fields. Congested gateways send one source quench message each time they discard a datagram; the datagram prefix identifies the datagram that was dropped. 

0 comments:

Post a Comment