NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ns3::ndn::AbstractFib Class Reference

An abstract, lightweight representation of the FIB. More...

#include <abstract-fib.hpp>

Public Types

using AllNodeFib = std::unordered_map< int, AbstractFib >
 

Public Member Functions

 AbstractFib (const Ptr< GlobalRouter > own, int numNodes)
 
const std::set< FibNextHop > & getNexthops (int dstId) const
 
const std::set< FibNextHop > & getUpwardNexthops (int dstId) const
 
void checkFib () const
 Make sure that FIB is consistent (each destination has at least one downward nexthop) More...
 
int numEnabledNhPerDst (int dstId) const
 
int getNodeId () const
 
Ptr< GlobalRoutergetGR () const
 
std::string getName () const
 
int getDegree () const
 
int getNumDsts () const
 
bool contains (int dstId) const
 
auto begin () const
 
auto end () const
 
void insert (int dstId, const FibNextHop &nh)
 
size_t erase (int dstId, int nhId)
 

Friends

std::ostream & operator<< (std::ostream &, const AbstractFib &fib)
 

Detailed Description

An abstract, lightweight representation of the FIB.

Definition at line 39 of file abstract-fib.hpp.

Member Typedef Documentation

◆ AllNodeFib

using ns3::ndn::AbstractFib::AllNodeFib = std::unordered_map<int, AbstractFib>

Definition at line 41 of file abstract-fib.hpp.

Constructor & Destructor Documentation

◆ AbstractFib()

ns3::ndn::AbstractFib::AbstractFib ( const Ptr< GlobalRouter own,
int  numNodes 
)
Parameters
ownThe GlobalRouter object representing the current router
numNodesThe total number of nodes in the network

Definition at line 36 of file abstract-fib.cpp.

Member Function Documentation

◆ getNexthops()

const set< FibNextHop > & ns3::ndn::AbstractFib::getNexthops ( int  dstId) const
Returns
Return set of nexthops per destination

Definition at line 130 of file abstract-fib.cpp.

Referenced by numEnabledNhPerDst(), and ns3::ndn::removeDeadEnds().

◆ getUpwardNexthops()

const set< FibNextHop > & ns3::ndn::AbstractFib::getUpwardNexthops ( int  dstId) const
Returns
Return set of upward nexthops per destination

Definition at line 140 of file abstract-fib.cpp.

Referenced by ns3::ndn::removeLoops().

◆ checkFib()

void ns3::ndn::AbstractFib::checkFib ( ) const

Make sure that FIB is consistent (each destination has at least one downward nexthop)

Definition at line 149 of file abstract-fib.cpp.

References ns3::ndn::DOWNWARD, ns3::ndn::FibNextHop::getCost(), ns3::ndn::FibNextHop::getNexthopId(), ns3::ndn::FibNextHop::getType(), and ns3::ndn::FibNextHop::MAX_COST.

◆ numEnabledNhPerDst()

int ns3::ndn::AbstractFib::numEnabledNhPerDst ( int  dstId) const
inline
Returns
Return number nexthops per destination
Precondition
Also assure that the destination is not equal to the current nodeId.

Definition at line 74 of file abstract-fib.hpp.

References getNexthops().

◆ getNodeId()

int ns3::ndn::AbstractFib::getNodeId ( ) const
inline

Definition at line 81 of file abstract-fib.hpp.

References getGR().

◆ getGR()

Ptr< GlobalRouter > ns3::ndn::AbstractFib::getGR ( ) const

Definition at line 78 of file abstract-fib.cpp.

Referenced by getNodeId().

◆ getName()

std::string ns3::ndn::AbstractFib::getName ( ) const
inline

Definition at line 90 of file abstract-fib.hpp.

◆ getDegree()

int ns3::ndn::AbstractFib::getDegree ( ) const
inline

Definition at line 96 of file abstract-fib.hpp.

◆ getNumDsts()

int ns3::ndn::AbstractFib::getNumDsts ( ) const
inline

Definition at line 102 of file abstract-fib.hpp.

◆ contains()

bool ns3::ndn::AbstractFib::contains ( int  dstId) const
inline

Definition at line 108 of file abstract-fib.hpp.

◆ begin()

auto ns3::ndn::AbstractFib::begin ( ) const
inline

Definition at line 115 of file abstract-fib.hpp.

◆ end()

auto ns3::ndn::AbstractFib::end ( ) const
inline

Definition at line 121 of file abstract-fib.hpp.

References erase(), insert(), and operator<<.

◆ insert()

void ns3::ndn::AbstractFib::insert ( int  dstId,
const FibNextHop nh 
)

◆ erase()

size_t ns3::ndn::AbstractFib::erase ( int  dstId,
int  nhId 
)

Definition at line 102 of file abstract-fib.cpp.

References ns3::ndn::UPWARD.

Referenced by end(), and ns3::ndn::removeDeadEnds().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const AbstractFib fib 
)
friend

Definition at line 175 of file abstract-fib.cpp.

Referenced by end().


The documentation for this class was generated from the following files: