Compound Module EtherHost

Package: inet.node.ethernet
File: src/inet/node/ethernet/EtherHost.ned

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

NodeStatus EtherAppCli EtherAppSrv EtherLLC EtherQoSQueue IEtherMAC

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.

Used in compound modules:

Name Type Description
LargeLAN compound module

Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment. Part of LargeNet(1,2).

MediumLAN compound module

Several hosts and an Ethernet hub on a switch; part of LargeNet(1,2).

SmallLAN compound module

Several hosts on an Ethernet hub; part of LargeNet(1,2).

Networks:

Name Type Description
BusLAN network

Sample Ethernet LAN: four hosts on a bus.

HubLAN network

Sample Ethernet LAN: four hosts connected by a hub.

LargeNet network

A large Ethernet LAN -- see model description here.

LargeNet network (no description)
MixedLAN network

Sample Ethernet LAN containing eight hosts, a switch and a bus.

SwitchedLAN network

Sample Ethernet LAN: four hosts connected to a switch.

TwoHosts network

Sample Ethernet LAN: two hosts directly connected to each other via twisted pair.

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 = queueType;
                @display("p=159,199;q=l2queue");
        }
        mac: <macType> like IEtherMAC {
            parameters:
                queueModule = (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;
}