A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::GlobalRouteManagerLSDB< T > Class Template Reference

The Link State DataBase (LSDB) of the Global Route Manager. More...

#include "global-route-manager-impl.h"

Inheritance diagram for ns3::GlobalRouteManagerLSDB< T >:
Collaboration diagram for ns3::GlobalRouteManagerLSDB< T >:

Public Member Functions

 GlobalRouteManagerLSDB ()
 Construct an empty Global Router Manager Link State Database.
 GlobalRouteManagerLSDB (const GlobalRouteManagerLSDB &)=delete
 ~GlobalRouteManagerLSDB ()
 Destroy an empty Global Router Manager Link State Database.
GlobalRoutingLSA< IpManager > * GetExtLSA (uint32_t index) const
 Look up the External Link State Advertisement associated with the given index.
GlobalRoutingLSA< IpManager > * GetLSA (IpAddress addr) const
 Look up the Link State Advertisement associated with the given link state ID (address).
GlobalRoutingLSA< IpManager > * GetLSAByLinkData (IpAddress addr) const
 Look up the Link State Advertisement associated with the given link state ID (address).
uint32_t GetNumExtLSAs () const
 Get the number of External Link State Advertisements.
void Initialize ()
 Set all LSA flags to an initialized state, for SPF computation.
void Insert (IpAddress addr, GlobalRoutingLSA< IpManager > *lsa)
 Insert an IP address / Link State Advertisement pair into the Link State Database.
GlobalRouteManagerLSDBoperator= (const GlobalRouteManagerLSDB &)=delete

Private Types

using Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
 Alias for Ipv4 and Ipv6 classes.
using IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
 Alias for Ipv4Address and Ipv6Address classes.
using IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header>
 Alias for Ipv4Header and Ipv6Header classes.
using IpInterfaceAddress
 Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
using IpManager = typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>
 Alias for Ipv4Manager and Ipv6Manager classes.
using IpMaskOrPrefix = typename std::conditional_t<IsIpv4, Ipv4Mask, Ipv6Prefix>
 Alias for Ipv4Mask And Ipv6Prefix.
using IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route>
 Alias for Ipv4Route and Ipv6Route classes.
using IpRoutingTableEntry
 Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.
typedef std::map< IpAddress, GlobalRoutingLSA< IpManager > * > LSDBMap_t
 container of IPv4 addresses / Link State Advertisements
typedef std::pair< IpAddress, GlobalRoutingLSA< IpManager > * > LSDBPair_t
 pair of IPv4 addresses / Link State Advertisements

Private Attributes

LSDBMap_t m_database
 database of IPv4 addresses / Link State Advertisements
std::vector< GlobalRoutingLSA< IpManager > * > m_extdatabase
 database of External Link State Advertisements

Static Private Attributes

static constexpr bool IsIpv4 = std::is_same_v<Ipv4Manager, T>
 Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Detailed Description

template<typename T>
class ns3::GlobalRouteManagerLSDB< T >

The Link State DataBase (LSDB) of the Global Route Manager.

