If you have any queries please leave a message here
Your Message

Internet Protocol Version 4 (IPv4) Datagram Format

Field Name Size (bits) Description
4 bits
Identifies the version of IP used to generate the datagram. For IPv4, this is the number 4. This field ensures compatibility between devices that may be running different versions of IP. In general, a device running an older version of IP will reject datagrams created by newer implementations, under the assumption that the older version may not be able to interpret the newer datagram correctly.
4 bits
This field provides the length of the IP header. The length of the header is represented in 32 bit words. This length also includes IP options (if any). Since this field is of 4 bits so the maximum header length allowed is 60 bytes. Usually when no options are present then the value of this field is 5. here 5 mean five 32 bit words that is 5*4=20 bytes.
Type Of Service (TOS)
8 bits
The Type Of Service (TOS) field is a one-byte field that was originally intended to provide certain quality-of-service (QoS) features for IP datagram delivery. It allowed IP datagrams to be tagged with information indicating not only their precedence, but also the preferred manner in which they should be delivered. It was divided into a number of subfields. (See Type Of Service (TOS) Subfields Table)
Total Length (TL)
16 bits
Specifies the total length of the IP datagram, in bytes. Since this field is 16 bits wide, the maximum length of an IP datagram is 65,535 bytes. When IP fragmentation takes place over the network then value of this field also changes.
16 bits
This field contains a 16-bit value that is common to each of the fragments belonging to a particular message; for datagrams originally sent unfragmented, it is still filled in so it can be used if the datagram must be fragmented by a router during delivery. The recipient uses this field to reassemble messages without accidentally mixing fragments from different messages. This is needed because fragments may arrive from multiple messages mixed together, since IP datagrams can be received out of order from any device.
3 bits
Three control flags, two of which are used to manage fragmentation and one that is reserved. (See IPv4 Flags Subfields Table)
Fragment Offset
13 bits
When fragmentation of a message occurs, this field specifies the offset, or position, in the message where the data in this fragment goes in units of eight bytes (64 bits). The first fragment has an offset of 0.
For example, if a message is 15000 bytes long and its local connection has an MTU (Maximum Transmission Unit) of 4100 bytes then it will need to divide this message into 4 fragments for transmission. First three segments are 4096 bytes long and last segment is remaining 2712 bytes long. The "Fragment Offset" of this segments are :
Segment 1 → fragment offset value = 0
Segment 2 → fragment offset value = {0+(4096/8)} = 512
Segment 3 → fragment offset value = {512+(4096/8)} = 1024
Segment 4 → fragment offset value = {1024+(4096/8)} = 1536
Time To Live (TTL)
8 bits
The TTL field was designed to contain a time value (in seconds), which would be filled in when the datagram was originally sent. Routers would decrease the time value periodically, and if it ever hit zero, destroy the datagram. This field is not used in exactly this manner. Routers today are fast and usually take far less than a second to forward a datagram, which makes it impractical to measure the time that a datagram lives.
8 bits
This field represents the transport layer protocol that handed over data to IP layer. When the data is demultiplexed at the destination, IP would need to know which protocol to hand over the data to.
Header Checksum
16 bits
A checksum is computed over the header to provide basic protection against corruption in transmission. This is not the more complex cyclic redundancy check (CRC) code that’s typically used by data link layer technologies such as Ethernet; it’s just a 16-bit checksum. It is calculated by dividing the header bytes into words (a word is two bytes) and then adding them together. Only the header is checksummed; not the data. At each hop, the device receiving the datagram does the same checksum calculation, and if there is a mismatch, it discards the datagram as damaged.
Source Address
32 bits
This is the 32-bit IP address of the originator of the datagram. Note that even though intermediate devices such as routers may handle the datagram, they do not normally put their address into this field—the address is always that of the device that originally sent the datagram.
Destination Address
32 bits
This is the 32-bit IP address of the intended recipient of the datagram. Again, even though devices such as routers may be the intermediate targets of the datagram, this field is always used to specify the ultimate destination.
One or more of several types of options may be included after the standard headers in certain IP datagrams.
If one or more options are included, and the number of bits used for them is not a multiple of 32, enough 0 bits are added to pad out the header to a multiple of 32 bits (four bytes).
This is the data that will be transmitted in the datagram. It is either an entire higher-layer message or a fragment of one.

Type Of Service (TOS) Subfields Table

Subfield Name Size (bits) Description
3 bits
This field indicating the priority of the datagram. There ware eight defined values, from lowest to highest priority :
000 : Routine
001 : Priority
010 : Immediate
011 : Flash
100 : Flash Override
110 : Internetwork Control
111 : Network Control
1 bit
Set to 0 to request normal delay in delivery; set 1 if a low delay delivery is requested.
1 bit
Set to 0 to request normal delivery throughput; set to 1 if higher throughput delivery is requested.
1 bit
Set to 0 to request normal reliability in delivery, set to 1 if higher reliability delivery is requested.
2 bits
Not used

IPv4 Flags Subfields Table

Subfield Name Size (bits) Description
1 bit
Not Used
Don't Fragment (DF)
1 bit
When set to 1, this says that the datagram should not be fragmented. Since the fragmentation process is generally invisible to higher layers, most protocols don’t care about this and don’t set this flag. It is, however, used for testing the maximum transmission unit (MTU) of a link.
More Fragment (MF)
1 bit
When set to 0, this indicates the last fragment in a message; when set to 1, it indicates that more fragments are yet to come in the fragmented message. If no fragmentation is used for a message, there is only one fragment (the whole message), and this flag is 0. If fragmentation is used, all fragments but the last set this flag to 1 so that the recipient knows when all fragments have been sent.


QuestionSolves.com is an educational website that helps worldwide students in solving computer education related queries.

Also, different software like Visual Studio, SQL Server, Oracle etc. are available to download in different versions.

Moreover, QuestionSolves.com provides solutions to your questions and assignments also.


Windows Command

UNIX Command

IGNOU Assignment Solution

IGNOU Question Paper Solution


Website Devlopment


Home Learning

Provide BCA, MCA Projects

Provide Assignment & Question Paper Solution


Follow Us