nlsr::Fib Class Reference

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

#include <fib.hpp>

Collaboration diagram for nlsr::Fib:
[legend]

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, const 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 ()
 

Data Fields

ndn::util::Signal< Fib, const ndn::Name & > onPrefixRegistrationSuccess
 

Static Public Attributes

static const std::string MULTICAST_STRATEGY
 
static const std::string BEST_ROUTE_V2_STRATEGY
 

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 52 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 
)

Definition at line 40 of file fib.cpp.

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 165 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 201 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 51 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 98 of file fib.hpp.

Here is the call graph for this function:

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

Definition at line 293 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,
const 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 89 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 376 of file fib.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

const std::string nlsr::Fib::BEST_ROUTE_V2_STRATEGY
static

Definition at line 228 of file fib.hpp.

const std::string nlsr::Fib::MULTICAST_STRATEGY
static

Definition at line 227 of file fib.hpp.

ndn::util::Signal<Fib, const ndn::Name&> nlsr::Fib::onPrefixRegistrationSuccess

Definition at line 229 of file fib.hpp.