EthernetSocketIo¶
Package: inet.applications.ethernet
simple module EthernetSocketIo
Provides Ethernet socket handling for generic applications.
Usage diagram¶
Inheritance diagram¶
Used in compound modules¶
Name |
Type |
Description |
|---|---|---|
compound module |
Generates traffic as an Ethernet application. The traffic source and traffic sink modules can be built from queueing model elements. |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“rcvd: {numReceived} pks\nsent: {numSent} pks” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
interfaceTableModule |
string |
Relative module path of the interface table |
|
interface |
string |
“” |
Network interface name |
protocol |
string |
“” |
Bind the socket to this protocol if specified |
localAddress |
string |
“” |
Local Ethernet MAC address |
remoteAddress |
string |
“” |
Remote Ethernet MAC address |
steal |
bool |
false |
Steal packets |
stopOperationExtraTime |
double |
-1s |
Extra time after lifecycle stop operation finished |
stopOperationTimeout |
double |
2s |
Timeout value for lifecycle stop operation |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
EthernetSocketIo |
|
display |
i=block/socket |
|
lifecycleSupport |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
trafficIn |
input |
||
trafficOut |
output |
||
socketIn |
input |
||
socketOut |
output |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
packetReceived |
|||
packetSent |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
packetReceived |
packets received |
packetReceived |
count,”sum(packetBytes)”,”vector(packetBytes)” |
none |
||
packetSent |
packets sent |
packetSent |
count,”sum(packetBytes)”,”vector(packetBytes)” |
none |
Source code¶
//
// Provides Ethernet socket handling for generic applications.
//
simple EthernetSocketIo extends SimpleModule
{
parameters:
@class(EthernetSocketIo);
string interfaceTableModule; // Relative module path of the interface table
string interface = default(""); // Network interface name
string protocol = default(""); // Bind the socket to this protocol if specified
string localAddress = default(""); // Local Ethernet MAC address
string remoteAddress = default(""); // Remote Ethernet MAC address
bool steal = default(false); // Steal packets
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
@lifecycleSupport();
displayStringTextFormat = default("rcvd: {numReceived} pks\nsent: {numSent} pks");
@display("i=block/socket");
@signal[packetSent](type=inet::Packet);
@signal[packetReceived](type=inet::Packet);
@statistic[packetSent](title="packets sent"; source=packetSent; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
@statistic[packetReceived](title="packets received"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
gates:
input trafficIn;
output trafficOut;
input socketIn;
output socketOut;
}