EtherHost

Package: inet.node.ethernet

EtherHost

compound module

An example host with one Ethernet port and a traffic generator that generates request-reply traffic directly over Ethernet. This host model does not contain higher layer protocols (IP, TCP). By default it is configured to use half-duplex MAC (CSMA/CD).

status : NodeStatus

Keeps track of the status of network node (up, down, etc.) for other modules, and also displays it...

Source:
status: NodeStatus if hasStatus {
    @display("p=50,50;is=s");
} cli : EtherAppCli

A simple traffic generator for the Ethernet model and the 802.11 model, and generally for any L2...

Source:
cli: EtherAppCli {
    parameters:
        registerSAP = true;
        @display("p=120,58,col");
} srv : EtherAppSrv

Server side of the EtherCli model -- generates ~EtherAppResp packets with the number of bytes...

Source:
srv: EtherAppSrv {
    parameters:
        registerSAP = true;
        @display("p=310,58,col");
} llc : EtherLLC

Provides Ethernet 802.3 encapsulation/decapsulation and dispatching to the appropriate higher layer...

Source:
llc: EtherLLC {
    parameters:
        @display("p=215,118");
    gates:
        upperLayerIn[2];
        upperLayerOut[2];
} queue : EtherQoSQueue

Queue module that gives the PAUSE frames a higher priority, and can be parametrized with an...

Source:
queue: EtherQoSQueue if queueType != "" {
    parameters:
        dataQueueType = parent.queueType;
        @display("p=159,199;q=l2queue");
} mac : like IEtherMAC

IEtherMAC: Interface for Ethernet MAC implementations.

Source:
mac: <macType> like IEtherMAC {
    parameters:
        queueModule = (parent.queueType == "" ? "" : "^.queue");
        @display("p=215,270;q=txQueue");
}

Usage diagram

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

Parameters

Name Type Default value Description
hasStatus bool false
csmacdSupport bool true

by default use CSMA/CD

macType string csmacdSupport ? "EtherMAC" : "EtherMACFullDuplex"

EtherMAC or EtherMACFullDuplex

queueType string ""

DropTailQueue, DiffServQueue, or empty to use the internal queue

Properties

Name Value Description
networkNode
labels node
display i=device/pc2

Gates

Name Direction Size Description
ethg inout

Unassigned submodule parameters

Name Type Default value Description
status.initialStatus string "UP"

TODO @signal, @statistic

cli.destAddress string ""

destination MAC address, or module path name of destination station; empty means off

cli.startTime double this.sendInterval

time of sending the first request

cli.stopTime double -1s

time of finishing sending, negative values mean forever

cli.localSAP int 0xf0
cli.remoteSAP int 0xf1
cli.sendInterval double uniform(0s,1s)

interval between sending requests

cli.reqLength int 100B

length of request packets

cli.respLength int 1KiB

length of response packets

srv.localSAP int 0xf1
queue.pauseQueue.frameCapacity int 100
mac.promiscuous bool

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

mac.address string

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

mac.duplexMode bool

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

mac.txQueueLimit int

maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule==""

mac.mtu int

Source code

//
// An example host with one Ethernet port and a traffic generator that
// generates request-reply traffic directly over Ethernet. This host model
// does not contain higher layer protocols (IP, TCP). By default it is
// configured to use half-duplex MAC (CSMA/CD).
//
module EtherHost
{
    parameters:
        bool hasStatus = default(false);
        bool csmacdSupport = default(true);  // by default use CSMA/CD
        string macType = default(csmacdSupport ? "EtherMAC" : "EtherMACFullDuplex"); // ~EtherMAC or ~EtherMACFullDuplex
        string queueType = default(""); // DropTailQueue, DiffServQueue, or empty to use the internal queue
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=device/pc2");
        *.interfaceTableModule = default("");
    gates:
        inout ethg @labels(EtherFrame-conn);
    submodules:
        status: NodeStatus if hasStatus {
            @display("p=50,50;is=s");
        }
        cli: EtherAppCli {
            parameters:
                registerSAP = true;
                @display("p=120,58,col");
        }
        srv: EtherAppSrv {
            parameters:
                registerSAP = true;
                @display("p=310,58,col");
        }
        llc: EtherLLC {
            parameters:
                @display("p=215,118");
            gates:
                upperLayerIn[2];
                upperLayerOut[2];
        }
        queue: EtherQoSQueue if queueType != "" {
            parameters:
                dataQueueType = parent.queueType;
                @display("p=159,199;q=l2queue");
        }
        mac: <macType> like IEtherMAC {
            parameters:
                queueModule = (parent.queueType == "" ? "" : "^.queue");
                @display("p=215,270;q=txQueue");
        }
    connections:

        cli.out --> llc.upperLayerIn[0];
        cli.in <-- llc.upperLayerOut[0];
        srv.out --> llc.upperLayerIn[1];
        srv.in <-- llc.upperLayerOut[1];

        llc.lowerLayerOut --> queue.in if queueType != "";
        queue.out --> mac.upperLayerIn if queueType != "";
        llc.lowerLayerOut --> mac.upperLayerIn if queueType == "";
        mac.upperLayerOut --> llc.lowerLayerIn;

        mac.phys <--> ethg;
}
File: src/inet/node/ethernet/EtherHost.ned