A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Radvd Class Reference

Router advertisement daemon. More...

#include <radvd.h>

+ Inheritance diagram for ns3::Radvd:
+ Collaboration diagram for ns3::Radvd:

Public Member Functions

 Radvd ()
 Constructor. More...
 
virtual ~Radvd ()
 Destructor. More...
 
void AddConfiguration (Ptr< RadvdInterface > routerInterface)
 Add configuration for an interface;. More...
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
- Public Member Functions inherited from ns3::Application
 Application ()
 
virtual ~Application ()
 
Ptr< NodeGetNode () const
 
void SetNode (Ptr< Node > node)
 
void SetStartTime (Time start)
 Specify application start time. More...
 
void SetStopTime (Time stop)
 Specify application stop time. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. 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
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Application
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Static Public Attributes

static const uint32_t MAX_RA_DELAY_TIME = 500
 Default value for maximum delay of RA (ms) More...
 

Protected Member Functions

virtual void DoDispose ()
 Dispose the instance. More...
 
- Protected Member Functions inherited from ns3::Application
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Private Types

typedef std::map< uint32_t,
EventId
EventIdMap
 Container: interface number, EventId. More...
 
typedef std::map< uint32_t,
EventId >::const_iterator 
EventIdMapCI
 Container Const Iterator: interface number, EventId. More...
 
typedef std::map< uint32_t,
EventId >::iterator 
EventIdMapI
 Container Iterator: interface number, EventId. More...
 
typedef std::list< Ptr
< RadvdInterface > > 
RadvdInterfaceList
 Container: Ptr to RadvdInterface. More...
 
typedef std::list< Ptr
< RadvdInterface >
>::const_iterator 
RadvdInterfaceListCI
 Container Const Iterator: Ptr to RadvdInterface. More...
 
typedef std::list< Ptr
< RadvdInterface > >::iterator 
RadvdInterfaceListI
 Container Iterator: Ptr to RadvdInterface. More...
 

Private Member Functions

void HandleRead (Ptr< Socket > socket)
 Handle received packet, especially router solicitation. More...
 
void ScheduleTransmit (Time dt, Ptr< RadvdInterface > config, EventId &eventId, Ipv6Address dst=Ipv6Address::GetAllNodesMulticast(), bool reschedule=false)
 Schedule sending a packet. More...
 
void Send (Ptr< RadvdInterface > config, Ipv6Address dst=Ipv6Address::GetAllNodesMulticast(), bool reschedule=false)
 Send a packet. More...
 
virtual void StartApplication ()
 Start the application. More...
 
virtual void StopApplication ()
 Stop the application. More...
 

Private Attributes

RadvdInterfaceList m_configurations
 List of configuration for interface. More...
 
EventIdMap m_eventIds
 Event ID map. More...
 
Ptr< UniformRandomVariablem_jitter
 Variable to provide jitter in advertisement interval. More...
 
Ptr< Socketm_socket
 Raw socket to send RA. More...
 

Additional Inherited Members

- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 
EventId m_startEvent
 The simulation time that the appliacation will end. More...
 
Time m_startTime
 The node that this application is installed on. More...
 
EventId m_stopEvent
 The event that will fire at m_startTime to start the application. More...
 
Time m_stopTime
 The simulation time that the appliacation will start. More...
 

Detailed Description

Router advertisement daemon.

Config Paths

ns3::Radvd is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/ApplicationList/[i]/$ns3::Radvd

Attributes

  • AdvertisementJitter: Uniform variable to provide jitter between min and max values of AdvInterval

Attributes defined in parent class ns3::Application

  • StartTime: Time at which the application will start
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read
  • StopTime: Time at which the application will stop
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read

No TraceSources are defined for this type.

Definition at line 47 of file radvd.h.

Member Typedef Documentation

typedef std::map<uint32_t, EventId> ns3::Radvd::EventIdMap
private

Container: interface number, EventId.

Definition at line 102 of file radvd.h.

typedef std::map<uint32_t, EventId>::const_iterator ns3::Radvd::EventIdMapCI
private

Container Const Iterator: interface number, EventId.

Definition at line 106 of file radvd.h.

typedef std::map<uint32_t, EventId>::iterator ns3::Radvd::EventIdMapI
private

Container Iterator: interface number, EventId.

Definition at line 104 of file radvd.h.

Container: Ptr to RadvdInterface.

Definition at line 95 of file radvd.h.

typedef std::list<Ptr<RadvdInterface> >::const_iterator ns3::Radvd::RadvdInterfaceListCI
private

Container Const Iterator: Ptr to RadvdInterface.

Definition at line 99 of file radvd.h.

Container Iterator: Ptr to RadvdInterface.

Definition at line 97 of file radvd.h.

Constructor & Destructor Documentation

ns3::Radvd::Radvd ( )

Constructor.

Definition at line 63 of file radvd.cc.

References NS_LOG_FUNCTION.

ns3::Radvd::~Radvd ( )
virtual

Destructor.

