0
9.5kviews
Explain IPv4 header format in detail. If value at HLEN field is 1101 find the size of option and padding field?

Mumbai University > Computer Engineering > Sem 5 > Computer Network

Marks: 10 Marks

Year: Dec 2015

1 Answer
1
247views
  • IP is a connectionless datagram protocol with no guarantee of reliability.IP can only detect the error and discards the packet if it is corrupted.
  • The IP frame header contains routing information and control information associated with datagram delivery. The IP header structure as shown in

enter image description here

  1. VER (version):

    i. This field defines the version of IP. Current version of IP is IPv4 and the latest version of IP is IPv6. It is four bit long field.

  2. HLEN (Header length):

    i. This field defines the length of the datagram header in 4-byte word. Its value must be multiplied by 4 to give the length in bytes.

  3. Differential services(DS):

    i. This field defines the class of the datagram for quality of service purpose.

    ii. Networks may offer service precedence, meaning that they accept traffic only above certain precedence at times of high load.

  4. Total length:

    i. This field defines the total length of the IP datagram. The total length includes the length of header as well as the data field.

    ii. The field length of this fields is 16 bits so the total length of the IP datagram is restricted to (26 - 1) = 65535 bytes of which 20 to 60 bytes are the header and the remaining are data.

  5. Identification, flag and offset:

    a. Identification: This field identifies the datagram originating from the source host. When a datagram is fragmented, the value in the identification field is copied into all fragments.

    b. Flag: This is a three bit field. The 3 bits are shown in :

    |$ \ \ \ $|$ \ \ \ $|$ \ \ \ $| |-|-|-|

    i. First bit is reserved, and it should be 0

    ii. The second bit is called “Do not fragment” bit. If this bit is “1” then machine should not fragment the datagram but if the value of this bit is 0 then the machine should fragment the datagram if only if necessary.

    iii. The third bit is called as “More Fragment Bit”. If it is 1 it means that the datagram is not the last fragment but if its value is 0 it shows that this is the last or the only fragment.

    b. Fragmentation offset: This is a 13 bit field which shows the relative position of this fragment with respect to the whole datagram.

  6. Time to live

    i. To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the value reaches zero, the packet is discarded.

  7. Protocol

    i. Tells the Network layer at the destination host, to which Protocol this packet belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP is 6 and UDP is 17.

  8. Header Checksum:

    i. This field is used to keep checksum value of entire header which is then used to check if the packet is received error-free.

  9. Source Address:

    i. 32-bit address of the Sender (or source) of the packet.

  10. Destination Address:

    i. 32-bit address of the Receiver (or destination) of the packet.

  11. Options:

    i. This is optional field, which is used if the value of IHL is greater than 5. These options may contain values for options such as Security, Record Route, Time Stamp, etc.

  • Example:

    If value at HLEN field is 1101 find the size of option and padding field.

    HLEN Value = 1101 = 13 Bytes.

    Total No. of Bytes in the Header = 13 x 4 = 52 Bytes.

    The first 20 bytes are the main header and the next 32 bytes are the

    options + Padding Field.

Please log in to add an answer.