IPv4 and IPv6 Header
IPv4 and IPv6 Header
IPv4 Header 20bytes and maximum IPv4 Header 60bytes its variable.
Version 4bits IHL 4bits TOS 8bits Total Length 16bit 4 bytes
Identifier 16bits Flag 3bits Fragment offset 13bits 4 bytes
TTL 8bits Protocol 8bits Checksum 16bits 4 bytes
Source address 32bits 4 bytes
Destination address 32 bits 4 bytes
Optional 40 bytes
Version
IHL
Header Data
Internet Header length, length of entire IP header.
Type of service field could specify a datagram priority and request router for low delay, high
throughput etc.
Total Length
Identification
If IP packet id fragment during the transmission, all the fragment contains same identification
number to identify original IP packet they belong too.
Flags
As required by the network resources, if IP packet is too large to handle, these flags tell if they can
be 1 fragment or not. In this 3-bit flag, always set to “0”.
Fragment offset
This offset tells the exact position of the fragment in the original IP packet.
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 this packet can cross. At each router value is reduce by 1.
Protocol
Tell the network layer at the destination host, to which protocol this packet belongs to for e.g. TCP,
UDP and ICMP etc.
Checksum
Version
Traffic class
In the Ipv6 header, the Traffic class field is used to prioritize and manage traggic by specifying the
type of service or quality of service (QoS) for the packets.
Flow label
The flow label in the IPv6 header is used to identify packets that belong to the same flow, allowing
routers to handle them with special treatment for performance optimization.
Payload length
This field is used to tell the routers how much information a particular packet contains in its payload.
Next Header
This field usually specify the transport layer protocol used by packet payload the two most common
kinds of next headers are TCP (6) and UDP (17) but many other headers are also possible.
Hop limit
The main function of this field is to avoid looping IPv6 data packets can pass through a maximum of
254 routers before being discorded.