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

Nix-vector routing protocol. More...

#include "nix-vector-routing.h"

+ Inheritance diagram for ns3::NixVectorRouting< T >:
+ Collaboration diagram for ns3::NixVectorRouting< T >:

Public Member Functions

 NixVectorRouting ()
 
 ~NixVectorRouting ()
 
void FlushGlobalNixRoutingCache () const
 Called when run-time link topology change occurs which iterates through the node list and flushes any nix vector caches.
 
void PrintRoutingPath (Ptr< Node > source, IpAddress dest, Ptr< OutputStreamWrapper > stream, Time::Unit unit) const
 Print the Routing Path according to Nix Routing.
 
void SetNode (Ptr< Node > node)
 Set the Node pointer of the node for which this routing protocol is to be placed.
 

Static Public Member Functions

static TypeId GetTypeId ()
 The Interface ID of the Global Router interface.
 

Private Types

typedef Callback< void, Ptr< const Packet >, const IpHeader &, Socket::SocketErrnoErrorCallback
 Callback for routing errors (e.g., no route found)
 
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 IpAddressHash = typename std::conditional_t< IsIpv4, Ipv4AddressHash, Ipv6AddressHash >
 Alias for Ipv4AddressHash and Ipv6AddressHash classes.
 
typedef std::unordered_map< IpAddress, ns3::Ptr< ns3::Node >, IpAddressHashIpAddressToNodeMap
 Mapping of IP address to ns-3 node.
 
using IpHeader = typename std::conditional_t< IsIpv4, Ipv4Header, Ipv6Header >
 Alias for Ipv4Header and Ipv6Header classes.
 
using IpInterface = typename std::conditional_t< IsIpv4, Ipv4Interface, Ipv6Interface >
 Alias for Ipv4Interface and Ipv6Interface classes.
 
using IpInterfaceAddress = typename std::conditional_t< IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress >
 Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.
 
using IpL3Protocol = typename std::conditional_t< IsIpv4, Ipv4L3Protocol, Ipv6L3Protocol >
 Alias for Ipv4L3Protocol and Ipv4L3Protocol classes.
 
using IpRoute = typename std::conditional_t< IsIpv4, Ipv4Route, Ipv6Route >
 Alias for Ipv4Route and Ipv6Route classes.
 
typedef std::map< IpAddress, Ptr< IpRoute > > IpRouteMap_t
 Map of IpAddress to IpRoute.
 
typedef Callback< void, Ptr< const Packet >, const IpHeader &, uint32_tLocalDeliverCallback
 Callback for packets to be locally delivered.
 
typedef std::conditional_t< IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6MulticastForwardCallback
 Callback for multicast packets to be forwarded.
 
typedef Callback< void, Ptr< Ipv4MulticastRoute >, Ptr< const Packet >, const IpHeader & > MulticastForwardCallbackv4
 Callback for IPv4 multicast packets to be forwarded.
 
typedef Callback< void, Ptr< const NetDevice >, Ptr< Ipv6MulticastRoute >, Ptr< const Packet >, const IpHeader & > MulticastForwardCallbackv6
 Callback for IPv6 multicast packets to be forwarded.
 
typedef std::unordered_map< Ptr< NetDevice >, Ptr< IpInterface > > NetDeviceToIpInterfaceMap
 Mapping of Ptr<NetDevice> to Ptr<IpInterface>.
 
typedef std::map< IpAddress, Ptr< NixVector > > NixMap_t
 Map of IpAddress to NixVector.
 
typedef std::conditional_t< IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6UnicastForwardCallback
 Callback for unicast packets to be forwarded.
 
typedef Callback< void, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > UnicastForwardCallbackv4
 Callback for IPv4 unicast packets to be forwarded.
 
typedef Callback< void, Ptr< const NetDevice >, Ptr< IpRoute >, Ptr< const Packet >, const IpHeader & > UnicastForwardCallbackv6
 Callback for IPv6 unicast packets to be forwarded.
 

Private Member Functions

bool BFS (uint32_t numberOfNodes, Ptr< Node > source, Ptr< Node > dest, std::vector< Ptr< Node > > &parentVector, Ptr< NetDevice > oif) const
 Breadth first search algorithm.
 
void BuildIpAddressToNodeMap () const
 Build map from IP Address to Node for faster lookup.
 
