nlsr::Fib Class Reference

Maps names to lists of next hops, and exports this information to NFD. More...

#include <fib.hpp>

Public Member Functions

 Fib (ndn::Face &face, ndn::Scheduler &scheduler, AdjacencyList &adjacencyList, ConfParameter &conf, ndn::security::v2::KeyChain &keyChain)
 
void remove (const ndn::Name &name)
 Completely remove a name prefix from the FIB. More...
 
void update (const ndn::Name &name, NexthopList &allHops)
 Set the nexthop list of a name. More...
 
void clean ()
 Remove all entries from the FIB. More...
 
void setEntryRefreshTime (int32_t fert)
 
void registerPrefix (const ndn::Name &namePrefix, const ndn::FaceUri &faceUri, uint64_t faceCost, const ndn::time::milliseconds &timeout, uint64_t flags, uint8_t times)
 Inform NFD of a next-hop. More...
 
void setStrategy (const ndn::Name &name, const std::string &strategy, uint32_t count)
 
void writeLog ()
 

Detailed Description

Maps names to lists of next hops, and exports this information to NFD.

The FIB (Forwarding Information Base) is the "authoritative" source of how to route Interests on this router to other nodes running NLSR. In essence, the FIB is a map that takes name prefixes to a list of next-hops out of this router. This class also contains methods to inform NFD about these relationships. The FIB has its entries populated by the NamePrefixTable

See also
nlsr::NamePrefixTable
nlsr::NamePrefixTable::addEntry
nlsr::NamePrefixTable::updateWithNewRoute

Definition at line 54 of file fib.hpp.

Constructor & Destructor Documentation

nlsr::Fib::Fib ( ndn::Face &  face,
ndn::Scheduler &  scheduler,
AdjacencyList adjacencyList,
ConfParameter conf,
ndn::security::v2::KeyChain &  keyChain 
)
inline

Definition at line 57 of file fib.hpp.

Here is the call graph for this function:

Member Function Documentation

void nlsr::Fib::clean ( )

Remove all entries from the FIB.

This method is called before terminating NLSR to minimize the time NFD spends routing on now-invalid information. This is not strictly necessary, because eventually those prefix registrations will expire, but cleaning up after ourselves improves performance.

See also
NlsrRunner::run

Definition at line 154 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::registerPrefix ( const ndn::Name &  namePrefix,
const ndn::FaceUri &  faceUri,
uint64_t  faceCost,
const ndn::time::milliseconds &  timeout,
uint64_t  flags,
uint8_t  times 
)

Inform NFD of a next-hop.

This method informs NFD of a next-hop for some name prefix. This method actually submits the information to NFD's RIB, which then aggregates its own best hops and updates NFD's (the actual) FIB. Typically, NLSR's FIB and NFD's FIB will be almost the same. However, this is not necessarily the case and there may be cases when other sources of information provide better next-hops to NFD that NLSR doesn't know about. For example, an operator could set up a direct link to a node that isn't running NLSR.

Parameters
namePrefixThe name prefix to register a next-hop for
faceUriThe faceUri of the adjacent that this prefix can be reached through
faceCostThe cost to reach namePrefix through faceUri
timeoutHow long this registration should last
flagsRoute inheritance flags (CAPTURE, CHILD_INHERIT)
timesHow many times we have failed to register this prefix since the last success.
See also
Fib::registerPrefixInNfd

Definition at line 199 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::remove ( const ndn::Name &  name)

Completely remove a name prefix from the FIB.

If a name prefix is found to no longer be reachable from this router, it will be removed from the FIB and all of its next-hops will be unregistered from NFD.

See also
nlsr::NamePrefixTable::removeEntry

Definition at line 39 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::setEntryRefreshTime ( int32_t  fert)
inline

Definition at line 107 of file fib.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::setStrategy ( const ndn::Name &  name,
const std::string &  strategy,
uint32_t  count 
)

Definition at line 306 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::update ( const ndn::Name &  name,
NexthopList allHops 
)

Set the nexthop list of a name.

This method is the entry for others to add next-hop information to the FIB. Formally put, this method registers in NFD all next-hops in allHops, and unregisters the set difference of newHops - oldHops. This method also schedules the regular refresh of those next hops.

Parameters
nameThe name prefix that the next-hops apply to
allHopsA complete list of next-hops to associate with name.

Definition at line 79 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::Fib::writeLog ( )

Definition at line 398 of file fib.cpp.

Here is the caller graph for this function: