---
id: "ipv4subnet"
kind: "datatype"
status: "stable"
is_pii: true
categories: ["internet"]
langs: ["common"]
quality: 90
url: "http://registry.apicrafter.io/datatype/ipv4subnet"
---

# IPv4 routing prefix (subnet) (`ipv4subnet`)

Block of IPv4 addresses in CIDR notation (RFC 4632): a dotted-decimal address, a slash and a prefix length from 0 to 32, such as 192.0.2.0/24. Wikidata records the address blocks of organizations in property P3761. The regexp does not require the host bits to be zero.

- Parent datatype: `ipsubnet`
- Personal data (PII): yes
- Categories: Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}/(?:3[0-2]|[12]?[0-9])$
```

## Examples

- `163.1.0.0/16` — University of Oxford (example of Wikidata property P3761)
- `193.166.190.0/24` — Helsinki University Hospital (example of Wikidata property P3761)
- `192.0.2.0/24` — Documentation range TEST-NET-1 (RFC 5737)
- `192.0.2.0/33` (invalid example) — The prefix length is larger than 32
- `192.0.2.0` (invalid example) — No prefix length

## Mappings

- wikidata: `P3761`

## Translations

- ru: Префикс сети IPv4 (подсеть): Блок IPv4-адресов в нотации CIDR, например 192.0.2.0/24.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing>
- wikidata: <https://www.wikidata.org/wiki/Property:P3761>
- doc: <https://www.rfc-editor.org/rfc/rfc4632>

## Quality

Score 90/100. Missing: detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/ipv4subnet.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/ipv4subnet.yaml>
