Question: Explain IPv4 header format in detail. If value at HLEN field is 1101 find the size of option and padding field?
2
ADD COMMENTlink
modified 5 days ago by gravatar for Abhishek Tiwari Abhishek Tiwari ♦♦ 50 written 3.3 years ago by gravatar for Sagar Narkar Sagar Narkar1.5k
3

IP Protocol:

  1. IP Protocol Stands for Internet Protocol.
  2. It is host to host network layer delivery protocol designed for the internet.
  3. It is connectionless datagram protocol.
  4. It is unreliable protocol because it does not provide any error or flow control.

IP Header Format:

enter image description here

I) Version: This Field defines the version of IP. It is Static 4 bit value.

II) Header Length: This Field defines the length of the datagram header. It is 4 bit value.

III) Type of Service: It is 8 bit value. It is used tell the network how to treat the IP packet. These bits are generally used to indicate the Quality of Service (QoS) for the IP Packet.

IV) Packet Length: 16 bit value indicating the size of the IP Packet in terms of bytes. This gives a maximum packet size of 65536 bytes.

V) Identification: 16 bit field used for reassembling the packet at the destination.

VI) Flags: It is 3 bits value. It indicates if the IP packet can be further fragmented or not and if the packet is the last fragment or not of a larger transfer.

VII) Fragment offset: 13 bit value used in the reassembly process at the destination.

VIII) Time to Live: 8 bit value telling the network how long an IP packet can exist in a network before it is destroyed.

IX) Protocol: 8 bit value used to indicate the type of protocol being used (TCP, UDP etc.).

X) Header checksum: It is 16 bit value. It is used to indicate errors in the header only. Every node in the network has to check and re-insert a new checksum as the header changes at every node.

XI) Source address: 32 bit value representing the IP address of the sender of the IP packet.

XII) Destination address: 32 bit value representing the IP address of the packets final destination.

XIII) Options: Options are not required for every datagram. They are used for network testing and debugging.

XIV) Padding: Variable size bit field. These bits are used to ensure a 32 bit boundary for the header is achieved.

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.

ADD COMMENTlink
written 3.3 years ago by gravatar for Sagar Narkar Sagar Narkar1.5k
0

• 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 Fig.

enter image description here

i. VER (version):

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.

ii. HLEN (Header length):

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.

iii. Differential services(DS):

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

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

iv. Total length:

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

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.

v. 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 :

enter image description here

First bit is reserved, and it should be 0

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.

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.

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

vi. Time to live

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.

vii. Protocol

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.

viii. Header Checksum:

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

ix. Source Address:

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

x. Destination Address:

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

xi. Options:

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.

ADD COMMENTlink
written 13 months ago by gravatar for Sayali Bagwe Sayali Bagwe2.3k
Please log in to add an answer.