pit

package
v0.0.0-...-1e60831 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 16 Imported by: 0

README

ndn-dpdk/container/pit

This package implements the Pending Interest Table (PIT).

Structure

The PIT is part of the PIT-CS Composite Table (PCCT). The PCCT provides the underlying storage and lookup functions for the PIT.

The PIT token is actually the 48-bit token identifying a PCC entry. The PIT automatically adds and removes this token upon inserting and deleting PIT entries on a PCC entry. Since each PCC entry can contain up to two PIT entries (one for MustBeFresh=0 and one for MustBeFresh=1), the same token identifies both PIT entries.

PIT Entry

Each PIT entry can contain many PIT downstream records (PitDn type) and PIT upstream records (PitUp type). The PitEntry type directly stores a small number of PitDn and PitUp. If more downstream/upstream records are required, the PIT extends the PitEntry with additional DN and UP slots using a PitEntryExt allocated from the PCCT's mempool.

A PIT entry also contains:

  • a representative Interest
  • a timer
  • several other fields aggregated from downstream and upstream records
  • a "FIB reference" that allows efficient access to the associated FIB entry (PitEntry_FindFibEntry)

Documentation

Overview

Package pit implements the Pending Interest Table.

Index

Constants

This section is empty.

Variables

View Source
var GqlCountersType = graphql.NewObject(graphql.ObjectConfig{
	Name:   "PitCounters",
	Fields: gqlserver.BindFields[Counters](nil),
})

GqlCountersType is the GraphQL type for Counters.

Functions

This section is empty.

Types

type Counters

type Counters struct {
	NEntries  uint64 `json:"nEntries" gqldesc:"Current number of entries." subtract:"-"`
	NInsert   uint64 `json:"nInsert" gqldesc:"Insertions that created a new PIT entry."`
	NFound    uint64 `json:"nFound" gqldesc:"Insertions that found an existing PIT entry."`
	NAllocErr uint64 `json:"nAllocErr" gqldesc:"Insertions that failed due to allocation error."`
	NDataHit  uint64 `json:"nDataHit" gqldesc:"Lookup-by-Data operations that found PIT entry/entries."`
	NDataMiss uint64 `json:"nDataMiss" gqldesc:"Lookup-by-Data operations that did not find PIT entry."`
	NNackHit  uint64 `json:"nNackHit" gqldesc:"Lookup-by-Nack operations that found PIT entry."`
	NNackMiss uint64 `json:"nNackMiss" gqldesc:"Lookup-by-Nack operations that did not found PIT entry."`
	NExpired  uint64 `json:"nExpired" gqldesc:"Entries expired."`
}

Counters contains PIT counters.

type DnRecord

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

DnRecord represents a PIT downstream record.

func (DnRecord) Expiry

func (dn DnRecord) Expiry() eal.TscTime

Expiry returns a timestamp when this record expires.

func (DnRecord) FaceID

func (dn DnRecord) FaceID() iface.ID

FaceID returns the face ID.

func (DnRecord) Nonce

func (dn DnRecord) Nonce() ndn.Nonce

Nonce returns the last received Nonce.

func (DnRecord) PitToken

func (dn DnRecord) PitToken() (token []byte)

PitToken returns the last received PIT token.

type Entry

type Entry C.PitEntry

Entry represents a PIT entry.

func EntryFromPtr

func EntryFromPtr(ptr unsafe.Pointer) *Entry

EntryFromPtr converts *C.PitEntry to Entry.

func (*Entry) DnRecords

func (entry *Entry) DnRecords() (list []DnRecord)

DnRecords returns downstream records.

func (*Entry) FibSeqNum

func (entry *Entry) FibSeqNum() uint32

FibSeqNum returns the FIB insertion sequence number recorded in this entry.

func (*Entry) InsertDnRecord

func (entry *Entry) InsertDnRecord(interest *ndni.Packet) *DnRecord

InsertDnRecord inserts new downstream record, or update existing downstream record.

func (*Entry) PitToken

func (entry *Entry) PitToken() uint64

PitToken returns the PIT token assigned to this entry.

func (*Entry) Ptr

func (entry *Entry) Ptr() unsafe.Pointer

Ptr returns *C.PitEntry pointer.

func (*Entry) UpRecords

func (entry *Entry) UpRecords() (list []UpRecord)

UpRecords returns upstream records.

type FindResult

type FindResult C.PitFindResult

FindResult represents the result of Pit.FindByData.

func (FindResult) CopyToCPitFindResult

func (fr FindResult) CopyToCPitFindResult(ptr unsafe.Pointer)

CopyToCPitFindResult copies this result to *C.PitFindResult.

func (FindResult) ListEntries

func (fr FindResult) ListEntries() (entries []*Entry)

ListEntries returns matched PIT entries.

func (FindResult) NeedDataDigest

func (fr FindResult) NeedDataDigest() bool

NeedDataDigest returns true if the result indicates that Data digest computation is needed.

type Pit

type Pit C.Pit

Pit represents a Pending Interest Table (PIT).

func FromPcct

func FromPcct(pcct *pcct.Pcct) *Pit

FromPcct converts Pcct to Pit.

func (*Pit) Counters

func (pit *Pit) Counters() (cnt Counters)

Counters reads counters from this PIT.

func (*Pit) Erase

func (pit *Pit) Erase(entry *Entry)

Erase erases a PIT entry.

func (*Pit) FindByData

func (pit *Pit) FindByData(data *ndni.Packet, token uint64) FindResult

FindByData searches for PIT entries matching a Data.

func (*Pit) FindByNack

func (pit *Pit) FindByNack(nack *ndni.Packet, token uint64) *Entry

FindByNack searches for PIT entries matching a Nack.

func (*Pit) Insert

func (pit *Pit) Insert(interest *ndni.Packet, fibEntry *fibreplica.Entry) (pitEntry *Entry, csEntry *cs.Entry)

Insert attempts to insert a PIT entry for the given Interest. It returns either a new or existing PIT entry, or a CS entry that satisfies the Interest.

func (*Pit) Len

func (pit *Pit) Len() int

Len returns number of PIT entries.

func (*Pit) TriggerTimeoutSched

func (pit *Pit) TriggerTimeoutSched()

TriggerTimeoutSched triggers the internal timeout scheduler.

type SuppressConfig

type SuppressConfig struct {
	Min        nnduration.Nanoseconds `json:"min,omitempty"`
	Max        nnduration.Nanoseconds `json:"max,omitempty"`
	Multiplier float64                `json:"multiplier,omitempty"`
}

SuppressConfig contains PIT suppression configuration.

func (SuppressConfig) CopyToC

func (sc SuppressConfig) CopyToC(ptr unsafe.Pointer)

CopyToC copies this configuration to *C.PitSuppressConfig.

type UpRecord

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

UpRecord represents a PIT upstream record.

func (UpRecord) FaceID

func (up UpRecord) FaceID() iface.ID

FaceID returns the face ID.

Jump to

Keyboard shortcuts

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