Each node in the simulation participating in global routing has a GlobalRouter interface. The primary job of this interface is to export Global Router Link State Advertisements (LSAs). These advertisements in turn contain a number of Global Router Link Records that describe the point to point links from the underlying node to other nodes (that will also export their own LSAs.

This class implements a searchable database of LSAs gathered from every router in the simulation.

Definition at line 632 of file global-route-manager-impl.h.

Member Typedef Documentation

◆ Ip

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::Ip = typename std::conditional_t<IsIpv4, Ipv4, Ipv6>
private

Alias for Ipv4 and Ipv6 classes.

Definition at line 643 of file global-route-manager-impl.h.

◆ IpAddress

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpAddress = typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>
private

Alias for Ipv4Address and Ipv6Address classes.

Definition at line 646 of file global-route-manager-impl.h.

◆ IpHeader

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpHeader = typename std::conditional_t<IsIpv4, Ipv4Header, Ipv6Header>
private

Alias for Ipv4Header and Ipv6Header classes.

Definition at line 652 of file global-route-manager-impl.h.

◆ IpInterfaceAddress

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpInterfaceAddress
private
Initial value:
typename std::conditional_t<IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress>

Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.

Definition at line 655 of file global-route-manager-impl.h.

◆ IpManager

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpManager = typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>
private

Alias for Ipv4Manager and Ipv6Manager classes.

Definition at line 640 of file global-route-manager-impl.h.

◆ IpMaskOrPrefix

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpMaskOrPrefix = typename std::conditional_t<IsIpv4, Ipv4Mask, Ipv6Prefix>
private

Alias for Ipv4Mask And Ipv6Prefix.

Definition at line 663 of file global-route-manager-impl.h.

◆ IpRoute

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpRoute = typename std::conditional_t<IsIpv4, Ipv4Route, Ipv6Route>
private

Alias for Ipv4Route and Ipv6Route classes.

Definition at line 649 of file global-route-manager-impl.h.

◆ IpRoutingTableEntry

template<typename T>
using ns3::GlobalRouteManagerLSDB< T >::IpRoutingTableEntry
private
Initial value:
typename std::conditional_t<IsIpv4, Ipv4RoutingTableEntry, Ipv6RoutingTableEntry>

Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.

Definition at line 659 of file global-route-manager-impl.h.

◆ LSDBMap_t

template<typename T>
typedef std::map<IpAddress, GlobalRoutingLSA<IpManager>*> ns3::GlobalRouteManagerLSDB< T >::LSDBMap_t
private

container of IPv4 addresses / Link State Advertisements

Definition at line 766 of file global-route-manager-impl.h.

◆ LSDBPair_t

template<typename T>
typedef std::pair<IpAddress, GlobalRoutingLSA<IpManager>*> ns3::GlobalRouteManagerLSDB< T >::LSDBPair_t
private

pair of IPv4 addresses / Link State Advertisements

Definition at line 768 of file global-route-manager-impl.h.

Constructor & Destructor Documentation

◆ GlobalRouteManagerLSDB() [1/2]

template<typename T>
ns3::GlobalRouteManagerLSDB< T >::GlobalRouteManagerLSDB ( )

Construct an empty Global Router Manager Link State Database.

The database map composing the Link State Database is initialized in this constructor.

Definition at line 448 of file global-route-manager-impl.cc.

References m_database, m_extdatabase, and NS_LOG_FUNCTION.

Referenced by GlobalRouteManagerLSDB(), and operator=().

Here is the caller graph for this function:

◆ ~GlobalRouteManagerLSDB()

template<typename T>
ns3::GlobalRouteManagerLSDB< T >::~GlobalRouteManagerLSDB ( )

Destroy an empty Global Router Manager Link State Database.

The database map is walked and all of the Link State Advertisements stored in the database are freed; then the database map itself is clear ()ed to release any remaining resources.

Definition at line 456 of file global-route-manager-impl.cc.

References m_database, m_extdatabase, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GlobalRouteManagerLSDB() [2/2]

template<typename T>
ns3::GlobalRouteManagerLSDB< T >::GlobalRouteManagerLSDB ( const GlobalRouteManagerLSDB< T > & )
delete

References GlobalRouteManagerLSDB().

Here is the call graph for this function:

Member Function Documentation

◆ GetExtLSA()

template<typename T>
GlobalRoutingLSA< typename GlobalRouteManagerLSDB< T >::IpManager > * ns3::GlobalRouteManagerLSDB< T >::GetExtLSA ( uint32_t index) const

Look up the External Link State Advertisement associated with the given index.

The external database map is searched for the given index and corresponding GlobalRoutingLSA is returned.

See also
GlobalRoutingLSA
Parameters
indexthe index associated with the LSA.
Returns
A pointer to the Link State Advertisement.

Definition at line 504 of file global-route-manager-impl.cc.

References m_extdatabase, and NS_LOG_FUNCTION.

◆ GetLSA()

template<typename T>
GlobalRoutingLSA< typename GlobalRouteManagerLSDB< T >::IpManager > * ns3::GlobalRouteManagerLSDB< T >::GetLSA ( IpAddress addr) const

Look up the Link State Advertisement associated with the given link state ID (address).

The database map is searched for the given IPV4 address and corresponding GlobalRoutingLSA is returned.

See also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr.

Definition at line 520 of file global-route-manager-impl.cc.

References m_database, and NS_LOG_FUNCTION.

◆ GetLSAByLinkData()

template<typename T>
GlobalRoutingLSA< typename GlobalRouteManagerLSDB< T >::IpManager > * ns3::GlobalRouteManagerLSDB< T >::GetLSAByLinkData ( IpAddress addr) const

Look up the Link State Advertisement associated with the given link state ID (address).

This is a variation of the GetLSA call to allow the LSA to be found by matching addr with the LinkData field of the TransitNetwork link record.

See also
GetLSA
Parameters
addrThe IP address associated with the LSA. Typically the Router
Returns
A pointer to the Link State Advertisement for the router specified by the IP address addr. ID.

Definition at line 538 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLinkRecord< T >::GetLinkData(), ns3::GlobalRoutingLSA< T >::GetLinkRecord(), ns3::GlobalRoutingLinkRecord< T >::GetLinkType(), ns3::GlobalRoutingLSA< T >::GetNLinkRecords(), m_database, NS_LOG_FUNCTION, and ns3::GlobalRoutingLinkRecord< T >::TransitNetwork.

Here is the call graph for this function:

◆ GetNumExtLSAs()

template<typename T>
uint32_t ns3::GlobalRouteManagerLSDB< T >::GetNumExtLSAs ( ) const

Get the number of External Link State Advertisements.

See also
GlobalRoutingLSA
Returns
the number of External Link State Advertisements.

Definition at line 512 of file global-route-manager-impl.cc.

References m_extdatabase, and NS_LOG_FUNCTION.

◆ Initialize()

template<typename T>
void ns3::GlobalRouteManagerLSDB< T >::Initialize ( )

Set all LSA flags to an initialized state, for SPF computation.

This function walks the database and resets the status flags of all of the contained Link State Advertisements to LSA_SPF_NOT_EXPLORED. This is done prior to each SPF calculation to reset the state of the SPFVertex structures that will reference the LSAs during the calculation.

See also
GlobalRoutingLSA
SPFVertex

Definition at line 477 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA< T >::LSA_SPF_NOT_EXPLORED, m_database, NS_LOG_FUNCTION, and ns3::GlobalRoutingLSA< T >::SetStatus().

Here is the call graph for this function:

◆ Insert()

template<typename T>
void ns3::GlobalRouteManagerLSDB< T >::Insert ( IpAddress addr,
GlobalRoutingLSA< IpManager > * lsa )

Insert an IP address / Link State Advertisement pair into the Link State Database.

The IPV4 address and the GlobalRoutingLSA given as parameters are converted to an STL pair and are inserted into the database map.

See also
GlobalRoutingLSA
Ipv4Address
Parameters
addrThe IP address associated with the LSA. Typically the Router ID.
lsaA pointer to the Link State Advertisement for the router.

Definition at line 489 of file global-route-manager-impl.cc.

References ns3::GlobalRoutingLSA< T >::ASExternalLSAs, ns3::GlobalRoutingLSA< T >::GetLSType(), m_database, m_extdatabase, and NS_LOG_FUNCTION.

Here is the call graph for this function:

◆ operator=()

template<typename T>
GlobalRouteManagerLSDB & ns3::GlobalRouteManagerLSDB< T >::operator= ( const GlobalRouteManagerLSDB< T > & )
delete

References GlobalRouteManagerLSDB().

Here is the call graph for this function:

Member Data Documentation

◆ IsIpv4

template<typename T>
bool ns3::GlobalRouteManagerLSDB< T >::IsIpv4 = std::is_same_v<Ipv4Manager, T>
staticconstexprprivate

Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Definition at line 637 of file global-route-manager-impl.h.

◆ m_database

template<typename T>
LSDBMap_t ns3::GlobalRouteManagerLSDB< T >::m_database
private

database of IPv4 addresses / Link State Advertisements

Definition at line 770 of file global-route-manager-impl.h.

Referenced by GlobalRouteManagerLSDB(), ~GlobalRouteManagerLSDB(), GetLSA(), GetLSAByLinkData(), Initialize(), and Insert().

◆ m_extdatabase

template<typename T>
std::vector<GlobalRoutingLSA<IpManager>*> ns3::GlobalRouteManagerLSDB< T >::m_extdatabase
private

database of External Link State Advertisements

Definition at line 772 of file global-route-manager-impl.h.

Referenced by GlobalRouteManagerLSDB(), ~GlobalRouteManagerLSDB(), GetExtLSA(), GetNumExtLSAs(), and Insert().


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