Generate RT mobile gaming traffic. More...
#include "rta-tig-mobile-gaming.h"
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< Socket > | GetSocket () 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< Node > | GetNode () 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< Object > | GetObject () 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< Object > | GetObject (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. | |
| SimpleRefCount & | operator= (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< UniformRandomVariable > | m_endSizeUniform |
| Uniform random variable to generate the end packet size. | |
| Ptr< UniformRandomVariable > | m_initialSizeUniform |
| Uniform random variable to generate the initial packet size. | |
| Ptr< LargestExtremeValueRandomVariable > | m_levArrivals |
| Largest extreme value random variable to generate packet arrival times. | |
| Ptr< LargestExtremeValueRandomVariable > | m_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 >, TrafficModelStage > | m_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< Socket > | m_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< Node > | m_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. | |
| Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
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.
ns3::RtaTigMobileGaming is accessible through the following paths with Config::Set and Config::Connect:
Custom|StatusSyncDl|StatusSyncUl|LockstepDl|LockstepUl TypeId Address Address Time -9.22337e+18ns:+9.22337e+18ns Time -9.22337e+18ns:+9.22337e+18ns 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.
|
private |
TracedCallback signature for packet and stage.
| [in] | packet | The packet. |
| [in] | stage | The gaming traffic model stage corresponding to the packet. |
Definition at line 113 of file rta-tig-mobile-gaming.h.
|
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.
|
strong |
Traffic model stages.
| Enumerator | |
|---|---|
| INITIAL | |
| GAMING | |
| ENDING | |
Definition at line 65 of file rta-tig-mobile-gaming.h.
| ns3::RtaTigMobileGaming::RtaTigMobileGaming | ( | ) |
Definition at line 99 of file rta-tig-mobile-gaming.cc.
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
override |
Definition at line 104 of file rta-tig-mobile-gaming.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
Assign a fixed random variable stream number to the random variables used by this Application object.
| stream | first stream index to use |
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.
|
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().
Application specific code for child subclasses upon a Connection Succeed event.
| socket | the connected socket |
Reimplemented from ns3::SourceApplication.
Definition at line 283 of file rta-tig-mobile-gaming.cc.
References NS_LOG_FUNCTION, and ScheduleNext().
|
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.
|
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().
|
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.
|
static |
Get the type ID.
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().
|
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().
|
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().
|
private |
Hold the current stage.
Definition at line 103 of file rta-tig-mobile-gaming.h.
Referenced by CancelEvents(), DoStartApplication(), DoStopApplication(), and SendPacket().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
Event ID of pending TX event scheduling.
Definition at line 105 of file rta-tig-mobile-gaming.h.
Referenced by CancelEvents(), and ScheduleNext().
|
private |
Traced Callback: transmitted packets and their stage.
Definition at line 116 of file rta-tig-mobile-gaming.h.
Referenced by GetTypeId(), and SendPacket().