EthernetMacLayer

Package: inet.linklayer.ethernet.modular

compound module EthernetMacLayer

(no description)

EthernetMacLayerupperLayerIn --> queue.inqueue.out --> server.inserver.out --> outboundEmitter.inoutboundEmitter.out --> lowerLayerOutlowerLayerIn --> inboundEmitter.ininboundEmitter.out --> fcsChecker.infcsChecker.out --> upperLayerOutlifetimer: inet.protocolelement.contract.IPacketLifeTimer (like IPacketLifeTimer) Source: lifetimer: <default("")> like IPacketLifeTimer if typename != "" { @display("p=100,100;is=s"); }lifetimerqueue: inet.queueing.queue.PacketQueue (like IPacketQueue) PacketQueue: Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic condi... IPacketQueue: Interface for packet queue modules. Source: queue: <default("PacketQueue")> like IPacketQueue { @display("p=200,100"); }queueserver: inet.queueing.server.InstantServer (like IPacketServer) InstantServer: Repeatedly pulls packets from the connected packet provider and pushes the packet into the connec... IPacketServer: Interface for packet server modules. Source: server: <default("InstantServer")> like IPacketServer { serveSchedulingPriority = default(0); @display("p=200,200"); }serveroutboundEmitter: inet.protocolelement.common.PacketEmitter (like IPacketFlow) IPacketFlow: Interface for packet flows. Source: outboundEmitter: <default("PacketEmitter")> like IPacketFlow { @display("p=200,400"); }outboundEmitterfcsChecker: inet.linklayer.ethernet.modular.EthernetFcsChecker (like IPacketFilter) IPacketFilter: Interface for packet filter modules. Source: fcsChecker: <default("EthernetFcsChecker")> like IPacketFilter { popFcs = default(false); @display("p=500,300"); }fcsCheckerinboundEmitter: inet.protocolelement.common.PacketEmitter (like IPacketFlow) IPacketFlow: Interface for packet flows. Source: inboundEmitter: <default("PacketEmitter")> like IPacketFlow { @display("p=500,400"); }inboundEmitter

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

LayeredEthernetInterface

compound module

Implements an Ethernet network interface.

Extends

Name

Type

Description

Module

compound module

Base module for all INET compound modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

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

bitrate

double

Properties

Name

Value

Description

class

EthernetMacLayer

display

i=block/layer

Gates

Name

Direction

Size

Description

upperLayerIn

input

upperLayerOut

output

lowerLayerIn

input

lowerLayerOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

queue.displayStringTextFormat

string

“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d”

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

queue.packetCapacity

int

-1

Maximum number of packets in the queue, no limit by default

queue.dataCapacity

int

-1b

Maximum total length of packets in the queue, no limit by default

queue.dropperClass

string

“”

Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class

queue.comparatorClass

string

“”

Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class

queue.bufferModule

string

“”

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

server.displayStringTextFormat

string

“served %p pk (%l)”

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

server.serveSchedulingPriority

int

0

Specifies the FES scheduling priority for the extra event that is pulling the packet, -1 means no extra event

outboundEmitter.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

outboundEmitter.packetFilter

object

“*”

Which packets are considered, matches all packets by default

outboundEmitter.direction

string

“undefined”

outboundEmitter.signalName

string

fcsChecker.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

fcsChecker.backpressure

bool

false

fcsChecker.popFcs

bool

false

inboundEmitter.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

inboundEmitter.packetFilter

object

“*”

Which packets are considered, matches all packets by default

inboundEmitter.direction

string

“undefined”

inboundEmitter.signalName

string

Source code

module EthernetMacLayer extends Module like IEthernetMacLayer
{
    parameters:
        double bitrate @unit(bps);
        *.bitrate = default(this.bitrate);
        lifetimer.collectionModule = default("^.queue");
        outboundEmitter.signalName = "packetSentToLower";
        outboundEmitter.direction = "outbound";
        inboundEmitter.signalName = "packetReceivedFromLower";
        inboundEmitter.direction = "inbound";
        @display("i=block/layer");
        @class(EthernetMacLayer);
    gates:
        input upperLayerIn;
        output upperLayerOut;
        input lowerLayerIn;
        output lowerLayerOut;
    submodules:
        lifetimer: <default("")> like IPacketLifeTimer if typename != "" {
            @display("p=100,100;is=s");
        }
        queue: <default("PacketQueue")> like IPacketQueue {
            @display("p=200,100");
        }
        server: <default("InstantServer")> like IPacketServer {
            serveSchedulingPriority = default(0);
            @display("p=200,200");
        }
        outboundEmitter: <default("PacketEmitter")> like IPacketFlow {
            @display("p=200,400");
        }
        fcsChecker: <default("EthernetFcsChecker")> like IPacketFilter {
            popFcs = default(false);
            @display("p=500,300");
        }
        inboundEmitter: <default("PacketEmitter")> like IPacketFlow {
            @display("p=500,400");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> queue.in;
        queue.out --> server.in;
        server.out --> outboundEmitter.in;
        outboundEmitter.out --> { @display("m=s"); } --> lowerLayerOut;

        lowerLayerIn --> { @display("m=s"); } --> inboundEmitter.in;
        inboundEmitter.out --> fcsChecker.in;
        fcsChecker.out --> { @display("m=n"); } --> upperLayerOut;
}

File: src/inet/linklayer/ethernet/modular/EthernetMacLayer.ned