IP Header | L3 Header

An IP header is header information at the beginning of an IP packet which contains information about IP version, source IP address, destination IP address, time-to-live, etc. Minimum size of IP Header is 20 byte and Maximum caan be upto 60 bytes.

L3 Header

Version field (4 bits) in IP header is used to know which Version of IP currenctly, IPv4 or IPv6.
Length or Header length (4 bits) is shows the size of header. Minimum size of header is 20 byte and Maximum size can be 60 byte.
DSCP/TOS (8 bits) bits are used to describe traffic class inside IP header. These bits are used in QOS (Quality of Service) for traffic priortisation.
Type feild consist the value which tells which type of protocol or service is running or encapsulated with. It is of 2 (16 bits).
When data size is maximum or greater then MTU, data is fragmented, to know which fragment is of which a unique identification number is given to all fragmented data. Each fragment of single data have same ID number from. The size of identification field id 8 bits.
IP Header Identification
Once data is fragmented data will add once they reach destination. No fragmented data id added before Destination.
Flag is a sequence of three flags used to control whether routers are allowed to fragment a packet and to indicate the parts of a packet to the receiver. Size of Flag is byte where 1 byte is unused. Flags are Reserved, Don't fragment and More fragment.
Reserve is default 0
Don't Fragment is default 0
More fragment: If it is 0 then no more fragment are coming ahead and if value is 1 then more fragments are coming.
Fragment Offset in IP header works as Sequence number in TCP. This field helps to know the delivery order of the data, whether it is getting delivered in order or not and is there any data missing or not. Let's understand with example,

The size of MTU is 1500 byte, where 20 byte is of header and 1480 byte data can be carried. in the first fragment sender will set value 0 and it will send and in next fragment it will set fragment value of 1480(0+1480) because same saze has been send on previous fragment and will set 2960 (0+1480+1480) in third fragment and will carry on by which destination device reciognize the serial of data and if any is missing will get to know.
TTl (Time to Live) (8 bits) is 255 default. TTL shows the life of data. Once data if forwarded TTl will decrease at every hope by 1. Once TTl is 1 and router receives data with TTl 1 then that packet is not farwarded and receiver router will reply to source router TTL expired.
Protocol (8 bits) field defines which information is encapsulated with IP header like ICMP info will be here if your are pinging and shows by value i.e value for ICmp is 88 and protocol field will containe 88 for ping.
Checksum is used for integrity of the data and to protect the header of IPv4 data packets against data corruption. which is of 16 bit long.
This field contains Exit interface IP address of Sender router from which it came. The size of this IP is of 32 bits.
This field contains the IP address of the destination router to which it is addressed. The size of this IP is of 32 bits.