Tuesday, March 31, 2020

IP Header





The fields in the IPv4 header are as follows:

Version (4 bits):  this field contains the version number of the IP (Internet Protocol) header.  In IPv4, this field always has a value of 4.

Internet Header Length (4 bits):  This is the length of the IP header in 32-bit words, including any optional fields.  In effect, this points to where the IP header ends and the data or payload begins.  The minimum value is 5 (5 x 32-bit words = 160 bits or 20 bytes).  This is equal to the minimum size of a IPv4 header, excluding any options or padding.

Type of Service (8 bits):  The Type of Service, or ToS, field specifies what type of treatment the packet should receive from routers.  The ToS information helps provide quality of service (QoS) features by offering different degrees of precedence.  When multiple packets are queued to be transmitted out the same interface, the ToS value can be used to decide which is sent first.  The ToS field was not widely used as originaly designed, and later in 1998 was changed to Differentiated Services (DS).

Total Length (16 bits):  This is the length of the IP packet, measured in bytes, including the IP header and the data.  This is a 16-bit field, so the maximum size of an IPv4 packet is 65,535 bytes.  Most IPv4 packets are much smaller.
The next three fields are used for packet fragmentation and reassembly.  IP was designed for a wide variety of transmission links.  Most transmission links enforce a maximum packet length known as the MTU (Maximum Transmission Unit).  The design of IP accommodates MTU differences by allowing routers to fragment IP packets when an MTU along the path is smaller than the sender's MTU.  
If a router receives an IPv4 packet that is larger than the MTU of the outgoing interface, this packet can be fragmented depending upon the options in the IPv4 header.  Sometimes packets are fragmented into multiple packets at the source.  The final destination of the IP packet is responsible for reassembling the fragments into the original full-size IP packet.

No comments:

Post a Comment