# IPv6 Header
## What is the IPv6 Header
The IPv6 header is the control information at the beginning of every IPv6 packet. Compared to the IPv4 header, the IPv6 header has been simplified and streamlined. The fixed portion of the IPv6 header is always 40 bytes, compared to IPv4's minimum of 20 bytes. However, IPv6 removes several fields from IPv4 and eliminates the need for checksums in the header, making routing faster. Optional header information in IPv6 is handled through extension headers rather than options fields.
## IPv6 Header Fields
The version field is 4 bits wide and contains the value 6 for IPv6 packets.
The traffic class field is 8 bits wide and is similar to the differentiated services field in IPv4. It is used for quality of service marking.
The flow label field is 20 bits wide and is used to identify packets belonging to the same flow, such as all packets of a video stream. Routers can use the flow label to provide special handling for packets belonging to the same flow without examining the full packet.
The payload length field is 16 bits wide and specifies the length of the IPv6 payload, not including the 40-byte fixed header.
The next header field is 8 bits wide and identifies the type of header that follows the fixed IPv6 header. It may indicate a transport layer protocol like TCP or UDP, or it may indicate an extension header.
The hop limit field is 8 bits wide and is equivalent to the time to live field in IPv4. It is decremented by 1 at each router, and the packet is discarded when it reaches zero.
The source address field is 128 bits wide and contains the IPv6 address of the packet's origin.
The destination address field is 128 bits wide and contains the IPv6 address of the intended recipient.
## IPv6 Extension Headers
IPv6 uses extension headers to carry optional information. Extension headers are placed between the fixed header and the upper layer protocol data. The next header field in each header points to the type of the following header, creating a chain. Common extension headers include the hop-by-hop options header, the routing header, the fragment header, the authentication header, and the encapsulating security payload header. Extension headers are processed only by the destination, not by intermediate routers, except for the hop-by-hop options header which must be processed by every router.
## Comparison with IPv4 Header
IPv6 removes the header checksum field because modern networks are reliable enough that per-router checksum verification is not necessary, and checksums in the Transport layer provide end-to-end error detection. IPv6 removes the fragmentation fields from the main header because fragmentation in IPv6 is handled only by the source, not by routers. IPv6 removes the options field from the main header and uses extension headers instead. These simplifications make IPv6 header processing faster than IPv4.Back to Subject