Skip to content

dv: add routing status datasets and an HTTP status page - #242

Closed
markverick wants to merge 9 commits into
mainfrom
feat/status-page-145
Closed

markverick wants to merge 9 commits into
mainfrom
feat/status-page-145

Conversation

@markverick

@markverick markverick commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #145.

DV currently exposes only local summary counts. Applications cannot
retrieve the router list and prefix announcements across the network.

  • Publish versioned, segmented routing snapshots at
    /<router-name>/32=DV/32=STATUS.
  • Include reachable routers, selected next hops, routing costs, and
    prefix announcements.
  • Sign snapshots with the configured DV router key and install routes
    for remote dataset retrieval.
  • Add ndnd fw status-report for XML reports and
    ndnd fw status-server for an HTML status page on port 6380.
  • Include forwarder counters, faces, FIB, RIB, content-store statistics,
    strategy choices, and DV routing information.

Snapshots are cached for one second, retain a bounded version history,
and are generated outside the engine's packet-processing loop.
The existing /localhost/nlsr/status endpoint remains available.

Regression tests cover snapshot consistency, segmentation, signatures,
remote certificate validation, route installation and removal, report
rendering, and HTTP failure handling.

Validation:

  • go test -race ./dv/... ./tools/nfdc/...
  • go vet ./dv/... ./tools/nfdc/...

markverick and others added 4 commits October 25, 2026 23:44
Read the outgoing-byte counter when constructing face status datasets.
Expose reachable routers, next hops, costs, and prefix announcements as
versioned, segmented objects signed with the configured DV router key.
Install routes for remote retrieval and retain bounded snapshot history.

Cover snapshot consistency, segmentation, signer selection, certificate
retrieval, and route installation and removal.

Refs: #145
Collect forwarder management and DV routing datasets for XML reports
and a server-rendered HTML page on port 6380. Share dataset fetching and
status conversion, and include a nonce in DV summary Interests.

Cover rendering, nonce generation, unavailable datasets, and concurrent
HTTP collection and failure recovery.

Refs: #145
dv: add routing status datasets and an HTTP status page

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Concurrent publication, remote trust validation, and management-connection recovery need final human integration review.

1 open issue
1 file not reviewed
  • dv/tlv/zz_generated.go: Generated file
What changed in this PR

Adds network-retrievable DV routing snapshots and integrates them into new forwarder status reports and an HTTP status page, addressing #145.

Changes:

  • Publishes signed, segmented routing snapshots with bounded caching and routes for remote retrieval.
  • Adds XML reports and an HTML status server on port 6380.
  • Adds regression coverage and documentation, and corrects the outgoing-byte counter.
File Description
tools/​nfdc/​nfdc.go Registers the new status commands.
tools/​nfdc/​nfdc_status_server.go Serves HTML reports and the stylesheet.
tools/​nfdc/​nfdc_status_server_test.go Tests HTTP responses and concurrent requests.
tools/​nfdc/​nfdc_status_report.go Collects forwarder and DV status for reporting.
tools/​nfdc/​nfdc_status_report_test.go Tests report mapping, rendering, and escaping.
tools/​nfdc/​nfdc_dataset.go Adds packet and object retrieval helpers.
tools/​nfdc/​ndnd-status.xsl Styles XML status reports.
tools/​nfdc/​ndnd-status.html Defines the server-rendered status page.
fw/​mgmt/​face.go Corrects the outgoing-byte counter.
dv/​tlv/​zz_generated.go Adds generated routing-status serialization.
dv/​tlv/​definitions.go Defines routing-status data structures.
dv/​dv/​table_algo.go Installs routes to remote status datasets.
dv/​dv/​status_dataset.go Copies, sorts, publishes, and caches snapshots.
dv/​dv/​status_dataset_test.go Tests snapshots, signing, segmentation, and routes.
dv/​dv/​status_dataset_consumer_test.go Tests remote certificate validation with forwarding hints.
dv/​dv/​router.go Initializes snapshot storage and registers the endpoint.
dv/​config/​schema.trust Authorizes router-signed status datasets.
dv/​config/​config.go Adds the status dataset naming helper.
docs/​fw-control.md Documents the report and server commands.
docs/​dv-control.md Documents dataset retrieval, validation, and format.

Review effort: Balanced

Comment on lines +32 to +33
t.Start()
defer t.Stop()
Serve the existing XML report at /status.xml alongside the HTML page.
Reuse report collection and its concurrency guard for both formats.

