Transport
Routing state, queued announcements, pending path requests and forwarding decisions in filament-transport.
filament-transport manages routing decisions and control-message state. Socket I/O lives in filament-interfaces. Constructing a routing object does not start a listener or connect these layers.
Routing state
RoutingTable::new() creates the table. PathEntry::new takes a destination, next hop, hop count, transport InterfaceId, and transport InterfaceMode. Table operations include insert, lookup, remove, expiry cleanup, and statistics. Exact routing declarations.
PathDiscovery::new and ForwardingEngine::new share an Arc<RoutingTable>. The forwarding constructor also requires an InterfaceMode.
A pending path request
The following uses the actual constructors and types. It creates local pending state; it does not transmit a packet, wait for a peer, or return a route. The supplied destination is a fixture. Source signatures were checked; the example was not executed in this documentation pass.
use std::sync::Arc;
use filament_transport::{
DestinationHash, ForwardingEngine, InterfaceMode, PathDiscovery, RoutingTable,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let routing = Arc::new(RoutingTable::new());
let discovery = PathDiscovery::new(Arc::clone(&routing));
let forwarder = ForwardingEngine::new(Arc::clone(&routing), InterfaceMode::Full);
let destination = DestinationHash::new([0u8; 16]);
let request = discovery.request_path(destination).await?;
assert_eq!(request.destination, destination);
assert_eq!(discovery.pending_count().await, 1);
assert_eq!(forwarder.interface_mode(), InterfaceMode::Full);
Ok(())
}A caller must transport the request. handle_request looks up a known route and may return a PathResponse; handle_response matches a pending request and updates the table. This manager does not authenticate the incoming response or bind a network socket. Validate peer/control-message authority in the integration layer before accepting route data. Path discovery reference.
Announcements
Announce::new accepts a destination hash, Ed25519 public-key bytes, optional application data, random blob and signature bytes. It does not derive an identity from a DID string or create a signature for the caller. process_announce does not verify that signature; an integration must authenticate an announcement before accepting it as trusted routing input.
Create AnnounceManager::new(bandwidth_cap) with an explicit fraction such as 0.02. process_announce(...).await performs queue/cache processing; queue_len().await exposes queue size. next_announce(interface_bitrate, elapsed).await returns an optional queued item according to the configured bandwidth allowance. The caller supplies timing/bitrate inputs and performs actual transmission. Announce reference.
Forwarding
ForwardingEngine::decide returns a decision from filament_transport::forwarding::ForwardingDecision: deliver, forward with a next hop/interface, or drop with a reason. HopInfo carries destination, hop limit and packet hash for loop tracking. Decisions are distinct from successful network sends. Forwarding reference.
Benchmark targets in older source comments are not current measured results. See the implementation boundaries for the state of the integrated runtime.