Repository navigation
dv: add routing status datasets and an HTTP status page - #242
markverick wants to merge 9 commits into
Conversation
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
There was a problem hiding this comment.
🔵 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
| 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.
There was a problem hiding this comment.
⚠️ 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
| ndnd cat /example/a/32=DV/32=STATUS > routing-status.tlv | ||
| ``` | ||
|
|
||
| The content is a `dv/tlv.RoutingStatus` snapshot of the responding router's |
There was a problem hiding this comment.
ABNF of this structure (and any nested structures not appearing elsewhere) should appear in the spec.
There was a problem hiding this comment.
added in the spec
There was a problem hiding this comment.
Is this file used anywhere?
Without a current usage, it would drift out of sync with the schema.
| return status, nil | ||
| } | ||
|
|
||
| func dvStatusName() enc.Name { |
There was a problem hiding this comment.
What does /localhost/nlsr/status have anything to do with DV?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I'll leave this to a future PR.
Issue created #243
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| return result.Data, nil | ||
| } | ||
|
|
||
| func (t *Tool) fetchObjectDataset(name enc.Name, noMetadata bool) (enc.Wire, error) { |
There was a problem hiding this comment.
How is the dataset validated?
Where is the trust schema specified?
There was a problem hiding this comment.
added validation and schema docs
|
|
||
| ## `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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
I see you have #244 done already for the equivalent feature. |
|
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. |

Fixes #145.
DV currently exposes only local summary counts. Applications cannot
retrieve the router list and prefix announcements across the network.
/<router-name>/32=DV/32=STATUS.prefix announcements.
for remote dataset retrieval.
ndnd fw status-reportfor XML reports andndnd fw status-serverfor an HTML status page on port 6380.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: