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

Generate RT mobile gaming traffic. More...

#include "rta-tig-mobile-gaming.h"

Inheritance diagram for ns3::RtaTigMobileGaming:
Collaboration diagram for ns3::RtaTigMobileGaming:

Public Types

enum class  ModelPresets : uint8_t {
  CUSTOM = 0 , STATUS_SYNC_DL , STATUS_SYNC_UL , LOCKSTEP_DL ,
  LOCKSTEP_UL
}
 Model presets enumeration. More...
enum class  TrafficModelStage : uint8_t { INITIAL = 0 , GAMING = 1 , ENDING = 2 }
 Traffic model stages. More...
Public Types inherited from ns3::Application
typedef void(* DelayAddressCallback) (const Time &delay, const Address &from)
 Common callback signature for packet delay and address.
typedef void(* StateTransitionCallback) (const std::string &oldState, const std::string &newState)
 Common signature used by callbacks to application's state transition trace source.

Public Member Functions

 RtaTigMobileGaming ()
 ~RtaTigMobileGaming () override
int64_t AssignStreams (int64_t stream) override
 Assign a fixed random variable stream number to the random variables used by this Application object.
Public Member Functions inherited from ns3::SourceApplication
 SourceApplication (bool allowPacketSocket=true)
 Constructor.
 ~SourceApplication () override
Address GetRemote () const
 get the remote address
Ptr< SocketGetSocket () const
 Get the socket this application is attached to.
virtual void SetRemote (const Address &addr)
 set the remote address
Public Member Functions inherited from ns3::Application
 Application ()
 ~Application () override
Ptr< NodeGetNode () const
void SetNode (Ptr< Node > node)
void SetStartTime (Time start)
 Specify application start time.
void SetStopTime (Time stop)
 Specify application stop time.
Public Member Functions inherited from ns3::Object
 Object ()
 Caller graph was not generated because of its size.
 ~Object () override
 Destructor.
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
void Dispose ()
 Dispose of this Object.
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
TypeId GetInstanceTypeId () const final
 Get the most derived TypeId for this Object.
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
bool IsInitialized () const
 Check if the object has been initialized.
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
uint32_t GetReferenceCount () const
 Get the reference count of the object.
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
void Ref () const
 Increment the reference count.
void Unref () const
 Decrement the reference count.
Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::SourceApplication
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Application
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.

Protected Member Functions

void DoInitialize () override
 Initialize() implementation.
Protected Member Functions inherited from ns3::SourceApplication
bool CloseSocket ()
 Close the socket.
void DoDispose () override
 Destructor implementation.
Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.

Private Types

typedef void(* TxTracedCallback) (Ptr< const Packet > packet, TrafficModelStage stage)
 TracedCallback signature for packet and stage.

Private Member Functions

void CancelEvents () override
 Cancel all pending events.
void DoConnectionSucceeded (Ptr< Socket > socket) override
 Application specific code for child subclasses upon a Connection Succeed event.
void DoStartApplication () override
 Application specific startup code for child subclasses.
void DoStopApplication () override
 Application specific shutdown code for child subclasses.
void ScheduleNext ()
 Schedule the next packet transmission.
void SendPacket ()
 Transmit one initial, gaming or ending packet.

Private Attributes

TrafficModelStage m_currentStage {TrafficModelStage::INITIAL}
 Hold the current stage.
Ptr< UniformRandomVariablem_endSizeUniform
 Uniform random variable to generate the end packet size.
Ptr< UniformRandomVariablem_initialSizeUniform
 Uniform random variable to generate the initial packet size.
Ptr< LargestExtremeValueRandomVariablem_levArrivals
 Largest extreme value random variable to generate packet arrival times.
Ptr< LargestExtremeValueRandomVariablem_levSizes
 Largest extreme value random variable to generate packet sizes.
ModelPresets m_modelPresets
 Model presets to use to configure the traffic generator.
EventId m_txEvent
 Event ID of pending TX event scheduling.
TracedCallback< Ptr< const Packet >, TrafficModelStagem_txStageTrace
 Traced Callback: transmitted packets and their stage.

Additional Inherited Members

Protected Types inherited from ns3::SourceApplication
typedef void(* ConnectionEventCallback) (Ptr< Socket > socket, const Address &local, const Address &remote)
 TracedCallback signature for connection success/failure event.
Protected Attributes inherited from ns3::SourceApplication
bool m_connected {false}
 flag whether socket is connected
TracedCallback< Ptr< Socket >, const Address &, const Address & > m_connectionFailure
 Traced Callback: connection failure event.
TracedCallback< Ptr< Socket >, const Address &, const Address & > m_connectionSuccess
 Traced Callback: connection success event.
Address m_local
 Local address to bind to.
Address m_peer
 Peer address.
TypeId m_protocolTid
 Protocol TypeId value.
Ptr< Socketm_socket
 Socket.
uint8_t m_tos
 The packets Type of Service.
TracedCallback< Ptr< const Packet > > m_txTrace
 Traced Callback: transmitted packets.
Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
 The node that this application is installed on.
EventId m_startEvent
 The event that will fire at m_startTime to start the application.
Time m_startTime
 The simulation time that the application will start.
EventId m_stopEvent
 The event that will fire at m_stopTime to end the application.
Time m_stopTime
 The simulation time that the application will end.

Detailed Description

Generate RT mobile gaming traffic.

This RT mobile gaming traffic generator follows requirements from IEEE 802.11 Real Time Applications TIG Report (Section 4.1.4: Traffic model) (see applications documentation for full citation).

RT mobile gaming traffic typically consists in small packets (between 30 and 500 Bytes) for both uplink and downlink, where usually downlink packets are bigger than uplink ones. Packets are generated on average every 30-60ms for uplink and downlink, usually downlink packet interval is larger than uplink one. The bandwidth for RT mobile gaming traffic is between 100kbps and 1Mbps.

Config Paths

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

  • "/NodeList/[i]/ApplicationList/[i]/$ns3::SourceApplication/$ns3::RtaTigMobileGaming"
  • "/NodeList/[i]/ApplicationList/[i]/$ns3::RtaTigMobileGaming"

Attributes

Attributes defined in parent class ns3::SourceApplication

  • Local: The Address on which to bind the socket. If not set, it is generated automatically when needed by the application.
    • Set with class: ns3::AddressValue
    • Underlying type: Address
    • Initial value: 00-00:00
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • Remote: The address of the destination, made of the remote IP address and the destination port
    • Set with class: ns3::AddressValue
    • Underlying type: Address
    • Initial value: 00-00:00
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • Tos: The Type of Service used to send IPv4 packets. All 8 bits of the TOS byte are set (including ECN bits).
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 0
    • Flags: constructwriteread
    • Support level: SUPPORTED

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: constructwriteread
    • Support level: SUPPORTED
  • 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: constructwriteread
    • Support level: SUPPORTED

TraceSources

TraceSources defined in parent class ns3::SourceApplication

Group: Applications
Size of this type is 352 bytes (on a 64-bit architecture).

Definition at line 37 of file rta-tig-mobile-gaming.h.

Member Typedef Documentation

◆ TxTracedCallback

typedef void(* ns3::RtaTigMobileGaming::TxTracedCallback) (Ptr< const Packet > packet, TrafficModelStage stage)
private

TracedCallback signature for packet and stage.

Parameters
[in]packetThe packet.
[in]stageThe gaming traffic model stage corresponding to the packet.

Definition at line 113 of file rta-tig-mobile-gaming.h.

Member Enumeration Documentation

◆ ModelPresets

enum class ns3::RtaTigMobileGaming::ModelPresets : uint8_t
strong

Model presets enumeration.

Enumerator
CUSTOM 
STATUS_SYNC_DL 
STATUS_SYNC_UL 
LOCKSTEP_DL 
LOCKSTEP_UL 

Definition at line 50 of file rta-tig-mobile-gaming.h.

◆ TrafficModelStage

