A Compact Representation of IPv6 Addresses (RFC1924)
Original Publication Date: 1996-Apr-01
Included in the Prior Art Database: 2019-Feb-12
Internet Society Requests For Comment (RFCs)
This document specifies a more compact representation of IPv6 addresses, which permits encoding in a mere 20 bytes. This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind.
Network Working Group R. Elz Request for Comments: 1924 University of Melbourne Category: Informational 1 April 1996
A Compact Representation of IPv6 Addresses
Status of this Memo
This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind. Distribution of this memo is unlimited.
IPv6 addresses, being 128 bits long, need 32 characters to write in the general case, if standard hex representation, is used, plus more for any punctuation inserted (typically about another 7 characters, or 39 characters total). This document specifies a more compact representation of IPv6 addresses, which permits encoding in a mere 20 bytes.
It is always necessary to be able to write in characters the form of an address, though in actual use it is always carried in binary. For IP version 4 (IP Classic) the well known dotted quad format is used. That is, 10.1.0.23 is one such address. Each decimal integer represents a one octet of the 4 octet address, and consequently has a value between 0 and 255 (inclusive). The written length of the address varies between 7 and 15 bytes.
For IPv6 however, addresses are 16 octets long [IPv6], if the old standard form were to be used, addresses would be anywhere between 31 and 63 bytes, which is, of course, untenable.
Because of that, IPv6 had chosen to represent addresses using hex digits, and use only half as many punctuation characters, which will mean addresses of between 15 and 39 bytes, which is still quite long. Further, in an attempt to save more bytes, a special format was invented, in which a single run of zero octets can be dropped, the two adjacent punctuation characters indicate this has happened, the number of missing zeroes can be deduced from the fixed size of the address.
In most cases, using genuine IPv6 addresses, one may expect the address as written to tend toward the upper limit of 39 octets, as long strings of zeroes are likely to be rare, and most of the other
Elz Informational [Page 1]
RFC 1924 A Compact Representation of IPv6 Addresses 1 April 1996
groups of 4 hex digits are likely to be longer than a single non-zero digit (just as MAC addresses typically have digits spread throughout their length).
This document specifies a new encoding, which can always represent any IPv6 address in 20 octets. While longer than the shortest possible representation of an IPv6 address, this is barely longer than half the longest representation, and will typically be shorter than the representation of most IPv6 addresses.
3. Current formats
[AddrSpec] specifies that the preferred text representation of IPv6 addresses is in one of three conventional forms.
The preferred form is x:x:x:x:x:x:x:x, where the ’x’s are the hexadecimal values of the eight 16-bit pieces of the address.
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 (39 characters)
1080:0:0:0:8:800:200C:417A (25 characters)
The second, or zero suppressed, form allows "::" to ind...