Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Docker
on:
push:
paths:
- Dockerfile
- .github/workflows/docker.yml
schedule:
# monthly on day 5
- cron: '20 15 5 * *'
Expand All @@ -13,12 +17,20 @@ permissions:

jobs:
testbed-master:
if: github.event_name != 'push'
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: testbed-master
target: testbed-master
testbed-caddy:
if: github.event_name != 'push'
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: testbed-caddy
target: testbed-caddy
testbed-ndnd-tools:
uses: named-data/actions/.github/workflows/docker-image.yml@v1
with:
name: testbed-ndnd-tools
target: testbed-ndnd-tools
tag-with-sha: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ __pycache__/
dist/
secrets.yml
.env
root-ca-home/
root-ca-home/
ndnd-root-ca-home/
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ VOLUME /testbed
WORKDIR /testbed


# Supply a shell for rendered NDNd tool entrypoints.
FROM busybox:1.37.0-musl@sha256:f6a95d611e0a8780fabdb2aec43e31275b2720dfefa3e41b16835bfc42454478 AS ndnd-tools-shell

FROM golang:1.24 AS ndnd-tools-build

ADD --keep-git-dir=true https://github.com/markverick/ndnd.git#f9c34574aa0dc7d295fa28bacd8b3060c650df15 /src
WORKDIR /src
RUN make

FROM ghcr.io/named-data/ndnd:dv2-staging@sha256:aba4d409d0f3ed2a7b134bd5d0ade0e0c9c37ad55e69254951c306f961b36d5b AS testbed-ndnd-tools

COPY --from=ndnd-tools-build /src/ndnd /ndnd
COPY --from=ndnd-tools-shell /bin/busybox /bin/sh


FROM caddy:2-alpine AS testbed-caddy

ADD --unpack https://nfd-status-page.ndn.today/NDNts-NFD-status-page.txz /srv/n
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ docker compose exec -e HOME=/testbed/root-ca-home master ndnsec list -c

Each node runs the pinned `ndnd-repo` container with identity `<default_prefix>/ndnd/repo` (e.g. `/ndn/edu/ucla/ndnd/repo`). Master generates a dedicated key, obtains a certificate from the local site CA, and installs the public chain selected by `globals.ndnd_repo_anchors`. The repo can write only its keychain and storage; it has no access to CA private keys or master renewal scripts.

## NDNd Distance Vector

Nodes with `ndnd_enabled: true` run the NDNd forwarder and a separate `ndnd dv` router. The router connects to the forwarder's `/run/ndnd/ndnd.sock` and exchanges DV traffic over its UDP listener on port 6364. All routers belong to the `/ndnd` DV network. Each site prefix prepends `/ndnd` to the configured `site` value; its router prefix appends `/%C1.Router/<router_name>`. Router identities are root-signed as `<ndnd_router_prefix>/32=DV`, and peers are selected from the configured NLSR neighbors that also enable NDNd.

Each enabled node also runs `ndnd pingserver --expose <ndnd_ca_prefix>` in a separate container, serving `<ndnd_ca_prefix>/ping/<SEQNUM>`. The `testbed-ndnd-tools` image builds pinned DV2 source with the ping-prefix registration fix and adds a shell for the rendered entrypoint. The Docker workflow publishes this image. The ping server registers only `<ndnd_ca_prefix>/ping`, leaving the site CA's registration separate. For example, Arizona serves `/ndnd/edu/arizona/ping/<SEQNUM>`.

## NDNd Merkle

