An interface aggregated to a node to provide global routing info. More...
#include "global-router-interface.h"
Public Member Functions | |
GlobalRouter () | |
Create a Global Router class. More... | |
uint32_t | DiscoverLSAs (void) |
Walk the connected channels, discover the adjacent routers and build the associated number of Global Routing Link State Advertisements that this router can export. More... | |
Ipv4RoutingTableEntry * | GetInjectedRoute (uint32_t i) |
Return the injected route indexed by i. More... | |
bool | GetLSA (uint32_t n, GlobalRoutingLSA &lsa) const |
Get a Global Routing Link State Advertisements that this router has said that it can export. More... | |
uint32_t | GetNInjectedRoutes (void) |
Get the number of injected routes that have been added to the routing table. More... | |
uint32_t | GetNumLSAs (void) const |
Get the Number of Global Routing Link State Advertisements that this router can export. More... | |
Ipv4Address | GetRouterId (void) const |
Get the Router ID associated with this Global Router. More... | |
Ptr< Ipv4GlobalRouting > | GetRoutingProtocol (void) |
Get the specific Global Routing Protocol used. More... | |
void | InjectRoute (Ipv4Address network, Ipv4Mask networkMask) |
Inject a route to be circulated to other routers as an external route. More... | |
void | RemoveInjectedRoute (uint32_t i) |
Withdraw a route from the global unicast routing table. More... | |
void | SetRoutingProtocol (Ptr< Ipv4GlobalRouting > routing) |
Set the specific Global Routing Protocol to be used. More... | |
bool | WithdrawRoute (Ipv4Address network, Ipv4Mask networkMask) |
Withdraw a route from the global unicast routing table. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Types | |
typedef std::list< Ipv4RoutingTableEntry * > | InjectedRoutes |
container of Ipv4RoutingTableEntry More... | |
typedef std::list< Ipv4RoutingTableEntry * >::const_iterator | InjectedRoutesCI |
Const Iterator to container of Ipv4RoutingTableEntry. More... | |
typedef std::list< Ipv4RoutingTableEntry * >::iterator | InjectedRoutesI |
Iterator to container of Ipv4RoutingTableEntry. More... | |
typedef std::list< GlobalRoutingLSA * > | ListOfLSAs_t |
container for the GlobalRoutingLSAs More... | |
Private Member Functions | |
GlobalRouter (GlobalRouter &sr) | |
Global Router copy construction is disallowed. More... | |
virtual | ~GlobalRouter () |
bool | AnotherRouterOnLink (Ptr< NetDevice > nd) const |
Checks for the presence of another router on the NetDevice. More... | |
bool | BridgeHasAlreadyBeenVisited (Ptr< BridgeNetDevice > device) const |
When recursively checking for devices on the link, check whether a given device has already been visited. More... | |
void | BuildNetworkLSAs (NetDeviceContainer c) |
Build one NetworkLSA for each net device talking to a network that we are the designated router for. More... | |
void | ClearBridgesVisited (void) const |
Clear the list of bridges visited on the link. More... | |
void | ClearLSAs (void) |
Clear list of LSAs. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
NetDeviceContainer | FindAllNonBridgedDevicesOnLink (Ptr< Channel > ch) const |
Return a container of all non-bridged NetDevices on a link. More... | |
Ipv4Address | FindDesignatedRouterForLink (Ptr< NetDevice > ndLocal) const |
Finds a designated router. More... | |
bool | FindInterfaceForDevice (Ptr< Node > node, Ptr< NetDevice > nd, uint32_t &index) const |
Given a node and a net device, find an IPV4 interface index that corresponds to that net device. More... | |
Ptr< NetDevice > | GetAdjacent (Ptr< NetDevice > nd, Ptr< Channel > ch) const |
Link through the given channel and find the net device that's on the other end. More... | |
void | MarkBridgeAsVisited (Ptr< BridgeNetDevice > device) const |
When recursively checking for devices on the link, mark a given device as having been visited. More... | |
Ptr< BridgeNetDevice > | NetDeviceIsBridged (Ptr< NetDevice > nd) const |
Decide whether or not a given net device is being bridged by a BridgeNetDevice. More... | |
GlobalRouter & | operator= (GlobalRouter &sr) |
Global Router assignment operator is disallowed. More... | |
void | ProcessBridgedBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c) |
Process a bridged broadcast link. More... | |
void | ProcessBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c) |
Process a generic broadcast link. More... | |
void | ProcessPointToPointLink (Ptr< NetDevice > ndLocal, GlobalRoutingLSA *pLSA) |
Process a point to point link. More... | |
void | ProcessSingleBroadcastLink (Ptr< NetDevice > nd, GlobalRoutingLSA *pLSA, NetDeviceContainer &c) |
Process a single broadcast link. More... | |
Private Attributes | |
std::vector< Ptr< BridgeNetDevice > > | m_bridgesVisited |
Container of bridges visited. More... | |
InjectedRoutes | m_injectedRoutes |
Routes we are exporting. More... | |
ListOfLSAs_t | m_LSAs |
database of GlobalRoutingLSAs More... | |
Ipv4Address | m_routerId |
router ID (its IPv4 address) More... | |
Ptr< Ipv4GlobalRouting > | m_routingProtocol |
the Ipv4GlobalRouting in use More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
An interface aggregated to a node to provide global routing info.
An interface aggregated to a node that provides global routing information to a global route manager. The presence of the interface indicates that the node is a router. The interface is the mechanism by which the router advertises its connections to neighboring routers. We're basically allowing the route manager to query for link state advertisements.
ns3::GlobalRouter is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 120 bytes (on a 64-bit architecture).
Definition at line 589 of file global-router-interface.h.
|
private |
container of Ipv4RoutingTableEntry
Definition at line 864 of file global-router-interface.h.
|
private |
Const Iterator to container of Ipv4RoutingTableEntry.
Definition at line 865 of file global-router-interface.h.
|
private |
Iterator to container of Ipv4RoutingTableEntry.
Definition at line 866 of file global-router-interface.h.
|
private |
container for the GlobalRoutingLSAs
Definition at line 858 of file global-router-interface.h.
ns3::GlobalRouter::GlobalRouter | ( | ) |
Create a Global Router class.
Definition at line 519 of file global-router-interface.cc.
References ns3::GlobalRouteManager::AllocateRouterId(), m_routerId, NS_LOG_FUNCTION, and ns3::Ipv4Address::Set().
|
privatevirtual |
Definition at line 526 of file global-router-interface.cc.
References ClearLSAs(), and NS_LOG_FUNCTION.
|
private |
Global Router copy construction is disallowed.
sr | object to copy from. |
Checks for the presence of another router on the NetDevice.
Given a node and an attached net device, take a look off in the channel to which the net device is attached and look for a node on the other side that has a GlobalRouter interface aggregated.
nd | NetDevice to scan |
Definition at line 1473 of file global-router-interface.cc.
References BridgeHasAlreadyBeenVisited(), ns3::NetDevice::GetChannel(), ns3::Channel::GetDevice(), ns3::Node::GetId(), ns3::Channel::GetNDevices(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().
|
private |
When recursively checking for devices on the link, check whether a given device has already been visited.
device | the bridge device to check |
Definition at line 1816 of file global-router-interface.cc.
References m_bridgesVisited, and NS_LOG_LOGIC.
Referenced by AnotherRouterOnLink(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().
|
private |
Build one NetworkLSA for each net device talking to a network that we are the designated router for.
c | the devices. |
Definition at line 1161 of file global-router-interface.cc.
References ns3::GlobalRoutingLSA::AddAttachedRouter(), ClearBridgesVisited(), FindAllNonBridgedDevicesOnLink(), FindInterfaceForDevice(), ns3::NetDeviceContainer::Get(), ns3::NetDevice::GetChannel(), ns3::Node::GetId(), ns3::NetDeviceContainer::GetN(), ns3::Channel::GetNDevices(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_LSAs, m_routerId, ns3::GlobalRoutingLSA::NetworkLSA, NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::GlobalRoutingLSA::SetAdvertisingRouter(), ns3::GlobalRoutingLSA::SetLinkStateId(), ns3::GlobalRoutingLSA::SetLSType(), ns3::GlobalRoutingLSA::SetNetworkLSANetworkMask(), ns3::GlobalRoutingLSA::SetNode(), and ns3::GlobalRoutingLSA::SetStatus().
Referenced by DiscoverLSAs().
|
private |
Clear the list of bridges visited on the link.
Definition at line 1807 of file global-router-interface.cc.
References m_bridgesVisited.
Referenced by BuildNetworkLSAs(), ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().
|
private |
Clear list of LSAs.
Definition at line 560 of file global-router-interface.cc.
References m_LSAs, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by ~GlobalRouter(), and DiscoverLSAs().
uint32_t ns3::GlobalRouter::DiscoverLSAs | ( | void | ) |
Walk the connected channels, discover the adjacent routers and build the associated number of Global Routing Link State Advertisements that this router can export.
This is a fairly expensive operation in that every time it is called the current list of LSAs is built by walking connected point-to-point channels and peeking into adjacent IPV4 stacks to get address information. This is done to allow for limited dynamics of the Global Routing environment. By that we mean that you can discover new link state advertisements after a network topology change by calling DiscoverLSAs and then by reading those advertisements.
Definition at line 593 of file global-router-interface.cc.
References ns3::GlobalRoutingLSA::ASExternalLSAs, BuildNetworkLSAs(), ClearLSAs(), FindInterfaceForDevice(), ns3::Node::GetDevice(), ns3::Node::GetId(), ns3::NetDeviceContainer::GetN(), ns3::Node::GetNDevices(), ns3::Object::GetObject(), ns3::NetDevice::IsBroadcast(), ns3::NetDevice::IsPointToPoint(), ns3::GlobalRoutingLSA::LSA_SPF_NOT_EXPLORED, m_injectedRoutes, m_LSAs, m_routerId, NetDeviceIsBridged(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ProcessBroadcastLink(), ProcessPointToPointLink(), ns3::GlobalRoutingLSA::RouterLSA, ns3::GlobalRoutingLSA::SetAdvertisingRouter(), ns3::GlobalRoutingLSA::SetLinkStateId(), ns3::GlobalRoutingLSA::SetLSType(), ns3::GlobalRoutingLSA::SetNetworkLSANetworkMask(), ns3::GlobalRoutingLSA::SetNode(), and ns3::GlobalRoutingLSA::SetStatus().
|
privatevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 546 of file global-router-interface.cc.
References ns3::Object::DoDispose(), bianchi11ax::k, m_injectedRoutes, m_routingProtocol, and NS_LOG_FUNCTION.
|
private |
Return a container of all non-bridged NetDevices on a link.
This method will recursively find all of the 'edge' devices in an L2 broadcast domain. If there are no bridged devices, then the container returned is simply the set of devices on the channel passed in as an argument. If the link has bridges on it (and therefore multiple ns3::Channel objects interconnected by bridges), the method will find all of the non-bridged devices in the L2 broadcast domain.
ch | a channel from the link |
Definition at line 1272 of file global-router-interface.cc.
References ns3::NetDeviceContainer::Add(), BridgeHasAlreadyBeenVisited(), ns3::NetDevice::GetChannel(), ns3::Channel::GetDevice(), ns3::NetDeviceContainer::GetN(), ns3::Channel::GetNDevices(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by BuildNetworkLSAs().
|
private |
Finds a designated router.
Given a local net device, we need to walk the channel to which the net device is attached and look for nodes with GlobalRouter interfaces on them (one of them will be us). Of these, the router with the lowest IP address on the net device connecting to the channel becomes the designated router for the link.
ndLocal | local NetDevice to scan |
Definition at line 1317 of file global-router-interface.cc.
References BridgeHasAlreadyBeenVisited(), FindInterfaceForDevice(), ns3::NetDevice::GetChannel(), ns3::Channel::GetDevice(), ns3::Node::GetId(), ns3::Channel::GetNDevices(), ns3::Ipv4::GetNInterfaces(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), MarkBridgeAsVisited(), NetDeviceIsBridged(), NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and NS_LOG_WARN.
Referenced by ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().
|
private |
Given a node and a net device, find an IPV4 interface index that corresponds to that net device.
This function may fail for various reasons. If a node does not have an internet stack (for example if it is a bridge) we won't have an IPv4 at all. If the node does have a stack, but the net device in question is bridged, there will not be an interface associated directly with the device.
node | the node |
nd | outgoing NetDevice |
index | the IPV4 interface index |
Definition at line 1734 of file global-router-interface.cc.
References ns3::Node::GetId(), ns3::Object::GetObject(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by BuildNetworkLSAs(), DiscoverLSAs(), FindDesignatedRouterForLink(), ProcessBridgedBroadcastLink(), ProcessPointToPointLink(), and ProcessSingleBroadcastLink().
|
private |
Link through the given channel and find the net device that's on the other end.
This only makes sense with a point-to-point channel.
nd | outgoing NetDevice |
ch | channel |
Definition at line 1696 of file global-router-interface.cc.
References ns3::Channel::GetDevice(), ns3::Channel::GetNDevices(), NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ProcessPointToPointLink().
Ipv4RoutingTableEntry * ns3::GlobalRouter::GetInjectedRoute | ( | uint32_t | i | ) |
Return the injected route indexed by i.
i | the index of the route |
Definition at line 1625 of file global-router-interface.cc.
References m_injectedRoutes, NS_ASSERT, and NS_LOG_FUNCTION.
bool ns3::GlobalRouter::GetLSA | ( | uint32_t | n, |
GlobalRoutingLSA & | lsa | ||
) | const |
Get a Global Routing Link State Advertisements that this router has said that it can export.
This is a fairly inexpensive expensive operation in that the hard work was done in GetNumLSAs. We just copy the indicated Global Routing Link State Advertisement into the requested GlobalRoutingLSA object.
You must call GlobalRouter::GetNumLSAs before calling this method in order to discover the adjacent routers and build the advertisements. GetNumLSAs will return the number of LSAs this router advertises. The parameter n (requested LSA number) must be in the range 0 to GetNumLSAs() - 1.
n | The index number of the LSA you want to read. |
lsa | The GlobalRoutingLSA class to receive the LSA information. |
Definition at line 1585 of file global-router-interface.cc.
References ns3::GlobalRoutingLSA::IsEmpty(), m_LSAs, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
uint32_t ns3::GlobalRouter::GetNInjectedRoutes | ( | void | ) |
Get the number of injected routes that have been added to the routing table.
Definition at line 1648 of file global-router-interface.cc.
References m_injectedRoutes, and NS_LOG_FUNCTION.
uint32_t ns3::GlobalRouter::GetNumLSAs | ( | void | ) | const |
Get the Number of Global Routing Link State Advertisements that this router can export.
To get meaningful information you must have previously called DiscoverLSAs. After you know how many LSAs are present in the router, you may call GetLSA () to retrieve the actual advertisement.
Definition at line 1575 of file global-router-interface.cc.
References m_LSAs, and NS_LOG_FUNCTION.
Ipv4Address ns3::GlobalRouter::GetRouterId | ( | void | ) | const |
Get the Router ID associated with this Global Router.
The Router IDs are allocated in the RoutingEnvironment – one per Router, starting at 0.0.0.1 and incrementing with each instantiation of a router.
Definition at line 580 of file global-router-interface.cc.
References m_routerId, and NS_LOG_FUNCTION.
Ptr< Ipv4GlobalRouting > ns3::GlobalRouter::GetRoutingProtocol | ( | void | ) |
Get the specific Global Routing Protocol used.
Definition at line 539 of file global-router-interface.cc.
References m_routingProtocol, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 511 of file global-router-interface.cc.
References ns3::TypeId::SetParent().
void ns3::GlobalRouter::InjectRoute | ( | Ipv4Address | network, |
Ipv4Mask | networkMask | ||
) |
Inject a route to be circulated to other routers as an external route.
network | The Network to inject |
networkMask | The Network Mask to inject |
Definition at line 1611 of file global-router-interface.cc.
References ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo(), m_injectedRoutes, and NS_LOG_FUNCTION.
|
private |
When recursively checking for devices on the link, mark a given device as having been visited.
device | the bridge device to mark |
Definition at line 1834 of file global-router-interface.cc.
References m_bridgesVisited, and NS_LOG_FUNCTION.
Referenced by AnotherRouterOnLink(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().
|
private |
Decide whether or not a given net device is being bridged by a BridgeNetDevice.
nd | the NetDevice |
Definition at line 1764 of file global-router-interface.cc.
References ns3::Node::GetDevice(), ns3::Node::GetNDevices(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), ns3::NetDevice::IsBridge(), NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by AnotherRouterOnLink(), DiscoverLSAs(), FindAllNonBridgedDevicesOnLink(), and FindDesignatedRouterForLink().
|
private |
Global Router assignment operator is disallowed.
sr | object to copy from. |
|
private |
Process a bridged broadcast link.
Definition at line 875 of file global-router-interface.cc.
References ns3::NetDeviceContainer::Add(), ns3::GlobalRoutingLSA::AddLinkRecord(), AnotherRouterOnLink(), ClearBridgesVisited(), ns3::Ipv4Address::CombineMask(), FindDesignatedRouterForLink(), FindInterfaceForDevice(), ns3::Ipv4Mask::Get(), ns3::Node::GetId(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), ns3::Ipv4Mask::GetPrefixLength(), ns3::NetDevice::IsBridge(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Ipv4Address::Set(), ns3::GlobalRoutingLinkRecord::SetLinkData(), ns3::GlobalRoutingLinkRecord::SetLinkId(), ns3::GlobalRoutingLinkRecord::SetLinkType(), ns3::GlobalRoutingLinkRecord::SetMetric(), ns3::GlobalRoutingLinkRecord::StubNetwork, and ns3::GlobalRoutingLinkRecord::TransitNetwork.
Referenced by ProcessBroadcastLink().
|
private |
Process a generic broadcast link.
Definition at line 746 of file global-router-interface.cc.
References ns3::NetDevice::IsBridge(), NS_LOG_FUNCTION, ProcessBridgedBroadcastLink(), and ProcessSingleBroadcastLink().
Referenced by DiscoverLSAs().
|
private |
Process a point to point link.
ndLocal | the NetDevice |
pLSA | the Global LSA |
Definition at line 1040 of file global-router-interface.cc.
References ns3::GlobalRoutingLSA::AddLinkRecord(), FindInterfaceForDevice(), ns3::Ipv4Mask::Get(), GetAdjacent(), ns3::NetDevice::GetChannel(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::GlobalRoutingLinkRecord::PointToPoint, ns3::GlobalRoutingLinkRecord::SetLinkData(), ns3::GlobalRoutingLinkRecord::SetLinkId(), ns3::GlobalRoutingLinkRecord::SetLinkType(), ns3::GlobalRoutingLinkRecord::SetMetric(), and ns3::GlobalRoutingLinkRecord::StubNetwork.
Referenced by DiscoverLSAs().
|
private |
Process a single broadcast link.
Definition at line 761 of file global-router-interface.cc.
References ns3::NetDeviceContainer::Add(), ns3::GlobalRoutingLSA::AddLinkRecord(), AnotherRouterOnLink(), ClearBridgesVisited(), ns3::Ipv4Address::CombineMask(), FindDesignatedRouterForLink(), FindInterfaceForDevice(), ns3::Ipv4Mask::Get(), ns3::Node::GetId(), ns3::NetDevice::GetNode(), ns3::Object::GetObject(), ns3::Ipv4Mask::GetPrefixLength(), NS_ABORT_MSG_IF, NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Ipv4Address::Set(), ns3::GlobalRoutingLinkRecord::SetLinkData(), ns3::GlobalRoutingLinkRecord::SetLinkId(), ns3::GlobalRoutingLinkRecord::SetLinkType(), ns3::GlobalRoutingLinkRecord::SetMetric(), ns3::GlobalRoutingLinkRecord::StubNetwork, and ns3::GlobalRoutingLinkRecord::TransitNetwork.
Referenced by ProcessBroadcastLink().
void ns3::GlobalRouter::RemoveInjectedRoute | ( | uint32_t | i | ) |
Withdraw a route from the global unicast routing table.
Calling this function will cause all indexed routes numbered above index i to have their index decremented. For instance, it is possible to remove N injected routes by calling RemoveInjectedRoute (0) N times.
i | The index (into the injected routing list) of the route to remove. |
Definition at line 1655 of file global-router-interface.cc.
References m_injectedRoutes, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
void ns3::GlobalRouter::SetRoutingProtocol | ( | Ptr< Ipv4GlobalRouting > | routing | ) |
Set the specific Global Routing Protocol to be used.
routing | the routing protocol |
Definition at line 533 of file global-router-interface.cc.
References m_routingProtocol, and NS_LOG_FUNCTION.
bool ns3::GlobalRouter::WithdrawRoute | ( | Ipv4Address | network, |
Ipv4Mask | networkMask | ||
) |
Withdraw a route from the global unicast routing table.
network | The Network to withdraw |
networkMask | The Network Mask to withdraw |
Definition at line 1674 of file global-router-interface.cc.
References m_injectedRoutes, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
|
mutableprivate |
Container of bridges visited.
Definition at line 874 of file global-router-interface.h.
Referenced by BridgeHasAlreadyBeenVisited(), ClearBridgesVisited(), and MarkBridgeAsVisited().
|
private |
Routes we are exporting.
Definition at line 867 of file global-router-interface.h.
Referenced by DiscoverLSAs(), DoDispose(), GetInjectedRoute(), GetNInjectedRoutes(), InjectRoute(), RemoveInjectedRoute(), and WithdrawRoute().
|
private |
database of GlobalRoutingLSAs
Definition at line 859 of file global-router-interface.h.
Referenced by BuildNetworkLSAs(), ClearLSAs(), DiscoverLSAs(), GetLSA(), and GetNumLSAs().
|
private |
router ID (its IPv4 address)
Definition at line 861 of file global-router-interface.h.
Referenced by GlobalRouter(), BuildNetworkLSAs(), DiscoverLSAs(), and GetRouterId().
|
private |
the Ipv4GlobalRouting in use
Definition at line 862 of file global-router-interface.h.
Referenced by DoDispose(), GetRoutingProtocol(), and SetRoutingProtocol().