Documentation
¶
Index ¶
- Variables
- func AddReadvertiser(r RibReadvertise)
- func At(n enc.Name, index int) enc.Component
- func CfgCsAdmit() bool
- func CfgCsCapacity() int
- func CfgCsReplacementPolicy() string
- func CfgCsServe() bool
- func CfgDeadNonceListLifetime() time.Duration
- func CfgSetCsAdmit(admit bool)
- func CfgSetCsCapacity(capacity int)
- func CfgSetCsServe(serve bool)
- func Initialize()
- func UpdateExpirationTimer(e PitEntry, t time.Time)
- type CsEntry
- type CsLRU
- type CsReplacementPolicy
- type DeadNonceList
- type FibNextHopEntry
- type FibStrategy
- type FibStrategyEntry
- type FibStrategyHashTable
- func (f *FibStrategyHashTable) ClearNextHopsEnc(name enc.Name)
- func (f *FibStrategyHashTable) FindNextHopsEnc(name enc.Name) []*FibNextHopEntry
- func (f *FibStrategyHashTable) FindStrategyEnc(name enc.Name) enc.Name
- func (f *FibStrategyHashTable) GetAllFIBEntries() []FibStrategyEntry
- func (f *FibStrategyHashTable) GetAllForwardingStrategies() []FibStrategyEntry
- func (f *FibStrategyHashTable) GetNumFIBEntries() int
- func (f *FibStrategyHashTable) InsertNextHopEnc(name enc.Name, nexthop uint64, cost uint64)
- func (f *FibStrategyHashTable) RemoveNextHopEnc(name enc.Name, nexthop uint64)
- func (f *FibStrategyHashTable) SetStrategyEnc(name enc.Name, strategy enc.Name)
- func (f *FibStrategyHashTable) UnSetStrategyEnc(name enc.Name)
- type FibStrategyTree
- func (f *FibStrategyTree) ClearNextHopsEnc(name enc.Name)
- func (f *FibStrategyTree) FindNextHopsEnc(name enc.Name) []*FibNextHopEntry
- func (f *FibStrategyTree) FindStrategyEnc(name enc.Name) enc.Name
- func (f *FibStrategyTree) GetAllFIBEntries() []FibStrategyEntry
- func (f *FibStrategyTree) GetAllForwardingStrategies() []FibStrategyEntry
- func (f *FibStrategyTree) GetNumFIBEntries() int
- func (f *FibStrategyTree) InsertNextHopEnc(name enc.Name, nexthop uint64, cost uint64)
- func (f *FibStrategyTree) RemoveNextHopEnc(name enc.Name, nexthop uint64)
- func (f *FibStrategyTree) SetStrategyEnc(name enc.Name, strategy enc.Name)
- func (f *FibStrategyTree) UnSetStrategyEnc(name enc.Name)
- type OnPitExpiration
- type PitCsPoolsT
- type PitCsTable
- type PitCsTree
- func (p *PitCsTree) CsSize() int
- func (p *PitCsTree) FindInterestExactMatchEnc(interest *defn.FwInterest) PitEntry
- func (p *PitCsTree) FindInterestPrefixMatchByDataEnc(data *defn.FwData, token *uint32) []PitEntry
- func (p *PitCsTree) FindMatchingDataFromCS(interest *defn.FwInterest) CsEntry
- func (p *PitCsTree) InsertData(data *defn.FwData, wire []byte)
- func (p *PitCsTree) InsertInterest(interest *defn.FwInterest, hint enc.Name, inFace uint64) (PitEntry, bool)
- func (p *PitCsTree) IsCsAdmitting() bool
- func (p *PitCsTree) IsCsServing() bool
- func (p *PitCsTree) PitSize() int
- func (p *PitCsTree) RemoveInterest(pitEntry PitEntry) bool
- func (p *PitCsTree) Update()
- func (p *PitCsTree) UpdateTicker() <-chan time.Time
- type PitEntry
- type PitInRecord
- type PitOutRecord
- type RibEntry
- type RibReadvertise
- type RibTable
- type Route
Constants ¶
This section is empty.
Variables ¶
var NetworkRegion = &networkRegionTable{}
NetworkRegion contains producer region names for this forwarder..
var PitCsPools = &PitCsPoolsT{ PitInRecord: sync_pool.New( func() *PitInRecord { return &PitInRecord{} }, func(obj *PitInRecord) { obj.PitToken = make([]byte, 0, 8) }, ), PitOutRecord: sync_pool.New( func() *PitOutRecord { return &PitOutRecord{} }, func(obj *PitOutRecord) {}, ), NameTreePitEntry: sync_pool.New( func() *nameTreePitEntry { entry := &nameTreePitEntry{} entry.inRecords = make(map[uint64]*PitInRecord) entry.outRecords = make(map[uint64]*PitOutRecord) return entry }, func(obj *nameTreePitEntry) { clear(obj.inRecords) clear(obj.outRecords) }, ), PitCsTreeNode: sync_pool.New( func() *pitCsTreeNode { return &pitCsTreeNode{ children: make(map[uint64]*pitCsTreeNode), pitEntries: make([]*nameTreePitEntry, 0, 4), } }, func(obj *pitCsTreeNode) { clear(obj.children) obj.name = nil obj.pitEntries = obj.pitEntries[:0] obj.csEntry = nil }, ), }
var Rib = RibTable{ // contains filtered or unexported fields }
Rib is the Routing Information Base.
Functions ¶
func AddReadvertiser ¶
func AddReadvertiser(r RibReadvertise)
(AI GENERATED DESCRIPTION): Adds the supplied RibReadvertise instance to the global list of readvertisers.
func At ¶
(AI GENERATED DESCRIPTION): Returns the component at the specified index of the name (negative indices count from the end) or an empty component if the index is out of bounds.
func CfgCsAdmit ¶ added in v1.4.3
func CfgCsAdmit() bool
CfgCsAdmit returns whether contents will be admitted to the Content Store.
func CfgCsCapacity ¶ added in v1.4.3
func CfgCsCapacity() int
CfgCsCapacity returns the capacity of each forwarding thread's Content Store.
func CfgCsReplacementPolicy ¶ added in v1.4.3
func CfgCsReplacementPolicy() string
CfgCsReplacementPolicy returns the replacement policy used by Content Stores in the forwarder.
func CfgCsServe ¶ added in v1.4.3
func CfgCsServe() bool
CfgCsServe returns whether contents will be served from the Content Store.
func CfgDeadNonceListLifetime ¶ added in v1.4.3
CfgDeadNonceListLifetime returns the lifetime of entries in the dead nonce list.
func CfgSetCsAdmit ¶ added in v1.4.3
func CfgSetCsAdmit(admit bool)
CfgSetCsAdmit sets whether contents will be admitted to the Content Store.
func CfgSetCsCapacity ¶ added in v1.4.3
func CfgSetCsCapacity(capacity int)
CfgSetCsCapacity sets the capacity of each forwarding thread's Content Store.
func CfgSetCsServe ¶ added in v1.4.3
func CfgSetCsServe(serve bool)
CfgSetCsServe sets whether contents will be served from the Content Store.
func UpdateExpirationTimer ¶
UpdateExpirationTimer sets the expiration time of the PIT entry.
Types ¶
type CsEntry ¶
type CsEntry interface {
Index() uint64 // the hash of the entry, for fast lookup
StaleTime() time.Time
Copy() (*defn.FwData, []byte, error)
}
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 PitCsTable) *CsLRU
NewCsLRU creates a new LRU replacement policy for the Content Store.
func (*CsLRU) AfterInsert ¶
AfterInsert is called after a new entry is inserted into the Content Store.
func (*CsLRU) AfterRefresh ¶
AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.
func (*CsLRU) BeforeErase ¶
BeforeErase is called before an entry is erased from the Content Store through management.
func (*CsLRU) BeforeUse ¶
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, wire []byte, data *defn.FwData)
// AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.
AfterRefresh(index uint64, wire []byte, data *defn.FwData)
// BeforeErase is called before an entry is erased from the Content Store through management.
BeforeErase(index uint64, wire []byte)
// BeforeUse is called before an entry in the Content Store is used to satisfy a pending Interest.
BeforeUse(index uint64, wire []byte)
// 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 ¶
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 enc.Name, nonce uint32) 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 enc.Name, nonce uint32) bool
Insert inserts an entry in the Dead Nonce List with the specified name and nonce. Returns whether nonce already present.
func (*DeadNonceList) RemoveExpiredEntries ¶
func (d *DeadNonceList) RemoveExpiredEntries()
RemoveExpiredEntry removes all expired entries from Dead Nonce List.
type FibNextHopEntry ¶
FibNextHopEntry represents a nexthop in a FIB entry.
type FibStrategy ¶
type FibStrategy interface {
FindNextHopsEnc(name enc.Name) []*FibNextHopEntry
FindStrategyEnc(name enc.Name) enc.Name
InsertNextHopEnc(name enc.Name, nextHop uint64, cost uint64)
ClearNextHopsEnc(name enc.Name)
RemoveNextHopEnc(name enc.Name, nextHop uint64)
GetNumFIBEntries() int
GetAllFIBEntries() []FibStrategyEntry
SetStrategyEnc(name enc.Name, strategy enc.Name)
UnSetStrategyEnc(name enc.Name)
GetAllForwardingStrategies() []FibStrategyEntry
}
FibStrategy represents the functionality that a FIB-strategy table should implement.
var FibStrategyTable FibStrategy
FibStrategy is a table containing FIB and Strategy entries for given prefixes.
type FibStrategyEntry ¶
type FibStrategyEntry interface {
Name() enc.Name
GetStrategy() enc.Name
GetNextHops() []*FibNextHopEntry
}
FibStrategyEntry represents an entry in the FIB-Strategy table.
type FibStrategyHashTable ¶
type FibStrategyHashTable struct {
// contains filtered or unexported fields
}
FibStrategyHashTable represents a tree implementation of the FIB-Strategy table.
func (*FibStrategyHashTable) ClearNextHopsEnc ¶
func (f *FibStrategyHashTable) ClearNextHopsEnc(name enc.Name)
ClearNextHops clears all nexthops for the specified prefix.
func (*FibStrategyHashTable) FindNextHopsEnc ¶
func (f *FibStrategyHashTable) FindNextHopsEnc(name enc.Name) []*FibNextHopEntry
(AI GENERATED DESCRIPTION): FindNextHopsEnc returns the list of next‑hop entries for the longest prefix match of the supplied name, scanning from that prefix downwards until it finds an entry with nexthops, or nil if no such entry exists.
func (*FibStrategyHashTable) FindStrategyEnc ¶
func (f *FibStrategyHashTable) FindStrategyEnc(name enc.Name) enc.Name
(AI GENERATED DESCRIPTION): Finds and returns the strategy name for the longest‑matching prefix of a given name, searching ancestor prefixes in the FIB until a strategy is found or nil is returned if none exists.
func (*FibStrategyHashTable) GetAllFIBEntries ¶
func (f *FibStrategyHashTable) GetAllFIBEntries() []FibStrategyEntry
GetAllFIBEntries returns all nexthop entries in the FIB.
func (*FibStrategyHashTable) GetAllForwardingStrategies ¶
func (f *FibStrategyHashTable) GetAllForwardingStrategies() []FibStrategyEntry
GetAllForwardingStrategies returns all strategy choice entries in the Strategy Table.
func (*FibStrategyHashTable) GetNumFIBEntries ¶ added in v1.5.0
func (f *FibStrategyHashTable) GetNumFIBEntries() int
GetNumFIBEntries returns the number of entries in the FIB.
func (*FibStrategyHashTable) InsertNextHopEnc ¶
func (f *FibStrategyHashTable) InsertNextHopEnc(name enc.Name, nexthop uint64, cost uint64)
InsertNextHop adds or updates a nexthop entry for the specified prefix.
func (*FibStrategyHashTable) RemoveNextHopEnc ¶
func (f *FibStrategyHashTable) RemoveNextHopEnc(name enc.Name, nexthop uint64)
(AI GENERATED DESCRIPTION): Removes the specified next hop from the FIB entry corresponding to the given encoded name, updating internal tables and pruning any empty entries.
func (*FibStrategyHashTable) SetStrategyEnc ¶
func (f *FibStrategyHashTable) SetStrategyEnc(name enc.Name, strategy enc.Name)
(AI GENERATED DESCRIPTION): Sets the routing strategy for a given name entry in the FIB strategy hash table, ensuring thread‑safe update of the entry’s strategy field.
func (*FibStrategyHashTable) UnSetStrategyEnc ¶
func (f *FibStrategyHashTable) UnSetStrategyEnc(name enc.Name)
UnsetStrategy unsets the strategy for the specified prefix.
type FibStrategyTree ¶
type FibStrategyTree struct {
// contains filtered or unexported fields
}
FibStrategy Tree represents a tree implementation of the FIB-Strategy table.
func (*FibStrategyTree) ClearNextHopsEnc ¶
func (f *FibStrategyTree) ClearNextHopsEnc(name enc.Name)
ClearNextHops clears all nexthops for the specified prefix.
func (*FibStrategyTree) FindNextHopsEnc ¶
func (f *FibStrategyTree) FindNextHopsEnc(name enc.Name) []*FibNextHopEntry
FindNextHops returns the longest-prefix matching nexthop(s) matching the specified name.
func (*FibStrategyTree) FindStrategyEnc ¶
func (f *FibStrategyTree) FindStrategyEnc(name enc.Name) enc.Name
FindStrategy returns the longest-prefix matching strategy choice entry for the specified name.
func (*FibStrategyTree) GetAllFIBEntries ¶
func (f *FibStrategyTree) GetAllFIBEntries() []FibStrategyEntry
GetAllFIBEntries returns all nexthop entries in the FIB.
func (*FibStrategyTree) GetAllForwardingStrategies ¶
func (f *FibStrategyTree) GetAllForwardingStrategies() []FibStrategyEntry
GetAllForwardingStrategies returns all strategy choice entries in the Strategy Table.
func (*FibStrategyTree) GetNumFIBEntries ¶ added in v1.5.0
func (f *FibStrategyTree) GetNumFIBEntries() int
GetNumFIBEntries returns the number of nexthop entries in the FIB.
func (*FibStrategyTree) InsertNextHopEnc ¶
func (f *FibStrategyTree) InsertNextHopEnc(name enc.Name, nexthop uint64, cost uint64)
InsertNextHop adds or updates a nexthop entry for the specified prefix.
func (*FibStrategyTree) RemoveNextHopEnc ¶
func (f *FibStrategyTree) RemoveNextHopEnc(name enc.Name, nexthop uint64)
RemoveNextHop removes the specified nexthop entry from the specified prefix.
func (*FibStrategyTree) SetStrategyEnc ¶
func (f *FibStrategyTree) SetStrategyEnc(name enc.Name, strategy enc.Name)
SetStrategy sets the strategy for the specified prefix.
func (*FibStrategyTree) UnSetStrategyEnc ¶
func (f *FibStrategyTree) UnSetStrategyEnc(name enc.Name)
UnsetStrategy unsets the strategy for the specified prefix.
type OnPitExpiration ¶
type OnPitExpiration func(PitEntry)
type PitCsPoolsT ¶ added in v1.5.0
type PitCsPoolsT struct {
PitInRecord sync_pool.SyncPool[*PitInRecord]
PitOutRecord sync_pool.SyncPool[*PitOutRecord]
NameTreePitEntry sync_pool.SyncPool[*nameTreePitEntry]
PitCsTreeNode sync_pool.SyncPool[*pitCsTreeNode]
}
type PitCsTable ¶
type PitCsTable interface {
// InsertInterest inserts an Interest into the PIT.
InsertInterest(interest *defn.FwInterest, hint enc.Name, inFace uint64) (PitEntry, bool)
// RemoveInterest removes an Interest from the PIT.
RemoveInterest(pitEntry PitEntry) bool
// FindInterestExactMatch finds an exact match for an Interest in the PIT.
FindInterestExactMatchEnc(interest *defn.FwInterest) PitEntry
// FindInterestPrefixMatchByDataEnc finds a prefix match for a Data in the PIT.
FindInterestPrefixMatchByDataEnc(data *defn.FwData, token *uint32) []PitEntry
// PitSize returns the number of entries in the PIT.
PitSize() int
// InsertData inserts a Data into the CS.
InsertData(data *defn.FwData, wire []byte)
// FindMatchingDataFromCS finds a matching Data in the CS.
FindMatchingDataFromCS(interest *defn.FwInterest) CsEntry
// CsSize returns the number of entries in the CS.
CsSize() int
// IsCsAdmitting returns whether the CS is admitting new entries.
IsCsAdmitting() bool
// IsCsServing returns whether the CS is serving entries.
IsCsServing() bool
// UpdateTicker returns the channel used to signal regular Update() calls in the forwarding thread.
UpdateTicker() <-chan time.Time
// Update() does whatever the PIT table needs to do regularly.
Update()
// contains filtered or unexported methods
}
PitCsTable dictates what functionality a Pit-Cs table should implement Warning: All functions must be called in the same forwarding goroutine as the creation of the table.
type PitCsTree ¶
type PitCsTree struct {
// contains filtered or unexported fields
}
PitCsTree represents a PIT-CS implementation that uses a name tree
func NewPitCS ¶
func NewPitCS(onExpiration OnPitExpiration) *PitCsTree
NewPitCS creates a new combined PIT-CS for a forwarding thread.
func (*PitCsTree) FindInterestExactMatchEnc ¶
func (p *PitCsTree) FindInterestExactMatchEnc(interest *defn.FwInterest) PitEntry
FindInterestPrefixMatchByData returns all interests that could be satisfied by the given data. Example: If we have interests /a and /a/b, a prefix search for data with name /a/b will return PitEntries for both /a and /a/b
func (*PitCsTree) FindInterestPrefixMatchByDataEnc ¶
FindInterestPrefixMatchByData returns all interests that could be satisfied by the given data. Example: If we have interests /a and /a/b, a prefix search for data with name /a/b will return PitEntries for both /a and /a/b
func (*PitCsTree) FindMatchingDataFromCS ¶
func (p *PitCsTree) FindMatchingDataFromCS(interest *defn.FwInterest) CsEntry
FindMatchingDataFromCS 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 (*PitCsTree) InsertData ¶
InsertData inserts a Data packet into the Content Store.
func (*PitCsTree) InsertInterest ¶
func (p *PitCsTree) InsertInterest(interest *defn.FwInterest, hint enc.Name, inFace uint64) (PitEntry, bool)
InsertInterest inserts an entry in the PIT upon receipt of an Interest. Returns tuple of PIT entry and whether the Nonce is a duplicate.
func (*PitCsTree) IsCsAdmitting ¶
IsCsAdmitting returns whether the CS is admitting content.
func (*PitCsTree) IsCsServing ¶
IsCsServing returns whether the CS is serving content.
func (*PitCsTree) RemoveInterest ¶
RemoveInterest removes the specified PIT entry, returning true if the entry was removed and false if was not (because it does not exist).
func (*PitCsTree) Update ¶
func (p *PitCsTree) Update()
(AI GENERATED DESCRIPTION): Expires all pending PIT entries whose timers have elapsed, invoking their expiration callbacks and removing them from the PIT.
func (*PitCsTree) UpdateTicker ¶ added in v1.5.0
(AI GENERATED DESCRIPTION): Returns the channel that emits time events whenever the PIT‑CS tree’s internal update ticker fires.
type PitEntry ¶
type PitEntry interface {
PitCs() PitCsTable
EncName() enc.Name
CanBePrefix() bool
MustBeFresh() bool
// Interests must match in terms of Forwarding Hint to be aggregated in PIT.
ForwardingHintNew() enc.Name
InRecords() map[uint64]*PitInRecord // Key is face ID
OutRecords() map[uint64]*PitOutRecord // Key is face ID
ExpirationTime() time.Time
Satisfied() bool
SetSatisfied(isSatisfied bool)
Token() uint32
InsertInRecord(interest *defn.FwInterest, face uint64, incomingPitToken []byte) (*PitInRecord, bool, uint32)
InsertOutRecord(interest *defn.FwInterest, face uint64) *PitOutRecord
RemoveInRecord(face uint64)
RemoveOutRecord(face uint64)
ClearOutRecords()
ClearInRecords()
// contains filtered or unexported methods
}
PitEntry dictates what entries in a PIT-CS table should implement
type PitInRecord ¶
type PitInRecord struct {
Face uint64
LatestTimestamp time.Time
LatestNonce uint32
ExpirationTime time.Time
PitToken []byte
}
PitInRecord records an incoming Interest on a given face.
type PitOutRecord ¶
type PitOutRecord struct {
Face uint64
LatestTimestamp time.Time
LatestNonce uint32
ExpirationTime time.Time
}
PitOutRecord records an outgoing Interest on a given face.
type RibEntry ¶
RibEntry represents an entry in the RIB table.
func (*RibEntry) HasCaptureRoute ¶
(AI GENERATED DESCRIPTION): Checks whether any route in the RIB entry is marked with the capture flag and returns true if at least one such route exists.
type RibReadvertise ¶
type RibTable ¶
type RibTable struct {
// contains filtered or unexported fields
}
RibTable represents the Routing Information Base (RIB).
func (*RibTable) AddEncRoute ¶
AddRoute adds or updates a RIB entry for the specified prefix.
func (*RibTable) CleanUpFace ¶ added in v1.4.2
(AI GENERATED DESCRIPTION): Removes all routing entries that reference the given face ID from the RIB, ensuring the table no longer uses that face.
func (*RibTable) GetAllEntries ¶
GetAllEntries returns all routes in the RIB.
type Route ¶
type Route struct {
FaceID uint64
Origin uint64
Cost uint64
Flags uint64
ExpirationPeriod *time.Duration
}
Route represents a route in a RIB entry.
func (*Route) HasCaptureFlag ¶
(AI GENERATED DESCRIPTION): Checks whether the route’s flags include the Capture flag.
func (*Route) HasChildInheritFlag ¶
(AI GENERATED DESCRIPTION): Returns true if the route’s Flags field has the RouteFlagChildInherit bit set, indicating that child routes inherit this route’s properties.