bool BuildNixVector (const std::vector< Ptr< Node > > &parentVector, uint32_t source, uint32_t dest, Ptr< NixVector > nixVector) const
 Recurses the T vector, created by BFS and actually builds the nixvector.
 
void CheckCacheStateAndFlush () const
 Flushes routing caches if required.
 
void DoDispose ()
 
void DoInitialize ()
 
uint32_t FindNetDeviceForNixIndex (Ptr< Node > node, uint32_t nodeIndex, IpAddress &gatewayIp) const
 Nix index is with respect to the neighbors.
 
uint32_t FindTotalNeighbors (Ptr< Node > node) const
 Simply iterates through the nodes net-devices and determines how many neighbors the node has.
 
void FlushIpRouteCache () const
 Flushes the cache which stores the Ip route based on the destination IP.
 
void FlushNixCache () const
 Flushes the cache which stores nix-vector based on destination IP.
 
void GetAdjacentNetDevices (Ptr< NetDevice > netDevice, Ptr< Channel > channel, NetDeviceContainer &netDeviceContainer) const
 Given a net-device returns all the adjacent net-devices, essentially getting the neighbors on that channel.
 
Ptr< IpInterfaceGetInterfaceByNetDevice (Ptr< NetDevice > netDevice) const
 Iterates through the node list and finds the one corresponding to the given IpAddress.
 
Ptr< IpRouteGetIpRouteInCache (IpAddress address)
 Checks the cache based on dest IP for the IpRoute.
 
Ptr< NixVectorGetNixVector (Ptr< Node > source, IpAddress dest, Ptr< NetDevice > oif) const
 Takes in the source node and dest IP and calls GetNodeByIp, BFS, accounting for any output interface specified, and finally BuildNixVector to return the built nix-vector.
 
Ptr< NixVectorGetNixVectorInCache (const IpAddress &address, bool &foundInCache) const
 Checks the cache based on dest IP for the nix-vector.
 
Ptr< NodeGetNodeByIp (IpAddress dest) const
 Iterates through the node list and finds the one corresponding to the given IpAddress.
 
Ptr< BridgeNetDeviceNetDeviceIsBridged (Ptr< NetDevice > nd) const
 Determine if the NetDevice is bridged.
 
virtual void NotifyAddAddress (uint32_t interface, IpInterfaceAddress address)
 
virtual void NotifyAddRoute (IpAddress dst, Ipv6Prefix mask, IpAddress nextHop, uint32_t interface, IpAddress prefixToUse=IpAddress::GetZero())
 Notify a new route.
 
virtual void NotifyInterfaceDown (uint32_t interface)
 
virtual void NotifyInterfaceUp (uint32_t interface)
 
virtual void NotifyRemoveAddress (uint32_t interface, IpInterfaceAddress address)
 
virtual void NotifyRemoveRoute (IpAddress dst, Ipv6Prefix mask, IpAddress nextHop, uint32_t interface, IpAddress prefixToUse=IpAddress::GetZero())
 Notify route removing.
 
virtual void PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
 Print the Routing Table entries.
 
void ResetTotalNeighbors ()
 Upon a run-time topology change caches are flushed and the total number of neighbors is reset to zero.
 
virtual bool RouteInput (Ptr< const Packet > p, const IpHeader &header, Ptr< const NetDevice > idev, const UnicastForwardCallback &ucb, const MulticastForwardCallback &mcb, const LocalDeliverCallback &lcb, const ErrorCallback &ecb)
 Route an input packet (to be forwarded or locally delivered)
 
