SimpleVoipReceiver

Package: inet.applications.voip

SimpleVoipReceiver

simple module

C++ definition

Receives a VoIP stream generated by a ~SimpleVoipSender, and records statistics. The most important statistic is MOS (Mean Opinion Score, a value between 1 and 5, representing a human user's view of the voice quality), computed using the E Model defined in the ITU-T G.107 standard. The parameters starting with "emodel_" correspond to the parameters of the E model.

The E Model was originally developed within ETSI as a transmission planning tool, described in ETSI technical report ETR 250, and then standardized by the ITU as G.107. The objective of the model was to determine a quality rating that incorporated the "mouth to ear" characteristics of a speech path.

The playout delay, buffer space, the UDP port to listen on, and other input can be specified in module parameters.

Inheritance diagram

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

Extends

Name Type Description
SimpleModule simple module

Base module for all INET simple modules.

Parameters

Name Type Default value Description
displayStringTextFormat string ""

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

localPort int
emodelIe int 5

Equipment impairment factor

emodelBpl int 10

Packet-loss robustness factor

emodelA int 5

Advantage factor

emodelRo double 93.2

Basic signal-to-noise ratio

playoutDelay double 0s

Initial delay for beginning playout after receiving the first packet

adaptivePlayoutDelay bool false

If true, adjust playoutDelay after each talkspurt

bufferSpace int 20

Buffer size in packets

mosSpareTime double 1s

Spare time before calculating MOS (after calculated playout time of last packet)

Properties

Name Value Description
class SimpleVoipReceiver
display i=block/source

Gates

Name Direction Size Description
socketIn input
socketOut output

Signals

Name Type Unit Description
voipPacketDelay simtime_t

When receive a frame

voipPlayoutLossRate double

At end of talkspurt

voipPlayoutDelay simtime_t

At end of talkspurt

voipTaildropLossRate double

At end of talkspurt

voipPacketLossRate double

At end of talkspurt

voipMosRate double

At end of talkspurt

Statistics

Name Title Source Record Unit Interpolation Mode Description
mos VoIP MOS voipMosRate stats, vector MOS
playoutDelay VoIP Playout Delay voipPlayoutDelay stats, vector s
packetLossRate VoIP Packet Loss voipPacketLossRate stats, vector ratio
playoutLossRate VoIP Playout Loss Rate voipPlayoutLossRate stats, vector ratio
taildropLossRate VoIP Tail Drop Loss Rate voipTaildropLossRate stats, vector ratio
endToEndDelay VoIP Packet End-to-End Delay voipPacketDelay stats, vector s

Source code

//
// Receives a VoIP stream generated by a ~SimpleVoipSender, and records statistics.
// The most important statistic is MOS (Mean Opinion Score, a value between 1
// and 5, representing a human user's view of the voice quality), computed using
// the E Model defined in the ITU-T G.107 standard. The parameters starting with
// "emodel_" correspond to the parameters of the E model.
//
// The E Model was originally developed within ETSI as a transmission planning tool,
// described in ETSI technical report ETR 250, and then standardized by the ITU as G.107.
// The objective of the model was to determine a quality rating that incorporated the
// "mouth to ear" characteristics of a speech path.
//
// The playout delay, buffer space, the UDP port to listen on, and other input
// can be specified in module parameters.
//
simple SimpleVoipReceiver extends SimpleModule like IApp
{
    parameters:
        @class(SimpleVoipReceiver);
        int localPort;
        int emodelIe = default(5);        // Equipment impairment factor
        int emodelBpl = default(10);      // Packet-loss robustness factor
        int emodelA = default(5);         // Advantage factor
        double emodelRo = default(93.2);  // Basic signal-to-noise ratio

        double playoutDelay @unit(s) = default(0s);      // Initial delay for beginning playout after receiving the first packet
        bool adaptivePlayoutDelay = default(false);      // If true, adjust playoutDelay after each talkspurt
        int bufferSpace = default(20);      // Buffer size in packets
        double mosSpareTime @unit(s) = default(1s); // Spare time before calculating MOS (after calculated playout time of last packet)

        @signal[voipPacketDelay](type="simtime_t");      // When receive a frame
        @signal[voipPacketLossRate](type="double");      // At end of talkspurt
        @signal[voipPlayoutDelay](type="simtime_t");    // At end of talkspurt
        @signal[voipPlayoutLossRate](type="double");    // At end of talkspurt
        @signal[voipMosRate](type="double");          // At end of talkspurt
        @signal[voipTaildropLossRate](type="double");   // At end of talkspurt
        @statistic[endToEndDelay](title="VoIP Packet End-to-End Delay"; unit="s"; source="voipPacketDelay"; record=stats,vector);
        @statistic[packetLossRate](title="VoIP Packet Loss"; unit="ratio"; source="voipPacketLossRate"; record=stats,vector);
        @statistic[playoutDelay](title="VoIP Playout Delay"; unit="s"; source="voipPlayoutDelay"; record=stats,vector);
        @statistic[playoutLossRate](title="VoIP Playout Loss Rate"; unit="ratio"; source="voipPlayoutLossRate"; record=stats,vector);
        @statistic[mos](title="VoIP MOS"; unit="MOS"; source="voipMosRate"; record=stats,vector);
        @statistic[taildropLossRate](title="VoIP Tail Drop Loss Rate"; unit="ratio"; source="voipTaildropLossRate"; record=stats,vector);

        @display("i=block/source");
    gates:
        input socketIn @labels(UdpCommand/up);
        output socketOut @labels(UdpCommand/down);
}

File: src/inet/applications/voip/SimpleVoipReceiver.ned