EthernetHost

Package: inet.node.ethernet

EthernetHost

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=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

This module connects multiple applications, protocols and interfaces with each other and...

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.

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

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

This module connects multiple applications, protocols and interfaces with each other and...

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

EthernetInterface: This module represents an Ethernet network interface.

IEthernetInterface: This module interface is implemented by 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.

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.initialStatus string "UP"

TODO @signal, @statistic

interfaceTable.displayAddresses bool false

whether to display IP addresses on links

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.localSAP int 0xf1
srv.stopOperationExtraTime double -1s

extra time after lifecycle stop operation 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

dp.forwardServiceRegistration bool true
dp.forwardProtocolRegistration bool true
li.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

li.forwardServiceRegistration bool true
li.forwardProtocolRegistration bool true
eth.bitrate double

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