Generate Virtual Desktop Infrastructure (VDI) traffic. More...
#include "tgax-virtual-desktop.h"
Public Types | |
| enum class | ModelPresets : uint8_t { CUSTOM = 0 , DOWNLINK , UPLINK } |
| Model presets enumeration. 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 | |
| TgaxVirtualDesktop () | |
| ~TgaxVirtualDesktop () 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 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. | |
| Time | GetInterArrival () const |
| Get the duration to use to schedule the TX of the next VDI packet. | |
| uint32_t | GetPacketSize () const |
| Get the size in bytes of the next VDI packet to send. | |
| void | ScheduleNext () |
| Schedule the next TX. | |
| void | SendPacket () |
| Transmit the next VDI packet. | |
| void | SetParametersPacketSize (const std::vector< std::pair< double, double > > ¶ms) |
| Set the parameters of the normal random variable used to generate the VDI packet sizes. | |
| void | TxAvailable (Ptr< Socket > socket, uint32_t available) |
| Handle a Send event. | |
| void | TxDone (Ptr< Socket > socket, uint32_t size) |
| Handle a Data Sent event. | |
Private Attributes | |
| Ptr< BernoulliRandomVariable > | m_dlModeSelection |
| Uniform random variable to select mode for downlink bimodal distribution. | |
| Ptr< UniformRandomVariable > | m_initialArrivalUniform |
| Uniform random variable to generate initial packet arrival in nanoseconds. | |
| bool | m_initialPacket {true} |
| True if the next packet to send is the initial packet. | |
| Ptr< ExponentialRandomVariable > | m_interArrivalExponential |
| Exponential random variable to generate packet arrival times in nanoseconds. | |
| ModelPresets | m_modelPresets |
| Model presets to use to configure the VDI traffic model parameters. | |
| std::vector< Ptr< NormalRandomVariable > > | m_pktSizeDistributions |
| Single or multi modal normal random variables to generate packet sizes in bytes. | |
| EventId | m_txEvent |
| Event id of pending TX event. | |
| Ptr< Packet > | m_unsentPacket |
| Unsent packet cached for future attempt. | |
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 Virtual Desktop Infrastructure (VDI) traffic.
This VDI traffic generator follows requirements from IEEE 802.11-14/0571r12 - 11ax Evaluation Methodology (Appendix 2 – Traffic model descriptions: Virtual Desktop Infrastructure Traffic Model) (see applications documentation for full citation).
In this model, desktop application packet arrival interval obeys an exponential distribution and packet size obeys a normal distribution.
ns3::TgaxVirtualDesktop is accessible through the following paths with Config::Set and Config::Connect:
ns3::Ptr<N3ns39PairValueINS_11DoubleValueES1_EE> Custom|Downlink|Uplink TypeId Address Address Time -9.22337e+18ns:+9.22337e+18ns Time -9.22337e+18ns:+9.22337e+18ns No TraceSources are defined for this type
Group: Applications
Size of this type is 344 bytes (on a 64-bit architecture).
Definition at line 40 of file tgax-virtual-desktop.h.
|
strong |
Model presets enumeration.
| Enumerator | |
|---|---|
| CUSTOM | |
| DOWNLINK | |
| UPLINK | |
Definition at line 53 of file tgax-virtual-desktop.h.
| ns3::TgaxVirtualDesktop::TgaxVirtualDesktop | ( | ) |
Definition at line 89 of file tgax-virtual-desktop.cc.
References NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
override |
Definition at line 94 of file tgax-virtual-desktop.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 100 of file tgax-virtual-desktop.cc.
References m_dlModeSelection, m_initialArrivalUniform, m_interArrivalExponential, m_pktSizeDistributions, and NS_LOG_FUNCTION.
|
overrideprivatevirtual |
Cancel all pending events.
Implements ns3::SourceApplication.
Definition at line 183 of file tgax-virtual-desktop.cc.
References m_initialPacket, m_txEvent, m_unsentPacket, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Application specific code for child subclasses upon a Connection Succeed event.
| socket | the connected socket |
Reimplemented from ns3::SourceApplication.
Definition at line 282 of file tgax-virtual-desktop.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 138 of file tgax-virtual-desktop.cc.
References CUSTOM, ns3::Object::DoInitialize(), DOWNLINK, m_initialArrivalUniform, m_interArrivalExponential, m_modelPresets, NS_LOG_FUNCTION, SetParametersPacketSize(), and UPLINK.
|
overrideprivatevirtual |
Application specific startup code for child subclasses.
Reimplemented from ns3::SourceApplication.
Definition at line 167 of file tgax-virtual-desktop.cc.
References ns3::SourceApplication::m_connected, ns3::SourceApplication::m_socket, ns3::MakeCallback(), NS_LOG_FUNCTION, ScheduleNext(), TxAvailable(), and TxDone().
|
private |
Get the duration to use to schedule the TX of the next VDI packet.
Definition at line 196 of file tgax-virtual-desktop.cc.
References m_initialArrivalUniform, m_initialPacket, m_interArrivalExponential, m_unsentPacket, and ns3::NanoSeconds().
Referenced by ScheduleNext().
|
private |
Get the size in bytes of the next VDI packet to send.
Definition at line 210 of file tgax-virtual-desktop.cc.
References m_dlModeSelection, and m_pktSizeDistributions.
Referenced by SendPacket().
|
static |
Get the type ID.
Definition at line 39 of file tgax-virtual-desktop.cc.
References ns3::SourceApplication::SourceApplication(), TgaxVirtualDesktop(), ns3::TypeId::ATTR_CONSTRUCT, ns3::TypeId::ATTR_GET, CUSTOM, DOWNLINK, ns3::TypeId::LookupByName(), m_initialArrivalUniform, m_interArrivalExponential, m_modelPresets, ns3::SourceApplication::m_protocolTid, ns3::MakeAttributeContainerAccessor(), ns3::MakeAttributeContainerChecker(), ns3::MakeDoubleChecker(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakePairChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTypeIdAccessor(), ns3::MakeTypeIdChecker(), SetParametersPacketSize(), ns3::TypeId::SetParent(), and UPLINK.
Referenced by TgaxVirtualDesktopTestCase::DoSetup().
|
private |
Schedule the next TX.
Definition at line 217 of file tgax-virtual-desktop.cc.
References GetInterArrival(), m_txEvent, NS_ASSERT, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendPacket().
Referenced by DoConnectionSucceeded(), DoStartApplication(), SendPacket(), TxAvailable(), and TxDone().
|
private |
Transmit the next VDI packet.
Definition at line 225 of file tgax-virtual-desktop.cc.
References ns3::Inet6SocketAddress::ConvertFrom(), ns3::InetSocketAddress::ConvertFrom(), ns3::Create(), GetPacketSize(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::InetSocketAddress::IsMatchingType(), m_initialPacket, ns3::SourceApplication::m_peer, ns3::SourceApplication::m_socket, m_txEvent, ns3::SourceApplication::m_txTrace, m_unsentPacket, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Time::S, and ScheduleNext().
Referenced by ScheduleNext().
|
private |
Set the parameters of the normal random variable used to generate the VDI packet sizes.
| params | a vector of pairs (mean, standard deviation) for each mode of the normal distribution used to generate the VDI packet sizes |
Definition at line 118 of file tgax-virtual-desktop.cc.
References ns3::CreateObject(), ns3::CreateObjectWithAttributes(), m_dlModeSelection, m_pktSizeDistributions, ns3::normal, and NS_LOG_FUNCTION.
Referenced by DoInitialize(), and GetTypeId().
Handle a Send event.
| socket | the connected socket |
| available | the amount of available bytes for transmission |
Definition at line 299 of file tgax-virtual-desktop.cc.
References m_unsentPacket, NS_LOG_FUNCTION, and ScheduleNext().
Referenced by DoStartApplication().
Handle a Data Sent event.
| socket | the connected socket |
| size | the amount of transmitted bytes |
Definition at line 289 of file tgax-virtual-desktop.cc.
References m_unsentPacket, NS_LOG_FUNCTION, and ScheduleNext().
Referenced by DoStartApplication().
|
private |
Uniform random variable to select mode for downlink bimodal distribution.
Definition at line 128 of file tgax-virtual-desktop.h.
Referenced by AssignStreams(), GetPacketSize(), and SetParametersPacketSize().
|
private |
Uniform random variable to generate initial packet arrival in nanoseconds.
Definition at line 123 of file tgax-virtual-desktop.h.
Referenced by AssignStreams(), DoInitialize(), GetInterArrival(), and GetTypeId().
|
private |
True if the next packet to send is the initial packet.
Definition at line 119 of file tgax-virtual-desktop.h.
Referenced by CancelEvents(), GetInterArrival(), and SendPacket().
|
private |
Exponential random variable to generate packet arrival times in nanoseconds.
Definition at line 126 of file tgax-virtual-desktop.h.
Referenced by AssignStreams(), DoInitialize(), GetInterArrival(), and GetTypeId().
|
private |
Model presets to use to configure the VDI traffic model parameters.
Definition at line 122 of file tgax-virtual-desktop.h.
Referenced by DoInitialize(), and GetTypeId().
|
private |
Single or multi modal normal random variables to generate packet sizes in bytes.
Definition at line 131 of file tgax-virtual-desktop.h.
Referenced by AssignStreams(), GetPacketSize(), and SetParametersPacketSize().
|
private |
Event id of pending TX event.
Definition at line 134 of file tgax-virtual-desktop.h.
Referenced by CancelEvents(), ScheduleNext(), and SendPacket().
Unsent packet cached for future attempt.
Definition at line 135 of file tgax-virtual-desktop.h.
Referenced by CancelEvents(), GetInterArrival(), SendPacket(), TxAvailable(), and TxDone().