A simple VoIP 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"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 | VoipPacketSent (Ptr< const Packet > packet, Time jitter) |
| Callback invoked when a VoIP packet is transmitted. | |
| void | VoipStateChanged (TgaxVoipTraffic::VoiceActivityState state, Time duration) |
| Callback invoked when the VoIP application state changes (active/silence). | |
A simple VoIP traffic generator example over Wi-Fi.
This example demonstrates how to set up a basic ns-3 simulation with VoIP traffic over a Wi-Fi network. It includes three configurations:
The simulation consists of:
To run with IPv4/UDP (default): ./ns3 run tgax-voip-example To run with IPv6/UDP: ./ns3 run "tgax-voip-example --socketType=ipv6" To run with PacketSocket: ./ns3 run "tgax-voip-example --socketType=packet"
To disable verbose logging: ./ns3 run "tgax-voip-example --verbose=false"
Definition in file tgax-voip-example.cc.
Callback invoked when the PacketSink receives a packet.
| context | The context string |
| packet | The received packet |
| address | The sender's address |
Definition at line 344 of file tgax-voip-example.cc.
References NS_LOG_INFO.
Callback invoked when a VoIP packet is transmitted.
| packet | The transmitted packet |
| jitter | The jitter applied to the packet |
Definition at line 328 of file tgax-voip-example.cc.
References ns3::Time::As(), NS_LOG_INFO, and ns3::Time::US.
| void VoipStateChanged | ( | TgaxVoipTraffic::VoiceActivityState | state, |
| Time | duration ) |
Callback invoked when the VoIP application state changes (active/silence).
| state | The new voice activity state |
| duration | The expected duration in this state |
Definition at line 335 of file tgax-voip-example.cc.
References ns3::TgaxVoipTraffic::ACTIVE_TALKING, ns3::Time::As(), ns3::Time::MS, and NS_LOG_INFO.