Definition at line 68 of file radvd.cc.

References m_configurations, m_socket, and NS_LOG_FUNCTION.

Member Function Documentation

void ns3::Radvd::AddConfiguration ( Ptr< RadvdInterface routerInterface)

Add configuration for an interface;.

Parameters
routerInterfaceconfiguration

Definition at line 125 of file radvd.cc.

References m_configurations, and NS_LOG_FUNCTION.

int64_t ns3::Radvd::AssignStreams ( 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.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Definition at line 132 of file radvd.cc.

References m_jitter, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

void ns3::Radvd::DoDispose ( void  )
protectedvirtual

Dispose the instance.

Reimplemented from ns3::Application.

Definition at line 79 of file radvd.cc.

References ns3::Application::DoDispose(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

TypeId ns3::Radvd::GetTypeId ( void  )
static

Get the type ID.

Returns
type ID

Definition at line 49 of file radvd.cc.

References m_jitter, and ns3::TypeId::SetParent().

Referenced by ns3::RadvdHelper::RadvdHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Radvd::ScheduleTransmit ( Time  dt,
Ptr< RadvdInterface config,
EventId eventId,
Ipv6Address  dst = Ipv6Address::GetAllNodesMulticast (),
bool  reschedule = false 
)
private

Schedule sending a packet.

Parameters
dtinterval between packet
configinterface configuration
eventIdevent ID associated
dstIPv6 destination address
rescheduleif true another send will be reschedule (periodic)

Definition at line 139 of file radvd.cc.

References NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and Send().

Referenced by HandleRead(), Send(), and StartApplication().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Radvd::Send ( Ptr< RadvdInterface config,
Ipv6Address  dst = Ipv6Address::GetAllNodesMulticast (),
bool  reschedule = false 
)
private

Send a packet.

Parameters
configinterface configuration
dstdestination address (default ff02::1)
rescheduleif true another send will be reschedule (periodic)

Definition at line 145 of file radvd.cc.

References ns3::Packet::AddHeader(), ns3::Packet::AddPacketTag(), ns3::Socket::Bind(), ns3::Socket::Connect(), ns3::Ipv6Address::GetAllNodesMulticast(), ns3::RadvdInterface::GetCurHopLimit(), ns3::RadvdInterface::GetDefaultLifeTime(), ns3::RadvdInterface::GetInterface(), ns3::RadvdInterface::GetLinkMtu(), ns3::RadvdInterface::GetMaxRtrAdvInterval(), ns3::RadvdInterface::GetMinRtrAdvInterval(), ns3::Application::GetNode(), ns3::Object::GetObject(), ns3::RadvdInterface::GetPrefixes(), ns3::RadvdInterface::GetReachableTime(), ns3::RadvdInterface::GetRetransTimer(), ns3::Packet::GetSize(), ns3::UniformRandomVariable::GetValue(), ns3::RadvdInterface::IsHomeAgentFlag(), ns3::RadvdInterface::IsManagedFlag(), ns3::RadvdInterface::IsOtherConfigFlag(), ns3::RadvdInterface::IsSourceLLAddress(), list, m_eventIds, m_jitter, m_socket, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ScheduleTransmit(), ns3::Socket::Send(), ns3::Icmpv6OptionPrefixInformation::SetFlags(), ns3::Icmpv6OptionPrefixInformation::SetPreferredTime(), ns3::Icmpv6OptionPrefixInformation::SetPrefix(), ns3::Icmpv6OptionPrefixInformation::SetPrefixLength(), ns3::SocketIpTtlTag::SetTtl(), and ns3::Icmpv6OptionPrefixInformation::SetValidTime().

Referenced by ScheduleTransmit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Radvd::StopApplication ( void  )
privatevirtual

Stop the application.

Reimplemented from ns3::Application.

Definition at line 109 of file radvd.cc.

References ns3::Simulator::Cancel(), m_eventIds, m_socket, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

Member Data Documentation

RadvdInterfaceList ns3::Radvd::m_configurations
private

List of configuration for interface.

Definition at line 150 of file radvd.h.

Referenced by AddConfiguration(), HandleRead(), StartApplication(), and ~Radvd().

EventIdMap ns3::Radvd::m_eventIds
private

Event ID map.

Definition at line 155 of file radvd.h.

Referenced by HandleRead(), Send(), StartApplication(), and StopApplication().

Ptr<UniformRandomVariable> ns3::Radvd::m_jitter
private

Variable to provide jitter in advertisement interval.

Definition at line 160 of file radvd.h.

Referenced by AssignStreams(), GetTypeId(), HandleRead(), and Send().

Ptr<Socket> ns3::Radvd::m_socket
private

Raw socket to send RA.

Definition at line 145 of file radvd.h.

Referenced by Send(), StartApplication(), StopApplication(), and ~Radvd().

const uint32_t ns3::Radvd::MAX_RA_DELAY_TIME = 500
static

Default value for maximum delay of RA (ms)

Definition at line 69 of file radvd.h.

Referenced by HandleRead().


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