Reputation: 1046
I'm having trouble compressing the IPv6 address: 8bfa:99f0:d4c5:0b8c:0f6f:04df:2804:283d
I think it would be: 8bfa:99f:d4c5:b8c:f6f:4df:284:283d
Unfortunately, this is not correct.
Upvotes: -1
Views: 560
Reputation: 46
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:
0111:0022:0003:0000:0000:0006:0070:0800 = 111:22:3::6:70:800
Upvotes: 2
Reputation: 361919
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
means 0284
, 2084
, 2804
, or 2840
.
Upvotes: 4