9#ifndef TGAX_VIDEO_TRAFFIC_H
10#define TGAX_VIDEO_TRAFFIC_H
14#include "ns3/data-rate.h"
15#include "ns3/event-id.h"
16#include "ns3/traced-callback.h"
77 using TrafficModels = std::map<TrafficModelClassIdentifier, TrafficModelParameters>;
Class for representing data rates.
An identifier for simulation events.
The gamma distribution Random Number Generator (RNG) that allows stream numbers to be set determinist...
Smart pointer class similar to boost::intrusive_ptr.
SourceApplication(bool allowPacketSocket=true)
Constructor.
static const TrafficModels m_trafficModels
Traffic models as defined in Table 5 from IEEE 802.11-14/0571r12 - 11ax Evaluation Methodology.
void TxAvailable(Ptr< Socket > socket, uint32_t available)
Handle a Send event.
std::map< uint64_t, EventId > m_sendEvents
Event IDs of pending TX events.
Ptr< GammaRandomVariable > m_latencyMs
Gamma random variable to generate latency (in milliseconds).
std::deque< UnsentPacketInfo > m_unsentPackets
Hold unsent packet for later attempt.
void SendWithLatency()
Schedule send of a packet with a random latency.
void CancelEvents() override
Cancel all pending events.
void Send(uint64_t eventId, uint32_t size, Time latency)
Effectively send a packet once the latency has elapsed.
double m_frameSizeBytesShape
Shape parameter for the Weibull distribution used to generate size of video frames (if model is custo...
void DoStartApplication() override
Application specific startup code for child subclasses.
DataRate m_bitRate
Video bit rate (if model is custom).
TracedCallback< Ptr< const Packet >, Time > m_txLatencyTrace
Traced Callback: transmitted packets and their latencies.
EventId m_generateFrameEvent
Event ID of pending frame generation event.
Ptr< WeibullRandomVariable > m_frameSizeBytes
Weibull random variable to generate size of video frames (in bytes).
double m_latencyMsShape
Shape parameter for the Gamma distribution used to generate latency.
Time m_interArrival
Calculated inter arrival duration between two generated packets.
std::deque< uint32_t > m_generatedFrames
Hold size of generated video frames.
static TypeId GetTypeId()
Get the type ID.
void DoInitialize() override
Initialize() implementation.
std::map< TrafficModelClassIdentifier, TrafficModelParameters > TrafficModels
Parameters for each traffic model.
void DoConnectionSucceeded(Ptr< Socket > socket) override
Application specific code for child subclasses upon a Connection Succeed event.
uint32_t GetNextPayloadSize()
uint32_t m_remainingSize
Number of bytes to send directly to the socket because current video frame is too large to be sent at...
void(* TxTracedCallback)(Ptr< const Packet > packet, Time latency)
TracedCallback signature for packet and latency.
double m_latencyMsScale
Scale parameter for the Gamma distribution used to generate latency.
double m_frameSizeBytesScale
Scale parameter for the Weibull distribution used to generate size of video frames (if model is custo...
void ScheduleNextFrame()
Schedule the next frame generation.
uint64_t m_nextEventId
The next event ID.
void GenerateVideoFrame()
Generate new video frame.
~TgaxVideoTraffic() override
std::optional< uint32_t > m_maxSize
Limit on the number of bytes that can be sent at once over the network, hence we limit at application...
TrafficModelClassIdentifier m_trafficModelClassId
The Traffic Model Class Identifier.
TrafficModelClassIdentifier
TrafficModelClassIdentifier enumeration.
void TxDone(Ptr< Socket > socket, uint32_t size)
Handle a Data Sent event.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this Application object.
TracedCallback< uint32_t > m_frameGeneratedTrace
Traced Callback: generated frames (amount of payload bytes).
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
a unique identifier for an interface.
The Weibull distribution Random Number Generator (RNG) which allows stream numbers to be set determin...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
List of parameters for a given traffic model.
double frameSizeBytesScale
scale parameter for the Weibull distribution used to generate size of video frames in bytes (correspo...
DataRate bitRate
video bit rate
double frameSizeBytesShape
shape parameter for the Weibull distribution used to generate size of video frames in bytes (correspo...
Structure to store information about packets that are not successfully transmitted.
uint64_t id
the associated TX event ID
Time latency
the networking latency applied to the first transmission attempt
Ptr< Packet > packet
the packet to transmit