Simple Module UDPSink

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

C++ definition

Consumes and prints packets received from the UDP module.

UDPSink

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
interfaceTableModule string

The path to the InterfaceTable module

startTime double 0s

application start time

stopTime double -1s

time of finishing receiving

localPort int

local port

receiveBroadcast bool false

if true, makes the socket receive broadcast packets

multicastGroup string ""

if non-empty, makes the socket receive multicast packets sent to that group

multicastSources string ""

if non-empty, than the socket receives multicast packets from those sources only

Properties:

Name Value Description
display i=block/sink

Gates:

Name Direction Size Description
udpIn input
udpOut output

Signals:

Name Type Unit
rcvdPk cPacket

Statistics:

Name Title Source Record Unit Interpolation Mode
rcvdPk packets received rcvdPk count, sum(packetBytes), vector(packetBytes) none
throughput throughput throughput(rcvdPk) vector bps
endToEndDelay end-to-end delay messageAge(rcvdPk) histogram, vector s none
rcvdPkSeqNo received packet sequence number appPkSeqNo(rcvdPk) vector none

Source code:

//
// Consumes and prints packets received from the ~UDP module.
//
simple UDPSink like IUDPApp
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        double startTime @unit(s) = default(0s); // application start time
        double stopTime @unit(s) = default(-1s);  // time of finishing receiving
        int localPort; // local port
        bool receiveBroadcast = default(false); // if true, makes the socket receive broadcast packets
        string multicastGroup = default(""); // if non-empty, makes the socket receive multicast packets sent to that group
        string multicastSources = default(""); // if non-empty, than the socket receives multicast packets from those sources only

        @display("i=block/sink");
        @signal[rcvdPk](type=cPacket);
        @statistic[rcvdPk](title="packets received"; source=rcvdPk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[throughput](title="throughput"; unit=bps; source="throughput(rcvdPk)"; record=vector);
        @statistic[endToEndDelay](title="end-to-end delay"; source="messageAge(rcvdPk)"; unit=s; record=histogram,vector; interpolationmode=none);
        @statistic[rcvdPkSeqNo](title="received packet sequence number"; source="appPkSeqNo(rcvdPk)"; record=vector; interpolationmode=none);

    gates:
        input udpIn @labels(UDPControlInfo/up);
        output udpOut @labels(UDPControlInfo/down);
}