9#ifndef TGAX_VOIP_TRAFFIC_H
10#define TGAX_VOIP_TRAFFIC_H
14#include "ns3/event-id.h"
16#include "ns3/traced-callback.h"
An identifier for simulation events.
The exponential distribution Random Number Generator (RNG).
The laplacian distribution Random Number Generator (RNG).
Smart pointer class similar to boost::intrusive_ptr.
SourceApplication(bool allowPacketSocket=true)
Constructor.
double m_inactiveToActive
Probability to transition from inactive/silence state to active/talking state.
~TgaxVoipTraffic() override
uint32_t m_activePacketSize
Size in bytes for payload of active packets.
VoiceActivityState m_currentState
Hold the current voice activity state.
Ptr< UniformRandomVariable > m_inactiveUniform
Uniform random variable to generate state transitions from inactive state.
Time m_silenceInterval
Interval between generation of silence packets.
void CancelEvents() override
Cancel all pending events.
TracedCallback< Ptr< const Packet >, Time > m_txJitterTrace
Traced Callback: transmitted packets and their jitters.
Time m_remainingEncodingDuration
The remaining duration to encode the current frame.
TracedCallback< VoiceActivityState, Time > m_stateUpdate
Traced Callback: voice activity state updated.
bool m_pendingStateTransition
Flag whether a state transition should once duration of current state has elapsed.
void ScheduleNext()
Schedule the next state update.
void SendPacket(uint64_t eventId, Ptr< Packet > packet, Time jitter)
Transmit one VoIP packet.
std::map< uint64_t, EventId > m_txPacketEvents
Event IDs of pending TX events.
VoiceActivityState
Voice activity states.
void SetInactiveExponentialMean(Time mean)
Set the mean of the exponential distribution used to calculate durations of inactive/silent state.
void(* TxTracedCallback)(Ptr< const Packet > packet, Time jitter)
TracedCallback signature for packet and jitter.
static TypeId GetTypeId()
Get the type ID.
Time m_remainingStateDuration
The remaining duration in the current state.
void SetActiveExponentialMean(Time mean)
Set the mean of the exponential distribution used to calculate durations of active/talking state.
Time GetStateUpdateInterval() const
Get the interval between two state updates.
Time m_voiceInterval
Interval between generation of voice packets.
Time GetEncoderFrameDuration() const
Get the duration to encode a frame based on the current state.
void DoConnectionSucceeded(Ptr< Socket > socket) override
Application specific code for child subclasses upon a Connection Succeed event.
Ptr< ExponentialRandomVariable > m_inactiveExponential
Exponential random variable to generate inactive/silent state durations.
uint32_t m_silencePacketSize
Size in bytes for payload of silence packets.
Ptr< ExponentialRandomVariable > m_activeExponential
Exponential random variable to generate active/talking state durations.
void(* StateUpdatedCallback)(VoiceActivityState state, Time duration)
TracedCallback signature for state change.
Ptr< UniformRandomVariable > m_activeUniform
Uniform random variable to generate state transitions from active state.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this Application object.
Ptr< LaplacianRandomVariable > m_delayJitterLaplacian
Laplacian random variable to generate delay jitter.
Time m_delayJitterBound
Bound of laplacian distribution used to calculate delay jitter.
uint64_t m_nextEventId
The next event ID.
void DoInitialize() override
Initialize() implementation.
double m_activeToInactive
Probability to transition from active/talking state to inactive/silence state.
void DoStartApplication() override
Application specific startup code for child subclasses.
void UpdateState()
Update voice activity state.
EventId m_stateUpdateEvent
Event ID of pending state update event scheduling.
Time m_delayJitterScale
Scale of laplacian distribution used to calculate delay jitter.
Simulation virtual time values and global simulation resolution.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)