EthernetHost

Package: inet.node.ethernet

EthernetHost

compound module

A simplified network device that communicates directly over Ethernet without higher layer protocols like IP or TCP. It provides a basic host model for Ethernet-only simulations.

This module includes Ethernet application client and server components that generate and respond to traffic at the Ethernet level. The host uses IEEE 802.2 LLC (Logical Link Control) for data link layer functionality and can be configured to use CSMA/CD (Carrier Sense Multiple Access with Collision Detection) for media access control in half-duplex mode.

<b>See also:</b> ~EthernetSwitch, ~EthernetHub, ~StandardHost

status : NodeStatus

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

Source:
status: NodeStatus if hasStatus {
    @display("p=100,100;is=s");
} interfaceTable : InterfaceTable

Keeps the table of network interfaces.

Source:
interfaceTable: InterfaceTable {
    parameters:
        @display("p=100,240;is=s");
} cli : EtherAppClient

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

Source:
cli: EtherAppClient {
    parameters:
        interface = "eth";
        @display("p=350,100");
} srv : EtherAppServer

Server side of the ~EtherAppClient model -- generates packets containing ~EtherAppResp chunks with...

Source:
srv: EtherAppServer {
    parameters:
        @display("p=550,100");
} dp : MessageDispatcher

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
dp: MessageDispatcher {
    parameters:
        @display("p=450,150;b=500,5,,,,1");
} llc : like IIeee8022Llc

Source:
llc: <default("Ieee8022Llc")> like IIeee8022Llc {
    parameters:
        @display("p=450,200");
} encap : like IEthernetLayer

EthernetEncapsulation: Performs Ethernet II or Ethernet with LLC/SNAP encapsulation/decapsulation.

IEthernetLayer: Module interface for Ethernet protocol layer implementations.

Source:
encap: <default("EthernetEncapsulation")> like IEthernetLayer if typename != "" {
    parameters:
        registerProtocol = true;
        @display("p=350,300");
} ethernet : like IEthernetLayer

IEthernetLayer: Module interface for Ethernet protocol layer implementations.

Source:
ethernet: <default("")> like IEthernetLayer if typename != "" {
    @display("p=550,300");
} li : MessageDispatcher

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
li: MessageDispatcher {
    parameters:
        @display("p=450,350;b=500,5");
} eth : like IEthernetInterface

EthernetInterface: Represents an Ethernet network interface.

IEthernetInterface: Interface for Ethernet network interfaces.

Source:
eth: <default("EthernetInterface")> like IEthernetInterface {
    parameters:
        @display("p=350,400,row,150;q=txQueue");
}

Usage diagram

The following diagram shows usage relationships between types. 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).

VoIPStreamLargeLAN compound module

Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment.

VoIPStreamMediumLAN compound module

Several hosts and an Ethernet hub on a switch

VoIPStreamSmallLAN compound module

Several hosts on an Ethernet hub

Used in

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.

Mrp4withHosts network (no description)
Mrp8 network (no description)
MrpRing network (no description)
SwitchedDuplexLAN network (no description)
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.

VoIPStreamLargeNet network

This is a copy of the LargeNet(1,2) Ethernet demo simulation in the INET Framework, modified to add a VoIP server and a VoIP client. It can be used to test VoIP transmission on a LAN with high background traffic.

Parameters

Name Type Default value Description
hasStatus bool false
csmacdSupport bool true

By default, use CSMA/CD

fcsMode string "declared"

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.displayStringTextFormat string ""

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

status.initialStatus string "UP"

TODO @signal, @statistic

interfaceTable.displayStringTextFormat string ""

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

interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

cli.displayStringTextFormat string ""

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

cli.interfaceTableModule string
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

Local service access point

cli.remoteSAP int 0xf1

Remote service access point

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

cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

srv.displayStringTextFormat string ""

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

srv.localSAP int 0xf1
srv.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation is finished

srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

