A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::RipNgHelper Class Reference

Helper class that adds RIPng routing to nodes. More...

#include "ripng-helper.h"

+ Inheritance diagram for ns3::RipNgHelper:
+ Collaboration diagram for ns3::RipNgHelper:

Public Member Functions

 RipNgHelper ()
 
 RipNgHelper (const RipNgHelper &o)
 Construct an RipNgHelper from another previously initialized instance (Copy Constructor).
 
 ~RipNgHelper () override
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
RipNgHelperCopy () const override
 
Ptr< Ipv6RoutingProtocolCreate (Ptr< Node > node) const override
 
void ExcludeInterface (Ptr< Node > node, uint32_t interface)
 Exclude an interface from RIPng protocol.
 
RipNgHelperoperator= (const RipNgHelper &)=delete
 
void Set (std::string name, const AttributeValue &value)
 
void SetDefaultRouter (Ptr< Node > node, Ipv6Address nextHop, uint32_t interface)
 Install a default route in the node.
 
void SetInterfaceMetric (Ptr< Node > node, uint32_t interface, uint8_t metric)
 Set a metric for an interface.
 
- Public Member Functions inherited from ns3::Ipv6RoutingHelper
virtual ~Ipv6RoutingHelper ()
 Destroy an Ipv6 Ipv6RoutingHelper.
 
virtual Ipv6RoutingHelperCopy () const =0
 virtual constructor
 
virtual Ptr< Ipv6RoutingProtocolCreate (Ptr< Node > node) const =0
 

Private Attributes

ObjectFactory m_factory
 Object Factory.
 
std::map< Ptr< Node >, std::set< uint32_t > > m_interfaceExclusions
 Interface Exclusion set.
 
std::map< Ptr< Node >, std::map< uint32_t, uint8_t > > m_interfaceMetrics
 Interface Metric set.
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::Ipv6RoutingHelper
template<class T >
static Ptr< T > GetRouting (Ptr< Ipv6RoutingProtocol > protocol)
 Request a specified routing protocol <T> from Ipv6RoutingProtocol protocol.
 
