refactor: sort IP registry files by range

This commit is contained in:
2026-07-22 19:29:13 +00:00
parent b38191f190
commit 052306bafe
7 changed files with 20 additions and 15 deletions
+1 -1
View File
@@ -21,4 +21,4 @@ For every address, investigate these independently:
6. **Infrastructure relationships** — IXPs, facilities, upstreams, cables, and geography where evidence permits. 6. **Infrastructure relationships** — IXPs, facilities, upstreams, cables, and geography where evidence permits.
7. **Time and provenance** — registry and routing facts can change, so every claim needs a source and verification date. 7. **Time and provenance** — registry and routing facts can change, so every claim needs a source and verification date.
The canonical structured records are in [`data/ip-addresses.csv`](../data/ip-addresses.csv). Range-level knowledge is indexed in [`registry-ips/`](../registry-ips/README.md), using filenames such as `apnic--1-1-1-0--24.md`. The canonical structured records are in [`data/ip-addresses.csv`](../data/ip-addresses.csv). Range-level knowledge is indexed in [`registry-ips/`](../registry-ips/README.md), using numerically sortable IP-first filenames such as `001-001-001-000--24--apnic.md`.
+15 -10
View File
@@ -5,21 +5,26 @@ This folder is the human-readable registry of IP knowledge collected by this rep
## Filename convention ## Filename convention
```text ```text
<registry>--<network-address-with-hyphens>--<prefix-length>.md <zero-padded-network-address>--<zero-padded-prefix-length>--<registry-or-status>.md
``` ```
Examples: Examples:
```text ```text
iana--0-0-0-0--8.md 000-000-000-000--08--iana.md
apnic--1-1-1-0--24.md 001-000-000-000--16--placeholder.md
001-001-001-000--24--apnic.md
``` ```
The parts mean: The parts mean:
- `registry`: authoritative number registry currently responsible for the record (`iana`, `afrinic`, `apnic`, `arin`, `lacnic`, or `ripe-ncc`); - `zero-padded-network-address`: canonical IPv4 network address, each octet padded to three digits and separated by hyphens;
- `network-address-with-hyphens`: canonical network address with dots replaced by hyphens; - `zero-padded-prefix-length`: CIDR range number without `/`, padded to two digits;
- `prefix-length`: CIDR range number without `/`. - `registry-or-status`: authoritative number registry when the range has been researched (`iana`, `afrinic`, `apnic`, `arin`, `lacnic`, or `ripe-ncc`), otherwise `placeholder`.
A known top-level registry is not enough to put that registry in the suffix. If the exact range's holder, routing, and subdivision have not been investigated, use `placeholder`.
The zero padding is required because repository browsers sort filenames lexicographically: without it, `1-10...` would appear before `1-2...`.
IPv6 filenames use the same rule, with colons replaced by hyphens and compressed notation expanded to avoid ambiguous names. IPv6 filenames use the same rule, with colons replaced by hyphens and compressed notation expanded to avoid ambiguous names.
@@ -27,10 +32,10 @@ IPv6 filenames use the same rule, with colons replaced by hyphens and compressed
| Range | Registry | Classification | Status | Known exact addresses | Record | | Range | Registry | Classification | Status | Known exact addresses | Record |
|---|---|---|---|---|---| |---|---|---|---|---|---|
| `0.0.0.0/8` | IANA | Special-purpose | Researched | `0.0.0.0` | [record](iana--0-0-0-0--8.md) | | `0.0.0.0/8` | IANA | Special-purpose | Researched | `0.0.0.0` | [record](000-000-000-000--08--iana.md) |
| `1.0.0.0/16` | APNIC | Pending subdivision/research | Placeholder | — | [record](apnic--1-0-0-0--16.md) | | `1.0.0.0/16` | APNIC | Pending subdivision/research | Placeholder | — | [record](001-000-000-000--16--placeholder.md) |
| `1.1.0.0/24` | APNIC | Pending research | Placeholder | — | [record](apnic--1-1-0-0--24.md) | | `1.1.0.0/24` | APNIC | Pending research | Placeholder | — | [record](001-001-000-000--24--placeholder.md) |
| `1.1.1.0/24` | APNIC | Public unicast | Researched | `1.1.1.1` | [record](apnic--1-1-1-0--24.md) | | `1.1.1.0/24` | APNIC | Public unicast | Researched | `1.1.1.1` | [record](001-001-001-000--24--apnic.md) |
These four files now provide contiguous documented coverage from `0.0.0.0` through `1.1.1.255`. The two middle files are explicitly marked as placeholders and must not be interpreted as fully researched ownership records. These four files now provide contiguous documented coverage from `0.0.0.0` through `1.1.1.255`. The two middle files are explicitly marked as placeholders and must not be interpreted as fully researched ownership records.
+4 -4
View File
@@ -121,10 +121,10 @@ def main() -> int:
ROOT / "address-book" / "ip-addresses.md", ROOT / "address-book" / "ip-addresses.md",
ROOT / "docs" / "04-ip-address-model.md", ROOT / "docs" / "04-ip-address-model.md",
ROOT / "registry-ips" / "README.md", ROOT / "registry-ips" / "README.md",
ROOT / "registry-ips" / "iana--0-0-0-0--8.md", ROOT / "registry-ips" / "000-000-000-000--08--iana.md",
ROOT / "registry-ips" / "apnic--1-0-0-0--16.md", ROOT / "registry-ips" / "001-000-000-000--16--placeholder.md",
ROOT / "registry-ips" / "apnic--1-1-0-0--24.md", ROOT / "registry-ips" / "001-001-000-000--24--placeholder.md",
ROOT / "registry-ips" / "apnic--1-1-1-0--24.md", ROOT / "registry-ips" / "001-001-001-000--24--apnic.md",
ROOT / "research" / "next-round.md", ROOT / "research" / "next-round.md",
] ]
for path in required_docs: for path in required_docs: