The Link State DataBase (LSDB) of the Global Route Manager. More...
#include "global-route-manager-impl.h"
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. | |
| GlobalRouteManagerLSDB & | operator= (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. | |
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.
|
private |
Alias for Ipv4 and Ipv6 classes.
Definition at line 643 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4Address and Ipv6Address classes.
Definition at line 646 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4Header and Ipv6Header classes.
Definition at line 652 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
Definition at line 655 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4Manager and Ipv6Manager classes.
Definition at line 640 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4Mask And Ipv6Prefix.
Definition at line 663 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4Route and Ipv6Route classes.
Definition at line 649 of file global-route-manager-impl.h.
|
private |
Alias for Ipv4RoutingTableEntry and Ipv6RoutingTableEntry classes.
Definition at line 659 of file global-route-manager-impl.h.
|
private |
container of IPv4 addresses / Link State Advertisements
Definition at line 766 of file global-route-manager-impl.h.
|
private |
pair of IPv4 addresses / Link State Advertisements
Definition at line 768 of file global-route-manager-impl.h.
| 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=().
| 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.
|
delete |
| 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.
| index | the index associated with the LSA. |
Definition at line 504 of file global-route-manager-impl.cc.
References m_extdatabase, and NS_LOG_FUNCTION.
| 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.
| addr | The IP address associated with the LSA. Typically the Router ID. |
Definition at line 520 of file global-route-manager-impl.cc.
References m_database, and NS_LOG_FUNCTION.
| 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.
| addr | The IP address associated with the LSA. Typically the Router |
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.
| uint32_t ns3::GlobalRouteManagerLSDB< T >::GetNumExtLSAs | ( | ) | const |
Get 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.
| 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.
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().
| 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.
| addr | The IP address associated with the LSA. Typically the Router ID. |
| lsa | A 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.
|
delete |
|
staticconstexprprivate |
Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.
Definition at line 637 of file global-route-manager-impl.h.
|
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().
|
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().