Documentation ¶
Index ¶
- Constants
- Variables
- func Configure()
- func HashNameToAllPrefixFwThreads(name *ndn.Name) []int
- func HashNameToFwThread(name *ndn.Name) int
- func InstantiateStrategies(fwThread *Thread) map[string]Strategy
- type BestRoute
- func (s *BestRoute) AfterContentStoreHit(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *BestRoute) AfterReceiveData(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *BestRoute) AfterReceiveInterest(pitEntry *table.PitEntry, inFace uint64, interest *ndn.Interest, ...)
- func (s *BestRoute) BeforeSatisfyInterest(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *BestRoute) Instantiate(fwThread *Thread)
- type Multicast
- func (s *Multicast) AfterContentStoreHit(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *Multicast) AfterReceiveData(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *Multicast) AfterReceiveInterest(pitEntry *table.PitEntry, inFace uint64, interest *ndn.Interest, ...)
- func (s *Multicast) BeforeSatisfyInterest(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data)
- func (s *Multicast) Instantiate(fwThread *Thread)
- type Strategy
- type StrategyBase
- func (s *StrategyBase) GetName() *ndn.Name
- func (s *StrategyBase) NewStrategyBase(fwThread *Thread, strategyName *ndn.GenericNameComponent, version uint64, ...)
- func (s *StrategyBase) SendData(data *ndn.Data, pitEntry *table.PitEntry, nexthop uint64, inFace uint64)
- func (s *StrategyBase) SendInterest(interest *ndn.Interest, pitEntry *table.PitEntry, nexthop uint64, ...)
- func (s *StrategyBase) String() string
- type Thread
- func (t *Thread) GetID() int
- func (t *Thread) GetNumCsEntries() int
- func (t *Thread) GetNumPitEntries() int
- func (t *Thread) QueueData(data *ndn.PendingPacket)
- func (t *Thread) QueueInterest(interest *ndn.PendingPacket)
- func (t *Thread) Run()
- func (t *Thread) String() string
- func (t *Thread) TellToQuit()
Constants ¶
const MaxFwThreads = 32
MaxFwThreads Maximum number of forwarding threads
const StrategyPrefix = "/localhost/nfd/strategy"
StrategyPrefix is the prefix of all strategy names for YaNFD
Variables ¶
var NumFwThreads int
NumFwThreads indicates the number of forwarding threads in the forwarder.
var StrategyVersions = make(map[string][]uint64)
StrategyVersions contains a list of strategies mapping to a list of their versions
var Threads map[int]*Thread
Threads contains all forwarding threads
Functions ¶
func HashNameToAllPrefixFwThreads ¶
HashNameToAllPrefixFwThreads hahes an NDN name to all forwarding threads for all prefixes of the name.
func HashNameToFwThread ¶
HashNameToFwThread hashes an NDN name to a forwarding thread.
func InstantiateStrategies ¶
InstantiateStrategies instantiates all strategies for a forwarding thread.
Types ¶
type BestRoute ¶
type BestRoute struct {
StrategyBase
}
BestRoute is a forwarding strategy that forwards Interests to the nexthop with the lowest cost.
func (*BestRoute) AfterContentStoreHit ¶
AfterContentStoreHit ...
func (*BestRoute) AfterReceiveData ¶
AfterReceiveData ...
func (*BestRoute) AfterReceiveInterest ¶
func (s *BestRoute) AfterReceiveInterest(pitEntry *table.PitEntry, inFace uint64, interest *ndn.Interest, nexthops []*table.FibNextHopEntry)
AfterReceiveInterest ...
func (*BestRoute) BeforeSatisfyInterest ¶
BeforeSatisfyInterest ...
func (*BestRoute) Instantiate ¶
Instantiate creates a new instance of the BestRoute strategy.
type Multicast ¶
type Multicast struct {
StrategyBase
}
Multicast is a forwarding strategy that forwards Interests to all nexthop faces.
func (*Multicast) AfterContentStoreHit ¶
AfterContentStoreHit ...
func (*Multicast) AfterReceiveData ¶
AfterReceiveData ...
func (*Multicast) AfterReceiveInterest ¶
func (s *Multicast) AfterReceiveInterest(pitEntry *table.PitEntry, inFace uint64, interest *ndn.Interest, nexthops []*table.FibNextHopEntry)
AfterReceiveInterest ...
func (*Multicast) BeforeSatisfyInterest ¶
BeforeSatisfyInterest ...
func (*Multicast) Instantiate ¶
Instantiate creates a new instance of the Multicast strategy.
type Strategy ¶
type Strategy interface { Instantiate(fwThread *Thread) String() string GetName() *ndn.Name AfterContentStoreHit(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data) AfterReceiveData(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data) AfterReceiveInterest(pitEntry *table.PitEntry, inFace uint64, interest *ndn.Interest, nexthops []*table.FibNextHopEntry) BeforeSatisfyInterest(pitEntry *table.PitEntry, inFace uint64, data *ndn.Data) }
Strategy represents a forwarding strategy.
type StrategyBase ¶
type StrategyBase struct {
// contains filtered or unexported fields
}
StrategyBase provides common helper methods for YaNFD forwarding strategies.
func (*StrategyBase) GetName ¶
func (s *StrategyBase) GetName() *ndn.Name
GetName returns the name of strategy, including version information.
func (*StrategyBase) NewStrategyBase ¶
func (s *StrategyBase) NewStrategyBase(fwThread *Thread, strategyName *ndn.GenericNameComponent, version uint64, strategyLogName string)
NewStrategyBase is a helper that allows specific strategies to initialize the base.
func (*StrategyBase) SendData ¶
func (s *StrategyBase) SendData(data *ndn.Data, pitEntry *table.PitEntry, nexthop uint64, inFace uint64)
SendData sends a Data packet on the specified face.
func (*StrategyBase) SendInterest ¶
func (s *StrategyBase) SendInterest(interest *ndn.Interest, pitEntry *table.PitEntry, nexthop uint64, inFace uint64)
SendInterest sends an Interest on the specified face.
func (*StrategyBase) String ¶
func (s *StrategyBase) String() string
type Thread ¶
type Thread struct { HasQuit chan interface{} // Counters NInInterests uint64 NInData uint64 NOutInterests uint64 NOutData uint64 NSatisfiedInterests uint64 NUnsatisfiedInterests uint64 // contains filtered or unexported fields }
Thread Represents a forwarding thread
func (*Thread) GetNumCsEntries ¶
GetNumCsEntries returns the number of entries in this thread's ContentStore.
func (*Thread) GetNumPitEntries ¶
GetNumPitEntries returns the number of entries in this thread's PIT.
func (*Thread) QueueData ¶
func (t *Thread) QueueData(data *ndn.PendingPacket)
QueueData queues a Data packet for processing by this forwarding thread.
func (*Thread) QueueInterest ¶
func (t *Thread) QueueInterest(interest *ndn.PendingPacket)
QueueInterest queues an Interest for processing by this forwarding thread.
func (*Thread) TellToQuit ¶
func (t *Thread) TellToQuit()
TellToQuit tells the forwarding thread to quit