EthernetInterface

Package: inet.linklayer.ethernet

EthernetInterface

compound module

This module represents an Ethernet network interface.

pcapRecorder[numPcapRecorders] : PcapRecorder

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");
} clock : like IClock

IClock: This module interface is implemented by clock models.

Source:
clock: <default("")> like IClock if typename != "" {
    parameters:
        @display("p=100,200;is=s");
} egressTC : like ITrafficConditioner

ITrafficConditioner: This module interface is implemented by traffic conditioner modules.

Source:
egressTC: <default("")> like ITrafficConditioner {
    parameters:
        @display("p=300,100");
} ingressTC : like ITrafficConditioner

ITrafficConditioner: This module interface is implemented by traffic conditioner modules.

Source:
ingressTC: <default("")> like ITrafficConditioner {
    parameters:
        @display("i=block/uparrow;p=700,100");
} queue : like IPacketQueue

EthernetQueue: Queue module that gives the PAUSE frames a higher priority.

IPacketQueue: This module interface is implemented by packet queue modules.

Source:
queue: <default("EthernetQueue")> like IPacketQueue {
    parameters:
        packetCapacity = default(1000);
        @display("p=300,250");
} mac : like IEtherMac

IEtherMac: Interface for Ethernet MAC implementations.

Source:
mac: <default(csmacdSupport ? "EthernetCsmaMac" : "EthernetMac")> like IEtherMac {
    parameters:
        @display("p=500,300");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
NetworkInterface compound module

This module serves as the base module for all network interfaces.

Parameters

Name Type Default value Description
displayStringTextFormat string "%a (%i)\n%m"
recordPcap bool false
numPcapRecorders int recordPcap ? 1 : 0
interfaceTableModule string
protocol string "ethernetmac"
address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

duplexMode bool true

selects full-duplex (true) or half-duplex (false) operation

csmacdSupport bool !duplexMode

by default CSMA/CD is turned off, so only point-to-point duplex links are supported.

bitrate double 0 bps
fcsMode string "declared"

Properties

Name Value Description
networkInterface
lifecycleSupport
class NetworkInterface
display i=block/ifcard

Gates

Name Direction Size Description
upperLayerIn input
upperLayerOut output
cutthroughIn input
cutthroughOut output
phys inout

Signals

Name Type Unit
packetDropped inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode
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

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::handleRegisterInterfacehandleRegisterInterface
MessageDispatcherinet::MessageDispatcher::pushPacketpushPacket
EthernetInterfaceinet::NetworkInterface::receiveSignalPOST_MODEL_CHANGE
InterfaceTableinet::InterfaceTable::findInterfaceByNamefindInterfaceByName
InterfaceTableinet::InterfaceTable::interfaceChangedinterfaceChanged
NextHopRoutingTableinet::NextHopRoutingTable::receiveSignalinterfaceCreated

Called methods (observed)

functioninfocall from
inet::NetworkInterface::handleOperationStagehandleOperationStageScenarioManager
inet::NetworkInterface::pushPacketpushPacketDscpMarker, PacketMultiplexer
inet::NetworkInterface::receiveSignalPOST_MODEL_CHANGE-=Network=-, ScenarioManager, EthernetInterface, OmittedTrafficConditioner

Push out messages (observed)

gatemsgkindctrldestModuletags
upperLayerOutPacket0MessageDispatcherDispatchProtocolReq, InterfaceInd, MacAddressInd, PacketProtocolTag, NetworkProtocolInd?

Shared Tagging operations (observed)

tagTypetagAction
InterfaceIndaddTagIfAbsent

Tagging operations (observed)

tagTypetagAction
clearTags

Unassigned submodule parameters

Name Type Default value Description
pcapRecorder.verbose bool true

whether to log packets on the module output

pcapRecorder.pcapFile string ""

the PCAP file to be written

pcapRecorder.fileFormat string "pcapng"
pcapRecorder.snaplen int 65535

maximum number of bytes to record per packet

pcapRecorder.dumpBadFrames bool true

enable dump of frames with hasBitError

pcapRecorder.sendingSignalNames string "packetSentToLower"

space-separated list of outbound packet signals to subscribe to

pcapRecorder.receivingSignalNames string "packetReceivedFromLower"

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 currently available: "inet::AckingMacToEthernetPcapRecorderHelper"

pcapRecorder.alwaysFlush bool false

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

pcapRecorder.displayStringTextFormat string "rec: %n pks"
mac.promiscuous bool

if true, all packets are received, otherwise only the ones with matching destination MAC address

mac.duplexMode bool

selects full-duplex (true) or half-duplex (false) operation

mac.mtu int

Source code

//
// This module represents an Ethernet network interface.
//
module EthernetInterface extends NetworkInterface like IEthernetInterface
{
    parameters:
        string interfaceTableModule;
        string protocol = default("ethernetmac");
        string address @mutable = default("auto");   // MAC address as hex string (12 hex digits), or
                                                     // "auto". "auto" values will be replaced by
                                                     // a generated MAC address in init stage 0.
        bool duplexMode = default(true);      // selects full-duplex (true) or half-duplex (false) operation
        bool csmacdSupport = default(!duplexMode);  // by default CSMA/CD is turned off, so only point-to-point duplex links are supported.
        double bitrate @unit(bps) = default(0 bps);
        string fcsMode @enum("declared","computed") = default("declared");
        *.interfaceTableModule = default(absPath(this.interfaceTableModule));
        *.fcsMode = this.fcsMode;
        *.duplexMode = this.duplexMode;
    gates:
        input upperLayerIn;
        output upperLayerOut;
        input cutthroughIn @loose;
        output cutthroughOut @loose;
        inout phys @labels(EthernetSignal);
    submodules:
        egressTC: <default("")> like ITrafficConditioner {
            parameters:
                @display("p=300,100");
        }
        ingressTC: <default("")> like ITrafficConditioner {
            parameters:
                @display("i=block/uparrow;p=700,100");
        }
        queue: <default("EthernetQueue")> like IPacketQueue {
            parameters:
                packetCapacity = default(1000);
                @display("p=300,250");
        }
        mac: <default(csmacdSupport ? "EthernetCsmaMac" : "EthernetMac")> like IEtherMac {
            parameters:
                @display("p=500,300");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> egressTC.in;
        egressTC.out --> queue.in;
        queue.out --> mac.upperLayerIn;

        mac.phys <--> { @display("m=s"); } <--> phys;

        mac.upperLayerOut --> ingressTC.in;
        ingressTC.out --> { @display("m=n"); } --> upperLayerOut;
}

File: src/inet/linklayer/ethernet/EthernetInterface.ned