dp.displayStringTextFormat string "processed %p pk (%l)"

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

dp.interfaceTableModule string

Module path to the ~InterfaceTable module

dp.forwardServiceRegistration bool true
dp.forwardProtocolRegistration bool true
dp.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

dp.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

dp.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

li.displayStringTextFormat string "processed %p pk (%l)"

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

li.interfaceTableModule string

Module path to the ~InterfaceTable module

li.forwardServiceRegistration bool true
li.forwardProtocolRegistration bool true
li.interfaceMapping object {}

Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

li.serviceMapping object {}

Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

li.protocolMapping object {}

Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

eth.bitrate double

Source code

//
// A simplified network device that communicates directly over Ethernet without
// higher layer protocols like IP or TCP. It provides a basic host model for
// Ethernet-only simulations.
//
// This module includes Ethernet application client and server components that generate
// and respond to traffic at the Ethernet level. The host uses IEEE 802.2 LLC (Logical
// Link Control) for data link layer functionality and can be configured to use
// CSMA/CD (Carrier Sense Multiple Access with Collision Detection) for media access
// control in half-duplex mode.
//
// @see ~EthernetSwitch, ~EthernetHub, ~StandardHost
//
module EthernetHost
{
    parameters:
        bool hasStatus = default(false);
        bool csmacdSupport = default(true);  // By default, use CSMA/CD
        string fcsMode @enum("declared","computed") = default("declared");
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=device/pc2");
        eth.csmacdSupport = this.csmacdSupport;
        *.interfaceTableModule = default(absPath(".interfaceTable"));
        *.fcsMode = this.fcsMode;
        eth.encap.typename = "";
        llc.registerProtocol = true;
    gates:
        inout ethg @labels(EtherFrame-conn);
    submodules:
        status: NodeStatus if hasStatus {
            @display("p=100,100;is=s");
        }
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=100,240;is=s");
        }
        cli: EtherAppClient {
            parameters:
                interface = "eth";
                @display("p=350,100");
        }
        srv: EtherAppServer {
            parameters:
                @display("p=550,100");
        }
        dp: MessageDispatcher {
            parameters:
                @display("p=450,150;b=500,5,,,,1");
        }
        llc: <default("Ieee8022Llc")> like IIeee8022Llc {
            parameters:
                @display("p=450,200");
        }
        encap: <default("EthernetEncapsulation")> like IEthernetLayer if typename != "" {
            parameters:
                registerProtocol = true;
                @display("p=350,300");
        }
        ethernet: <default("")> like IEthernetLayer if typename != "" {
            @display("p=550,300");
        }
        li: MessageDispatcher {
            parameters:
                @display("p=450,350;b=500,5");
        }
        eth: <default("EthernetInterface")> like IEthernetInterface {
            parameters:
                @display("p=350,400,row,150;q=txQueue");
        }
    connections:
        cli.out --> dp.in++;
        dp.out++ --> cli.in;
        srv.out --> dp.in++;
        dp.out++ --> srv.in;

        dp.out++ --> llc.upperLayerIn;
        llc.upperLayerOut --> dp.in++;
        llc.lowerLayerOut --> encap.upperLayerIn if exists(llc) && exists(encap);
        encap.upperLayerOut --> llc.lowerLayerIn if exists(llc) && exists(encap);
        encap.lowerLayerOut --> li.in++ if exists(encap);
        li.out++ --> encap.lowerLayerIn if exists(encap);
        llc.lowerLayerOut --> ethernet.upperLayerIn if exists(llc) && exists(ethernet);
        ethernet.upperLayerOut --> llc.lowerLayerIn if exists(llc) && exists(ethernet);
        ethernet.lowerLayerOut --> li.in++ if exists(ethernet);
        li.out++ --> ethernet.lowerLayerIn if exists(ethernet);

        li.out++ --> eth.upperLayerIn;
        eth.upperLayerOut --> li.in++;

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

File: src/inet/node/ethernet/EthernetHost.ned