IPv6 Address and Address Notation and Prefix Representation
(Page 3 of 4)
Zero Compression in IPv6 Addresses
Fortunately, there is a short-cut that can be applied to shorten some addresses even further. This technique is sometimes called zero compression. The method allows a single string of contiguous zeroes in an IPv6 address to be replaced by a double-colon. So, for example, the address above could be expressed as:
We know how many zeroes are replaced by the :: because we can see how many fully-expressed (uncompressed) hex words are in the address. In this case there are six, so the :: represents two zero words. To prevent ambiguity, the double-colon can appear only once in any IP address, because if it appeared more than once we could not tell how many zeroes were replaced in each instance. So, if our example address were 805B:2D9D:DC28:0:0:FC57:0:0, we could replace either the first pair of zeroes or the second, but not both.
Zero compression doesn't make our example much shorter, but due to how IPv6 addresses are structured, long strings of zeroes are common. For example, consider this address:
With compression, this could be expressed as just:
It works even better on special addresses. The full IPv6 loopback address is:
With compression, this is simply:
For even more fun, consider the Even more odd, the IPv6 unspecified address:
Apply zero compression to an address that is all zeroes, and what do you get? Thats right:
No numbers at all! Of course thinking of :: as an address does take some getting used to.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.