Package: inet.applications.udpapp
UdpEchoApp
simple moduleListens 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.
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 |
|
| stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
| stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Properties
| Name | Value | Description |
|---|---|---|
| display | i=block/app | |
| lifecycleSupport |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| socketIn | input | ||
| socketOut | output |
Signals
| Name | Type | Unit |
|---|---|---|
| packetSent | inet::Packet |
Statistics
| Name | Title | Source | Record | Unit | Interpolation Mode |
|---|---|---|---|---|---|
| echoedPk | packets echoed | packetSent | count, sum(packetBytes), vector(packetBytes) | none |
Direct method calls (observed)
| call to | function | info |
|---|---|---|
| MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
Incoming messages (observed)
| gate | msg | kind | ctrl | srcModule | tags |
|---|---|---|---|---|---|
| socketIn | Indication | 1 (UdpStatusInd::UDP_I_ERROR) | UdpErrorIndication | Udp | L3AddressInd, L4PortInd, SocketInd |
| socketIn | Packet | 0 (UdpStatusInd::UDP_I_DATA) | Udp | DscpInd, EcnInd, HopLimitInd, InterfaceInd, L3AddressInd, L4PortInd, NetworkProtocolInd, SocketInd, TosInd, TransportProtocolInd, DispatchProtocolInd?, ErrorRateInd?, Ieee802SapInd?, MacAddressInd?, SignalPowerInd?, SignalTimeInd?, SnirInd?, Ieee80211ChannelInd?, Ieee80211ModeInd? |
Outgoing messages (observed)
| gate | msg | kind | ctrl | destModule | tags |
|---|---|---|---|---|---|
| socketOut | Packet | 0 (UdpCommandCode::UDP_C_DATA) | Udp | DispatchProtocolReq, L3AddressReq, L4PortReq, SocketReq | |
| socketOut | Request | 1 (UdpCommandCode::UDP_C_BIND) | UdpBindCommand | Udp | DispatchProtocolReq, SocketReq |
| socketOut | Request | 3 (UdpCommandCode::UDP_C_SETOPTION) | UdpJoinMulticastGroupsCommand | Udp | DispatchProtocolReq, SocketReq |
Packet operations (observed)
| chunkType | packetAction |
|---|---|
| trim |
Shared Tagging operations (observed)
| tagType | tagAction |
|---|---|
| clearTags | |
| DispatchProtocolReq | addTagIfAbsent |
| L3AddressInd | getTag |
| L3AddressReq | addTagIfAbsent |
| L4PortInd | getTag |
| L4PortReq | addTagIfAbsent |
| SocketInd | findTag |
| SocketReq | addTagIfAbsent |
Tagging operations (observed)
| tagType | tagAction |
|---|---|
| inet::Ipv4InterfaceData | findTag |
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"); @lifecycleSupport; double stopOperationExtraTime @unit(s) = default(-1s); // extra time after lifecycle stop operation finished double stopOperationTimeout @unit(s) = default(2s); // timeout value for lifecycle stop operation @signal[packetSent](type=inet::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