table

package
v0.0.0-...-d9b08a0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouteFlagChildInherit uint64 = 0x01
	RouteFlagCapture      uint64 = 0x02
)

Route flags.

View Source
const (
	RouteOriginApp       uint64 = 0
	RouteOriginStatic    uint64 = 255
	RouteOriginNLSR      uint64 = 128
	RouteOriginPrefixAnn uint64 = 129
	RouteOriginClient    uint64 = 65
	RouteOriginAutoreg   uint64 = 64
	RouteOriginAutoconf  uint64 = 66
)

Route origins.

Variables

View Source
var Measurements *measurements

Measurements contains the global measurements table,

View Source
var NetworkRegion *networkRegionTable

NetworkRegion contains producer region names for this forwarder..

Functions

func Configure

func Configure()

Configure configures the forwarding system.

func SetCsCapacity

func SetCsCapacity(capacity int)

SetCsCapacity sets the CS capacity from management.

Types

type CsEntry

type CsEntry struct {
	Data      *ndn.Data
	StaleTime time.Time
	// contains filtered or unexported fields
}

CsEntry is an entry in a thread's CS.

type CsLRU

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

CsLRU is a least recently used (LRU) replacement policy for the Content Store.

func NewCsLRU

func NewCsLRU(cs *PitCs) *CsLRU

NewCsLRU creates a new LRU replacement policy for the Content Store.

func (*CsLRU) AfterInsert

func (l *CsLRU) AfterInsert(index uint64, data *ndn.Data)

AfterInsert is called after a new entry is inserted into the Content Store.

func (*CsLRU) AfterRefresh

func (l *CsLRU) AfterRefresh(index uint64, data *ndn.Data)

AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.

func (*CsLRU) BeforeErase

func (l *CsLRU) BeforeErase(index uint64, data *ndn.Data)

BeforeErase is called before an entry is erased from the Content Store through management.

func (*CsLRU) BeforeUse

func (l *CsLRU) BeforeUse(index uint64, data *ndn.Data)

BeforeUse is called before an entry in the Content Store is used to satisfy a pending Interest.

func (*CsLRU) EvictEntries

func (l *CsLRU) EvictEntries()

EvictEntries is called to instruct the policy to evict enough entries to reduce the Content Store size below its size limit.

type CsReplacementPolicy

type CsReplacementPolicy interface {
	// AfterInsert is called after a new entry is inserted into the Content Store.
	AfterInsert(index uint64, data *ndn.Data)

	// AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.
	AfterRefresh(index uint64, data *ndn.Data)

	// BeforeErase is called before an entry is erased from the Content Store through management.
	BeforeErase(index uint64, data *ndn.Data)

	// BeforeUse is called before an entry in the Content Store is used to satisfy a pending Interest.
	BeforeUse(index uint64, data *ndn.Data)

	// EvictEntries is called to instruct the policy to evict enough entries to reduce the Content Store size below its size limit.
	EvictEntries()
}

CsReplacementPolicy represents a cache replacement policy for the Content Store.

type DeadNonceList

type DeadNonceList struct {
	ExpirationTimer chan bool
	// contains filtered or unexported fields
}

DeadNonceList represents the Dead Nonce List for a forwarding thread.

func NewDeadNonceList

func NewDeadNonceList() *DeadNonceList

NewDeadNonceList creates a new Dead Nonce List for a forwarding thread.

func (*DeadNonceList) Find

func (d *DeadNonceList) Find(name *ndn.Name, nonce []byte) bool

Find returns whether the specified name and nonce combination are present in the Dead Nonce List.

func (*DeadNonceList) Insert

func (d *DeadNonceList) Insert(name *ndn.Name, nonce []byte) bool

Insert inserts an entry in the Dead Nonce List with the specified name and nonce. Returns whether nonce already present.

func (*DeadNonceList) RemoveExpiredEntry

func (d *DeadNonceList) RemoveExpiredEntry()

RemoveExpiredEntry removes the front entry from Dead Nonce List.

type FibNextHopEntry

type FibNextHopEntry struct {
	Nexthop uint64
	Cost    uint64
}

FibNextHopEntry represents a nexthop in a FIB entry.

type FibStrategyEntry

