Module service_discovery

Module service_discovery 

Source
Expand description

ServiceDiscoveryProtocol/ndn/local/sd/services/ and /ndn/local/nd/peers.

This protocol implementation handles two closely related discovery functions:

§1. Service record publication and browsing

Producers call ServiceDiscoveryProtocol::publish to register a ServiceRecord. The protocol responds to incoming browse Interests (/ndn/local/sd/services/ with CanBePrefix) with Data packets for each locally registered record.

When an incoming service record Data arrives from a peer, the protocol optionally auto-populates the FIB using the announced prefix (governed by ServiceDiscoveryConfig::auto_populate_fib and related fields).

§2. Demand-driven peer list (/ndn/local/nd/peers)

Any node can express an Interest for /ndn/local/nd/peers to get a snapshot of the current neighbor table. The protocol responds with a Data whose Content is a compact TLV list of neighbor names.

§Wire format — Peers response

PeerList ::= (PEER-ENTRY TLV)*
PEER-ENTRY  ::= 0xE0 length Name

Structs§

ServiceDiscoveryProtocol
Service discovery and peer-list protocol.

Functions§

decode_peer_list
Decode a PeerList Data Content into a Vec<Name>.