IPv6报文格式
IPv6(Internet Protocol Version 6)是网络层协议的第二代标准协议,也被称为IPng(IP Next Generation),它是Internet工程任务组(IETF)设计的一套规范,是IPv4 [RFC 791]的升级版本。
一、IPv6报文头格式
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Extension Headers |
+ ... ... +
二、IPv6报文头字段解释
字段 | 长度 | 含义 |
---|---|---|
Version | 4比特 |
|
Traffic class | 8比特 | 流量类别。该字段及其功能类似于IPv4的业务类型字段。该字段以区分业务编码点(DSCP)标记一个IPv6数据包,以此指明数据包应当如何处理。 |
Flow Label | 20比特 | 流标签。该字段用来标记IP数据包的一个流,当前的标准中没有定义如何管理和处理流标签的细节。 |
Payload length | 16比特 | 该字段表示有效载荷的长度,有效载荷是指紧跟IPv6基本报头的数据包,包含IPv6扩展报头。 |
Next header | 8比特 | 下一报头,该字段指明了跟随在IPv6基本报头后的扩展报头的信息类型。 |
Hop limit | 8比特 | 跳数限制,该字段定义了IPv6数据包所能经过的最大跳数,这个字段和IPv4中的TTL字段非常相似。 |
Source Address | 128比特 | 该字段表示该报文的源地址。 |
Destination Address | 128比特 | 该字段表示该报文的目的地址。 |
Extension Headers | 可变 | 扩展报头。IPv6取消了IPv4报头中的选项字段,并引入了多种扩展报文头,在提高处理效率的同时还增强了IPv6的灵活性,为IP协议提供了良好的扩展能力。当超过一种扩展报头被用在同一个分组里时,报头必须按照下列顺序出现:
不是所有的扩展报头都需要被转发路由设备查看和处理的。路由设备转发时根据基本报头中Next Header值来决定是否要处理扩展头。 除了目的选项扩展报头出现两次(一次在路由扩展报头之前,另一次在上层扩展报头之前),其余扩展报头只出现一次。 |
三、IPv6报文示例
Frame 401: 86 bytes on wire (688 bits), 86 bytes captured (688 bits) on interface 0
Interface id: 0 (\Device\NPF_{69F7154F-F213-4B4C-9DC4-C423DA185F1E})
Encapsulation type: Ethernet (1)
Arrival Time: Mar 17, 2015 14:04:35.310056000
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1426572275.310056000 seconds
[Time delta from previous captured frame: 0.000002000 seconds]
[Time delta from previous displayed frame: 0.000002000 seconds]
[Time since reference or first frame: 23.762389000 seconds]
Frame Number: 401
Frame Length: 86 bytes (688 bits)
Capture Length: 86 bytes (688 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ipv6:ipv6.nxt:ipv6.hop_opt:icmpv6]
[Coloring Rule Name: ICMP]
[Coloring Rule String: icmp || icmpv6]
Ethernet II, Src: 00:23:e9:87:d4:01 (00:23:e9:87:d4:01), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Destination: IPv6mcast_01 (33:33:00:00:00:01)
Address: IPv6mcast_01 (33:33:00:00:00:01)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
Source: 00:23:e9:87:d4:01 (00:23:e9:87:d4:01)
Address: 00:23:e9:87:d4:01 (00:23:e9:87:d4:01)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv6 (0x86dd)
Internet Protocol Version 6, Src: 2073:7472:696e:6706:c0a8:ca02:0:586 (2073:7472:696e:6706:c0a8:ca02:0:586), Dst: ff02::1 (ff02::1)
0110 .... = Version: 6
[0110 .... = This field makes the filter "ip.version == 6" possible: 6]
.... 0000 0000 .... .... .... .... .... = Traffic class: 0x00000000
.... 0000 00.. .... .... .... .... .... = Differentiated Services Field: Default (0x00000000)
.... .... ..0. .... .... .... .... .... = ECN-Capable Transport (ECT): Not set
.... .... ...0 .... .... .... .... .... = ECN-CE: Not set
.... .... .... 0000 0000 0000 0000 0000 = Flowlabel: 0x00000000
Payload length: 32
Next header: IPv6 hop-by-hop option (0)
Hop limit: 1
Source: 2073:7472:696e:6706:c0a8:ca02:0:586 (2073:7472:696e:6706:c0a8:ca02:0:586)
Destination: ff02::1 (ff02::1)
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Hop-by-Hop Option
Next header: ICMPv6 (58)
Length: 0 (8 bytes)
IPv6 Option (Router Alert)
Type: Router Alert (5)
Length: 2
Router Alert: MLD (0)
IPv6 Option (Pad1)
Type: Pad1 (0)
Pad1
IPv6 Option (Pad1)
Type: Pad1 (0)
Pad1
Internet Control Message Protocol v6
Type: Multicast Listener Query (130)
Code: 0
Checksum: 0x8535 [correct]
Maximum Response Delay [ms]: 1000
Reserved: 0000
Multicast Address: :: (::)
四、IPv6协议栈结构
+------+ +-----+ +-----+ +-----+
|Telnet| | FTP | | TFTP| ... | ... |
+------+ +-----+ +-----+ +-----+
| | | |
+-----+ +-----+ +-----+
| TCP | | UDP | ... | ... |
+-----+ +-----+ +-----+
| | |
+--------------------------+----+
| IPv6 & ICMPv6 |
+--------------------------+----+
|
+---------------------------+
| Local Network Protocol |
+---------------------------+
发表评论