IPv6 SLAAC(无状态自动配置)
主机可以通过RA(Router-Advertisement)消息ICMP type134中携带的前缀得到地址的前缀部分,同时通过该接口自动生成接口ID部分,从而得到一个完整的128位的IPV6地址,该消息默认情况下每200S发送一次。当然主机(或路由器)也可以主动发送RS(Router Solicit)消息ICMP Type=133来主动请求该前缀。
IPv6 SLAAC地址分配过程抓包分析
PC RS报文获取地址前缀,Type类型133
为配置接口,主机需要前缀信息(类似于IPV4地址的网络部分),因此它会发送一条路由器请求(RouterSolicitation,RS)消息。该消息以组播方式发送给所有路由器。这实际上是一种ICMP消息,并用编号进行标识。PC发送RS(Router Solicitation)给到本地节点,所有路由器组播地址FF02::2,源地址和目的地址如下红色字体。
Internet Protocol Version 6, Src: fe80::6d87:f0b:1be3:9972, Dst: ff02::2
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 16
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: fe80::6d87:f0b:1be3:9972
Destination Address: ff02::2
Frame 335: 70 bytes on wire (560 bits), 70 bytes captured (560 bits)
Ethernet II, Src: 26:fc:27:b4:a6:a1 (26:fc:27:b4:a6:a1), Dst: IPv6mcast_02 (33:33:00:00:00:02)
Internet Protocol Version 6, Src: fe80::6d87:f0b:1be3:9972, Dst: ff02::2
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 16
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: fe80::6d87:f0b:1be3:9972
Destination Address: ff02::2
Internet Control Message Protocol v6
Type: Router Solicitation (133)
Code: 0
Checksum: 0x54f4 [correct]
[Checksum Status: Good]
Reserved: 00000000
ICMPv6 Option (Source link-layer address : 26:fc:27:b4:a6:a1)
Type: Source link-layer address (1)
Length: 1 (8 bytes)
Link-layer address: 26:fc:27:b4:a6:a1 (26:fc:27:b4:a6:a1)
路由设备回复RA,Type类型134
路由器使用一条路由器通告(Router-Advertisement,RA)消息进行应答,其中包含请求的前级信息。RA消息也是组播分组,被发送到表示所有节点的组播地址,其ICMP类型为134。RA消息是定期发送的,但主机发送RS消息后,可立即得到响应,因此无需等待下一条定期发送的RA消息,就能获得所需的信息。
Frame 336: 158 bytes on wire (1264 bits), 158 bytes captured (1264 bits)
Ethernet II, Src: 96:ab:fd:96:d0:7d (96:ab:fd:96:d0:7d), Dst: 26:fc:27:b4:a6:a1 (26:fc:27:b4:a6:a1)
Internet Protocol Version 6, Src: fe80::a9f1:df9b:a5f6:b82d, Dst: fe80::6d87:f0b:1be3:9972
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 104
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: fe80::a9f1:df9b:a5f6:b82d
Destination Address: fe80::6d87:f0b:1be3:9972
Internet Control Message Protocol v6
Type: Router Advertisement (134)
Code: 0
Checksum: 0x23f9 [correct]
[Checksum Status: Good]
Cur hop limit: 255
Flags: 0x40, Other configuration, Prf (Default Router Preference): Medium
Router lifetime (s): 65535
Reachable time (ms): 0
Retrans timer (ms): 0
ICMPv6 Option (Source link-layer address : 96:ab:fd:96:d0:7d)
Type: Source link-layer address (1)
Length: 1 (8 bytes)
Link-layer address: 96:ab:fd:96:d0:7d (96:ab:fd:96:d0:7d)
ICMPv6 Option (MTU : 1500)
Type: MTU (5)
Length: 1 (8 bytes)
Reserved
MTU: 1500
ICMPv6 Option (Prefix information : 2408:8456:3204:dd45::/64)
Type: Prefix information (3)
Length: 4 (32 bytes)
Prefix Length: 64
Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
Valid Lifetime: Infinity (4294967295)
Preferred Lifetime: Infinity (4294967295)
Reserved
Prefix: 2408:8456:3204:dd45::
ICMPv6 Option (Recursive DNS Server fe80::94ab:fdff:fe93:cd7a fe80::94ab:fdff:fe93:cd7a)
Type: Recursive DNS Server (25)
Length: 5 (40 bytes)
Reserved
Lifetime: Infinity (4294967295)
Recursive DNS Servers: fe80::94ab:fdff:fe93:cd7a
Recursive DNS Servers: fe80::94ab:fdff:fe93:cd7a
路由分配地址发送NS,消息类型Type=135,PC回复NA,消息类型Type=136
NS ,Type=135,分配地址2408:8456:3204:dd45:a5c2:1725:60cf:de87
Internet Protocol Version 6, Src: fe80::a9f1:df9b:a5f6:b82d, Dst: ff02::1:ffcf:de87
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 32
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: fe80::a9f1:df9b:a5f6:b82d
Destination Address: ff02::1:ffcf:de87
Frame 341: 86 bytes on wire (688 bits), 86 bytes captured (688 bits)
Ethernet II, Src: 96:ab:fd:96:d0:7d (96:ab:fd:96:d0:7d), Dst: IPv6mcast_ff:cf:de:87 (33:33:ff:cf:de:87)
Internet Protocol Version 6, Src: fe80::a9f1:df9b:a5f6:b82d, Dst: ff02::1:ffcf:de87
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 32
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: fe80::a9f1:df9b:a5f6:b82d
Destination Address: ff02::1:ffcf:de87
Internet Control Message Protocol v6
Type: Neighbor Solicitation (135)
Code: 0
Checksum: 0x9b6d [correct]
[Checksum Status: Good]
Reserved: 00000000
Target Address: 2408:8456:3204:dd45:a5c2:1725:60cf:de87
ICMPv6 Option (Source link-layer address : 96:ab:fd:96:d0:7d)
Type: Source link-layer address (1)
Length: 1 (8 bytes)
Link-layer address: 96:ab:fd:96:d0:7d (96:ab:fd:96:d0:7d)
NA,Type=136,PC回复使用地址2408:8456:3204:dd45:a5c2:1725:60cf:de87
Internet Protocol Version 6, Src: 2408:8456:3204:dd45:a5c2:1725:60cf:de87, Dst: fe80::a9f1:df9b:a5f6:b82d
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 32
Next Header: ICMPv6 (58)
Hop Limit: 255
Source Address: 2408:8456:3204:dd45:a5c2:1725:60cf:de87
Destination Address: fe80::a9f1:df9b:a5f6:b82d
Internet Control Message Protocol v6
Type: Neighbor Advertisement (136)
Code: 0
Checksum: 0xd24f [correct]
[Checksum Status: Good]
Flags: 0x60000000, Solicited, Override
0... .... .... .... .... .... .... .... = Router: Not set
.1.. .... .... .... .... .... .... .... = Solicited: Set
..1. .... .... .... .... .... .... .... = Override: Set
...0 0000 0000 0000 0000 0000 0000 0000 = Reserved: 0
Target Address: 2408:8456:3204:dd45:a5c2:1725:60cf:de87
ICMPv6 Option (Target link-layer address : 26:fc:27:b4:a6:a1)
Type: Target link-layer address (2)
Length: 1 (8 bytes)
Link-layer address: 26:fc:27:b4:a6:a1 (26:fc:27:b4:a6:a1)
地址分配过程
文章来源:https://www.toymoban.com/news/detail-661202.html
文章来源地址https://www.toymoban.com/news/detail-661202.html
到了这里,关于【IPv6】IPV6 SLAAC地址分配过程及抓包分析的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!