IPv6 Address Formats
This Standard describes how to represent IPv6 addresses in the UI in a way that is easy for users to parse.
Guidelines
Text Representation
- For a Global Unicast address, use the IPv6 address prefix allocated for documentation purposes:
2001:db8:1ced:f00d::
- For a Link Local address, use any valid Link Local range. For example:
fe80::e0:F727:e400:a
- Use /64 for the subnet prefix
2001:db8:1ced:f00d::/64
- Use the canonical text representation format:
- Remove leading zeros (0db8 becomes db8)
- Compress contiguous zeros in the 16-bit segments (2001:db8:0000:0000:0000:0000:1 becomes 2001:db8::1)
- Use lowercase for hex digits
- In a Link Local address, if a zone index is needed, append the index to the address, separated by a percent sign (%). Don't display the default zone index.
fe80:f00d::1%eth0
- If the address also contains a port number, enclose the address in square brackets ([]). This notation avoids confusion between the colons characters (:) that separate the address from the colon that separates the port number.
[2001:db8:1ced:f00d::1]:443
IPv6 Text Box
- Use a standard text box for an IPv6 address. Don't use a formatted pattern because users might copy the IP address into the text box.
- Be flexible with accepting IPv6 formats. Users are likely to enter IPv6 addresses in a variety of formats. For example:
Full format 2001:db8:0000:0000:0000:0000:1 Condensed format 2001:db8::1 Subnet prefix 2001:db8:1ced:f00d::/64 Port number [2001:db8:1ced:f00d::1]:443 - Support mixed IPv6 and IPv4 notation. In this example, the final 32 bits are in IPv4 notation.
::ffff:c000:0280
- If the IPv6 address and prefix are known, prepopulate the text input box.
- If the IPv6 address is for a host's local network device, prepopulate the prefix length field with 64.
- Ignore invalid characters upon input.
- On validation, convert uppercase hex digits to lowercase, remove leading zeros, and compress contiguous zeros.
- If space allows, provide separate text input boxes for the address and subnet prefix.
- Don't explain the various IPv6 formats directly in the UI. Instead, ensure that the application checks for the canonical format.
Mixed IP Address Types
- If users can enter either an IPv6 address, IPv4 address, or host name into a text input box, ensure that validation checks for all notations. A text box that accepts host name cannot support character restriction.
- In a list or datagrid that includes both IPv6 and IPv4 addresses:
- Allow IPv4 dotted-decimal format (10.0.100.1)
- Perform sort and find operations on the "condensed" version of the addresses