avocadoLambda
avocadoLambda

Reputation: 1046

Compression Rules to IPv6

I'm having trouble compressing the IPv6 address: 8​b​f​a​:​9​9​f​0​:​d​4​c​5​:​0​b​8​c​:​0​f​6​f​:​0​4​d​f​:​2​8​0​4​:​2​8​3​d​

I think it would be: 8bfa:99f:d4c5:b8c:f6f:4df:284:283d

Unfortunately, this is not correct.

Upvotes: -1

Views: 560

Answers (2)

0xD
0xD

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

John Kugelman
John Kugelman

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

Related Questions