UdpEchoApp
Package: inet.applications.udpapp

UdpEchoApp

simple module

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

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
socketIn input
socketOut output

Signals

Name Type Unit
packetSent Packet

Statistics

Name Title Source Record Unit Interpolation Mode
echoedPk packets echoed packetSent 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 IApp
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        int localPort;  // local port to listen on
        @display("i=block/app");
        @signal[packetSent](type=Packet);
        @statistic[echoedPk](title="packets echoed"; source=packetSent; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input socketIn @labels(UdpControlInfo/up);
        output socketOut @labels(UdpControlInfo/down);
}
File: src/inet/applications/udpapp/UdpEchoApp.ned