Rust implementations of the Named Data Networking (NDN) protocol stack, published as a set of layered crates.
Named Data Networking is an information-centric networking architecture: instead of addressing hosts, consumers request content by name, and any node holding a validly signed copy of that content can answer. These crates implement NDN's wire format and packet types, so applications can speak NDN without hand-rolling the protocol themselves.
The stack is layered bottom-up -- each crate depends only on the ones below it, and each is usable on its own.
ndn-tlv-- Provides abstractions for working with TLV-encoded data, the binary format every NDN packet is built from.ndn-tlv-derive-- TheTlvderive macrondn-tlvuses to implement itsTlvEncode,TlvDecode, andTlvtraits for structs and enums.ndn-protocol-- Implements the core NDN packet types -- names, Interests, Data, and signatures -- on top ofndn-tlv.ndn-ndnlp-- A partial implementation of NDNLPv2, the link-layer protocol NDN packets are framed in before being sent over a transport.ndn-nfd-mgmt-- A partial implementation of the NFD Management protocol, used to send control commands -- like registering a route -- to a locally running NFD forwarder.ndn-app-- An application framework for building NDN applications in Rust, on top ofndn-ndnlp,ndn-nfd-mgmt, andndn-protocol.
ndn-ndnlp and ndn-nfd-mgmt only implement as much of their respective protocols as ndn-app needs -- they are not complete implementations of NDNLPv2 or the NFD management protocol.
Most applications only need ndn-app:
cargo add ndn-app
See its README for a worked example. If you only need packet encoding and decoding without the application framework, ndn-tlv or ndn-protocol may be enough on their own.
Each crate lives in its own repository rather than a monorepo, but they depend on each other during development via relative path dependencies in their Cargo.toml (e.g. ndn-protocol depends on ../ndn-tlv). To build one of these crates from its git repository rather than from crates.io, clone the crates it depends on as sibling directories with names matching the crate names:
some-directory/
├── ndn-tlv/
├── ndn-tlv-derive/
├── ndn-protocol/
├── ndn-ndnlp/
├── ndn-nfd-mgmt/
└── ndn-app/
ndn-app depends, directly or transitively, on all of the others, so building it from source needs all six repositories present. Building a lower-level crate like ndn-tlv on its own only needs ndn-tlv-derive alongside it.
This only matters when building from the git repositories directly -- adding one of these crates with cargo add pulls the published version from crates.io and doesn't require anything to be cloned locally.
MIT
Produced as part of a Master's thesis in Computer Science.