2
34kviews
Draw a neat diagram of IPv4 header. Explain each field.
1 Answer
6
2.1kviews
  1. IP datagram is unit of transfer in an IP network. It carries enough information about the network to get forwarded to its destination; it consists of a header followed by bytes of data.
  2. The header contains information about the type of IP datagram, how long the datagram should stay on the network with special flags indicating any special purpose the datagram is supposed to serve etc.
  3. The minimum use of the IP header is 20 bytes consisting of five 32 bit words.
  4. The packet datagram header is as shown below: enter image description here

a) Version (4 bit): It is used to define the IP version. The value 4 defines the packet as IPv4 while value 6 defines the packet as IPv6.

b) Header length (4 bit): It is used to define the length of the header. It does not include the data field and the value cannot be greater than 60 bytes. The default value of this field i.e. no options present is 5.

c) Type of service (8 bit): Of the 8 bits, the first three bits i.e. the precedence bits are ignored. The type of service is represented by the next 4 bit and the last bit is left unused. They are:

Type of service Description
0000 Normal serivce
0001 Minimize monetary cost
0010 Maximize reliability
0100 Maximize throughput
1000 Maximize delay

d) Total length (16 bit): It defines the total length of the datagram, header and data and the maximum size of IP datagram can be 65535 bytes.

e) Identification (16 bit): Identifier is assigned by the host during fragmentation. This helps in reassembling the fragmented datagrams. Each fragment of a single datagram has the same identification number.

f) Flags (3 bit): There are 3 types of flags and only two of the three allocated bits are used. They are used to indicate three different statuses namely Reserved, Do not fragment and more fragments.

g) Fragment offset (13 bit): It is primarily used during fragmentation process. The fragmented datagrams are of 8 bytes and this is used in reassembly of fragmented IP datagrams.

h) Time to live (8 bit): It represents number of hops that the IP datagram will go through before being discarded. The value is decremented by one by every router that handles the datagram. When this field reaches 0, the datagram is thrown away and the sender is notified with an ICMP (Internet Control Message Protocol) message.

i) Protocol (8 bit): It identifies which upper layer protocol are encapsulated in the packets. For example: Identifier 0 indicates Reserved and similarly 6 indicate TCP.

j) Header checksum (16 bit): It is a 16 bit checksum used for error detection. It is calculated by dividing the header bytes into words (a word is two bytes) and then adding them together. The operation is performed only on the header and not on the data.

k) Source IP (32 bit): It is the IP address of the originator of the datagram packet.

l) Destination IP (32 bit): It is the IP address of the intended recipient of the datagram packet.

m) Options (Variable length) and padding: The options field is used for additional header or information if required. If one or more options are included and the number of bits used for them is not a multiple of 32, then padding field is used to make the header a multiple of 32.

Please log in to add an answer.