IPv6的压缩规则
我在压缩IPv6地址时遇到困难: 8 BFA:9 9 F 0:D 4 C 5:0 B 8 C:0 F 6 F:0 4 DF:2 8 0 4:2 8 3 D D d
我认为是: 8BFA:99F:D4C5:B8C:F6F:4DF:284:283D
不幸的是,这是不正确的。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就像您每天使用的常规小数号一样,只能删除领先的零。中间的尾零和零必须留下来。
如果可以删除其他是
0284
,2084
,2804
,还是2840
。Just like regular decimal numbers you work with every day, only leading zeros can be removed. Trailing zeros and zeros in the middle must stay.
If the other ones could be removed you wouldn't know whether
284
means0284
,2084
,2804
, or2840
.Hexa 99f0拐杖被压缩到Hexa 99f,因为它们的值不同。
HEXA 0B8C可以压缩到HEXA B8C,因为左零不会更改两个最终值。
IPv6地址由8组4组组成。如果它们的两个(或更多)范围是0000,则可以替代他们。例如:
Hexa 99f0 canot be compressed to hexa 99f because they are not the same value.
Hexa 0b8c can be compressed to hexa b8c because left zeroes dont change both final value.
IPv6 address are composed of 8 groups of 4 hexa-digits. If two (or more) consecutives of them are 0000 you can supress they. E.G: