Loopback¶
Package: inet.linklayer.loopback
simple module Loopback
Loopback interface module implementation.
See also: LoopbackInterface
Usage diagram¶
Inheritance diagram¶
Used in compound modules¶
Name |
Type |
Description |
|---|---|---|
compound module |
Implements a loopback network interface. |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“rcv:{numRcvdOK} snt:{numSent}” |
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 |
|
mtu |
int |
4470B |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
Loopback |
|
display |
i=block/rxtx |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
upperLayerIn |
input |
||
upperLayerOut |
output |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
packetReceivedFromUpper |
cPacket |
||
packetSentToUpper |
cPacket |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
passedUpPk |
packets passed to higher layer |
packetSentToUpper |
count,”sum(packetBytes)”,”vector(packetBytes)” |
none |
||
rcvdPkFromHl |
packets received from higher layer |
packetReceivedFromUpper |
count,”sum(packetBytes)”,”vector(packetBytes)” |
none |
Source code¶
//
// Loopback interface module implementation.
//
// @see ~LoopbackInterface
//
simple Loopback extends SimpleModule
{
parameters:
@class(Loopback);
string interfaceTableModule; // The path to the InterfaceTable module
int mtu @unit(B) = default(4470B);
displayStringTextFormat = default("rcv:{numRcvdOK} snt:{numSent}");
@display("i=block/rxtx");
@signal[packetSentToUpper](type=cPacket);
@signal[packetReceivedFromUpper](type=cPacket);
@statistic[rcvdPkFromHl](title="packets received from higher layer"; source=packetReceivedFromUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
@statistic[passedUpPk](title="packets passed to higher layer"; source=packetSentToUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
gates:
input upperLayerIn;
output upperLayerOut;
}