virtual Ptr< IpRouteRouteOutput (Ptr< Packet > p, const IpHeader &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
 Query routing cache for an existing route, for an outbound packet.
 
virtual void SetIpv4 (Ptr< Ip > ipv4)
 Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol.
 
virtual void SetIpv6 (Ptr< Ip > ipv6)
 Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.
 

Private Attributes

Ptr< Ipm_ip
 IP object.
 
IpRouteMap_t m_ipRouteCache
 Cache stores IpRoutes based on destination ip.
 
NixMap_t m_nixCache
 Cache stores nix-vectors based on destination ip.
 
Ptr< Nodem_node
 Node object.
 
uint32_t m_totalNeighbors
 Total neighbors used for nix-vector to determine number of bits.
 

Static Private Attributes

static uint32_t g_epoch = 1
 Nix Epoch, incremented each time a flush is performed.
 
static IpAddressToNodeMap g_ipAddressToNodeMap
 Address to node map.
 
static bool g_isCacheDirty = false
 Flag to mark when caches are dirty and need to be flushed.
 
static NetDeviceToIpInterfaceMap g_netdeviceToIpInterfaceMap
 NetDevice pointer to IpInterface pointer map.
 
static constexpr bool IsIpv4 = std::is_same_v<Ipv4RoutingProtocol, T>
 Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.
 

Detailed Description

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

Nix-vector routing protocol.

Internal:
Since this class is meant to be specialized only by Ipv4RoutingProtocol or Ipv6RoutingProtocol the implementation of this class doesn't need to be exposed here; it is in nix-vector-routing.cc.

Definition at line 69 of file nix-vector-routing.h.

Member Typedef Documentation

◆ ErrorCallback

template<typename T >
typedef Callback<void, Ptr<const Packet>, const IpHeader&, Socket::SocketErrno> ns3::NixVectorRouting< T >::ErrorCallback
private

Callback for routing errors (e.g., no route found)

Definition at line 324 of file nix-vector-routing.h.

◆ Ip

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

Alias for Ipv4 and Ipv6 classes.

Definition at line 77 of file nix-vector-routing.h.

◆ IpAddress

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

Alias for Ipv4Address and Ipv6Address classes.

Definition at line 80 of file nix-vector-routing.h.

◆ IpAddressHash

template<typename T >
using ns3::NixVectorRouting< T >::IpAddressHash = typename std::conditional_t<IsIpv4, Ipv4AddressHash, Ipv6AddressHash>
private

Alias for Ipv4AddressHash and Ipv6AddressHash classes.

Definition at line 86 of file nix-vector-routing.h.

◆ IpAddressToNodeMap

template<typename T >
typedef std::unordered_map<IpAddress, ns3::Ptr<ns3::Node>, IpAddressHash> ns3::NixVectorRouting< T >::IpAddressToNodeMap
private

Mapping of IP address to ns-3 node.

Used to avoid linear searching of nodes/devices to find a node in GetNodeByIp() method. NIX vector routing assumes IP addresses are unique so mapping can be done without duplication.

Definition at line 513 of file nix-vector-routing.h.

◆ IpHeader

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

Alias for Ipv4Header and Ipv6Header classes.

Definition at line 89 of file nix-vector-routing.h.

◆ IpInterface

template<typename T >
using ns3::NixVectorRouting< T >::IpInterface = typename std::conditional_t<IsIpv4, Ipv4Interface, Ipv6Interface>
private

Alias for Ipv4Interface and Ipv6Interface classes.

Definition at line 96 of file nix-vector-routing.h.

◆ IpInterfaceAddress

template<typename T >
using ns3::NixVectorRouting< T >::IpInterfaceAddress = typename std::conditional_t<IsIpv4, Ipv4InterfaceAddress, Ipv6InterfaceAddress>
private

Alias for Ipv4InterfaceAddress and Ipv6InterfaceAddress classes.

Definition at line 92 of file nix-vector-routing.h.

◆ IpL3Protocol

template<typename T >
using ns3::NixVectorRouting< T >::IpL3Protocol = typename std::conditional_t<IsIpv4, Ipv4L3Protocol, Ipv6L3Protocol>
private

Alias for Ipv4L3Protocol and Ipv4L3Protocol classes.

Definition at line 99 of file nix-vector-routing.h.

◆ IpRoute

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

Alias for Ipv4Route and Ipv6Route classes.

Definition at line 83 of file nix-vector-routing.h.

◆ IpRouteMap_t

template<typename T >
typedef std::map<IpAddress, Ptr<IpRoute> > ns3::NixVectorRouting< T >::IpRouteMap_t
private

Map of IpAddress to IpRoute.

Definition at line 289 of file nix-vector-routing.h.

◆ LocalDeliverCallback

template<typename T >
typedef Callback<void, Ptr<const Packet>, const IpHeader&, uint32_t> ns3::NixVectorRouting< T >::LocalDeliverCallback
private

Callback for packets to be locally delivered.

Definition at line 321 of file nix-vector-routing.h.

◆ MulticastForwardCallback

template<typename T >
typedef std::conditional_t<IsIpv4, MulticastForwardCallbackv4, MulticastForwardCallbackv6> ns3::NixVectorRouting< T >::MulticastForwardCallback
private

Callback for multicast packets to be forwarded.

Definition at line 318 of file nix-vector-routing.h.

◆ MulticastForwardCallbackv4

template<typename T >
typedef Callback<void, Ptr<Ipv4MulticastRoute>, Ptr<const Packet>, const IpHeader&> ns3::NixVectorRouting< T >::MulticastForwardCallbackv4
private

Callback for IPv4 multicast packets to be forwarded.

Definition at line 305 of file nix-vector-routing.h.

◆ MulticastForwardCallbackv6

template<typename T >
typedef Callback<void, Ptr<const NetDevice>, Ptr<Ipv6MulticastRoute>, Ptr<const Packet>, const IpHeader&> ns3::NixVectorRouting< T >::MulticastForwardCallbackv6
private

Callback for IPv6 multicast packets to be forwarded.

Definition at line 313 of file nix-vector-routing.h.

◆ NetDeviceToIpInterfaceMap

template<typename T >
typedef std::unordered_map<Ptr<NetDevice>, Ptr<IpInterface> > ns3::NixVectorRouting< T >::NetDeviceToIpInterfaceMap
private

Mapping of Ptr<NetDevice> to Ptr<IpInterface>.

Definition at line 517 of file nix-vector-routing.h.

◆ NixMap_t

template<typename T >
typedef std::map<IpAddress, Ptr<NixVector> > ns3::NixVectorRouting< T >::NixMap_t
private

Map of IpAddress to NixVector.

Definition at line 287 of file nix-vector-routing.h.

◆ UnicastForwardCallback

template<typename T >
typedef std::conditional_t<IsIpv4, UnicastForwardCallbackv4, UnicastForwardCallbackv6> ns3::NixVectorRouting< T >::UnicastForwardCallback
private

Callback for unicast packets to be forwarded.

Definition at line 301 of file nix-vector-routing.h.

◆ UnicastForwardCallbackv4

template<typename T >
typedef Callback<void, Ptr<IpRoute>, Ptr<const Packet>, const IpHeader&> ns3::NixVectorRouting< T >::UnicastForwardCallbackv4
private

Callback for IPv4 unicast packets to be forwarded.

Definition at line 293 of file nix-vector-routing.h.

◆ UnicastForwardCallbackv6

template<typename T >
typedef Callback<void, Ptr<const NetDevice>, Ptr<IpRoute>, Ptr<const Packet>, const IpHeader&> ns3::NixVectorRouting< T >::UnicastForwardCallbackv6
private

Callback for IPv6 unicast packets to be forwarded.

Definition at line 297 of file nix-vector-routing.h.

Constructor & Destructor Documentation

◆ NixVectorRouting()

template<typename T >
ns3::NixVectorRouting< T >::NixVectorRouting

Definition at line 79 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

◆ ~NixVectorRouting()

template<typename T >
ns3::NixVectorRouting< T >::~NixVectorRouting

Definition at line 86 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ BFS()

template<typename T >
bool ns3::NixVectorRouting< T >::BFS ( uint32_t  numberOfNodes,
Ptr< Node source,
Ptr< Node dest,
std::vector< Ptr< Node > > &  parentVector,
Ptr< NetDevice oif 
) const
private

Breadth first search algorithm.

Parameters
[in]numberOfNodestotal number of nodes
[in]sourceSource Node
[in]destDestination Node
[out]parentVectorParent vector for retracing routes
[in]oifspecific output interface to use from source node, if not null
Returns
false if dest not found, true o.w.

Definition at line 1131 of file nix-vector-routing.cc.

References ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ BuildIpAddressToNodeMap()

template<typename T >
void ns3::NixVectorRouting< T >::BuildIpAddressToNodeMap
private

Build map from IP Address to Node for faster lookup.

Definition at line 465 of file nix-vector-routing.cc.

References ns3::NodeList::Begin(), ns3::NodeList::End(), NS_ABORT_MSG_IF, NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ BuildNixVector()

template<typename T >
bool ns3::NixVectorRouting< T >::BuildNixVector ( const std::vector< Ptr< Node > > &  parentVector,
uint32_t  source,
uint32_t  dest,
Ptr< NixVector nixVector 
) const
private

Recurses the T vector, created by BFS and actually builds the nixvector.

Parameters
[in]parentVectorParent vector for retracing routes
[in]sourceSource Node index
[in]destDestination Node index
[out]nixVectorthe NixVector to be used for routing
Returns
true on success, false otherwise.

Definition at line 285 of file nix-vector-routing.cc.

References ns3::NetDeviceContainer::Begin(), ns3::NetDeviceContainer::End(), ns3::NetDeviceContainer::GetN(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ CheckCacheStateAndFlush()

template<typename T >
void ns3::NixVectorRouting< T >::CheckCacheStateAndFlush
private

Flushes routing caches if required.

Definition at line 1431 of file nix-vector-routing.cc.

◆ DoDispose()

template<typename T >
void ns3::NixVectorRouting< T >::DoDispose
private

◆ DoInitialize()

template<typename T >
void ns3::NixVectorRouting< T >::DoInitialize
private

◆ FindNetDeviceForNixIndex()

template<typename T >
uint32_t ns3::NixVectorRouting< T >::FindNetDeviceForNixIndex ( Ptr< Node node,
uint32_t  nodeIndex,
IpAddress gatewayIp 
) const
private

Nix index is with respect to the neighbors.

The net-device index must be derived from this

Parameters
[in]nodethe current node under consideration
[in]nodeIndexNix Node index
[out]gatewayIpIP address of the gateway
Returns
the index of the NetDevice in the node.

Definition at line 652 of file nix-vector-routing.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ FindTotalNeighbors()

template<typename T >
uint32_t ns3::NixVectorRouting< T >::FindTotalNeighbors ( Ptr< Node node) const
private

Simply iterates through the nodes net-devices and determines how many neighbors the node has.

Parameters
[in]nodenode pointer
Returns
the number of neighbors of m_node.

Definition at line 575 of file nix-vector-routing.cc.

References ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ FlushGlobalNixRoutingCache()

template<typename T >
template void ns3::NixVectorRouting< T >::FlushGlobalNixRoutingCache ( ) const

Called when run-time link topology change occurs which iterates through the node list and flushes any nix vector caches.

Internal:
const is used here due to need to potentially flush the cache in const methods such as PrintRoutingTable. Caches are stored in mutable variables and flushed in const methods.

Definition at line 150 of file nix-vector-routing.cc.

References ns3::NodeList::Begin(), ns3::NodeList::End(), NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ FlushIpRouteCache()

template<typename T >
void ns3::NixVectorRouting< T >::FlushIpRouteCache
private

Flushes the cache which stores the Ip route based on the destination IP.

Definition at line 184 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

◆ FlushNixCache()

template<typename T >
void ns3::NixVectorRouting< T >::FlushNixCache
private

Flushes the cache which stores nix-vector based on destination IP.

Definition at line 176 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

◆ GetAdjacentNetDevices()

template<typename T >
void ns3::NixVectorRouting< T >::GetAdjacentNetDevices ( Ptr< NetDevice netDevice,
Ptr< Channel channel,
NetDeviceContainer netDeviceContainer 
) const
private

Given a net-device returns all the adjacent net-devices, essentially getting the neighbors on that channel.

Parameters
[in]netDevicethe NetDevice attached to the channel.
[in]channelthe channel to check
[out]netDeviceContainerthe NetDeviceContainer of the NetDevices in the channel.

Definition at line 364 of file nix-vector-routing.cc.

References ns3::NetDeviceContainer::Add(), ns3::Ipv6InterfaceAddress::LINKLOCAL, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ GetInterfaceByNetDevice()

template<typename T >
Ptr< typename NixVectorRouting< T >::IpInterface > ns3::NixVectorRouting< T >::GetInterfaceByNetDevice ( Ptr< NetDevice netDevice) const
private

Iterates through the node list and finds the one corresponding to the given IpAddress.

Parameters
netDeviceNetDevice pointer
Returns
The node with the specified IP.

Definition at line 548 of file nix-vector-routing.cc.

References NS_LOG_ERROR.

◆ GetIpRouteInCache()

template<typename T >
Ptr< typename NixVectorRouting< T >::IpRoute > ns3::NixVectorRouting< T >::GetIpRouteInCache ( IpAddress  address)
private

Checks the cache based on dest IP for the IpRoute.

Parameters
addressAddress to check
Returns
The cached route.

Definition at line 266 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GetNixVector()

template<typename T >
Ptr< NixVector > ns3::NixVectorRouting< T >::GetNixVector ( Ptr< Node source,
IpAddress  dest,
Ptr< NetDevice oif 
) const
private

Takes in the source node and dest IP and calls GetNodeByIp, BFS, accounting for any output interface specified, and finally BuildNixVector to return the built nix-vector.

Parameters
sourceSource node
destDestination node address
oifPreferred output interface
Returns
The NixVector to be used in routing.
Internal:
Do not process packets to self (see Bug 1308)

Definition at line 192 of file nix-vector-routing.cc.

References ns3::NodeList::GetNNodes(), NS_LOG_DEBUG, NS_LOG_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetNixVectorInCache()

template<typename T >
Ptr< NixVector > ns3::NixVectorRouting< T >::GetNixVectorInCache ( const IpAddress address,
bool &  foundInCache 
) const
private

Checks the cache based on dest IP for the nix-vector.

Parameters
addressAddress to check
foundInCacheAddress found in cache
Returns
The NixVector to be used in routing.

Definition at line 245 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GetNodeByIp()

template<typename T >
Ptr< Node > ns3::NixVectorRouting< T >::GetNodeByIp ( IpAddress  dest) const
private

Iterates through the node list and finds the one corresponding to the given IpAddress.

Parameters
destdestination node IP
Returns
The node with the specified IP.

Definition at line 519 of file nix-vector-routing.cc.

References NS_LOG_ERROR, and NS_LOG_FUNCTION.

◆ GetTypeId()

template<typename T >
TypeId ns3::NixVectorRouting< T >::GetTypeId
static

The Interface ID of the Global Router interface.

Returns
The Interface ID
See also
Object::GetObject ()

Definition at line 60 of file nix-vector-routing.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ NetDeviceIsBridged()

template<typename T >
Ptr< BridgeNetDevice > ns3::NixVectorRouting< T >::NetDeviceIsBridged ( Ptr< NetDevice nd) const
private

Determine if the NetDevice is bridged.

Parameters
ndthe NetDevice to check
Returns
the bridging NetDevice (or null if the NetDevice is not bridged)

Definition at line 609 of file nix-vector-routing.cc.

References NS_ABORT_MSG_UNLESS, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ NotifyAddAddress()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyAddAddress ( uint32_t  interface,
IpInterfaceAddress  address 
)
privatevirtual
Parameters
interfacethe index of the interface we are being notified about
addressa new address being added to an interface
See also
Ipv4RoutingProtocol::NotifyAddAddress
Ipv6RoutingProtocol::NotifyAddAddress

Definition at line 1095 of file nix-vector-routing.cc.

◆ NotifyAddRoute()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyAddRoute ( IpAddress  dst,
Ipv6Prefix  mask,
IpAddress  nextHop,
uint32_t  interface,
IpAddress  prefixToUse = IpAddress::GetZero() 
)
privatevirtual

Notify a new route.

Parameters
dstdestination address
maskdestination mask
nextHopnextHop for this destination
interfaceoutput interface
prefixToUseprefix to use as source with this route
See also
Ipv6RoutingProtocol::NotifyAddRoute

Definition at line 1109 of file nix-vector-routing.cc.

◆ NotifyInterfaceDown()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyInterfaceDown ( uint32_t  interface)
privatevirtual
Parameters
interfacethe index of the interface we are being notified about
See also
Ipv4RoutingProtocol::NotifyInterfaceDown
Ipv6RoutingProtocol::NotifyInterfaceDown

Definition at line 1088 of file nix-vector-routing.cc.

◆ NotifyInterfaceUp()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyInterfaceUp ( uint32_t  interface)
privatevirtual
Parameters
interfacethe index of the interface we are being notified about
See also
Ipv4RoutingProtocol::NotifyInterfaceUp
Ipv6RoutingProtocol::NotifyInterfaceUp

Definition at line 1081 of file nix-vector-routing.cc.

◆ NotifyRemoveAddress()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyRemoveAddress ( uint32_t  interface,
IpInterfaceAddress  address 
)
privatevirtual
Parameters
interfacethe index of the interface we are being notified about
addressa new address being added to an interface
See also
Ipv4RoutingProtocol::NotifyRemoveAddress
Ipv6RoutingProtocol::NotifyRemoveAddress

Definition at line 1102 of file nix-vector-routing.cc.

◆ NotifyRemoveRoute()

template<typename T >
void ns3::NixVectorRouting< T >::NotifyRemoveRoute ( IpAddress  dst,
Ipv6Prefix  mask,
IpAddress  nextHop,
uint32_t  interface,
IpAddress  prefixToUse = IpAddress::GetZero() 
)
privatevirtual

Notify route removing.

Parameters
dstdestination address
maskdestination mask
nextHopnextHop for this destination
interfaceoutput interface
prefixToUseprefix to use as source with this route
See also
Ipv6RoutingProtocol::NotifyRemoveRoute

Definition at line 1120 of file nix-vector-routing.cc.

◆ PrintRoutingPath()

template<typename T >
template void ns3::NixVectorRouting< T >::PrintRoutingPath ( Ptr< Node source,
IpAddress  dest,
Ptr< OutputStreamWrapper stream,
Time::Unit  unit 
) const

Print the Routing Path according to Nix Routing.

Parameters
sourceSource node
destDestination node address
streamThe ostream the Routing path is printed to
unitthe time unit to be used in the report
Note
IpAddress is alias for either Ipv4Address or Ipv6Address depending on on whether the network is IPv4 or IPv6 respectively.

Definition at line 1296 of file nix-vector-routing.cc.

References ns3::Time::As(), ns3::Now(), NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ PrintRoutingTable()

template<typename T >
void ns3::NixVectorRouting< T >::PrintRoutingTable ( Ptr< OutputStreamWrapper stream,
Time::Unit  unit = Time::S 
) const
privatevirtual

Print the Routing Table entries.

Parameters
streamThe ostream the Routing table is printed to
unitThe time unit to be used in the report
See also
Ipv4RoutingProtocol::PrintRoutingTable
Ipv6RoutingProtocol::PrintRoutingTable

Definition at line 1002 of file nix-vector-routing.cc.

References ns3::Time::As(), ns3::Names::FindName(), ns3::Now(), and NS_LOG_FUNCTION_NOARGS.

+ Here is the call graph for this function:

◆ ResetTotalNeighbors()

template<typename T >
void ns3::NixVectorRouting< T >::ResetTotalNeighbors ( )
private

Upon a run-time topology change caches are flushed and the total number of neighbors is reset to zero.

◆ RouteInput()

template<typename T >
bool ns3::NixVectorRouting< T >::RouteInput ( Ptr< const Packet p,
const IpHeader header,
Ptr< const NetDevice idev,
const UnicastForwardCallback ucb,
const MulticastForwardCallback mcb,
const LocalDeliverCallback lcb,
const ErrorCallback ecb 
)
privatevirtual

Route an input packet (to be forwarded or locally delivered)

Parameters
preceived packet
headerinput parameter used to form a search key for a route
idevPointer to ingress network device
ucbCallback for the case in which the packet is to be forwarded as unicast
mcbCallback for the case in which the packet is to be forwarded as multicast
lcbCallback for the case in which the packet is to be locally delivered
ecbCallback to call if there is an error in forwarding
Returns
true if NixVectorRouting class takes responsibility for forwarding or delivering the packet, false otherwise
See also
Ipv4RoutingProtocol::RouteInput
Ipv6RoutingProtocol::RouteInput

Definition at line 870 of file nix-vector-routing.cc.

References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Callback< R, UArgs >::IsNull(), NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ RouteOutput()

template<typename T >
Ptr< typename NixVectorRouting< T >::IpRoute > ns3::NixVectorRouting< T >::RouteOutput ( Ptr< Packet p,
const IpHeader header,
Ptr< NetDevice oif,
Socket::SocketErrno sockerr 
)
privatevirtual

Query routing cache for an existing route, for an outbound packet.

Parameters
ppacket to be routed. Note that this method may modify the packet. Callers may also pass in a null pointer.
headerinput parameter (used to form key to search for the route)
oifOutput interface Netdevice. May be zero, or may be bound via socket options to a particular output interface.
sockerrOutput parameter; socket errno
Returns
a code that indicates what happened in the lookup
See also
Ipv4RoutingProtocol::RouteOutput
Ipv6RoutingProtocol::RouteOutput

Definition at line 700 of file nix-vector-routing.cc.

References ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NOTERROR, ns3::Ipv6Address::GetZero(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

◆ SetIpv4()

template<typename T >
void ns3::NixVectorRouting< T >::SetIpv4 ( Ptr< Ip ipv4)
privatevirtual

Typically, invoked directly or indirectly from ns3::Ipv4::SetRoutingProtocol.

Parameters
ipv4the ipv4 object this routing protocol is being associated with
See also
Ipv4RoutingProtocol::SetIpv4

Definition at line 93 of file nix-vector-routing.cc.

References NS_ASSERT, and NS_LOG_DEBUG.

◆ SetIpv6()

template<typename T >
void ns3::NixVectorRouting< T >::SetIpv6 ( Ptr< Ip ipv6)
privatevirtual

Typically, invoked directly or indirectly from ns3::Ipv6::SetRoutingProtocol.

Parameters
ipv6the ipv6 object this routing protocol is being associated with
See also
Ipv6RoutingProtocol::SetIpv6

Definition at line 104 of file nix-vector-routing.cc.

References NS_ASSERT, and NS_LOG_DEBUG.

◆ SetNode()

template<typename T >
template void ns3::NixVectorRouting< T >::SetNode ( Ptr< Node node)

Set the Node pointer of the node for which this routing protocol is to be placed.

Parameters
nodeNode pointer

Definition at line 141 of file nix-vector-routing.cc.

References NS_LOG_FUNCTION_NOARGS.

Member Data Documentation

◆ g_epoch

template<typename T >
uint32_t ns3::NixVectorRouting< T >::g_epoch = 1
staticprivate

Nix Epoch, incremented each time a flush is performed.

Definition at line 492 of file nix-vector-routing.h.

◆ g_ipAddressToNodeMap

template<typename T >
NixVectorRouting< T >::IpAddressToNodeMap ns3::NixVectorRouting< T >::g_ipAddressToNodeMap
staticprivate

Address to node map.

Definition at line 514 of file nix-vector-routing.h.

◆ g_isCacheDirty

template<typename T >
bool ns3::NixVectorRouting< T >::g_isCacheDirty = false
staticprivate

Flag to mark when caches are dirty and need to be flushed.

Used for lazy cleanup of caches when there are many topology changes.

Definition at line 487 of file nix-vector-routing.h.

◆ g_netdeviceToIpInterfaceMap

template<typename T >
NixVectorRouting< T >::NetDeviceToIpInterfaceMap ns3::NixVectorRouting< T >::g_netdeviceToIpInterfaceMap
staticprivate

NetDevice pointer to IpInterface pointer map.

Definition at line 519 of file nix-vector-routing.h.

◆ IsIpv4

template<typename T >
constexpr bool ns3::NixVectorRouting< T >::IsIpv4 = std::is_same_v<Ipv4RoutingProtocol, T>
staticconstexprprivate

Alias for determining whether the parent is Ipv4RoutingProtocol or Ipv6RoutingProtocol.

Definition at line 74 of file nix-vector-routing.h.

◆ m_ip

template<typename T >
Ptr<Ip> ns3::NixVectorRouting< T >::m_ip
private

IP object.

Definition at line 500 of file nix-vector-routing.h.

◆ m_ipRouteCache

template<typename T >
IpRouteMap_t ns3::NixVectorRouting< T >::m_ipRouteCache
mutableprivate

Cache stores IpRoutes based on destination ip.

Definition at line 498 of file nix-vector-routing.h.

◆ m_nixCache

template<typename T >
NixMap_t ns3::NixVectorRouting< T >::m_nixCache
mutableprivate

Cache stores nix-vectors based on destination ip.

Definition at line 495 of file nix-vector-routing.h.

◆ m_node

template<typename T >
Ptr<Node> ns3::NixVectorRouting< T >::m_node
private

Node object.

Definition at line 501 of file nix-vector-routing.h.

◆ m_totalNeighbors

template<typename T >
uint32_t ns3::NixVectorRouting< T >::m_totalNeighbors
private

Total neighbors used for nix-vector to determine number of bits.

Definition at line 504 of file nix-vector-routing.h.


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