EthernetInterface

Package: inet.linklayer.ethernet

EthernetInterface

compound module

Ethernet network interface. Complements EtherMac and EtherEncap with an output queue for QoS and RED support.

ITrafficConditioner ITrafficConditioner IOutputQueue IEtherMac IEtherEncap IIeee8021qEncap

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
InterfaceEntry compound module (no description)

Parameters

Name Type Default value Description
displayStringTextFormat string "%a (%i)\n%m"
interfaceTableModule string
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.

csmacdSupport bool false

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

fcsMode string "declared"

Properties

Name Value Description
class InterfaceEntry
lifecycleSupport
display i=block/ifcard;bgl=2

Gates

Name Direction Size Description
upperLayerIn input
upperLayerOut output
phys inout

Unassigned submodule parameters

Name Type Default value Description
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

//
// Ethernet network interface. Complements ~EtherMac and ~EtherEncap
// with an output queue for QoS and RED support.
//
module EthernetInterface extends InterfaceEntry like IEthernetInterface
{
    parameters:
        @class(InterfaceEntry);
        @lifecycleSupport;
        string interfaceTableModule;
        string address = 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 csmacdSupport = default(false);  // by default CSMA/CD is turned off, so only point-to-point duplex links are supported.
        string fcsMode @enum("declared","computed") = default("declared");
        @display("i=block/ifcard;bgl=2");
        *.interfaceTableModule = default(absPath(interfaceTableModule));
        *.fcsMode = fcsMode;
    gates:
        input upperLayerIn;
        output upperLayerOut;
        inout phys @labels(EtherFrame);
    submodules:
        ingressTC: <default("")> like ITrafficConditioner if typename != "" {
            @display("p=400,100");
        }
        egressTC: <default("")> like ITrafficConditioner if typename != "" {
            @display("p=100,100");
        }
        queue: <default("")> like IOutputQueue if typename != "" {
            parameters:
                @display("p=150,400;q=l2queue");
        }
        mac: <default(csmacdSupport ? "EtherMac" : "EtherMacFullDuplex")> like IEtherMac {
            parameters:
                queueModule = (exists(queue) ? "^.queue" : "");
                txQueueLimit = (exists(queue) ? 1 : 10000); // queue sends one packet at a time
                @display("p=250,500");
        }
        encap: <default("EtherEncap")> like IEtherEncap {
            parameters:
                @display("p=250,200");
        }
        qEncap: <default("")> like IIeee8021qEncap if typename != "" {
            parameters:
                @display("p=150,300");
        }
    connections:
        mac.upperLayerOut --> qEncap.lowerLayerIn if exists(qEncap);
        mac.upperLayerOut --> encap.lowerLayerIn if !exists(qEncap);

        mac.upperLayerIn <-- queue.out if exists(queue);
        mac.upperLayerIn <-- qEncap.lowerLayerOut if !exists(queue) && exists(qEncap);
        mac.upperLayerIn <-- encap.lowerLayerOut if !exists(queue) && !exists(qEncap);

        encap.lowerLayerOut --> qEncap.upperLayerIn if exists(qEncap);
        encap.lowerLayerIn <-- qEncap.upperLayerOut if exists(qEncap);

        qEncap.lowerLayerOut --> queue.in if exists(qEncap) && exists(queue);
        encap.lowerLayerOut --> queue.in if !exists(qEncap) && exists(queue);

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

        // no ingressTC
        encap.upperLayerOut --> { @display("m=n"); } --> upperLayerOut if !exists(ingressTC);

        // there is ingressTC
        if exists(ingressTC) {
            encap.upperLayerOut --> ingressTC.in;
            ingressTC.out --> { @display("m=n"); } --> upperLayerOut;
        }

        // no egressTC
        upperLayerIn --> { @display("m=n"); } --> encap.upperLayerIn if !exists(egressTC);

        // there is egressTC
        if exists(egressTC) {
            upperLayerIn --> { @display("m=n"); } --> egressTC.in;
            egressTC.out --> encap.upperLayerIn;
        }
}

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