IPv6報頭


IPv6絕妙之處在於它的頭。 IPv6地址比IPv4大4倍,但IPv6報頭比IPv4的大只有2倍。 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:

擴充套件頭的順序應該是:

這些標頭檔案:

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

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

擴充套件報頭被安排了一個又一個的連結列表的方式,如下圖中所示:

[Image: Extension Headers Connected Format]