Compress an IPv6 address with two equal zero runs
Convert a full eight-hextet IPv6 address to RFC 5952 notation and normalize the same address to its /64 network.
Try these inputsWorked calculation
- Remove leading zeros from each hextet. The sequence becomes 2001:db8:0:0:20:0:0:42.
- The two zero runs each have length two. Compress the leftmost to obtain 2001:db8::20:0:0:42.
- A /64 retains the first four hextets and zeroes the last four, so the network reads 2001:db8::/64.
Results
- Selected child
- 2001:db8::/64
- Selected leaf
- 2001:db8::/64
- Child prefixes
- 1
IPv6 prefix tree
- Selected prefix
- Nearby or parent prefix
- Parent network
- 2001:db8::/64
- Last address in parent
- 2001:db8::ffff:ffff:ffff:ffff
- Full address
- 2001:0db8:0000:0000:0020:0000:0000:0042
- Compressed address
- 2001:db8::20:0:0:42
- Addresses in parent
- 18,446,744,073,709,551,616
- Leaves in selected child
- 1
- Address space
- IPv6
| Level | Index | Prefix | Selection |
|---|---|---|---|
| Child | 0 | 2001:db8::/64 | Selected |
| Leaf | 0 | 2001:db8::/64 | Selected |
Questions
Would 2001:db8:0:0:20::42 identify the same numeric address?
Yes. The RFC 5952 canonical representation chooses the leftmost equal-length run, so it prints differently.
Can two double colons appear in one address?
The syntax uses at most one ::. Otherwise the number of omitted hextets would be ambiguous.