Friday, October 26, 2012

ICMP - Internet control message protocol



ICMP basically provides a way to report the error messages which are encountered in network to the original source.

Do you know the protocol used in ping?

Well, the answer is ICMP. It is implemented using ICMP echo request and ICMP echo response. If a system receives an ICMP echo request, it will generate an ICMP echo response and sends it to the original source.

ICMP echo request is nothing but PING.

ICMP echo request packet


0                                                      7 8                                                      15  16                                                  31
                       TYPE
CODE
                 CHECKSUM

                       IDENTIFIER
SEQUENCE NUMBER

                                                                             OPTIONAL DATA

ICMP echo reply packet


0                                                      7 8                                                      15  16                                                  31
                       TYPE
                       CODE
                 CHECKSUM

This is not used( So we can make bits set to zero)

                                                                             OPTIONAL DATA

TYPE Field                                          ICMP Message Type
0                                                             Echo Reply
8                                                             Echo Response
CODE Value                                        Meaning
0                                                              Network Unreachable

CHECKSUM

 ICMP message header checksum (additive algorithm is used to calculate checksum) 

IDENTIFIER and SEQUENCE NUMBER

These fields are used to match echo requests to corresponding echo replies. 

DATA

 It is variable length; the data which is to be returned to sender will be present here.

No comments:

Post a Comment