Only UCLA runs the `ndnd-merkle` container, selected by `services.ndnd-merkle.hosts: [UCLA]` in `config.yml`, with identity `/ndn/edu/ucla/ndnd/merkle`. Master automatically provisions and renews its dedicated site-issued certificate using the same testbed anchors as the repo. Its trust schema permits testbed-certified users to append under their own identities and only the log key to sign responses. History persists in `dist/ndnd-merkle/storage`.
Expand Down Expand Up @@ -144,3 +150,78 @@ sudo systemctl enable unattended-upgrades
sudo systemctl start unattended-upgrades
sudo unattended-upgrades --debug
```

## NDNd Status

The NDNd forwarder, DV router, status server, CA services, and `/ndnd` Merkle log
use the digest-pinned DV2 staging image configured in Compose. The `/ndnd`
repository uses a repository-capable DV2 image.
Upgrade the forwarder, DV router, and status server together; the DV2 BIFT
management dataset uses TLV encoding. Both repository configurations explicitly
supply their management trust schema.

NFD-connected services use their service-specific images and NFD RIB registration.
NDNd-connected services use DV prefix advertising.

On hosts with `ndnd_enabled: true`, Caddy exposes:

- `/ndnd-status/`: HTML status page.
- `/ndnd-status/status.xml`: XML status report.
- `/ndnd-status/status.json`: JSON status report.

For example: `https://suns.cs.ucla.edu/ndnd-status/status.json`.

The renderer compiles `templates/ndnd-dv/dv-schema.lvs.j2` for both DV and the
status server. It permits only inventoried NDNd router certificates, issued
directly by the `/ndnd` root, to sign their routing and status datasets. DV
explicitly loads this schema; the status server receives the same schema and
the public root certificate in PEM format through a separate read-only mount.
It has no access to router private keys. Changes to either status trust file
cause the renderer to restart the status server.
The same compiled schema is published at `/file-server/ndnd/dv-schema.tlv`
for clients.

The status server validates `/<router>/32=DV/32=STATUS` before including the
routing dataset. It does not fall back to an unrestricted schema. The local
DV summary remains available if the signed dataset cannot be validated; check
the status server logs and the report's routing state in that case.

The CA host requires the root `ca.key.pem` and `ca.cert.pem` in
`ndnd-root-ca-home/ndnd/`, owned by the service UID (root in the pinned images),
with the private key mode set to `0600`. The certificate must match the committed trust anchor;
the root services load these credentials directly. Master renders service
configuration and renews service certificates before marking itself ready,
using the same lifecycle as other testbed services. Cron performs subsequent
renewals and reloads. Root creation and replacement remain operator tasks.
NDNd-enabled sites set `VAR_NDND_ROOT_CA_SECRET` in `.env` for root enrollment;
NFD-only sites do not need that setting.

## NDNd Network Bridge

NDNd-enabled sites bridge the two forwarders locally over UDP. NFD sends `/ndnd`
Interests to NDNd through a capture route, excluding inherited root routes, and
advertises `/ndnd` through NLSR. NDNd installs a `/ndn` PET
next hop toward NFD and advertises it through DV. Producers still register on
the network matching their top-level prefix; the bridge does not redistribute
producer registrations or change application trust policies.

Each enabled host needs a unique, stable `ndnd_bier_index`. The forwarder loads
that index at startup, and `framework/ndnd-network-init.py` registers the same
router-to-index inventory on every node and rebuilds the BIFT. Both cron scripts
run this initializer after service updates. It binds announcements to permanent
UDP faces, restores entries after restarts, and reloads NDNd-connected producers
when their forwarder's or DV router's startup time changes. The NFD-connected repository and
Merkle service are outside that restart group.

NDNd uses the NLSR neighbor connections between enabled sites. DV2 assigns a
fixed cost of 1 per link; it does not use NLSR's configured link costs.

To reconcile a running node manually from its checkout:

```bash
docker compose exec -T -e PWD="$PWD" master python3 framework/ndnd-network-init.py
```

The bridge has static routes. An abrupt peer failure does not automatically
withdraw its gateway advertisement; alternative gateway advertisements alone do
not guarantee immediate failover. Gateway health tracking is not implemented here.
1 change: 1 addition & 0 deletions anchors/ndnd-root.base64
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BugHIwgEbmRuZAgDS0VZCAiErVznAwK56QgCTkE2CAAAAaFYpS5aFAkYAQIZBAA27oAVLDAqMAUGAytlcAMhAOi1L42QxRzGB/yMvduMM19dM3ukSmyubURXLZG9RvY1FkYbAQUcFwcVCARuZG5kCANLRVkICIStXOcDArnp/QD9Jv0A/g8yMDI2MTAyMFQwOTI5NDL9AP8PMjAyNzEwMjBUMDkyOTQyF0Aj+qOlJSdFN9wGXmnobfYLUmjqNikwnydWB6qUAmp1EGZN5d3q8kcQ5By/6B44uzeVau5TksFdwRZKoB7HtxwE
72 changes: 72 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ host_vars_path: host_vars

