Simple Module UDPVideoStreamSvr

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

C++ definition

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 waitInterval, until videoSize is reached. The parameters packetLen and waitInterval can be set to constant values to create CBR traffic, or to random values (e.g. waitInterval=uniform(1e-6, 1.01e-6)) to accomodate jitter.

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

See also: UDPVideoStreamCli

UDPVideoStreamSvr

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

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

Parameters:

Name Type Default value Description
serverPort int

port to listen on

waitInterval double

interval between sending video stream packets

packetLen int
videoSize int

Properties:

Name Value Description
display i=block/app

Gates:

Name Direction Size Description
udpIn input
udpOut output

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
// waitInterval, until videoSize is reached. The parameters packetLen
// and waitInterval can be set to constant values to create CBR traffic,
// or to random values (e.g. waitInterval=uniform(1e-6, 1.01e-6)) to
// accomodate jitter.
//
// The server can serve several clients, and several streams per client.
//
// @see UDPVideoStreamCli
//
simple UDPVideoStreamSvr like UDPApp
{
    parameters:
        int serverPort; // port to listen on
        volatile double waitInterval @unit("s"); // interval between sending video stream packets
        volatile int packetLen @unit("B");
        volatile int videoSize @unit("B");
        @display("i=block/app");
    gates:
        input udpIn @labels(UDPControlInfo/up);
        output udpOut @labels(UDPControlInfo/down);
}