enum class ns3::RtaTigMobileGaming::TrafficModelStage : uint8_t
strong

Traffic model stages.

Enumerator
INITIAL 
GAMING 
ENDING 

Definition at line 65 of file rta-tig-mobile-gaming.h.

Constructor & Destructor Documentation

◆ RtaTigMobileGaming()

ns3::RtaTigMobileGaming::RtaTigMobileGaming ( )

Definition at line 99 of file rta-tig-mobile-gaming.cc.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

Here is the caller graph for this function:

◆ ~RtaTigMobileGaming()

ns3::RtaTigMobileGaming::~RtaTigMobileGaming ( )
override

Definition at line 104 of file rta-tig-mobile-gaming.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::RtaTigMobileGaming::AssignStreams ( int64_t stream)
overridevirtual

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

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

Reimplemented from ns3::Application.

Definition at line 110 of file rta-tig-mobile-gaming.cc.

References m_endSizeUniform, m_initialSizeUniform, m_levArrivals, m_levSizes, and NS_LOG_FUNCTION.

◆ CancelEvents()

void ns3::RtaTigMobileGaming::CancelEvents ( )
overrideprivatevirtual

Cancel all pending events.

Implements ns3::SourceApplication.

Definition at line 203 of file rta-tig-mobile-gaming.cc.

References ENDING, m_currentStage, m_txEvent, and NS_LOG_FUNCTION.

Referenced by SendPacket().

Here is the caller graph for this function:

◆ DoConnectionSucceeded()

void ns3::RtaTigMobileGaming::DoConnectionSucceeded ( Ptr< Socket > socket)
overrideprivatevirtual

Application specific code for child subclasses upon a Connection Succeed event.

Parameters
socketthe connected socket

Reimplemented from ns3::SourceApplication.

Definition at line 283 of file rta-tig-mobile-gaming.cc.

References NS_LOG_FUNCTION, and ScheduleNext().

Here is the call graph for this function:

◆ DoInitialize()

void ns3::RtaTigMobileGaming::DoInitialize ( )
overrideprotectedvirtual

Initialize() implementation.

This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.

Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.

Reimplemented from ns3::Application.

Definition at line 122 of file rta-tig-mobile-gaming.cc.

References CUSTOM, ns3::Object::DoInitialize(), LOCKSTEP_DL, LOCKSTEP_UL, m_endSizeUniform, m_initialSizeUniform, m_levArrivals, m_levSizes, m_modelPresets, NS_LOG_FUNCTION, STATUS_SYNC_DL, and STATUS_SYNC_UL.

Here is the call graph for this function:

◆ DoStartApplication()

void ns3::RtaTigMobileGaming::DoStartApplication ( )
overrideprivatevirtual

Application specific startup code for child subclasses.

Reimplemented from ns3::SourceApplication.

Definition at line 180 of file rta-tig-mobile-gaming.cc.

References INITIAL, ns3::SourceApplication::m_connected, m_currentStage, ns3::SourceApplication::m_socket, NS_LOG_FUNCTION, and ScheduleNext().

Here is the call graph for this function:

◆ DoStopApplication()

void ns3::RtaTigMobileGaming::DoStopApplication ( )
overrideprivatevirtual

Application specific shutdown code for child subclasses.

Reimplemented from ns3::SourceApplication.

Definition at line 196 of file rta-tig-mobile-gaming.cc.

References ENDING, m_currentStage, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::RtaTigMobileGaming::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 38 of file rta-tig-mobile-gaming.cc.

References RtaTigMobileGaming(), ns3::SourceApplication::SourceApplication(), ns3::TypeId::ATTR_CONSTRUCT, ns3::TypeId::ATTR_GET, CUSTOM, ns3::UdpSocketFactory::GetTypeId(), LOCKSTEP_DL, LOCKSTEP_UL, m_endSizeUniform, m_initialSizeUniform, m_levArrivals, m_levSizes, m_modelPresets, ns3::SourceApplication::m_protocolTid, m_txStageTrace, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), ns3::TypeId::SetParent(), STATUS_SYNC_DL, and STATUS_SYNC_UL.

