Module hello

Module hello 

Source
Expand description

SWIM/Hello neighbor discovery protocol family.

This module contains the shared hello protocol state machine and its link-medium implementations.

§Module layout

Sub-moduleContents
payloadHelloPayload TLV codec — the wire format for hello Data Content
mediumLinkMedium trait — link-specific face creation, signing, address extraction
protocolHelloProtocol<T> — generic SWIM/hello/probe state machine
udpUdpNeighborDiscovery — UDP multicast neighbor discovery (requires udp-hello feature)
probeSWIM direct/indirect probe packet builders and parsers

To support a new link type (e.g. Ethernet, Bluetooth, LoRa):

  1. Create a new file in this module (e.g. ether.rs).
  2. Implement medium::LinkMedium for your medium struct — this provides link-specific face creation, hello Data signing, and address extraction.
  3. Define a type alias: pub type EtherNeighborDiscovery = HelloProtocol<YourMedium>;
  4. Re-export it from this mod.rs and from the crate root (lib.rs).

The generic protocol::HelloProtocol<T> handles all the shared logic: hello scheduling, SWIM probes, neighbor lifecycle, gossip diffs. Your medium only implements the link-specific parts.

Re-exports§

pub use medium::HELLO_PREFIX_DEPTH;
pub use medium::HELLO_PREFIX_STR;
pub use medium::HelloCore;
pub use medium::HelloState;
pub use medium::LinkMedium;
pub use payload::CAP_CONTENT_STORE;
pub use payload::CAP_FRAGMENTATION;
pub use payload::CAP_SVS;
pub use payload::CAP_VALIDATION;
pub use payload::DiffEntry;
pub use payload::HelloPayload;
pub use payload::NeighborDiff;
pub use payload::T_ADD_ENTRY;
pub use payload::T_CAPABILITIES;
pub use payload::T_NEIGHBOR_DIFF;
pub use payload::T_NODE_NAME;
pub use payload::T_PUBLIC_KEY;
pub use payload::T_REMOVE_ENTRY;
pub use payload::T_SERVED_PREFIX;
pub use payload::T_UNICAST_PORT;
pub use probe::DirectProbe;
pub use probe::IndirectProbe;
pub use probe::build_direct_probe;
pub use probe::build_indirect_probe;
pub use probe::build_indirect_probe_encoded;
pub use probe::build_probe_ack;
pub use probe::is_probe_ack;
pub use probe::parse_direct_probe;
pub use probe::parse_indirect_probe;
pub use protocol::HelloProtocol;
pub use udp::UdpNeighborDiscovery;

Modules§

ether
EtherNeighborDiscovery — NDN neighbor discovery over raw Ethernet.
medium
LinkMedium trait — abstraction over link-layer differences for discovery.
payload
HelloPayload — NDN neighbor discovery hello packet TLV codec.
probe
SWIM direct and indirect liveness probe packets.
protocol
HelloProtocol<T> — generic SWIM/hello/probe discovery state machine.
udp
UdpNeighborDiscovery — cross-platform NDN neighbor discovery over UDP.