In addition to expanding the IPv4 32-bit address space to a 128-bit address space, IPv6 makes the IP header more efficient. The IP header is the header of the IP packet, or datagram, that contains control information about how the packet can be delivered from its source to its destination. Figure A shows the layout of the IPv4 header. The header uses 13 fields to identify various control settings. The IPv4 header's total length comprises a minimum of 20 octets (8 bits per octet), or five 32-bit words. The IPv6 header, as Figure B shows, has only 8 fields with a fixed length of 40 octets.

The Ver (version) field remains in IPv6. In IPv6 the version field's number is 6, and in IPv4 its number is 4. The Source Address and Destination Address fields also remain in IPv6. These fields serve the same function in both IPv6 and IPv4 headers, but each field is 128 bits long in IPv6, as opposed to 32 bits long in IPv4.

In IPv6 the Total Length field has been renamed Payload Length. These two fields are similar but not identical. The payload length is the variable length of the data the IPv6 packet carries after the IPv6 header, whereas IPv4's total length is the variable length of the IPv4 header plus the variable length of the data. Because the IPv6 header's fixed length is 40 octets, IPv6 can easily derive total length by adding 40 octets to the Payload Length. This modification lets IPv6 omit IPv4's IP Header Length field, which is 20 octets plus the variable length of the Options + Padding field. (Padding makes the IPv4 header end on a 32-bit boundary.)

IPv4 uses the Time to Live (TTL) field to specify how long a packet can be alive when it traverses the network. This specification prevents the packet from undergoing an infinite loop. IPv4 expresses the TTL field in time ticks, such as 3 seconds, or in router hops, such as 3 hops. When the time is up or the router decrements the number of hops to zero, the network discards the packet. Because most applications define TTL in hops, IPv6 changed IPv4's Time to Live field to the Hop Limit field. Thus, IPv6 applications use only hops to express TTL.

IPv6 renamed and enhanced IPv4's Protocol field to the Next Header field. The Protocol field in IPv4 designates a packet's transport-layer protocol (e.g., TCP or UDP), which specifies what type of transport data follows the IPv4 header. The Next Header field in IPv6, however, can insert extension headers between the IPv6 header and the transport data. Each extension header other than the transport header (such as the TCP header) includes its own Next Header that specifies the following header's type, forming a daisy chain of IPv6 headers. IPv6 defines six extension headers: Hop-by-Hop Options, Destination Options, Routing, Fragment, Authentication, and Encapsulating Security Payload. Figure C shows an example of an IPv6 packet's extension headers.

Because IPv6's extension headers superseded IPv4's Options field, IPv6 eliminated the Options field. IPv6 also removed the three fields related to data fragmentation in IPv4: Identi-fication, Flags, and Fragment Offset. In IPv6, the Fragment extension header covers data fragmentation.

IPv6 eliminates the Header Checksum field, which handles error checking in IPv4. IPv6 depends instead on reliable transmission in the data link protocols and on error checking in upper-layer protocols.

IPv6 incorporates in its header two new fields for Quality of Service (QoS). These fields are the Class and Flow Control fields. The Class field replaces IPv4's Type of Service field, and it lets the originating host or the forwarding router identify the class or priority of the packet. The Flow Control field lets the source host label a sequence of packets (i.e., a flow) that requires special handling by intermediate routers when the packets travel from source to destination. A QoS protocol such as Resource Reservation Setup Protocol (RSVP) can use the Class and Flow Control fields to conduct special handling, such as realtime video transmission.

The header design in IPv6 can improve packet transmission, particularly router performance. For exam- ple, in IPv4, when the source host includes optional information that requires action from only the destination host, every intermediate router between the source and the destination will nevertheless examine the contents of the Options field. In IPv6, the source host can use the Destination Options extension header to carry optional information, and only the destination host will check the information in the Destination Options header. Therefore, routers forward packets faster because they don't waste time checking information that's irrelevant to them.

Another improvement in packet transmission increases router efficiency. In IPv6, routers do not handle data fragmentation and reassembly. Fragmentation is carried out only at the source host, and reassembly is carried out only at the destination host. This change in IPv6 leads to better router performance.