PacketDispatcher

Struct PacketDispatcher 

Source
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: usize

Resolved 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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more