IPv6報頭


IPv6絕妙之處在於它的頭。 IPv6地址比IPv4大4倍,但IPv6報頭比IPv4的大隻有2倍。 IPv6報文頭有一個固定的頁眉和零個或多個可選(續期)頭。這是一臺路由器必備的所有必要信息保存在固定的頭部。擴展報頭中包含的可選信息,有助於路由器瞭解如何處理數據包/流。

固定報頭

IPv6報頭 [ Image: IPv6 Fixed Header]

IPv6的報頭固定爲40字節長,包含以下信息。

S.N. 字段&描述
1

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

2

Traffic Class (8-bits): These 8 bits are divided into two parts. Most significant 6 bits are used for Type of Service, which tells the Router what services should be provided to this packet. 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 which helps the router to identify that this packet belongs to a specific flow of information. This field helps to 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 this 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 Extension Headers contain Hop-by-Hop Extension Header than 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 Extension Header is not present then it indicates the Upper Layer PDU. The values for the type of Upper Layer PDU is 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字段包含值59,則表明沒有頭這個頭之後,甚至沒有上層報頭。

下面的擴展報頭必須支持按RFC 2460:

IPv6報頭

擴展頭的順序應該是:

IPv6報頭

這些頭文件:

  • 1. 應該由第一和隨後的目的地進行處理。

  • 2. 應該由最終目的地處理。

擴展報頭被安排了一個又一個的鏈接列表的方式,如下圖中所示:

IPv6報頭 [ Image: Extension Headers Connected Format]