UDPVideoStreamSvr

Package: inet.applications.udpapp

UDPVideoStreamSvr

simple module

Video stream server. To be used with UDPVideoStreamCli.

The server will wait for incoming "video streaming requests". When a request arrives, it draws a random video stream size using the videoSize parameter, and starts streaming to the client. During streaming, it will send UDP packets of size packetLen at every sendInterval, until videoSize is reached. The parameters packetLen and sendInterval can be set to constant values to create CBR traffic, or to random values (e.g. sendInterval=uniform(1e-6, 1.01e-6)) to accomodate jitter.

The server can serve several clients, and several streams per client.

Statistics:

reqStreamBytes: statistic of bytelength of requested video streams. sentPkBytes: statistic of sent packets and sent bytes.

See also: UDPVideoStreamCli

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

port to listen on

sendInterval double

interval between sending video stream packets

packetLen int

length of a video packet in bytes

videoSize int

length of full a video stream in bytes

Properties

Name Value Description
display i=block/app

Gates

Name Direction Size Description
udpIn input
udpOut output

Signals

Name Type Unit
sentPk cPacket
reqStreamBytes long

Statistics

Name Title Source Record Unit Interpolation Mode
sentPk packets sent sentPk count, sum(packetBytes), vector(packetBytes) none
reqStreamBytes requested stream bytes count, sum, vector none

Source code

//
// Video stream server. To be used with ~UDPVideoStreamCli.
//
// The server will wait for incoming "video streaming requests".
// When a request arrives, it draws a random video stream size
// using the videoSize parameter, and starts streaming to the client.
// During streaming, it will send UDP packets of size packetLen at every
// sendInterval, until videoSize is reached. The parameters packetLen
// and sendInterval can be set to constant values to create CBR traffic,
// or to random values (e.g. sendInterval=uniform(1e-6, 1.01e-6)) to
// accomodate jitter.
//
// The server can serve several clients, and several streams per client.
//
// Statistics:
//
// reqStreamBytes: statistic of bytelength of requested video streams.
// sentPkBytes: statistic of sent packets and sent bytes.
//
// @see ~UDPVideoStreamCli
//
simple UDPVideoStreamSvr like IUDPApp
{
    parameters:
        int localPort; // port to listen on
        volatile double sendInterval @unit(s); // interval between sending video stream packets
        volatile int packetLen @unit(B);  // length of a video packet in bytes
        volatile int videoSize @unit(B);  // length of full a video stream in bytes
        @display("i=block/app");
        @signal[sentPk](type=cPacket);
        @signal[reqStreamBytes](type=long);
        @statistic[reqStreamBytes](title="requested stream bytes"; record=count,sum,vector; interpolationmode=none);
        @statistic[sentPk](title="packets sent"; source=sentPk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input udpIn @labels(UDPControlInfo/up);
        output udpOut @labels(UDPControlInfo/down);
}

File: src/inet/applications/udpapp/UDPVideoStreamSvr.ned