A Discrete-Event Network Simulator
API
ns3::Ping6 Class Reference

A ping6 application. More...

#include "ping6.h"

+ Inheritance diagram for ns3::Ping6:
+ Collaboration diagram for ns3::Ping6:

Public Member Functions

 Ping6 ()
 Constructor. More...
 
virtual ~Ping6 ()
 Destructor. More...
 
void SetIfIndex (uint32_t ifIndex)
 Set the out interface index. More...
 
void SetLocal (Ipv6Address ipv6)
 Set the local address. More...
 
void SetRemote (Ipv6Address ipv6)
 Set the remote peer. More...
 
void SetRouters (std::vector< Ipv6Address > routers)
 Set routers for routing type 0 (loose routing). 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 ()
 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<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (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 ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Application
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...
 

Protected Member Functions

virtual void DoDispose ()
 Dispose this object;. More...
 
- Protected Member Functions inherited from ns3::Application
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. 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...
 

Private Member Functions

void HandleRead (Ptr< Socket > socket)
 Receive method. More...
 
void ScheduleTransmit (Time dt)
 Schedule sending a packet. More...
 
void Send ()
 Send a packet. More...
 
virtual void StartApplication ()
 Start the application. More...
 
virtual void StopApplication ()
 Stop the application. More...
 

Private Attributes

Ipv6Address m_address
 Peer IPv6 address. More...
 
uint32_t m_count
 Number of "Echo request" packets that will be sent. More...
 
uint32_t m_ifIndex
 Out interface (i.e. More...
 
Time m_interval
 Interval between packets sent. More...
 
uint32_t m_ipInterfaceIndex
 IP interface index relative to the local address. More...
 
Ptr< Ipv6L3Protocolm_ipv6Protocol
 IP interface index relative to the local address. More...
 
Ipv6Address m_localAddress
 Local address. More...
 
Ipv6Address m_peerAddress
 Peer address. More...
 
std::vector< Ipv6Addressm_routers
 Routers addresses for routing type 0. More...
 
EventId m_sendEvent
 Event ID. More...
 
uint32_t m_sent
 Number of packets sent. More...
 
uint16_t m_seq
 Sequence number. More...
 
uint32_t m_size
 Size of the packet. More...
 
Ptr< Socketm_socket
 Local socket. More...
 

Additional Inherited Members

- Public Types inherited from ns3::Application
typedef void(* DelayAddressCallback) (const Time &delay, const Address &from)
 Common callback signature for packet delay and address. More...
 
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source. More...
 
- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 The node that this application is installed on. More...
 
EventId m_startEvent
 The event that will fire at m_startTime to start the application. More...
 
Time m_startTime
 The simulation time that the application will start. More...
 
EventId m_stopEvent
 The event that will fire at m_stopTime to end the application. More...
 
Time m_stopTime
 The simulation time that the application will end. More...
 

Detailed Description

A ping6 application.


Config Paths

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

  • "/NodeList/[i]/ApplicationList/[i]/$ns3::Ping6"

Attributes

  • MaxPackets: The maximum number of packets the application will send
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 100
    • Flags: construct write read
  • Interval: The time to wait between packets
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +1e+09ns
    • Flags: construct write read
  • RemoteIpv6: The Ipv6Address of the outbound packets
  • LocalIpv6: Local Ipv6Address of the sender
  • PacketSize: Size of packets generated
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 100
    • Flags: construct write read

Attributes defined in parent class ns3::Application

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

No TraceSources are defined for this type.
Size of this type is 272 bytes (on a 64-bit architecture).

Definition at line 43 of file ping6.h.

Constructor & Destructor Documentation

◆ Ping6()

ns3::Ping6::Ping6 ( )

Constructor.

Definition at line 78 of file ping6.cc.

References m_ifIndex, m_ipInterfaceIndex, m_sendEvent, m_sent, m_seq, m_socket, and NS_LOG_FUNCTION.

◆ ~Ping6()

ns3::Ping6::~Ping6 ( )
virtual

Destructor.

Definition at line 89 of file ping6.cc.

References m_socket, and NS_LOG_FUNCTION.

Member Function Documentation

◆ DoDispose()

void ns3::Ping6::DoDispose ( void  )
protectedvirtual

Dispose this object;.

Reimplemented from ns3::Application.

Definition at line 95 of file ping6.cc.

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

+ Here is the call graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
type ID

Definition at line 43 of file ping6.cc.

References m_count, m_interval, m_localAddress, m_peerAddress, m_size, ns3::MakeIpv6AddressAccessor(), ns3::MakeIpv6AddressChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().

Referenced by ns3::Ping6Helper::Ping6Helper().

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

◆ HandleRead()

◆ ScheduleTransmit()

void ns3::Ping6::ScheduleTransmit ( Time  dt)
private

Schedule sending a packet.

Parameters
dtinterval between packet

Definition at line 155 of file ping6.cc.

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

Referenced by Send(), and StartApplication().

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

◆ Send()

◆ SetIfIndex()

void ns3::Ping6::SetIfIndex ( uint32_t  ifIndex)

Set the out interface index.

This is to send to link-local (unicast or multicast) address when a node has multiple interfaces.

Parameters
ifIndexinterface index

Definition at line 150 of file ping6.cc.

References m_ifIndex.

◆ SetLocal()

void ns3::Ping6::SetLocal ( Ipv6Address  ipv6)

Set the local address.

Parameters
ipv6the local IPv6 address

Definition at line 126 of file ping6.cc.

References m_localAddress, and NS_LOG_FUNCTION.

◆ SetRemote()

void ns3::Ping6::SetRemote ( Ipv6Address  ipv6)

Set the remote peer.

Parameters
ipv6IPv6 address of the peer

Definition at line 132 of file ping6.cc.

References m_peerAddress, and NS_LOG_FUNCTION.

◆ SetRouters()

void ns3::Ping6::SetRouters ( std::vector< Ipv6Address routers)

Set routers for routing type 0 (loose routing).

Parameters
routersrouters addresses

Definition at line 161 of file ping6.cc.

References m_routers.

◆ StartApplication()

◆ StopApplication()

void ns3::Ping6::StopApplication ( void  )
privatevirtual

Stop the application.

Reimplemented from ns3::Application.

Definition at line 138 of file ping6.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ m_address

Ipv6Address ns3::Ping6::m_address
private

Peer IPv6 address.

Definition at line 125 of file ping6.h.

◆ m_count

uint32_t ns3::Ping6::m_count
private

Number of "Echo request" packets that will be sent.

Definition at line 130 of file ping6.h.

Referenced by GetTypeId(), and Send().

◆ m_ifIndex

uint32_t ns3::Ping6::m_ifIndex
private

Out interface (i.e.

for link-local communication).

Definition at line 185 of file ping6.h.

Referenced by HandleRead(), Ping6(), Send(), and SetIfIndex().

◆ m_interval

Time ns3::Ping6::m_interval
private

Interval between packets sent.

Definition at line 145 of file ping6.h.

Referenced by GetTypeId(), and Send().

◆ m_ipInterfaceIndex

uint32_t ns3::Ping6::m_ipInterfaceIndex
private

IP interface index relative to the local address.

Definition at line 155 of file ping6.h.

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

◆ m_ipv6Protocol

Ptr<Ipv6L3Protocol> ns3::Ping6::m_ipv6Protocol
private

IP interface index relative to the local address.

Definition at line 160 of file ping6.h.

Referenced by HandleRead(), and StartApplication().

◆ m_localAddress

Ipv6Address ns3::Ping6::m_localAddress
private

Local address.

Definition at line 150 of file ping6.h.

Referenced by GetTypeId(), Send(), SetLocal(), and StartApplication().

◆ m_peerAddress

Ipv6Address ns3::Ping6::m_peerAddress
private

Peer address.

Definition at line 165 of file ping6.h.

Referenced by GetTypeId(), Send(), and SetRemote().

◆ m_routers

std::vector<Ipv6Address> ns3::Ping6::m_routers
private

Routers addresses for routing type 0.

Definition at line 190 of file ping6.h.

Referenced by Send(), and SetRouters().

◆ m_sendEvent

EventId ns3::Ping6::m_sendEvent
private

Event ID.

Definition at line 180 of file ping6.h.

Referenced by Ping6(), ScheduleTransmit(), Send(), and StopApplication().

◆ m_sent

uint32_t ns3::Ping6::m_sent
private

Number of packets sent.

Definition at line 135 of file ping6.h.

Referenced by Ping6(), and Send().

◆ m_seq

uint16_t ns3::Ping6::m_seq
private

Sequence number.

Definition at line 175 of file ping6.h.

Referenced by Ping6(), and Send().

◆ m_size

uint32_t ns3::Ping6::m_size
private

Size of the packet.

Definition at line 140 of file ping6.h.

Referenced by GetTypeId(), and Send().

◆ m_socket

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

Local socket.

Definition at line 170 of file ping6.h.

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


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