📜  IPv6-标头

📅  最后修改于: 2020-12-14 05:31:28             🧑  作者: Mango


IPv6的奇迹在于其标头。 IPv6地址是IPv4的4倍,但令人惊讶的是,IPv6地址的标头仅是IPv4的2倍。 IPv6标头具有一个固定标头和零个或多个可选(扩展)标头。路由器必不可少的所有必要信息都保存在固定报头中。扩展头包含可选信息,可帮助路由器了解如何处理数据包/流。

固定头

[图片:IPv6固定标头]

IPv6固定标头的长度为40个字节,并包含以下信息。

S.N. Field & Description
1

Version (4-bits): It represents the version of Internet Protocol, i.e. 0110.

2

Traffic Class (8-bits): These 8 bits are divided into two parts. The most significant 6 bits are used for Type of Service to let the Router Known what services should be provided to this packet. The least significant 2 bits are used for Explicit Congestion Notification (ECN).

3

Flow Label (20-bits): This label is used to maintain the sequential flow of the packets belonging to a communication. The source labels the sequence to help the router identify that a particular packet belongs to a specific flow of information. This field helps avoid re-ordering of data packets. It is designed for streaming/real-time media.

4

Payload Length (16-bits): This field is used to tell the routers how much information a particular packet contains in its payload. Payload is composed of Extension Headers and Upper Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension Headers contain Hop-by-Hop Extension Header, then the payload may exceed 65535 bytes and this field is set to 0.

5

Next Header (8-bits): This field is used to indicate either the type of Extension Header, or if the Extension Header is not present then it indicates the Upper Layer PDU. The values for the type of Upper Layer PDU are same as IPv4’s.

6

Hop Limit (8-bits): This field is used to stop packet to loop in the network infinitely. This is same as TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a link (router/hop). When the field reaches 0 the packet is discarded.

7

Source Address (128-bits): This field indicates the address of originator of the packet.

8

Destination Address (128-bits): This field provides the address of intended recipient of the packet.

扩展头

在IPv6中,固定标头仅包含必要的信息,避免了那些不需要或很少使用的信息。所有这些信息都以扩展头的形式放在固定头和上层头之间。每个扩展头均由不同的值标识。

使用扩展头时,IPv6固定头的“下一个头”字段指向第一个扩展头。如果还有一个扩展头,则第一个扩展头的“ Next-Header”字段指向第二个扩展头,依此类推。最后一个扩展头的“ Next-Header”字段指向上层头。因此,所有标题以链接列表的方式指向下一个。

如果“下一个报头”字段包含值59,则表明该报头之后没有报头,甚至上层报头也没有。

根据RFC 2460,必须支持以下扩展头:

扩展头的顺序应为:

这些标题:

  • 1.应由第一个和后续目的地处理。

  • 2.应由最终目的地处理。

扩展头以链接列表的方式一个接一个地排列,如下图所示:

[图片:扩展头连接格式]