Show figures of the routing table on the home page (closes #154) #196

Merged
clawbot merged 1 commits from issue-154-home-cards into next 2026-10-27 18:27:02 +01:00
Collaborator

Builds #154 as planned in #154 (comment).

What changed:

  • / has cards for the newest and oldest kept route, the newest and oldest updated AS (by asns.last_seen), the AS with the most prefixes, the ASes with a single prefix, and fifteen well-known networks.
  • Two cards count bogon announcements and prefixes with several origin ASes. They link to the new pages /bogons and /multiple-origins, which list up to 1,000 rows in prefix order and give the total.
  • New package internal/bogon tells reserved prefixes and AS numbers, from the IANA special-purpose registries. Multicast space, 224.0.0.0/4 and ff00::/8, is reserved too, from the IANA address space registries.
  • Table.Overview makes the one walk over the routing table. The server works the cards out once a minute and serves that copy.

Worth knowing:

  • The walk lets the read lock go every 10,000 prefixes, partway through a range over a Go map. Go allows this; a prefix added or removed in that gap may or may not be counted.
  • A new index on asns(last_seen) adds one index update to each AS write.
  • Server.Start now reads the table in the background, so one integration test gives its server an empty table.

Judgement calls:

  • The most specific registry row decides, so the AS112, AMT, Teredo and 6to4 blocks are not bogons.
  • A well-known network's last update is its newest kept route; last_seen is always recent for transit networks.
  • AS 0 counts on neither the most-prefixes nor the single-prefix card.
  • No well-known AS number needed correcting.

Model: opus-5-5

Builds https://git.eeqj.de/sneak/routewatch/issues/154 as planned in https://git.eeqj.de/sneak/routewatch/issues/154#issuecomment-156618. What changed: - `/` has cards for the newest and oldest kept route, the newest and oldest updated AS (by `asns.last_seen`), the AS with the most prefixes, the ASes with a single prefix, and fifteen well-known networks. - Two cards count bogon announcements and prefixes with several origin ASes. They link to the new pages `/bogons` and `/multiple-origins`, which list up to 1,000 rows in prefix order and give the total. - New package `internal/bogon` tells reserved prefixes and AS numbers, from the IANA special-purpose registries. Multicast space, `224.0.0.0/4` and `ff00::/8`, is reserved too, from the IANA address space registries. - `Table.Overview` makes the one walk over the routing table. The server works the cards out once a minute and serves that copy. Worth knowing: - The walk lets the read lock go every 10,000 prefixes, partway through a range over a Go map. Go allows this; a prefix added or removed in that gap may or may not be counted. - A new index on `asns(last_seen)` adds one index update to each AS write. - `Server.Start` now reads the table in the background, so one integration test gives its server an empty table. Judgement calls: - The most specific registry row decides, so the AS112, AMT, Teredo and 6to4 blocks are not bogons. - A well-known network's last update is its newest kept route; `last_seen` is always recent for transit networks. - AS 0 counts on neither the most-prefixes nor the single-prefix card. - No well-known AS number needed correcting. Model: opus-5-5
clawbot added the needs-review label 2026-10-27 17:49:48 +01:00
clawbot self-assigned this 2026-10-27 17:49:48 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. internal/bogon/bogon.go (specialPurposeBlocks and the package doc), and the README entry for GET /bogons: multicast space is not counted as reserved. The plan in #154 (comment) names multicast among the reserved space. Anyone reading a bogon card expects 224.0.0.0/4 and ff00::/8 to count, since the common bogon lists all include them. Acceptable: both blocks count as reserved, taken from the IANA IPv4 and IPv6 address space registries, which list them as Multicast. The package doc, the comment above the list and the README sentence name that source.

  2. internal/routetable/overview_internal_test.go, TestWalkPrefixesVisitsEveryPrefix: no test checks that the walk lets the read lock go. With the release removed from walkPrefixes, every test still passes. Acceptable: a test in which an update started during the walk's first batch completes before the walk reaches its second batch.

  3. internal/server/server.go, Start: no test checks that a started server works out the cards. With the goroutine that runs keepHomeCardsFresh removed, every test still passes, and the home page would say forever that the figures are being worked out. Acceptable: a test that starts a server and sees the cards appear.

  4. internal/templates/multiple_origins.html: an origin carried by one peer reads "1 peers". Acceptable: "1 peer".

Judgement call: the 1,000-row cap on /bogons and /multiple-origins is taken as intended, although the issue asks for a page that lists all the bogon announcements.
Judgement call: releasing the lock during the walk is accepted as disclosed. A prefix that is removed and added again during one walk can be listed twice; that is rare and gone a minute later.

Model: opus-5-5

FAIL (needs-rework) 1. `internal/bogon/bogon.go` (`specialPurposeBlocks` and the package doc), and the README entry for `GET /bogons`: multicast space is not counted as reserved. The plan in https://git.eeqj.de/sneak/routewatch/issues/154#issuecomment-156618 names multicast among the reserved space. Anyone reading a bogon card expects `224.0.0.0/4` and `ff00::/8` to count, since the common bogon lists all include them. Acceptable: both blocks count as reserved, taken from the IANA IPv4 and IPv6 address space registries, which list them as Multicast. The package doc, the comment above the list and the README sentence name that source. 2. `internal/routetable/overview_internal_test.go`, `TestWalkPrefixesVisitsEveryPrefix`: no test checks that the walk lets the read lock go. With the release removed from `walkPrefixes`, every test still passes. Acceptable: a test in which an update started during the walk's first batch completes before the walk reaches its second batch. 3. `internal/server/server.go`, `Start`: no test checks that a started server works out the cards. With the goroutine that runs `keepHomeCardsFresh` removed, every test still passes, and the home page would say forever that the figures are being worked out. Acceptable: a test that starts a server and sees the cards appear. 4. `internal/templates/multiple_origins.html`: an origin carried by one peer reads "1 peers". Acceptable: "1 peer". Judgement call: the 1,000-row cap on `/bogons` and `/multiple-origins` is taken as intended, although the issue asks for a page that lists all the bogon announcements. Judgement call: releasing the lock during the walk is accepted as disclosed. A prefix that is removed and added again during one walk can be listed twice; that is rare and gone a minute later. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-27 18:02:11 +01:00
clawbot added 1 commit 2026-10-27 18:10:11 +01:00
The home page gets cards for the newest and oldest kept route, the newest
and oldest updated AS, the AS with the most prefixes, the ASes with a
single prefix and fifteen well-known networks. Two more cards count the
bogon announcements and the prefixes with several origin ASes. They link
to the new pages /bogons and /multiple-origins, which list up to 1,000
entries each.

The new package internal/bogon tells reserved prefixes and AS numbers,
from the IANA special-purpose and address space registries. Table.Overview
walks the table and lets the read lock go every 10,000 prefixes. The
server works the cards out once a minute and serves that copy. A new index
on asns(last_seen) finds the newest and oldest updated AS.

Model: opus-5-5
clawbot force-pushed issue-154-home-cards from c90af9a873 to 385775de04 2026-10-27 18:10:11 +01:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-27 18:10:51 +01:00
Author
Collaborator
  1. Fixed: both multicast blocks count as reserved; the package doc, the comment above the list and the README name the IANA IPv4 and IPv6 address space registries; TestPrefix covers both.
  2. Fixed: TestWalkPrefixesLetsUpdatesIn waits, through TryRLock, until the update waits for the lock, then checks at the second batch's first prefix that the update is in the table. It fails with the release removed.
  3. Fixed: TestStartedServerWorksOutTheCards starts a server and waits for the cards on /. It fails with the goroutine removed.
  4. Fixed: TestListPagesListTheirEntries checks the "1 peer" text. The other templates the PR adds give no count in running text, so they needed no change.

Judgement call: the list in internal/bogon is renamed from specialPurposeBlocks to registryBlocks, since it now holds rows of two kinds of IANA registry.

Model: opus-5-5

1. Fixed: both multicast blocks count as reserved; the package doc, the comment above the list and the README name the IANA IPv4 and IPv6 address space registries; `TestPrefix` covers both. 2. Fixed: `TestWalkPrefixesLetsUpdatesIn` waits, through `TryRLock`, until the update waits for the lock, then checks at the second batch's first prefix that the update is in the table. It fails with the release removed. 3. Fixed: `TestStartedServerWorksOutTheCards` starts a server and waits for the cards on `/`. It fails with the goroutine removed. 4. Fixed: `TestListPagesListTheirEntries` checks the "1 peer" text. The other templates the PR adds give no count in running text, so they needed no change. Judgement call: the list in `internal/bogon` is renamed from `specialPurposeBlocks` to `registryBlocks`, since it now holds rows of two kinds of IANA registry. Model: opus-5-5
Author
Collaborator

PASS: the cards on / and the pages /bogons and /multiple-origins meet #154 as planned in #154 (comment), and the four findings of #196 (comment) are fixed.

Judgement call: the 1,000-row cap on /bogons is accepted, although the issue asks for a page that lists all the bogon announcements.
Judgement call: the README does not say that a more specific registry row can make a block announceable, as for Teredo; the registries say so in their own notes, so this is not counted as an error.

Model: opus-5-5

PASS: the cards on `/` and the pages `/bogons` and `/multiple-origins` meet https://git.eeqj.de/sneak/routewatch/issues/154 as planned in https://git.eeqj.de/sneak/routewatch/issues/154#issuecomment-156618, and the four findings of https://git.eeqj.de/sneak/routewatch/pulls/196#issuecomment-159347 are fixed. Judgement call: the 1,000-row cap on `/bogons` is accepted, although the issue asks for a page that lists all the bogon announcements. Judgement call: the README does not say that a more specific registry row can make a block announceable, as for Teredo; the registries say so in their own notes, so this is not counted as an error. Model: opus-5-5
clawbot merged commit 281d162e27 into next 2026-10-27 18:27:02 +01:00
clawbot deleted branch issue-154-home-cards 2026-10-27 18:27:02 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#196