Document the endpoint and cover XML responses, invalid requests,
collection failures, and concurrent HTML/XML requests.

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: f3337a9 Previous: d37de74 Ratio
BenchmarkDataEncodeMediumLongName 1017 ns/op 1032 B/op 9 allocs/op 426.8 ns/op 1032 B/op 9 allocs/op 2.38
BenchmarkDataEncodeMediumLongName - ns/op 1017 ns/op 426.8 ns/op 2.38

This comment was automatically generated by workflow using github-action-benchmark.

CC: @pulsejet

Comment thread docs/dv-control.md
ndnd cat /example/a/32=DV/32=STATUS > routing-status.tlv
```

The content is a `dv/tlv.RoutingStatus` snapshot of the responding router's

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ABNF of this structure (and any nested structures not appearing elsewhere) should appear in the spec.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in the spec

Comment thread tools/nfdc/ndnd-status.xsl Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file used anywhere?
Without a current usage, it would drift out of sync with the schema.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

return status, nil
}

func dvStatusName() enc.Name {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does /localhost/nlsr/status have anything to do with DV?

@markverick markverick Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main branch's management prefix is still localhost/nslr
dv2 branch already renamed to /localhost/dv/status. I suppose this PR should also handle the naming change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this to a future PR.
Issue created #243

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the spec for current naming?
Add a comment that links to the spec, to make it clear that this has nothing to do with NLSR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just reuses NSLR namespace/spec. It has nothing to do with NLSR
https://redmine.named-data.net/projects/nlsr/wiki/NLSR_Management/28/annotate

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this PR should also handle the naming change?

If dv2 has a clean commit that handles the naming change, you can rebase it into this PR, BEFORE other features.
Otherwise, you should open a separate PR for the naming change, along with specs if missing, to be merged BEFORE this PR.
The current code is very confusing.

Comment thread tools/nfdc/nfdc_dataset.go Outdated
return result.Data, nil
}

func (t *Tool) fetchObjectDataset(name enc.Name, noMetadata bool) (enc.Wire, error) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the dataset validated?
Where is the trust schema specified?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added validation and schema docs

Comment thread docs/fw-control.md Outdated

## `ndnd fw status-report`

The status-report command prints the NDNd status document as XML. It includes general forwarder counters, faces, FIB and RIB entries, content-store statistics, strategy choices, and DV status when the DV service is available. The DV section includes reachable routers, next hops, costs, and learned prefix announcements from the [DV routing dataset](dv-control.md#routing-status-dataset). Fields that NDNd does not provide, such as NameTree, Measurements, and Nack counters, are not included.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's best to provide a JSON edition in addition to or in place of the XML edition.
See NFD's feature request: https://redmine.named-data.net/issues/5342

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added json support

Document RDR discovery and segmented object names, the unwrapped
routing-status content, and ABNF for its status and router fields.
Reuse the existing next-hop, cost, and prefix-announcement definitions.
Link the control reference to the protocol specification.
Remove the XSL template, HTTP stylesheet route, and XML processing
instruction. Keep server-rendered HTML and machine-readable XML.
Update documentation and remove the stylesheet-specific assertions.
Load repeatable trust-anchor certificate files into an in-memory
keychain and validate metadata and segments with the built-in DV
schema. Use data-name forwarding hints for certificate retrieval.

Keep routing details unavailable without anchors or on validation
failure. Preserve the local management trust model for other datasets.
Cover valid segmented data, signature tampering, wrong-router signers,
untrusted roots, missing anchors, and invalid certificate files.
Serve /status.json and support status-report --format json while
preserving XML as the CLI default. Reuse the report model, collection,
and DV validation for HTML, XML, and JSON.

Define fixed JSON field types and preserve full-width integer values.
Validate DV router and prefix costs against existing infinity limits
before displaying them as numbers. Keep other status available when
a routing dataset is rejected.

Cover JSON encoding, HTTP responses and concurrency, invalid format
handling, cost boundaries, and rejection of signed invalid-cost data.
@yoursunny

yoursunny commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

I see you have #244 done already for the equivalent feature.
Why not rebase and deploy the other branch?

@markverick

markverick commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

I'm closing this PR since we changed the plan to deploy it on dv2 branch. I do not intend to keep duplicated commits here.

The routing status and the stage page of dv2 will look different from main, and is not compatible with the current main.

Later on, we need to port the hopefully clean commits (nslr namespace change -> ndncert server/email challenge -> new routing features -> routing status) into main.

@markverick markverick closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dv] status dataset

3 participants