fwdp

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 26 Imported by: 0

README

ndn-dpdk/app/fwdp

This package implements the forwarder's data plane.

Input Thread (FwInput)

An FwInput thread runs an iface.RxLoop as its main loop ("RX" role), which reads and decodes packets from one or more network interfaces. Bursts of received L3 packets are processed by InputDemux3, configured to use the NDT for Interests and the PIT token for Data and Nacks.

Forwarding Thread (FwFwd)

An FwFwd thread runs the FwFwd_Run function as its main loop ("FWD" role). The main loop first performs some maintenance work:

  • Mark a URCU quiescent state, as required by the FIB.
  • Trigger the PIT timeout scheduler.

Then it reads packets from the input queues and handles each packet separately:

  • FwFwd_RxInterest function handles an incoming Interest.
  • FwFwd_RxData function handles an incoming Data.
  • FwFwd_RxNack function handles an incoming Nack.
Data Structure Usage

All FwFwd threads have read-only access to a shared FIB.

Each FwFwd has a private partition of PIT and CS. An outgoing Interest from a FwFwd must carry the identifier of this FwFwd as the first 8 bits of its PIT token, so that returning Data or Nack can be dispatched to the same FwFwd and thus use the same PIT-CS partition.

Congestion Control

Each FwFwd has three CoDel queues, one for each L3 packet type. They are backed by DPDK rings in multi-producer single-consumer mode. An FwInput thread enqueues packets to these queues; in case the DPDK ring is full, the packet is dropped. An FwFwd dequeues packets from these queues; if the CoDel algorithm indicates a packet should be dropped, FwFwd places a congestion mark on the packet but does not drop it. The ratio of dequeue burst size among the three queues determines the relative weight among L3 packet types; for example, dequeuing up to 48 Interests, 64 Data, and 64 Nacks would give Data/Nacks priority over Interests.

Note that congestion mark handling is currently incomplete. Some limitations are:

  • FwFwd can place a congestion mark only on the ingress side (e.g., to signal that the forwarder cannot sustain the current rate of incoming packets), not on the egress side (e.g., to signal link congestion).
  • FwFwd does not add or remove the congestion mark during Interest aggregation or Data caching.
  • FwFwd does not place a congestion mark on reply Data/Nack when Interest congestion occurs, although the producer could do so.
Per-Packet Logging

FwFwd uses the DEBUG log level for per-packet logging. Generally, a log line has several key-value pairs delimited by whitespace. Keys use "kebab-case". Common keys include:

  • "interest-from", "data-from", "nack-from": incoming FaceID in packet arrival.
  • "interest-to", "data-to", "nack-to": outgoing FaceID in packet transmission.
  • "npkt" (meaning "NDN packet"): memory address of a packet.
  • "dn-token": PIT token at the downstream node.
  • "up-token": PIT token assigned by this node, which is sent upstream.
  • "drop": reason for dropping a packet.
  • "pit-entry", "cs-entry": memory address of a table entry.
  • "pit-key": debug string of a PIT entry.
  • "sg-id": strategy identifier.
  • "sg-res": return value of a strategy invocation.
  • "helper": handing off to a helper.

Crypto Helper (FwCrypto)

FwCrypto provides implicit digest computation for Data packets. When an FwFwd processes an incoming Data packet and finds a PIT entry whose Interest carries an ImplicitSha256DigestComponent, it needs to know the Data's implicit digest in order to determine whether the Data satisfies the Interest. Instead of performing the digest computation synchronously, which would block the processing of other packets, the FwFwd passes the Data to FwCrypto. After the digest is computed, the Data packet goes back to FwFwd, which can then re-process it and use the computed digest to determine whether it satisfies the pending Interest.

An FwCrypto thread runs the FwCrypto_Run function as its main loop ("CRYPTO" role). It receives Data packets from FwFwd threads through a queue, and enqueues crypto operations toward a DPDK cryptodev. The cryptodev computes the SHA-256 digest of the packet and stores it in the mbuf header. The FwCrypto then dequeues the completed crypto operations from the cryptodev and re-dispatches the Data to FwFwd using an InputDemux that is configured to use the PIT token.

Documentation

Overview

Package fwdp implements the forwarder's data plane.

Index

Constants

This section is empty.

Variables

View Source
var (
	GqlInputNodeType   *gqlserver.NodeType
	GqlInputType       *graphql.Object
	GqlFwdCountersType *graphql.Object
	GqlFwdNodeType     *gqlserver.NodeType
	GqlFwdType         *graphql.Object
	GqlDataPlaneType   *graphql.Object
)

