MeridianMERIDIAN

IPv6 Address

technology.internet.ip_v6

Standard IPv6 address format with 8 16-bit hex groups separated by colons. May use :: notation for zero compression. Resolves to VARCHAR.

Shape

Pattern
^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$
ValueLengthShape
2001:0db8:85a3:0000:0000:8a2e:0370:733439matches
2001:db8:85a3::8a2e:370:733428rejected
::13rejected
fe80::17rejected
2001:0db8:85a3:0000:0000:8a2e:0370:7334440rejected: one character extra

Background

Origin

RFC 1884, titled IP Version 6 Addressing Architecture, was published in December 1995 with R. Hinden and S. Deering as editors.[1] RFC 1884 gave the preferred text form of an IPv6 address as 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.[1] In RFC 1884, the :: notation indicates multiple groups of 16 bits of zeros.[1] RFC 1884 says that :: can only appear once in an address.[1]

RFC 4291 obsoletes RFC 3513.[2] RFC 4291 defines IPv6 addresses as 128-bit identifiers for interfaces and sets of interfaces.[2] RFC 8200 describes IPv6 as a new version of the Internet Protocol, designed as the successor to IPv4.[3] RFC 8200 says IPv6 increases the IP address size from 32 bits to 128 bits.[3]

RFC 4291 calls the unicast address 0:0:0:0:0:0:0:1 the loopback address.[2] RFC 4291 gives ::1 as the compressed form of the loopback address.[2] RFC 4291 lists link-local unicast addresses under the prefix FE80::/10.[2] RFC 4291 says link-local addresses are for use on a single link.[2]

RFC 5952, titled A Recommendation for IPv6 Address Text Representation, was published in August 2010 by S. Kawamura and M. Kawashima.[4] RFC 5952 states that a single IPv6 address can be text represented in many ways.[4] RFC 5952 defines a canonical textual representation format for IPv6 addresses.[4] Under RFC 5952, leading zeros in each group must be suppressed.[4] RFC 5952 requires the :: symbol to be used to its maximum capability.[4] RFC 5952 forbids using :: to shorten just one 16-bit 0 field.[4] RFC 5952 requires hexadecimal letters to be represented in lowercase.[4]

Use

Expect one address to arrive in several spellings, full and compressed, upper and lower case, and normalise every value to one form before you join, count distinct values or deduplicate. (Meridian's view) Python's ipaddress module describes its compressed form as the address with leading zeroes in groups omitted and the longest sequence of all-zero groups collapsed to a single empty group.[5] Python's ipaddress module returns the compressed form when str() is called on an IPv6 address.[5] Python's ipaddress module describes the exploded form as the long form, with all leading zeroes and all-zero groups included.[5]

Wikipedia notes that a zone index is separated from an IPv6 address by a percent sign.[6] Python's ipaddress module accepts an optional scope zone ID written as a %scope_id suffix, giving fe80::1234%1 as an example.[5] Wikipedia notes that literal IPv6 addresses are enclosed in square brackets in resource identifiers such as URLs.[6] RFC 5952 recommends the bracketed style from RFC 3986 for an IPv6 address written with a port number.[4] When a column comes from web or proxy logs, strip any brackets, port and zone suffix into their own columns before you test whether the remainder is an address. (Meridian's view)

PostgreSQL's inet type holds an IPv4 or IPv6 host address, and optionally its subnet, in one field.[7] PostgreSQL's documentation recommends its network address types over plain text types because they offer input error checking and specialised operators and functions.[7] DuckDB's inet extension defines an INET data type for storing IPv4 and IPv6 Internet addresses.[8]

Detection notes

v1 migration: Was internet.ip_v6. Complex regex due to :: compression notation.

Use it

CLI · DuckDB
$ finetype infer -i "2001:0db8:85a3:0000:0000:8a2e:0370:7334" --mode column
→ technology.internet.ip_v6

SELECT ft_infer('2001:0db8:85a3:0000:0000:8a2e:0370:7334');
-- → 'technology.internet.ip_v6'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/technology.internet.ip_v6 · Frictionless type string

finetype taxonomy technology.internet.ip_v6 -o json-schema

Aliases

ipv6

Type Registry