Simple Module UDPEchoApp

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

C++ definition

Listens on an UDP port, and sends back each received packet to its sender. Note: when used together with UDPBasicApp, UDPBasicApp's "received packet lifetime" statistic will record round-trip times.

UDPEchoApp

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

localPort int

local port to listen on

Properties:

Name Value Description
display i=block/app

Gates:

Name Direction Size Description
udpIn input
udpOut output

Signals:

Name Type Unit
pk cPacket

Statistics:

Name Title Source Record Unit Interpolation Mode
echoedPk packets echoed pk count, sum(packetBytes), vector(packetBytes) none

Source code:

//
// Listens on an UDP port, and sends back each received packet to its sender.
// Note: when used together with ~UDPBasicApp, ~UDPBasicApp's "received packet
// lifetime" statistic will record round-trip times.
//
simple UDPEchoApp like IUDPApp
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        int localPort;  // local port to listen on
        @display("i=block/app");
        @signal[pk](type=cPacket);
        @statistic[echoedPk](title="packets echoed"; source=pk; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input udpIn @labels(UDPControlInfo/up);
        output udpOut @labels(UDPControlInfo/down);
}