type FibStrategyEntry struct {
	Name *ndn.Name
	// contains filtered or unexported fields
}

FibStrategyEntry represents an entry in the FIB-Strategy table.

var FibStrategyTable *FibStrategyEntry

FibStrategyTable is a table containing FIB and Strategy entries for given prefixes.

func (*FibStrategyEntry) AddNexthop

func (f *FibStrategyEntry) AddNexthop(name *ndn.Name, nexthop uint64, cost uint64)

AddNexthop adds or updates a nexthop entry for the specified prefix.

func (*FibStrategyEntry) ClearNexthops

func (f *FibStrategyEntry) ClearNexthops(name *ndn.Name)

ClearNexthops clears all nexthops for the specified prefix.

func (*FibStrategyEntry) GetAllFIBEntries

func (f *FibStrategyEntry) GetAllFIBEntries() []*FibStrategyEntry

GetAllFIBEntries returns all nexthop entries in the FIB.

func (*FibStrategyEntry) GetAllStrategyChoices

func (f *FibStrategyEntry) GetAllStrategyChoices() []*FibStrategyEntry

GetAllStrategyChoices returns all strategy choice entries in the Strategy Table.

func (*FibStrategyEntry) GetNexthops

func (f *FibStrategyEntry) GetNexthops() []*FibNextHopEntry

GetNexthops gets nexthops in the specified entry.

func (*FibStrategyEntry) GetStrategy

func (f *FibStrategyEntry) GetStrategy() *ndn.Name

GetStrategy gets the strategy set at the current node.

func (*FibStrategyEntry) LongestPrefixNexthops

func (f *FibStrategyEntry) LongestPrefixNexthops(name *ndn.Name) []*FibNextHopEntry

LongestPrefixNexthops returns the longest-prefix matching nexthop(s) matching the specified name.

func (*FibStrategyEntry) LongestPrefixStrategy

func (f *FibStrategyEntry) LongestPrefixStrategy(name *ndn.Name) *ndn.Name

LongestPrefixStrategy returns the longest-prefix matching strategy choice entry for the specified name.

func (*FibStrategyEntry) RemoveNexthop

func (f *FibStrategyEntry) RemoveNexthop(name *ndn.Name, nexthop uint64)

RemoveNexthop removes the specified nexthop entry from the specified prefix.

func (*FibStrategyEntry) SetStrategy

func (f *FibStrategyEntry) SetStrategy(name *ndn.Name, strategy *ndn.Name)

SetStrategy sets the strategy for the specified prefix.

func (*FibStrategyEntry) UnsetStrategy

func (f *FibStrategyEntry) UnsetStrategy(name *ndn.Name)

UnsetStrategy unsets the strategy for the specified prefix.

type PitCs

type PitCs struct {
	ExpiringPitEntries chan *PitEntry
	// contains filtered or unexported fields
}

PitCs represents the PIT-CS tree for a thread.

func NewPitCS

func NewPitCS() *PitCs

NewPitCS creates a new combined PIT-CS for a forwarding thread.

func (*PitCs) CsSize

func (p *PitCs) CsSize() int

CsSize returns the number of entries in the CS.

func (*PitCs) FindMatchingDataCS

func (p *PitCs) FindMatchingDataCS(interest *ndn.Interest) *CsEntry

FindMatchingDataCS finds the best matching entry in the CS (if any). If MustBeFresh is set to true in the Interest, only non-stale CS entries will be returned.

func (*PitCs) FindOrInsertPIT

func (p *PitCs) FindOrInsertPIT(interest *ndn.Interest, hint *ndn.Delegation, inFace uint64) (*PitEntry, bool)

FindOrInsertPIT inserts an entry in the PIT upon receipt of an Interest. Returns tuple of PIT entry and whether the Nonce is a duplicate.

func (*PitCs) FindPITFromData

func (p *PitCs) FindPITFromData(data *ndn.Data, token *uint32) []*PitEntry

FindPITFromData finds the PIT entries matching a Data packet. Note that this does not consider the effect of MustBeFresh.

func (*PitCs) InsertDataCS

func (p *PitCs) InsertDataCS(data *ndn.Data)

InsertDataCS inserts a Data packet into the Content Store.

func (*PitCs) IsCsAdmitting

func (p *PitCs) IsCsAdmitting() bool

