Module prefix_announce

Module prefix_announce 

Source
Expand description

Service record publisher and browser.

Implements the /ndn/local/sd/services/ naming convention for browsable prefix advertisement. Any producer can publish a thin TLV record at a well-known name; any consumer discovers available prefixes by expressing a prefix Interest for /ndn/local/sd/services/.

§Naming convention

/ndn/local/sd/services/<prefix-hash>/<node-name>/v=<timestamp-ms>
  • <prefix-hash> — first 8 hex bytes of the FNV-1a hash of the announced prefix in canonical URI form. Allows O(1) FIB lookup when many records are present.
  • <node-name> — the producer’s NDN name components (flattened into the hierarchical name).
  • v=<timestamp-ms> — version component using NDN naming conventions. Consumers express CanBePrefix=true to fetch the latest version.

§Content TLV

ServiceRecord ::= ANNOUNCED-PREFIX TLV
                  NODE-NAME TLV
                  FRESHNESS-MS TLV?
                  CAPABILITIES TLV?

TLV type assignments (within the 0xC0–0xFF experimental range):

TypeName
0xD0ANNOUNCED-PREFIX
0xD1SD-NODE-NAME
0xD2FRESHNESS-MS
0xD3SD-CAPABILITIES

The FRESHNESS-MS field is advisory: consumers that cache service records should re-fetch after this many milliseconds even if the CS has not expired the entry. It is separate from the NDN FreshnessPeriod in MetaInfo (which controls CS behaviour at the forwarder level).

Structs§

ServiceRecord
A service advertisement record.

Functions§

build_browse_interest
Build a prefix Interest for browsing.
make_record_name
Construct the full Data name for a service record.