InterfaceService

Package: inet.protocolelement.service

compound module InterfaceService

(no description)

InterfaceServiceupperLayerIn --> sendToMacAddress.insendToMacAddress.out --> resending.inresending.out --> sendWithAcknowledge.insendWithAcknowledge.out --> m1.in++m1.out --> sendWithProtocol.insendWithProtocol.out --> crcInserter.incrcInserter.out --> transmitter.intransmitter.out --> phys$ophys$i --> crcChecker.incrcChecker.out --> receiveWithProtocol.inreceiveWithProtocol.out --> d1.in++d1.out++ --> receiveWithAcknowledge.inreceiveWithAcknowledge.out --> receiveAtMacAddress.inreceiveWithAcknowledge.ackOut --> m1.in++d1.out++ --> sendWithAcknowledge.ackInreceiveAtMacAddress.out --> upperLayerOutpcapRecorder[numPcapRecorders]: inet.common.packet.recorder.PcapRecorder inherited from NetworkInterface Records PCAP traces of frames sent/received by other modules within the same host. Source: pcapRecorder[numPcapRecorders]: PcapRecorder { parameters: moduleNamePatterns = ".^"; @display("p=100,100;is=s"); }pcapRecorder[numPcapRecorders]clock: inet.clock.contract.IClock (like IClock) inherited from NetworkInterface IClock: Interface for clock models. Source: clock: <default("")> like IClock if typename != "" { parameters: @display("p=100,200;is=s"); }clocksendToMacAddress: inet.protocolelement.selectivity.SendToMacAddress Source: sendToMacAddress: SendToMacAddress { @display("p=300,100"); }sendToMacAddressresending: inet.protocolelement.acknowledgement.Resending Source: resending: Resending { @display("p=300,200"); }resendingsendWithAcknowledge: inet.protocolelement.acknowledgement.SendWithAcknowledge Source: sendWithAcknowledge: SendWithAcknowledge { @display("p=300,300"); }sendWithAcknowledgem1: inet.queueing.common.PacketMultiplexer Connects multiple packet producers to one packet consumer. Source: m1: PacketMultiplexer { @display("p=300,400"); }m1sendWithProtocol: inet.protocolelement.dispatching.SendWithProtocol Source: sendWithProtocol: SendWithProtocol { @display("p=300,500"); }sendWithProtocolcrcInserter: inet.protocolelement.checksum.EthernetFcsHeaderInserter Inserts Ethernet FCS checksums as headers into packets to enable data integrity verification. Source: crcInserter: EthernetFcsHeaderInserter { @display("p=300,600"); }crcInsertertransmitter: inet.protocolelement.transceiver.PacketTransmitter Receives packets from the upper layer as a whole. Source: transmitter: PacketTransmitter { @display("p=300,700"); }transmitterreceiveAtMacAddress: inet.protocolelement.selectivity.ReceiveAtMacAddress Source: receiveAtMacAddress: ReceiveAtMacAddress { @display("p=600,100"); }receiveAtMacAddressreceiveWithAcknowledge: inet.protocolelement.acknowledgement.ReceiveWithAcknowledge Source: receiveWithAcknowledge: ReceiveWithAcknowledge { @display("p=600,200"); }receiveWithAcknowledged1: inet.common.MessageDispatcher Facilitates the interconnection of applications, protocols, and network interfaces, dispatching m... Source: d1: MessageDispatcher { @display("p=600,300"); }d1receiveWithProtocol: inet.protocolelement.dispatching.ReceiveWithProtocol Source: receiveWithProtocol: ReceiveWithProtocol { @display("p=600,400"); }receiveWithProtocolcrcChecker: inet.protocolelement.checksum.EthernetFcsHeaderChecker Checks Ethernet FCS checksums inserted as headers in packets in order to verify data integrity. Source: crcChecker: EthernetFcsHeaderChecker { @display("p=600,500"); }crcChecker

Usage diagram

Inheritance diagram

Extends

Name

Type

Description

NetworkInterface

compound module

Serves as the base module for all network interfaces.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“%a (%i)\n%m”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

recordPcap

bool

false

numPcapRecorders

int

recordPcap ? 1 : 0

interfaceTableModule

string

protocol

string

Properties

Name

Value

Description

class

inet::NetworkInterface

display

i=block/ifcard

lifecycleSupport

networkInterface

Gates

Name

Direction

Size

Description

upperLayerIn

input

upperLayerOut

output

phys

inout

Signals

Name

Type

Unit

Description

packetDropped

inet::Packet

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

packetDropInterfaceDown

packet drops: interface down

packetDropReasonIsInterfaceDown(packetDropped)

count,sum(packetBytes),vector(packetBytes)

none

packetDropNoCarrier

packet drops: no carrier

packetDropReasonIsNoCarrier(packetDropped)

count,sum(packetBytes),vector(packetBytes)

none

Unassigned submodule parameters

Name

Type

Default value

Description

pcapRecorder.displayStringTextFormat

string

“rec: %n pks”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

