IPv6

IPv6地址类型

unicast: 唯一地址,一个地址对应一个interface
anycast: 一组地址,数据报文将传递给组中最近的一个interface
multicast: 一组地址,数据报文将传递给组中的所有interface

IPv6地址划分

Address type IPv6 notation
Unspecified ::/128
Loopback ::1/128
Multicast FF00::/8
Link-local unicast FE80::/10
Site-local unicast FEC0::/10

Ipv6协议头

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class |             Flow Label                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Payload Length        |  Next Header  |   Hop Limit   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                         Source Address                        +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                      Destination Address                      +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

与Ipv4的头相比, 有以下需要注意的地方:

  1. Ipv6的头部为固定长度,因此没有了头部长度的内容,option使用NextHeader的指针串联起来,没有长度限制
  2. 分片信息以可选的形式存在option中,而不再像ipv4放在header中
  3. 地址长度由32bit变为128bit

参考文档:

rfc2460: Internet Protocol Version 6 (IPv6) Specification
rfc3513: Internet Protocol Version 6 (IPv6) Addressing Architecture