IPv4 Address
technology.internet.ip_v4Standard 4-octet IPv4 address format (e.g., 192.168.1.1). Resolves to VARCHAR with INET validation. Can optionally parse to DuckDB INET type with the inet extension.
Shape
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$| Value | Length | Shape |
|---|---|---|
| 192.168.1.1 | 11 | matches |
| 8.8.8.8 | 7 | matches |
| 127.0.0.1 | 9 | matches |
| 10.0.0.0 | 8 | matches |
| 192.168.1. | 10 | rejected: one character short |
Told apart
1 of the 12 other internet types accept every one of these samples on shape alone.
- Hostnamematches them by pattern
Background
Origin
The Internet Protocol that IPv4 addresses belong to is specified in RFC 791, dated September 1981.[1] RFC 791 states that addresses are fixed length of four octets (32 bits).[1] IPv4 was the first version deployed for production on SATNET in 1982 and on the ARPANET in January 1983.[2]
IPv4 addresses are most often written in dot-decimal notation: four octets expressed individually in decimal numbers, without any extra leading zeros, separated by periods.[2] The primary address pool of the Internet, maintained by IANA, was exhausted on 3 February 2011.[2]
Use
RFC 6890, Special-Purpose IP Address Registries, lists 127.0.0.0/8 as the Loopback block.[3]
Python's ipaddress module accepts an IPv4 address as four decimal integers in the inclusive range 0 to 255, separated by dots.[4] The ipaddress documentation says leading zeroes are not tolerated, to prevent confusion with octal notation.[4] Since Python 3.9.5, leading zeros in an IPv4 address string are treated as an error.[4] When a column holds values like 010.001.001.001, decide deliberately what they mean before parsing, rather than letting whichever library is to hand decide for you. (Meridian's view)
DuckDB's inet extension defines the INET data type for storing IPv4 and IPv6 Internet addresses.[5] DuckDB's inet extension supports the CIDR notation for subnet masks.[5] In DuckDB, the host component of an INET value can be extracted using the HOST() function.[5] Keeping the original text alongside a parsed address column is cheap insurance, because a column that mixes bare addresses, prefixes and IPv6 values tends to surprise someone later. (Meridian's view)
Where you'll meet it
Google's own Public DNS documentation gives its IPv4 addresses as 8.8.8.8 and 8.8.4.4.[6]
Sources
- [1]RFC 791: Internet Protocolstandard
- [2]IPv4secondary source
- [3]RFC 6890: Special-Purpose IP Address Registriesstandard
- [4]ipaddress — IPv4/IPv6 manipulation librarydocumentation
- [5]inet Extensiondocumentation
- [6]Get Started | Public DNS | Google for Developersorganisation
Detection notes
v1 migration: Was internet.ip_v4. transform_ext uses DuckDB's inet extension if available. Without the extension, stored as VARCHAR but validated as IPv4.
Use it
$ finetype infer -i "192.168.1.1" --mode column
→ technology.internet.ip_v4
SELECT ft_infer('192.168.1.1');
-- → 'technology.internet.ip_v4'CAST({col} AS VARCHAR)Schema
https://meridian.online/schemas/technology.internet.ip_v4 · Frictionless type string
finetype taxonomy technology.internet.ip_v4 -o json-schema