A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tgax-video-example.cc File Reference

A simple buffered video streaming traffic generator example over Wi-Fi. More...

#include "ns3/applications-module.h"
#include "ns3/core-module.h"
#include "ns3/internet-module.h"
#include "ns3/mobility-module.h"
#include "ns3/network-module.h"
#include "ns3/wifi-module.h"
Include dependency graph for tgax-video-example.cc:

Go to the source code of this file.

Functions

void PacketReceived (std::string context, Ptr< const Packet > packet, const Address &address)
 Callback invoked when the PacketSink receives a packet.
void VideoFrameGenerated (uint32_t frameSize)
 Callback invoked when a video frame is generated.
void VideoPacketSent (Ptr< const Packet > packet, Time latency)
 Callback invoked when a video packet is transmitted.

Detailed Description

A simple buffered video streaming traffic generator example over Wi-Fi.

This example demonstrates how to set up a basic ns-3 simulation with video streaming traffic over a Wi-Fi network. It includes support for:

  1. Buffered video streaming (BV1-BV6): Different bit rates from 2Mbps to 15.6Mbps
  2. Multicast video streaming (MC1-MC2): 3Mbps and 6Mbps multicast
  3. Custom video parameters: User-defined Weibull parameters and bit rate

The simulation consists of:

  • A simple Wi-Fi network with one AP (Access Point) and one or more STAs (Stations)
  • Video traffic flowing from the AP to the STA(s)
  • Application-level tracing to observe video frames being generated and sent

The video traffic model follows IEEE 802.11-14/0571r12 TGAX evaluation methodology:

  • Video frame sizes are drawn from a Weibull distribution
  • Network latency is modeled using a Gamma distribution (mean ~14.8ms)
  • Multiple predefined profiles for different video quality levels

To run with default settings (BV1, 2Mbps): ./ns3 run tgax-video-example To run with higher bit rate: ./ns3 run "tgax-video-example --model=BV3" To run with multicast: ./ns3 run "tgax-video-example --model=MC1" To run with TCP: ./ns3 run "tgax-video-example --protocol=tcp"

To disable verbose logging: ./ns3 run "tgax-video-example --verbose=false"

Definition in file tgax-video-example.cc.

Function Documentation

◆ PacketReceived()

void PacketReceived ( std::string context,
Ptr< const Packet > packet,
const Address & address )

Callback invoked when the PacketSink receives a packet.

Parameters
contextThe context string
packetThe received packet
addressThe sender's address

Definition at line 322 of file tgax-video-example.cc.

References NS_LOG_INFO.

◆ VideoFrameGenerated()

void VideoFrameGenerated ( uint32_t frameSize)

Callback invoked when a video frame is generated.

Parameters
frameSizeThe size of the generated frame in bytes

Definition at line 316 of file tgax-video-example.cc.

References NS_LOG_INFO.

◆ VideoPacketSent()

void VideoPacketSent ( Ptr< const Packet > packet,
Time latency )

Callback invoked when a video packet is transmitted.

Parameters
packetThe transmitted packet
latencyThe network latency applied to the packet

Definition at line 309 of file tgax-video-example.cc.

References ns3::Time::As(), NS_LOG_INFO, and ns3::Time::US.

Here is the call graph for this function: