A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
rta-tig-mobile-gaming-example.cc File Reference

A simple real-time mobile gaming 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 rta-tig-mobile-gaming-example.cc:

Go to the source code of this file.

Functions

void GamingPacketSent (std::string context, Ptr< const Packet > packet, RtaTigMobileGaming::TrafficModelStage stage)
 Callback invoked when a gaming packet is transmitted.
void PacketReceived (std::string context, Ptr< const Packet > packet, const Address &address)
 Callback invoked when the PacketSink receives a packet.

Detailed Description

A simple real-time mobile gaming traffic generator example over Wi-Fi.

This example demonstrates how to set up a basic ns-3 simulation with real-time mobile gaming traffic over a Wi-Fi network. Real-time mobile gaming is characterized by small packets (30-500 bytes) sent frequently (every 30-60ms) with low latency requirements.

The simulation consists of:

  • A simple Wi-Fi network with one AP (Access Point) and one STA (Station)
  • Gaming traffic with three stages: Initial, Gaming, and Ending
  • Application-level tracing to observe gaming packets and stage transitions

The traffic model follows IEEE 802.11-18/2009r6 RTA TIG Report (Section 4.1.4):

  • Two synchronization mechanisms: Status Sync and Frame Lockstep Sync
  • Packet sizes and arrivals follow Largest Extreme Value distribution
  • Initial and end packets follow Uniform distribution

Traffic model presets:

  • Status Sync DL: a=13ms, b=3.7ms arrivals; a=50, b=11 bytes sizes
  • Status Sync UL: a=15ms, b=5.7ms arrivals; a=38, b=3.7 bytes sizes
  • Lockstep DL: a=28ms, b=4.2ms arrivals; a=210, b=35 bytes sizes
  • Lockstep UL: a=22ms, b=3.4ms arrivals; a=92, b=38 bytes sizes

To run with default (status-sync DL): ./ns3 run rta-tig-mobile-gaming-example To run status-sync UL: ./ns3 run "rta-tig-mobile-gaming-example --model=status-sync-ul" To run lockstep DL: ./ns3 run "rta-tig-mobile-gaming-example --model=lockstep-dl" To run lockstep UL: ./ns3 run "rta-tig-mobile-gaming-example --model=lockstep-ul"

To disable verbose logging: ./ns3 run "rta-tig-mobile-gaming-example --verbose=false"

Definition in file rta-tig-mobile-gaming-example.cc.

Function Documentation

◆ GamingPacketSent()

void GamingPacketSent ( std::string context,
Ptr< const Packet > packet,
RtaTigMobileGaming::TrafficModelStage stage )

Callback invoked when a gaming packet is transmitted.

Parameters
contextThe context string
packetThe transmitted packet
stageThe traffic model stage

Definition at line 341 of file rta-tig-mobile-gaming-example.cc.

References NS_LOG_INFO.

◆ 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 350 of file rta-tig-mobile-gaming-example.cc.

References NS_LOG_INFO.