pub struct PacketDispatcher {Show 14 fields
pub face_table: Arc<FaceTable>,
pub face_states: Arc<DashMap<FaceId, FaceState>>,
pub rib: Arc<Rib>,
pub decode: TlvDecodeStage,
pub cs_lookup: CsLookupStage,
pub pit_check: PitCheckStage,
pub strategy: StrategyStage,
pub pit_match: PitMatchStage,
pub validation: ValidationStage,
pub cs_insert: CsInsertStage,
pub channel_cap: usize,
pub pipeline_threads: usize,
pub discovery: Arc<dyn DiscoveryProtocol>,
pub discovery_ctx: Arc<EngineDiscoveryContext>,
}Expand description
The packet dispatcher.
Spawns one Tokio task per face that reads packets from that face and sends
them to a shared mpsc channel. A single pipeline runner drains the
channel, performs the fast-path fragment sieve, and spawns per-packet tasks
for full pipeline processing across multiple cores.
The fragment sieve stays single-threaded (cheap DashMap entry, ~2 µs) while the expensive pipeline stages (decode, CS, PIT, strategy) run in parallel. All shared tables (PIT, FIB, CS, face table) are concurrent-safe, so parallel pipeline tasks are correct without additional synchronisation.
Fields§
§face_table: Arc<FaceTable>§face_states: Arc<DashMap<FaceId, FaceState>>§rib: Arc<Rib>§decode: TlvDecodeStage§cs_lookup: CsLookupStage§pit_check: PitCheckStage§strategy: StrategyStage§pit_match: PitMatchStage§validation: ValidationStage§cs_insert: CsInsertStage§channel_cap: usize§pipeline_threads: usizeResolved pipeline thread count (always ≥ 1).
discovery: Arc<dyn DiscoveryProtocol>Active discovery protocol — receives on_inbound calls before packets
enter the NDN forwarding pipeline.
discovery_ctx: Arc<EngineDiscoveryContext>Engine discovery context — passed to protocol hooks.