5.5.2 IPv6 datagram format

5.5.2 IPv6 datagram format

First of all, let's recall the IPv4 datagram header format ( 5.2.3 IP datagram (1) IP datagram format ), including a fixed part of 20 bytes and a variable-length option part, as shown in the figure

Compare

The red box marks the fields that will disappear in IPv6, and the ellipse marks the fields that still exist in IPv6 but will change. From this we can see that compared with IPv4, the header of the IPv6 datagram has undergone a large change. In the following, we will discover the characteristics of the IPv6 protocol by understanding the format of the IPv6 header.

as shown in the picture

IPv6

An IPv6 datagram consists of two parts: a 40-byte basic header and a variable-length payload. The payload section also includes an extension header and a data section.

  1. As shown in the figure, the version field in the basic header is still 4 bits, and the value is 6
  2. The next field is the traffic class. This field is similar to the service type field in IPv4. It is mainly used to distinguish the category or priority level of the datagram, so as to realize the differentiated services of different types of communication traffic. This field occupies 8 bits, and is currently undergoing experiments on the performance of different traffic types.
  3. The flow label field occupies 20 bits. There is no concept of flow in IPv4. "Flow" represents a series of datagrams from a specific source point to a specific destination in the Internet, and the routers on the path passed by the "flow" The indicated quality of service is guaranteed. All datagrams belonging to the same flow have the same flow label . Here we need to understand why the concept of flow is introduced. In IPv6, a specific flow is often associated with a specific service. In other words, the transmission of the flow All routers on the path should try their best to ensure the quality of service specified by the "flow" when processing datagrams. By introducing the concept of flow, IPv6 can overcome the shortcomings of IPv4 network services and meet the individuality of many new network applications. demand for personalized service quality.
  4. The payload length (payload Length) occupies a total of 16 bits, which gives the number of bytes contained in the datagram except the basic header, that is, indicates the number of bytes of the IPv6 datagram except the basic header (all extended headers are counted within the payload), and its maximum value is 64KB.
  5. The next header (next header) occupies 8 bits. It is equivalent to the protocol field or optional field of IPv4. It is used to describe the type of the next extension header or the protocol to which the data belongs.
  6. The hop limit occupies 8 bits. The source station sets the hop limit when sending the datagram, which is equivalent to the TTL field of IPv4. It will be decremented by 1 every time it passes through a router. If the value is zero, directly Will be discarded by routers, this field is to prevent routing loops in the network.
  7. The source address and destination address fields are expanded from the original 4 bytes and 32 bits to 16 bytes, which is 128 bits.

After we know the various fields of the datagram in IPv6, let's compare the specific changes in the datagram format of IPv6 compared with IPv4.

Let's look at the basic first

  1. The header length field of IPv4 is canceled, and the total length field of the datagram in IPv4 is replaced by the payload length field.
  2. The source and destination addresses are increased from 4 bytes to 16 bytes.
  3. Fragmentation-related fields no longer appear in the basic header and have been transferred to the "fragmentation extension header".
  4. The time-to-live field was renamed to the hop limit field.
  5. The service type field is renamed as the traffic category field, and the flow label field is added for resource pre-allocation.
  6. The protocol field is replaced by the next header field indicating the subsequent content format. It should be noted here that the next header may be the extension header of the IPv6 datagram, or it may be the header of ICMP, TCP, UDP, IGMP, OSPF, etc.

Look at the extension header

  1. Compared with IPv4, the biggest change in the datagram format of IPv6 is the introduction of the extension header field . In essence, the function of the extension header is similar to the option field in IPv4. For IPv4, some enhanced functions are provided through some variable-length option fields, such as record routing, source routing, etc., but because the option field is optional, and the length is also variable, it will inevitably affect the router's packet processing and efficiency. In IPv6, all the functions of the options in the original IPv4 header are placed in the extension header, and the extension header is left to be processed by the hosts at the source station and the destination station at both ends of the path.
  2. It should be noted here that the extension header in IPv6 is generally not processed on the intermediate router, except for a few hop-by-hop option extension headers. More extended headers to enhance the capabilities of network services.

Guess you like

Origin blog.csdn.net/nytcjsjboss/article/details/131350142