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

Generate Virtual Desktop Infrastructure (VDI) traffic. More...

#include "tgax-virtual-desktop.h"

Inheritance diagram for ns3::TgaxVirtualDesktop:
Collaboration diagram for ns3::TgaxVirtualDesktop:

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< 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 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 > > &params)
 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< BernoulliRandomVariablem_dlModeSelection
 Uniform random variable to select mode for downlink bimodal distribution.
Ptr< UniformRandomVariablem_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< ExponentialRandomVariablem_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< Packetm_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< 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 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.

Config Paths

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

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

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

No TraceSources are defined for this type

TraceSources defined in parent class ns3::SourceApplication

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

Definition at line 40 of file tgax-virtual-desktop.h.

Member Enumeration Documentation

◆ ModelPresets

enum class ns3::TgaxVirtualDesktop::ModelPresets : uint8_t
strong

Model presets enumeration.

Enumerator
CUSTOM 
DOWNLINK 
UPLINK 

Definition at line 53 of file tgax-virtual-desktop.h.

Constructor & Destructor Documentation

◆ TgaxVirtualDesktop()

ns3::TgaxVirtualDesktop::TgaxVirtualDesktop ( )

Definition at line 89 of file tgax-virtual-desktop.cc.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

Here is the caller graph for this function:

◆ ~TgaxVirtualDesktop()

ns3::TgaxVirtualDesktop::~TgaxVirtualDesktop ( )
override

Definition at line 94 of file tgax-virtual-desktop.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AssignStreams()

int64_t ns3::TgaxVirtualDesktop::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 100 of file tgax-virtual-desktop.cc.

References m_dlModeSelection, m_initialArrivalUniform, m_interArrivalExponential, m_pktSizeDistributions, and NS_LOG_FUNCTION.

◆ CancelEvents()

void ns3::TgaxVirtualDesktop::CancelEvents ( )
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.

◆ DoConnectionSucceeded()

void ns3::TgaxVirtualDesktop::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 282 of file tgax-virtual-desktop.cc.

References NS_LOG_FUNCTION, and ScheduleNext().

Here is the call graph for this function:

◆ DoInitialize()

void ns3::TgaxVirtualDesktop::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 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.

Here is the call graph for this function:

◆ DoStartApplication()

void ns3::TgaxVirtualDesktop::DoStartApplication ( )
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().

Here is the call graph for this function:

◆ GetInterArrival()

Time ns3::TgaxVirtualDesktop::GetInterArrival ( ) const
private

Get the duration to use to schedule the TX of the next VDI packet.

Returns
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().

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

◆ GetPacketSize()

uint32_t ns3::TgaxVirtualDesktop::GetPacketSize ( ) const
private

Get the size in bytes of the next VDI packet to send.

Returns
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().

Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::TgaxVirtualDesktop::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

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().

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

◆ ScheduleNext()

void ns3::TgaxVirtualDesktop::ScheduleNext ( )
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().

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

◆ SendPacket()

void ns3::TgaxVirtualDesktop::SendPacket ( )
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().

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

◆ SetParametersPacketSize()

void ns3::TgaxVirtualDesktop::SetParametersPacketSize ( const std::vector< std::pair< double, double > > & params)
private

Set the parameters of the normal random variable used to generate the VDI packet sizes.

Parameters
paramsa 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().

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

◆ TxAvailable()

void ns3::TgaxVirtualDesktop::TxAvailable ( Ptr< Socket > socket,
uint32_t available )
private

Handle a Send event.

Parameters
socketthe connected socket
availablethe 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().

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

◆ TxDone()

void ns3::TgaxVirtualDesktop::TxDone ( Ptr< Socket > socket,
uint32_t size )
private

Handle a Data Sent event.

Parameters
socketthe connected socket
sizethe 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().

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

Member Data Documentation

◆ m_dlModeSelection

Ptr<BernoulliRandomVariable> ns3::TgaxVirtualDesktop::m_dlModeSelection
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().

◆ m_initialArrivalUniform

Ptr<UniformRandomVariable> ns3::TgaxVirtualDesktop::m_initialArrivalUniform
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().

◆ m_initialPacket

bool ns3::TgaxVirtualDesktop::m_initialPacket {true}
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().

◆ m_interArrivalExponential

Ptr<ExponentialRandomVariable> ns3::TgaxVirtualDesktop::m_interArrivalExponential
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().

◆ m_modelPresets

ModelPresets ns3::TgaxVirtualDesktop::m_modelPresets
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().

◆ m_pktSizeDistributions

std::vector<Ptr<NormalRandomVariable> > ns3::TgaxVirtualDesktop::m_pktSizeDistributions
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().

◆ m_txEvent

EventId ns3::TgaxVirtualDesktop::m_txEvent
private

Event id of pending TX event.

Definition at line 134 of file tgax-virtual-desktop.h.

Referenced by CancelEvents(), ScheduleNext(), and SendPacket().

◆ m_unsentPacket

Ptr<Packet> ns3::TgaxVirtualDesktop::m_unsentPacket
private

Unsent packet cached for future attempt.

Definition at line 135 of file tgax-virtual-desktop.h.

Referenced by CancelEvents(), GetInterArrival(), SendPacket(), TxAvailable(), and TxDone().


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