static void PrintNeighborCacheAllAt (Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of all nodes at a particular time.
 
static void PrintNeighborCacheAllEvery (Time printInterval, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of all nodes at regular intervals specified by user.
 
static void PrintNeighborCacheAt (Time printTime, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of a node at a particular time.
 
static void PrintNeighborCacheEvery (Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the neighbor cache of a node at regular intervals specified by user.
 
static void PrintRoutingTableAllAt (Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of all nodes at a particular time.
 
static void PrintRoutingTableAllEvery (Time printInterval, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of all nodes at regular intervals specified by user.
 
static void PrintRoutingTableAt (Time printTime, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of a node at a particular time.
 
static void PrintRoutingTableEvery (Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
 prints the routing tables of a node at regular intervals specified by user.
 

Detailed Description

Helper class that adds RIPng routing to nodes.

This class is expected to be used in conjunction with ns3::InternetStackHelper::SetRoutingHelper

Definition at line 43 of file ripng-helper.h.

Constructor & Destructor Documentation

◆ RipNgHelper() [1/2]

ns3::RipNgHelper::RipNgHelper ( )

Definition at line 32 of file ripng-helper.cc.

References m_factory, and ns3::ObjectFactory::SetTypeId().

Referenced by Copy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RipNgHelper() [2/2]

ns3::RipNgHelper::RipNgHelper ( const RipNgHelper o)

Construct an RipNgHelper from another previously initialized instance (Copy Constructor).

Parameters
oThe object to copy from.

Definition at line 37 of file ripng-helper.cc.

References m_interfaceExclusions, and m_interfaceMetrics.

◆ ~RipNgHelper()

ns3::RipNgHelper::~RipNgHelper ( )
override

Definition at line 44 of file ripng-helper.cc.

References m_interfaceExclusions, and m_interfaceMetrics.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::RipNgHelper::AssignStreams ( NodeContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
cNetDeviceContainer of the set of net devices for which the SixLowPanNetDevice should be modified to use a fixed stream
streamfirst stream index to use
Returns
the number of stream indices assigned by this helper

Definition at line 89 of file ripng-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), list, and NS_ASSERT_MSG.

+ Here is the call graph for this function:

◆ Copy()

RipNgHelper * ns3::RipNgHelper::Copy ( ) const
overridevirtual
Returns
pointer to clone of this RipNgHelper

This method is mainly for internal use by the other helpers; clients are expected to free the dynamic memory allocated by this method

Implements ns3::Ipv6RoutingHelper.

Definition at line 51 of file ripng-helper.cc.

References RipNgHelper().

+ Here is the call graph for this function:

◆ Create()

Ptr< Ipv6RoutingProtocol > ns3::RipNgHelper::Create ( Ptr< Node node) const
overridevirtual
Parameters
nodethe node on which the routing protocol will run
Returns
a newly-created routing protocol

This method will be called by ns3::InternetStackHelper::Install

Implements ns3::Ipv6RoutingHelper.

Definition at line 57 of file ripng-helper.cc.

References ns3::ObjectFactory::Create(), m_factory, m_interfaceExclusions, and m_interfaceMetrics.

+ Here is the call graph for this function:

◆ ExcludeInterface()

void ns3::RipNgHelper::ExcludeInterface ( Ptr< Node node,
uint32_t  interface 
)

Exclude an interface from RIPng protocol.

You have to call this function before installing RIPng in the nodes.

Note: the exclusion means that RIPng will not be propagated on that interface. The network prefix on that interface will be still considered in RIPng.

Parameters
nodethe node
interfacethe network interface to be excluded

Definition at line 161 of file ripng-helper.cc.

References m_interfaceExclusions.

◆ operator=()

RipNgHelper & ns3::RipNgHelper::operator= ( const RipNgHelper )
delete

◆ Set()

void ns3::RipNgHelper::Set ( std::string  name,
const AttributeValue value 
)
Parameters
namethe name of the attribute to set
valuethe value of the attribute to set.

This method controls the attributes of ns3::RipNg

Definition at line 83 of file ripng-helper.cc.

References m_factory, and ns3::ObjectFactory::Set().

Referenced by Ipv6RipngSplitHorizonStrategyTest::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDefaultRouter()

void ns3::RipNgHelper::SetDefaultRouter ( Ptr< Node node,
Ipv6Address  nextHop,
uint32_t  interface 
)

Install a default route in the node.

The traffic will be routed to the nextHop, located on the specified interface, unless a more specific route is found.

Parameters
nodethe node
nextHopthe next hop
interfacethe network interface

Definition at line 129 of file ripng-helper.cc.

References list, and NS_ASSERT_MSG.

◆ SetInterfaceMetric()

void ns3::RipNgHelper::SetInterfaceMetric ( Ptr< Node node,
uint32_t  interface,
uint8_t  metric 
)

Set a metric for an interface.

You have to call this function before installing RIPng in the nodes.

Note: RIPng will apply the metric on route message reception. As a consequence, interface metric should be set on the receiver.

Parameters
nodethe node
interfacethe network interface
metricthe interface metric

Definition at line 179 of file ripng-helper.cc.

References m_interfaceMetrics.

Referenced by Ipv6RipngCountToInfinityTest::DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_factory

ObjectFactory ns3::RipNgHelper::m_factory
private

Object Factory.

Definition at line 141 of file ripng-helper.h.

Referenced by RipNgHelper(), Create(), and Set().

◆ m_interfaceExclusions

std::map<Ptr<Node>, std::set<uint32_t> > ns3::RipNgHelper::m_interfaceExclusions
private

Interface Exclusion set.

Definition at line 143 of file ripng-helper.h.

Referenced by RipNgHelper(), ~RipNgHelper(), Create(), and ExcludeInterface().

◆ m_interfaceMetrics

std::map<Ptr<Node>, std::map<uint32_t, uint8_t> > ns3::RipNgHelper::m_interfaceMetrics
private

Interface Metric set.

Definition at line 144 of file ripng-helper.h.

Referenced by RipNgHelper(), ~RipNgHelper(), Create(), and SetInterfaceMetric().


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