Showing posts with label IP. Show all posts
Showing posts with label IP. Show all posts

Thursday, February 24, 2011

Internet Control Message Protocol (ICMP)

Why ICMP is important

IP protocol lacks error reporting mechanism and hosting/managing queries. To compensate ICMP protocol comes to the role as a companion to IP protocol giving following two services.

  • Provides error reporting mechanism
  • Hosts and manages queries

Did you have any doubt

ICMP is a network layer protocol as IP is, so one would suspect whether ICMP messages are passed directly to the data link layer. The answer is no. ICMP messages are first encapsulated inside ip datagram and then passed to the below data link layer. Following image clearly shows you how it happens.


Talking about ICMP messages

  • Error reporting messages
  • ICMP acts as error reporting protocol it does not correct errors, error corrections are done by the higher level protocols. ICMP always sends the error messages to original source. There are five types of error messages as listed below.
    • Destination unreachable
    • Source quench
    • Time exeeded
    • Parameter problem
    • Redirection
  • Query messages
  • ICMP can also diagnose network problems through query messages. There are two pairs of query messages used for this purpose today.
    • Echo request or reply
    • Timestamp request or reply

Debugging tools that uses ICMP

ping

ping program can be used to find out whether a host is alive and responding. The source host sends an ICMP echo request message, if the destination host is alive it responds with ICMP echo reply messages.



traceroute

traceroute progam in unix or tracert in windows can be used to trace the route of a packet from source to destination.


Tuesday, November 23, 2010

IP Header


• Version (Specifies the format of the IP packet header): 4 bits.

• IHL, Internet Header Length (Specifies the length of the IP packet header in 32 bit words. The minimum value for a valid header is 5): 4 bits.

• Differentiated Services (This field is defined in RFC 2474 and obsoletes the TOS field): 8 bits.

• Total length (Contains the length of the datagram). 16 bits.

• Identification (Used to identify the fragments of one datagram from those of another. The originating protocol module of an internet datagram sets the identification field to a value that must be unique for that source-destination pair and protocol for the time the datagram will be active in the internet system. The originating protocol module of a complete datagram clears the MF bit to zero and the Fragment Offset field to zero): 16 bits.

• Flags: 3 bits.

• Fragment Offset (Used to direct the reassembly of a fragmented datagram): 13 bits.

• TTL, Time to Live (A timer field used to track the lifetime of the datagram. When the TTL field is decremented down to zero, the datagram is discarded): 8 bits.

• Protocol (This field specifies the next encapsulated protocol): 8 bits.

• Header checksum (A 16 bit one's complement checksum of the IP header and IP options): 16 bits.

• Source IP address (IP address of the sender): 32 bits.

• Destination IP address (IP address of the intended receiver): 32 bits.