Windows下IPv6地址的形成和使用

在使用Windows下的ifconfig或者ipv6 if命令查看IPv6连接状态的时候常常会看到一个网卡在global link上会有多个global address出现,如下:

ipconfig
Ethernet adapter 本地连接 :

Connection-specific DNS Suffix . :
Autoconfiguration IP Address. . . : 169.254.131.180
Subnet Mask . . . . . . . . . . . : 255.255.0.0
IP Address. . . . . . . . . . . . : 2001:da8:4000:23:2c76:a98d:d750:ee45

IP Address. . . . . . . . . . . . : 2001:da8:4000:23:78c9:fc49:595d:b8df

IP Address. . . . . . . . . . . . : 2001:da8:4000:23:2843:8803:747e:6dfe

IP Address. . . . . . . . . . . . : 2001:da8:4000:23:f97c:8bc7:bf88:454e

IP Address. . . . . . . . . . . . : 2001:da8:4000:23:398d:97ce:fd4d:b277

IP Address. . . . . . . . . . . . : 2001:da8:4000:23:a00:39ff:fe01:fbe7
IP Address. . . . . . . . . . . . : fe80::a00:39ff:fe01:fbe7%4
Default Gateway . . . . . . . . . : fe80::2e0:fcff:fe4f:1026%4

ipv6 if
Interface 4: Ethernet: 本地连接
Guid {CC74D20D-5CEA-4AE8-862A-C6A3FBF2F008}
uses Neighbor Discovery
uses Router Discovery
link-layer address: 08-00-39-01-fb-e7
preferred global 2001:da8:4000:23:2c76:a98d:d750:ee45, life 6d18h58m14s/18h5
5m27s (temporary)
deprecated global 2001:da8:4000:23:78c9:fc49:595d:b8df, life 5d19h1m5s/0s (t
emporary)
deprecated global 2001:da8:4000:23:2843:8803:747e:6dfe, life 4d19h3m57s/0s (
temporary)
deprecated global 2001:da8:4000:23:f97c:8bc7:bf88:454e, life 3d19h6m48s/0s (
temporary)
deprecated global 2001:da8:4000:23:398d:97ce:fd4d:b277, life 2d19h9m40s/0s (
temporary)
preferred global 2001:da8:4000:23:a00:39ff:fe01:fbe7, life 29d23h58m46s/6d23
h58m46s (public)

preferred link-local fe80::a00:39ff:fe01:fbe7, life infinite
multicast interface-local ff01::1, 1 refs, not reportable
multicast link-local ff02::1, 1 refs, not reportable
multicast link-local ff02::1:ff01:fbe7, 2 refs, last reporter
multicast link-local ff02::1:ff4d:b277, 1 refs, last reporter
multicast link-local ff02::1:ff88:454e, 1 refs, last reporter
multicast link-local ff02::1:ff7e:6dfe, 1 refs, last reporter
multicast link-local ff02::1:ff5d:b8df, 1 refs, last reporter
multicast link-local ff02::1:ff50:ee45, 1 refs, last reporter
link MTU 1500 (true link MTU 1500)
current hop limit 64
reachable time 20500ms (base 30000ms)
retransmission interval 1000ms
DAD transmits 1
default site prefix length 48

这个形式的多个全局IPv6地址曾经使我很困惑,但是通过分析IPv6无状态地址自动配置机制以及微软提出的rfc3041“Privacy Extensions for Stateless Address Autoconfiguration in IPv6”,终于对此有了比较深入的了解。

这里的多个地址中,最后一个
preferred global 2001:da8:4000:23:a00:39ff:fe01:fbe7, life 29d23h58m46s/6d23
h58m46s (public)
是固定的全局地址,它可以手动配置或者由网络前缀和硬件地址转化成的接口标识联合生成,在整个与网络相连的过程中,这个地址是始终不会变的
而之前的众多地址
preferred global 2001:da8:4000:23:2c76:a98d:d750:ee45, life 6d18h58m14s/18h5
5m27s (temporary)
deprecated global 2001:da8:4000:23:78c9:fc49:595d:b8df, life 5d19h1m5s/0s (t
emporary)
deprecated global 2001:da8:4000:23:2843:8803:747e:6dfe, life 4d19h3m57s/0s (
temporary)
deprecated global 2001:da8:4000:23:f97c:8bc7:bf88:454e, life 3d19h6m48s/0s (
temporary)
deprecated global 2001:da8:4000:23:398d:97ce:fd4d:b277, life 2d19h9m40s/0s (
temporary)
虽然也是全局地址,但是它们的作用与前者不一样,它的作用是在用户对外发起连接的时候充当连接发起的IPv6地址,这一行为的目的在于保证主机在对外通信 时候的匿名性。这个地址是由路由前缀和由主机随机生成的接口标识组成的。这个地址是有有效期限制的,几个小时或者几天,在期间,系统一直以这个地址为主机 地址向外发出连接和请求。每一个时刻只有一个临时地址是有效的,在一个地址过期时会立刻生成一个新的地址作为新的临时地址。已经过期的地址不会立即被删 除,它会保存几个小时或者几天,此时过期的临时地址不能对外发起连接,但是可以接受外部发来的之前请求的信息。

微软提出这个RCF的主要目的在于保证主机在对外通信时候的匿名性,其原因在于在ipv6连接网络使用 Stateless Address Autoconfiguration 自动生成的全局地址为如下形式AB,其中A是前缀,B是主机根据硬件接口地址生成的接口标识,这样,相像一下一个移动主机在网内移动的时候,虽然A是不断 变化的,但是B始终是常量(而且是全局唯一的),这样就给人以跟踪移动主机移动路线或者访问站点的可能性,所以需要这样一种带有适当有效期长度的临时 IPv6地址来对外发出网络请求。而根据硬件地址生成的那个全局地址则可以作为服务器地址来接受外界的主动连接请求。

参考资料:
[1]. http://technet2.microsoft.com/WindowsServer/en/library/01f5811d-589e-4c11-9161-0ce24a6f8a181033.mspx?mfr=true
[2]. http://www.ietf.org/rfc/rfc3041.txt
[3]. http://technet2.microsoft.com/WindowsServer/en/library/f953fa20-f037-4609-89eb-0178240f103b1033.mspx?mfr=true
[4]. http://www.microsoft.com/china/technet/itsolutions/network/ipv6/ipv6config.mspx
[5]. http://www.edu.cn/20051202/3163947.shtml 


转载地址:http://hi.baidu.com/eqmcc/blog/item/c95f2d09daa66c87d1581be2.html

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值