pcapRecorder.verbose

bool

true

Whether to log packets on the module output

pcapRecorder.recordEmptyPackets

bool

true

Specifies if zero length packets are recorded or not

pcapRecorder.enableConvertingPackets

bool

true

Specifies if converting packets to link type is allowed or not

pcapRecorder.pcapFile

string

“”

The PCAP file to be written, suggested value: pcapFile = “${resultdir}/${configname}-#${runnumber}” + fullpath() + “.pcap”

pcapRecorder.fileFormat

string

“pcapng”

pcapRecorder.snaplen

int

65535

Maximum number of bytes to record per packet

pcapRecorder.timePrecision

int

6

Time precision in recorded file. pcap supports only 6 (usec) or 9 (nanosec), pcapng supports more values (see ‘if_tsresol’ option in pcapng file format).

pcapRecorder.dumpBadFrames

bool

true

Enable dump of frames with hasBitError

pcapRecorder.sendingSignalNames

string

“transmissionEnded”

Space-separated list of outbound packet signals to subscribe to

pcapRecorder.receivingSignalNames

string

“receptionEnded”

Space-separated list of inbound packet signals to subscribe to

pcapRecorder.dumpProtocols

string

“ethernetmac ppp ieee80211mac”

Space-separated list of protocol names as defined in the Protocol class

pcapRecorder.packetFilter

object

“*”

Which packets are considered, matches all packets by default

pcapRecorder.helpers

string

“”

Usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype

pcapRecorder.alwaysFlush

bool

false

Flush the pcapFile after each write to ensure that all packets are captured in case of a crash

sendToMacAddress.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

sendToMacAddress.address

string

“”

resending.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

resending.numRetries

int

sendWithAcknowledge.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

sendWithAcknowledge.acknowledgeTimeout

double

m1.displayStringTextFormat

string

“passed %p pk (%l)”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

m1.forwardServiceRegistration

bool

true

m1.forwardProtocolRegistration

bool

true

sendWithProtocol.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

crcInserter.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

crcInserter.checksumMode

string

“declared”

crcInserter.headerPosition

string

“front”

transmitter.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

transmitter.clockModule

string

“”

Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional

transmitter.datarate

double

receiveAtMacAddress.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

receiveAtMacAddress.address

string

receiveWithAcknowledge.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

d1.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

d1.interfaceTableModule

string

Module path to the InterfaceTable module

d1.forwardServiceRegistration

bool

true

d1.forwardProtocolRegistration

bool

true

d1.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

d1.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

d1.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

receiveWithProtocol.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

crcChecker.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

crcChecker.backpressure

bool

false

crcChecker.headerPosition

string

“front”

Source code

module InterfaceService extends NetworkInterface
{
    parameters:
        string interfaceTableModule;
        string protocol;
        @class(inet::NetworkInterface);
        @display("i=block/ifcard");
    gates:
        input upperLayerIn @loose;
        output upperLayerOut @loose;
        inout phys;
    submodules:
        sendToMacAddress: SendToMacAddress {
            @display("p=300,100");
        }
        resending: Resending {
            @display("p=300,200");
        }
        sendWithAcknowledge: SendWithAcknowledge {
            @display("p=300,300");
        }
        m1: PacketMultiplexer {
            @display("p=300,400");
        }
        sendWithProtocol: SendWithProtocol {
            @display("p=300,500");
        }
        crcInserter: EthernetFcsHeaderInserter {
            @display("p=300,600");
        }
        transmitter: PacketTransmitter {
            @display("p=300,700");
        }
        receiveAtMacAddress: ReceiveAtMacAddress {
            @display("p=600,100");
        }
        receiveWithAcknowledge: ReceiveWithAcknowledge {
            @display("p=600,200");
        }
        d1: MessageDispatcher {
            @display("p=600,300");
        }
        receiveWithProtocol: ReceiveWithProtocol {
            @display("p=600,400");
        }
        crcChecker: EthernetFcsHeaderChecker {
            @display("p=600,500");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> sendToMacAddress.in;
        sendToMacAddress.out --> resending.in;
        resending.out --> sendWithAcknowledge.in;
        sendWithAcknowledge.out --> m1.in++;
        m1.out --> sendWithProtocol.in;
        sendWithProtocol.out --> crcInserter.in;
        crcInserter.out --> transmitter.in;
        transmitter.out --> { @display("m=s"); } --> phys$o;

        phys$i --> { @display("m=s"); } --> crcChecker.in;
        crcChecker.out --> receiveWithProtocol.in;
        receiveWithProtocol.out --> d1.in++;
        d1.out++ --> receiveWithAcknowledge.in;
        receiveWithAcknowledge.out --> receiveAtMacAddress.in;
        receiveWithAcknowledge.ackOut --> m1.in++;
        d1.out++ --> sendWithAcknowledge.ackIn;
        receiveAtMacAddress.out --> { @display("m=n"); } --> upperLayerOut;
}

File: src/inet/protocolelement/service/InterfaceService.ned