GraphQL types.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ndt      ndt.Config         `json:"ndt,omitempty"`
	Fib      fibdef.Config      `json:"fib,omitempty"`
	Pcct     pcct.Config        `json:"pcct,omitempty"`
	Suppress pit.SuppressConfig `json:"suppress,omitempty"`

	Crypto            CryptoConfig         `json:"crypto,omitempty"`
	FwdInterestQueue  iface.PktQueueConfig `json:"fwdInterestQueue,omitempty"`
	FwdDataQueue      iface.PktQueueConfig `json:"fwdDataQueue,omitempty"`
	FwdNackQueue      iface.PktQueueConfig `json:"fwdNackQueue,omitempty"`
	LatencySampleFreq *int                 `json:"latencySampleFreq,omitempty"` // latency sample frequency, between 0 and 30
}

Config contains data plane configuration.

type Crypto

type Crypto struct {
	ealthread.Thread
	// contains filtered or unexported fields
}

Crypto represents a crypto helper thread.

func (*Crypto) Close

func (fwc *Crypto) Close() error

Close stops the thread.

func (*Crypto) String

func (fwc *Crypto) String() string

type CryptoConfig

type CryptoConfig struct {
	InputCapacity  int `json:"inputCapacity,omitempty"`
	OpPoolCapacity int `json:"opPoolCapacity,omitempty"`
}

CryptoConfig contains crypto helper thread configuration.

type DataPlane

type DataPlane struct {
	// contains filtered or unexported fields
}

DataPlane represents the forwarder data plane.

var (
	// GqlDataPlane is the DataPlane instance accessible via GraphQL.
	GqlDataPlane *DataPlane
)

func New

func New(cfg Config) (dp *DataPlane, e error)

New creates and launches forwarder data plane.

func (*DataPlane) Close

func (dp *DataPlane) Close() error

Close stops the data plane and releases resources.

func (*DataPlane) Fib

func (dp *DataPlane) Fib() *fib.Fib

Fib returns the FIB.

func (*DataPlane) Fwds

func (dp *DataPlane) Fwds() []*Fwd

Fwds returns a list of forwarding threads.

func (*DataPlane) Ndt

func (dp *DataPlane) Ndt() *ndt.Ndt

Ndt returns the NDT.

type Fwd

type Fwd struct {
	ealthread.Thread
	// contains filtered or unexported fields
}

Fwd represents a forwarding thread.

func (*Fwd) Close

func (fwd *Fwd) Close() error

Close stops and releases the forwarding thread.

func (*Fwd) Cs

func (fwd *Fwd) Cs() *cs.Cs

Cs returns the CS.

func (*Fwd) Init

func (fwd *Fwd) Init(lc eal.LCore, pcctCfg pcct.Config, qcfgI, qcfgD, qcfgN iface.PktQueueConfig,
	latencySampleFreq int, suppressCfg pit.SuppressConfig) (e error)

Init initializes the forwarding thread. Excluding FIB.

func (*Fwd) NumaSocket

func (fwd *Fwd) NumaSocket() eal.NumaSocket

NumaSocket implements fib.LookupThread.

func (*Fwd) Pit

func (fwd *Fwd) Pit() *pit.Pit

Pit returns the PIT.

func (*Fwd) ReadCounters

func (fwd *Fwd) ReadCounters() (cnt FwdCounters)

ReadCounters retrieves forwarding thread counters.

func (*Fwd) SetFib

func (fwd *Fwd) SetFib(replica unsafe.Pointer, index int)

SetFib implements fib.LookupThread.

func (*Fwd) String

func (fwd *Fwd) String() string

type FwdCounters

type FwdCounters struct {
	NNoFibMatch   uint64 `json:"nNoFibMatch"`   // Interests dropped due to no FIB match
	NDupNonce     uint64 `json:"nDupNonce"`     // Interests dropped due to duplicate nonce
	NSgNoFwd      uint64 `json:"nSgNoFwd"`      // Interests not forwarded by strategy
	NNackMismatch uint64 `json:"nNackMismatch"` // Nacks dropped due to outdated nonce
	// contains filtered or unexported fields
}

FwdCounters contains forwarding thread counters.

type Input

type Input struct {
	// contains filtered or unexported fields
}

Input represents an input thread.

func (*Input) Close

func (fwi *Input) Close() error

Close stops the thread.

func (*Input) String

func (fwi *Input) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL