VoIPStreamReceiver

Package: inet.applications.voipstream

VoIPStreamReceiver

simple module

VoIPStreamReceiver listens on an UDP port, and expects to receive VoIP packets on it. The received voice is then saved into a result audio file that can be compared with the original for further evaluation. VoIP packets are numbered, and out-of-order packets are discarded (the corresponding voice interval will be recorded as silence into the file). VoIP packets that miss their deadlines will similarly be discarded. It is assumed that the audio is played back with delay (by default 20ms), which allows some jitter for the incoming packets. The resulting audio file is closed when the simulation completes (i.e. in the OMNeT++ finish() function). Only one voice session ("call") may be underway at a time.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Parameters

Name Type Default value Description
localPort int
playoutDelay double 20ms
resultFile string

Properties

Name Value Description
display i=block/arrival

Gates

Name Direction Size Description
udpIn input
udpOut output

Signals

Name Type Unit
lostPackets long
packetHasVoice long
delay simtime_t
dropPk cPacket
connState long
rcvdPk cPacket
lostSamples long

Statistics

Name Title Source Record Unit Interpolation Mode
lostPackets lost packets vector, stats none
packetHasVoice voice or silence packet mean, vector none
numSessions total number of sessions sum(connState+1)/2 last
delay delay vector, histogram s none
dropPk packets dropped dropPk count, sum(packetBytes), vector(packetBytes) none
rcvdPk packets received rcvdPk count, sum(packetBytes), vector(packetBytes) none
numActiveSessions number of active sessions sum(connState) max, timeavg, vector sample-hold
lostSamples lost samples vector, stats none

Source code

//
// VoIPStreamReceiver listens on an UDP port, and expects to receive VoIP packets on
// it. The received voice is then saved into a result audio file that can be
// compared with the original for further evaluation. VoIP packets are
// numbered, and out-of-order packets are discarded (the corresponding voice
// interval will be recorded as silence into the file). VoIP packets that miss
// their deadlines will similarly be discarded. It is assumed that the audio is
// played back with delay (by default 20ms), which allows some jitter for the
// incoming packets. The resulting audio file is closed when the simulation
// completes (i.e. in the OMNeT++ finish() function). Only one voice session
// ("call") may be underway at a time.
//
simple VoIPStreamReceiver like IUDPApp
{
    parameters:
        int localPort;
        double playoutDelay @unit(s) = default(20ms);
        string resultFile;
        @signal[rcvdPk](type=cPacket); // expected type=VoIPStreamPacket
        @signal[dropPk](type=cPacket);
        @signal[lostSamples](type=long);
        @signal[lostPackets](type=long);
        @signal[packetHasVoice](type=long);  // 1=yes, 0=no
        @signal[connState](type=long);  // 1=open, -1=close
        @signal[delay](type=simtime_t);  // total time lag of voice transmission
        @statistic[rcvdPk](title="packets received"; source=rcvdPk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[dropPk](title="packets dropped"; source=dropPk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[lostSamples](title="lost samples"; interpolationmode=none; record=vector,stats);
        @statistic[lostPackets](title="lost packets"; interpolationmode=none; record=vector,stats);
        @statistic[packetHasVoice](title="voice or silence packet"; record=mean,vector; interpolationmode=none);
        @statistic[delay](title="delay"; unit=s; record=vector,histogram; interpolationmode=none);
        @statistic[numActiveSessions](title="number of active sessions"; source="sum(connState)"; record=max,timeavg,vector; interpolationmode=sample-hold; );
        @statistic[numSessions](title="total number of sessions"; source="sum(connState+1)/2"; record=last);
        @display("i=block/arrival");
    gates:
        input udpIn;
        output udpOut;
}

File: src/inet/applications/voipstream/VoIPStreamReceiver.ned