# This must match exactly with the docker-compose.yml file
services:
ndnd:
enabled_by: ndnd_enabled
profile: ndnd
template_path: templates/ndnd
render_path: dist/ndnd

ndnd-dv:
enabled_by: ndnd_enabled
profile: ndnd
template_path: templates/ndnd-dv
render_path: dist/ndnd-dv

ndnd-http-status-server:
enabled_by: ndnd_enabled
profile: ndnd
template_path: templates/ndnd-http-status-server
render_path: dist/ndnd-http-status-server

ndnd-pingserver:
enabled_by: ndnd_enabled
profile: ndnd
template_path: templates/ndnd-pingserver
render_path: dist/ndnd-pingserver

ndnd-site-ca:
enabled_by: ndnd_enabled
profile: ndnd-site-ca
template_path: templates/ndnd-site-ca
render_path: dist/ndnd-site-ca

ndnd-root-ca:
hosts: [UCLA]
enabled_by: ndnd_enabled
profile: ndnd-root-ca
template_path: templates/ndnd-root-ca
render_path: dist/ndnd-root-ca

ndnd-root-http-ca:
hosts: [UCLA]
enabled_by: ndnd_enabled
profile: ndnd-root-ca
template_path: templates/ndnd-root-http-ca
render_path: dist/ndnd-root-http-ca

caddy:
template_path: templates/caddy
render_path: dist/caddy
Expand Down Expand Up @@ -39,12 +83,25 @@ services:
template_path: templates/ndnd-repo
render_path: dist/ndnd-repo

ndnd-network-repo:
enabled_by: ndnd_enabled
profile: ndnd
template_path: templates/ndnd-network-repo
render_path: dist/ndnd-network-repo

ndnd-merkle:
hosts: [UCLA]
profile: merkle-log
template_path: templates/ndnd-merkle
render_path: dist/ndnd-merkle

ndnd-network-merkle:
hosts: [UCLA]
enabled_by: ndnd_enabled
profile: ndnd-merkle-log
template_path: templates/ndnd-network-merkle
render_path: dist/ndnd-network-merkle

ndncert:
template_path: templates/ndncert
render_path: dist/ndncert
Expand Down Expand Up @@ -74,6 +131,17 @@ globals:
# Explicitly select the active root; retain additional roots here during rollover.
ndnd_repo_anchors:
- anchors/ndn-testbed-root.ndncert.2204.base64
ndnd_udp_port: 6364
ndnd_dv_network: /ndnd
ndnd_ca_host: UCLA
ndnd_ca_info: "NDNd Testbed Root CA"
ndnd_ca_max_validity_period: "7776000"
ndnd_ca_max_suffix_length: "5"
ndnd_ca_supported_challenges: [email, dns]
ndnd_site_ca_supported_challenges: [email]
ndnd_root_http_ca_url: https://suns.cs.ucla.edu/ndnd-ca
ndnd_root_anchor_path: anchors/ndnd-root.base64
ndnd_root_http_ca_internal_url: http://ndnd-root-http-ca:8777

# Declare variables available for each host
# You can use lint.py to check variables, their types and
Expand All @@ -97,8 +165,12 @@ variables:
memsize: number
neighbors: dict
position: list
ndnd_ca_prefix: "?string"
hr_angle: number
hr_radius: number
ethernet_device: string
is_root_ca: "?boolean"
is_status_page: "?boolean"
ndnd_enabled: "?boolean"
ndnd_router_prefix: "?string"
ndnd_bier_index: "?number"
Loading