A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
rta-tig-mobile-gaming.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 DERONNE SOFTWARE ENGINEERING
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#ifndef RTA_TIG_MOBILE_GAMING_H
10#define RTA_TIG_MOBILE_GAMING_H
11
12#include "source-application.h"
13
14#include "ns3/address.h"
15#include "ns3/event-id.h"
16#include "ns3/ptr.h"
17
18namespace ns3
19{
20
23
24/**
25 * @ingroup applications
26 * @brief Generate RT mobile gaming traffic.
27 *
28 * This RT mobile gaming traffic generator follows requirements from IEEE 802.11 Real Time
29 * Applications TIG Report (Section 4.1.4: Traffic model) (see applications documentation for
30 * full citation).
31 *
32 * RT mobile gaming traffic typically consists in small packets (between 30 and 500 Bytes) for both
33 * uplink and downlink, where usually downlink packets are bigger than uplink ones. Packets are
34 * generated on average every 30-60ms for uplink and downlink, usually downlink packet interval is
35 * larger than uplink one. The bandwidth for RT mobile gaming traffic is between 100kbps and 1Mbps.
36 */
38{
39 public:
40 /**
41 * @brief Get the type ID.
42 * @return the object TypeId
43 */
44 static TypeId GetTypeId();
45
47 ~RtaTigMobileGaming() override;
48
49 /// Model presets enumeration
50 enum class ModelPresets : uint8_t
51 {
52 CUSTOM = 0, //< Custom traffic model (by default, load parameters of DL status-sync model
53 // presets)
54 STATUS_SYNC_DL, //< DL status-sync model presets
55 STATUS_SYNC_UL, //< UL status-sync model presets
56 LOCKSTEP_DL, //< DL lockstep model presets
57 LOCKSTEP_UL //< UL lockstep model presets
58 };
59
60 int64_t AssignStreams(int64_t stream) override;
61
62 /**
63 * Traffic model stages
64 */
65 enum class TrafficModelStage : uint8_t
66 {
68 GAMING = 1,
70 };
71
72 protected:
73 void DoInitialize() override;
74
75 private:
76 void DoStartApplication() override;
77 void DoStopApplication() override;
78 void DoConnectionSucceeded(Ptr<Socket> socket) override;
79 void CancelEvents() override;
80
81 /**
82 * Schedule the next packet transmission
83 */
84 void ScheduleNext();
85
86 /**
87 * Transmit one initial, gaming or ending packet
88 */
89 void SendPacket();
90
91 ModelPresets m_modelPresets; //!< Model presets to use to configure the traffic generator
92
94 m_initialSizeUniform; //!< Uniform random variable to generate the initial packet size
96 m_endSizeUniform; //!< Uniform random variable to generate the end packet size
97
99 m_levArrivals; //!< Largest extreme value random variable to generate packet arrival times
101 m_levSizes; //!< Largest extreme value random variable to generate packet sizes
102
104
105 EventId m_txEvent; //!< Event ID of pending TX event scheduling
106
107 /**
108 * TracedCallback signature for packet and stage.
109 *
110 * @param [in] packet The packet.
111 * @param [in] stage The gaming traffic model stage corresponding to the packet.
112 */
114
115 /// Traced Callback: transmitted packets and their stage.
117};
118
119/**
120 * Serialize gaming traffic model stage to ostream in a human-readable form.
121 *
122 * @param os std::ostream
123 * @param stage the gaming traffic model stage
124 * @return std::ostream
125 */
126std::ostream& operator<<(std::ostream& os, RtaTigMobileGaming::TrafficModelStage stage);
127
128} // namespace ns3
129
130#endif /* RTA_TIG_MOBILE_GAMING_H */
An identifier for simulation events.
Definition event-id.h:45
The Largest Extreme Value distribution Random Number Generator (RNG).
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
void DoStartApplication() override
Application specific startup code for child subclasses.
TracedCallback< Ptr< const Packet >, TrafficModelStage > m_txStageTrace
Traced Callback: transmitted packets and their stage.
void CancelEvents() override
Cancel all pending events.
EventId m_txEvent
Event ID of pending TX event scheduling.
ModelPresets
Model presets enumeration.
Ptr< UniformRandomVariable > m_endSizeUniform
Uniform random variable to generate the end packet size.
TrafficModelStage m_currentStage
Hold the current stage.
void DoInitialize() override
Initialize() implementation.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this Application object.
void(* TxTracedCallback)(Ptr< const Packet > packet, TrafficModelStage stage)
TracedCallback signature for packet and stage.
void SendPacket()
Transmit one initial, gaming or ending packet.
Ptr< LargestExtremeValueRandomVariable > m_levArrivals
Largest extreme value random variable to generate packet arrival times.
static TypeId GetTypeId()
Get the type ID.
ModelPresets m_modelPresets
Model presets to use to configure the traffic generator.
void ScheduleNext()
Schedule the next packet transmission.
Ptr< LargestExtremeValueRandomVariable > m_levSizes
Largest extreme value random variable to generate packet sizes.
TrafficModelStage
Traffic model stages.
void DoConnectionSucceeded(Ptr< Socket > socket) override
Application specific code for child subclasses upon a Connection Succeed event.
void DoStopApplication() override
Application specific shutdown code for child subclasses.
Ptr< UniformRandomVariable > m_initialSizeUniform
Uniform random variable to generate the initial packet size.
SourceApplication(bool allowPacketSocket=true)
Constructor.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:50
The uniform distribution Random Number Generator (RNG).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148