UdpSink¶
Package: inet.applications.udpapp
simple module UdpSink
Consumes and prints packets received from the Udp module.
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“rcvd: {numReceived} pks” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
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, then the socket receives multicast packets from those sources only |
stopOperationExtraTime |
double |
-1s |
Extra time after lifecycle stop operation finished |
stopOperationTimeout |
double |
2s |
Timeout value for lifecycle stop operation |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
UdpSink |
|
display |
i=block/sink |
|
lifecycleSupport |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
socketIn |
input |
||
socketOut |
output |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
packetReceived |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
endToEndDelay |
end-to-end delay |
dataAge(packetReceived) |
histogram,vector |
s |
none |
|
packetReceived |
packets received |
packetReceived |
count,”sum(packetBytes)”,”vector(packetBytes)” |
none |
||
rcvdPkSeqNo |
received packet sequence number |
appPkSeqNo(packetReceived) |
vector |
none |
||
throughput |
throughput |
throughput(packetReceived) |
vector |
bps |
Source code¶
//
// Consumes and prints packets received from the ~Udp module.
//
simple UdpSink extends SimpleModule like IApp
{
parameters:
@class(UdpSink);
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, then the socket receives multicast packets from those sources only
displayStringTextFormat = default("rcvd: {numReceived} pks");
@display("i=block/sink");
@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[packetReceived](type=inet::Packet);
@statistic[packetReceived](title="packets received"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
@statistic[throughput](title="throughput"; unit=bps; source="throughput(packetReceived)"; record=vector);
@statistic[endToEndDelay](title="end-to-end delay"; source="dataAge(packetReceived)"; unit=s; record=histogram,vector; interpolationmode=none);
@statistic[rcvdPkSeqNo](title="received packet sequence number"; source="appPkSeqNo(packetReceived)"; record=vector; interpolationmode=none);
gates:
input socketIn @labels(UdpCommand/up);
output socketOut @labels(UdpCommand/down);
}