IsCsAdmitting returns whether the CS is admitting contents.

func (*PitCs) IsCsServing

func (p *PitCs) IsCsServing() bool

IsCsServing returns whether the CS is serving contents.

func (*PitCs) PitSize

func (p *PitCs) PitSize() int

PitSize returns the number of entries in the PIT.

func (*PitCs) RemovePITEntry

func (p *PitCs) RemovePITEntry(pitEntry *PitEntry) bool

RemovePITEntry removes the specified PIT entry.

type PitCsNode

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

PitCsNode represents an entry in a PIT-CS tree.

type PitEntry

type PitEntry struct {
	Name           *ndn.Name
	CanBePrefix    bool
	MustBeFresh    bool
	ForwardingHint *ndn.Delegation          // Interests must match in terms of Forwarding Hint to be aggregated in PIT.
	InRecords      map[uint64]*PitInRecord  // Key is face ID
	OutRecords     map[uint64]*PitOutRecord // Key is face ID
	ExpirationTime time.Time
	Satisfied      bool

	Token uint32
	// contains filtered or unexported fields
}

PitEntry is an entry in a thread's PIT.

func (*PitEntry) ClearInRecords

func (e *PitEntry) ClearInRecords()

ClearInRecords removes all in-records from the PIT entry.

func (*PitEntry) ClearOutRecords

func (e *PitEntry) ClearOutRecords()

ClearOutRecords removes all out-records from the PIT entry.

func (*PitEntry) FindOrInsertInRecord

func (e *PitEntry) FindOrInsertInRecord(interest *ndn.Interest, face uint64, incomingPitToken []byte) (*PitInRecord, bool)

FindOrInsertInRecord finds or inserts an InRecord for the face, updating the metadata and returning whether there was already an in-record in the entry.

func (*PitEntry) FindOrInsertOutRecord

func (e *PitEntry) FindOrInsertOutRecord(interest *ndn.Interest, face uint64) *PitOutRecord

FindOrInsertOutRecord finds or inserts an OutRecord for the face, updating the metadata.

func (*PitEntry) SetExpirationTimerToNow

func (e *PitEntry) SetExpirationTimerToNow()

SetExpirationTimerToNow updates the expiration timer to the current time.

func (*PitEntry) UpdateExpirationTimer

func (e *PitEntry) UpdateExpirationTimer()

UpdateExpirationTimer updates the expiration timer to the latest expiration time of any in or out record in the entry.

type PitInRecord

type PitInRecord struct {
	Face            uint64
	LatestNonce     []byte
	LatestTimestamp time.Time
	LatestInterest  *ndn.Interest
	ExpirationTime  time.Time
	PitToken        []byte
}

PitInRecord records an incoming Interest on a given face.

type PitOutRecord

type PitOutRecord struct {
	Face            uint64
	LatestNonce     []byte
	LatestTimestamp time.Time
	LatestInterest  *ndn.Interest
	ExpirationTime  time.Time
}

PitOutRecord records an outgoing Interest on a given face.

type RibEntry

type RibEntry struct {
	Name *ndn.Name
	// contains filtered or unexported fields
}

RibEntry represents an entry in the RIB table.

var Rib *RibEntry

Rib is a table containing the RIB.

func (*RibEntry) AddRoute

func (r *RibEntry) AddRoute(name *ndn.Name, faceID uint64, origin uint64, cost uint64, flags uint64, expirationPeriod *time.Duration)

AddRoute adds or updates a RIB entry for the specified prefix.

func (*RibEntry) GetAllEntries

func (r *RibEntry) GetAllEntries() []*RibEntry

GetAllEntries returns all routes in the FIB.

func (*RibEntry) GetRoutes

func (r *RibEntry) GetRoutes() []*Route

GetRoutes returns all routes in the RIB entry.

func (*RibEntry) RemoveRoute

func (r *RibEntry) RemoveRoute(name *ndn.Name, faceID uint64, origin uint64)

RemoveRoute removes the specified route from the specified prefix.

type Route

type Route struct {
	FaceID           uint64
	Origin           uint64
	Cost             uint64
	Flags            uint64
	ExpirationPeriod *time.Duration
}

Route represents a route in a RIB entry.

Jump to

Keyboard shortcuts

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