Referenced by RtaTigMobileGamingTestCase::DoSetup().

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

◆ ScheduleNext()

void ns3::RtaTigMobileGaming::ScheduleNext ( )
private

Schedule the next packet transmission.

Definition at line 215 of file rta-tig-mobile-gaming.cc.

References m_levArrivals, m_txEvent, ns3::MicroSeconds(), NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendPacket().

Referenced by DoConnectionSucceeded(), DoStartApplication(), and SendPacket().

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

◆ SendPacket()

void ns3::RtaTigMobileGaming::SendPacket ( )
private

Transmit one initial, gaming or ending packet.

Definition at line 224 of file rta-tig-mobile-gaming.cc.

References CancelEvents(), ns3::SourceApplication::CloseSocket(), ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), ENDING, GAMING, INITIAL, ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_currentStage, m_endSizeUniform, m_initialSizeUniform, m_levSizes, ns3::SourceApplication::m_peer, ns3::SourceApplication::m_socket, m_txStageTrace, ns3::SourceApplication::m_txTrace, ns3::Simulator::Now(), NS_ABORT_MSG_IF, NS_LOG_FUNCTION, NS_LOG_INFO, packetSize, ns3::Time::S, and ScheduleNext().

Referenced by ScheduleNext().

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

Member Data Documentation

◆ m_currentStage

TrafficModelStage ns3::RtaTigMobileGaming::m_currentStage {TrafficModelStage::INITIAL}
private

Hold the current stage.

Definition at line 103 of file rta-tig-mobile-gaming.h.

Referenced by CancelEvents(), DoStartApplication(), DoStopApplication(), and SendPacket().

◆ m_endSizeUniform

Ptr<UniformRandomVariable> ns3::RtaTigMobileGaming::m_endSizeUniform
private

Uniform random variable to generate the end packet size.

Definition at line 96 of file rta-tig-mobile-gaming.h.

Referenced by AssignStreams(), DoInitialize(), GetTypeId(), and SendPacket().

◆ m_initialSizeUniform

Ptr<UniformRandomVariable> ns3::RtaTigMobileGaming::m_initialSizeUniform
private

Uniform random variable to generate the initial packet size.

Definition at line 94 of file rta-tig-mobile-gaming.h.

Referenced by AssignStreams(), DoInitialize(), GetTypeId(), and SendPacket().

◆ m_levArrivals

Ptr<LargestExtremeValueRandomVariable> ns3::RtaTigMobileGaming::m_levArrivals
private

Largest extreme value random variable to generate packet arrival times.

Definition at line 99 of file rta-tig-mobile-gaming.h.

Referenced by AssignStreams(), DoInitialize(), GetTypeId(), and ScheduleNext().

◆ m_levSizes

Ptr<LargestExtremeValueRandomVariable> ns3::RtaTigMobileGaming::m_levSizes
private

Largest extreme value random variable to generate packet sizes.

Definition at line 101 of file rta-tig-mobile-gaming.h.

Referenced by AssignStreams(), DoInitialize(), GetTypeId(), and SendPacket().

◆ m_modelPresets

ModelPresets ns3::RtaTigMobileGaming::m_modelPresets
private

Model presets to use to configure the traffic generator.

Definition at line 91 of file rta-tig-mobile-gaming.h.

Referenced by DoInitialize(), and GetTypeId().

◆ m_txEvent

EventId ns3::RtaTigMobileGaming::m_txEvent
private

Event ID of pending TX event scheduling.

Definition at line 105 of file rta-tig-mobile-gaming.h.

Referenced by CancelEvents(), and ScheduleNext().

◆ m_txStageTrace

TracedCallback<Ptr<const Packet>, TrafficModelStage> ns3::RtaTigMobileGaming::m_txStageTrace
private

Traced Callback: transmitted packets and their stage.

Definition at line 116 of file rta-tig-mobile-gaming.h.

Referenced by GetTypeId(), and SendPacket().


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