Documentation
¶
Index ¶
- Constants
- Variables
- func AddReadvertiser(r RibReadvertise)
- func At(n enc.Name, index int) enc.Component
- func Configure()
- func CreateFIBTable(fibTableAlgorithm string)
- func CsCapacity() int
- func SetCsCapacity(capacity int)
- func SetExpirationTimerToNow(e PitEntry)
- func UpdateExpirationTimer(e PitEntry)
- 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) 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) 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 PitCsTable
- type PitCsTree
- func (p *PitCsTree) CsSize() int
- func (p *PitCsTree) FindInterestExactMatchEnc(interest *spec.Interest) PitEntry
- func (p *PitCsTree) FindInterestPrefixMatchByDataEnc(data *spec.Data, token *uint32) []PitEntry
- func (p *PitCsTree) FindMatchingDataFromCS(interest *spec.Interest) CsEntry
- func (p *PitCsTree) InsertData(data *spec.Data, wire []byte)
- func (p *PitCsTree) InsertInterest(interest *spec.Interest, 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) UpdateTimer() <-chan struct{}
- type PitEntry
- type PitInRecord
- type PitOutRecord
- type RibEntry
- type RibReadvertise
- type RibTable
- type Route
Constants ¶
const ( RouteFlagChildInherit uint64 = 0x01 RouteFlagCapture uint64 = 0x02 )
Route flags.
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 ¶
var NetworkRegion *networkRegionTable
NetworkRegion contains producer region names for this forwarder..
var Rib = RibTable{ // contains filtered or unexported fields }
Rib is the Routing Information Base.
Functions ¶
func AddReadvertiser ¶
func AddReadvertiser(r RibReadvertise)
func CreateFIBTable ¶
func CreateFIBTable(fibTableAlgorithm string)
func SetCsCapacity ¶
func SetCsCapacity(capacity int)
SetCsCapacity sets the CS capacity from management.
func SetExpirationTimerToNow ¶
func SetExpirationTimerToNow(e PitEntry)
SetExpirationTimerToNow updates the expiration timer to the current time.
func UpdateExpirationTimer ¶
func UpdateExpirationTimer(e PitEntry)
UpdateExpirationTimer updates the expiration timer to the latest expiration time of any in or out record in the entry.
Types ¶
type CsEntry ¶
type CsEntry interface {
Index() uint64 // the hash of the entry, for fast lookup
StaleTime() time.Time
Copy() (*spec.Data, []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 *spec.Data)
// AfterRefresh is called after a new data packet refreshes an existing entry in the Content Store.
AfterRefresh(index uint64, wire []byte, data *spec.Data)
// 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)
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
func (*FibStrategyHashTable) FindStrategyEnc ¶
func (f *FibStrategyHashTable) FindStrategyEnc(name enc.Name) enc.Name
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) 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)
func (*FibStrategyHashTable) SetStrategyEnc ¶
func (f *FibStrategyHashTable) SetStrategyEnc(name enc.Name, strategy enc.Name)
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
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) InsertNextHopEnc ¶
func (f *FibStrategyTree) InsertNextHopEnc(name enc.Name, nexthop uint64, cost uint64)
func (*FibStrategyTree) RemoveNextHopEnc ¶
func (f *FibStrategyTree) RemoveNextHopEnc(name enc.Name, nexthop uint64)
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 PitCsTable ¶
type PitCsTable interface {
InsertInterest(interest *spec.Interest, hint enc.Name, inFace uint64) (PitEntry, bool)
RemoveInterest(pitEntry PitEntry) bool
FindInterestExactMatchEnc(interest *spec.Interest) PitEntry
FindInterestPrefixMatchByDataEnc(data *spec.Data, token *uint32) []PitEntry
PitSize() int
InsertData(data *spec.Data, wire []byte)
FindMatchingDataFromCS(interest *spec.Interest) CsEntry
CsSize() int
IsCsAdmitting() bool
IsCsServing() bool
// UpdateTimer returns the channel used to signal regular Update() calls in the forwarding thread.
// <- UpdateTimer() and Update() must be called in pairs.
UpdateTimer() <-chan struct{}
// Update() does whatever the PIT table needs to do regularly.
// It may schedule the next UpdateTimer().
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 ¶
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 ¶
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 *spec.Interest, 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) UpdateTimer ¶
func (p *PitCsTree) UpdateTimer() <-chan struct{}
type PitEntry ¶
type PitEntry interface {
PitCs() PitCsTable
EncName() enc.Name
CanBePrefix() bool
MustBeFresh() bool
ForwardingHintNew() enc.Name
// 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
SetExpirationTime(t time.Time)
Satisfied() bool
SetSatisfied(isSatisfied bool)
Token() uint32
InsertInRecord(interest *spec.Interest, face uint64, incomingPitToken []byte) (*PitInRecord, bool, uint32)
InsertOutRecord(interest *spec.Interest, face uint64) *PitOutRecord
GetOutRecords() []*PitOutRecord
ClearOutRecords()
ClearInRecords()
}
PitEntry dictates what entries in a PIT-CS table should implement
type PitInRecord ¶
type PitInRecord struct {
Face uint64
LatestTimestamp time.Time
LatestInterest enc.Name
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
LatestInterest enc.Name
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 ¶
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
func (*RibTable) GetAllEntries ¶
GetAllEntries returns all routes in the RIB.