LargeLAN

Package: inet.examples.ethernet.lans

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

switch : EthernetSwitch

EthernetSwitch models a Layer 2 Ethernet switch with support for various IEEE 802.1 protocols and...

Source:
switch: EthernetSwitch {
    parameters:
        eth[0].duplexMode = false;
        @display("p=450,100");
} host[n] : EthernetHost

A simplified network device that communicates directly over Ethernet without higher layer protocols...

Source:
host[n]: EthernetHost {
    parameters:
        csmacdSupport = false;
        eth.duplexMode = true;
        @display("p=100,200,row,100");
} hub : EthernetHub

A simple Ethernet hub device that operates at the physical layer.

Source:
hub: EthernetHub {
    parameters:
        @display("p=900,100");
} hhost[h] : EthernetHost

A simplified network device that communicates directly over Ethernet without higher layer protocols...

Source:
hhost[h]: EthernetHost {
    parameters:
        csmacdSupport = true;
        eth.duplexMode = false;
        @display("p=1050,100,col,100");
} tap[b+1] : WireJunction

Models a generic wiring hub.

Source:
tap[b+1]: WireJunction {
    parameters:
        @display("p=,,r,50");
} bhost[b] : EthernetHost

A simplified network device that communicates directly over Ethernet without higher layer protocols...

Source:
bhost[b]: EthernetHost {
    parameters:
        csmacdSupport = true;
        eth.duplexMode = false;
        @display("p=100,400,row,100");
}

Usage diagram

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

Used in

Name Type Description
LargeNet network

A large Ethernet LAN -- see model description here.

Parameters

Name Type Default value Description
n int

number of hosts on the switch

h int

number of hosts on the hub

b int

number of hosts on the bus

Properties

Name Value Description
display i=old/cloud

Gates

Name Direction Size Description
ethg inout

Unassigned submodule parameters

Name Type Default value Description
switch.macTable.agingTime double
switch.macTable.forwardingTableFile string
switch.interfaceTable.displayStringTextFormat string ""

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

switch.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

switch.status.displayStringTextFormat string ""

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

switch.status.initialStatus string "UP"

TODO @signal, @statistic

switch.pcapRecorder.displayStringTextFormat string "rec: %n pks"

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

switch.pcapRecorder.verbose bool true

Whether to log packets on the module output

switch.pcapRecorder.recordEmptyPackets bool true

Specifies if zero length packets are recorded or not

switch.pcapRecorder.enableConvertingPackets bool true

Specifies if converting packets to link type is allowed or not

switch.pcapRecorder.pcapFile string ""

The PCAP file to be written, suggested value: pcapFile = "${resultdir}/${configname}-#${runnumber}" + fullpath() + ".pcap"

switch.pcapRecorder.fileFormat string "pcapng"
switch.pcapRecorder.snaplen int 65535

Maximum number of bytes to record per packet

switch.pcapRecorder.timePrecision int 6

Time precision in recorded file. pcap supports only 6 (usec) or 9 (nanosec), pcapng supports more values (see 'if_tsresol' option in pcapng file format).

switch.pcapRecorder.dumpBadFrames bool true

Enable dump of frames with hasBitError

switch.pcapRecorder.moduleNamePatterns string "wlan[*] eth[*] ppp[*]"

Space-separated list of sibling module names to listen on

switch.pcapRecorder.sendingSignalNames string "transmissionEnded"

Space-separated list of outbound packet signals to subscribe to

switch.pcapRecorder.receivingSignalNames string "receptionEnded"

Space-separated list of inbound packet signals to subscribe to

switch.pcapRecorder.dumpProtocols string "ethernetmac ppp ieee80211mac"

Space-separated list of protocol names as defined in the Protocol class

switch.pcapRecorder.packetFilter object "*"

Which packets are considered, matches all packets by default

switch.pcapRecorder.helpers string ""

Usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype currently available: "inet::AckingMacToEthernetPcapRecorderHelper"

switch.pcapRecorder.alwaysFlush bool false

Flush the pcapFile after each write to ensure that all packets are captured in case of a crash

switch.mrp.ccmInterval double
switch.mrp.mrpRole string
switch.mrp.timingProfile int
switch.mrp.uuid0 int
switch.mrp.uuid1 int
switch.mrp.ringPort1 int
switch.mrp.ringPort2 int
switch.mrp.interconnectionLinkCheckAware bool
switch.mrp.interconnectionRingCheckAware bool
switch.mrp.nonblockingMrcSupported bool
switch.mrp.reactOnLinkChange bool
switch.mrp.visualize bool
switch.stp.helloTime double
switch.stp.forwardDelay double
switch.stp.maxAge double
switch.stp.bridgePriority int
switch.stp.visualize bool
switch.gptp.gptpNodeType string "BRIDGE_NODE"
switch.sc.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

switch.sc.interfaceTableModule string

Module path to the ~InterfaceTable module

switch.sc.forwardServiceRegistration bool true
switch.sc.forwardProtocolRegistration bool true
switch.sc.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

switch.sc.serviceMapping object {}

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

switch.sc.protocolMapping object {}

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

switch.cb.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

switch.cb.interfaceTableModule string

Module path to the ~InterfaceTable module

switch.cb.forwardServiceRegistration bool true
switch.cb.forwardProtocolRegistration bool true
switch.cb.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

switch.cb.serviceMapping object {}

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

switch.cb.protocolMapping object {}

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

switch.bl.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

switch.bl.interfaceTableModule string

Module path to the ~InterfaceTable module

switch.bl.forwardServiceRegistration bool true
switch.bl.forwardProtocolRegistration bool true
switch.bl.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

switch.bl.serviceMapping object {}

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

switch.bl.protocolMapping object {}

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

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

switch.li.interfaceTableModule string

Module path to the ~InterfaceTable module

switch.li.forwardServiceRegistration bool true
switch.li.forwardProtocolRegistration bool true
switch.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

switch.li.serviceMapping object {}

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

switch.li.protocolMapping object {}

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

switch.eth.bitrate double
host.status.displayStringTextFormat string ""

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

host.status.initialStatus string "UP"

TODO @signal, @statistic

host.interfaceTable.displayStringTextFormat string ""

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

host.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

host.cli.displayStringTextFormat string ""

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

host.cli.interfaceTableModule string
host.cli.destAddress string ""

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

host.cli.startTime double this.sendInterval

Time of sending the first request

host.cli.stopTime double -1s

Time of finishing sending, negative values mean forever

host.cli.localSAP int 0xf0

Local service access point

host.cli.remoteSAP int 0xf1

Remote service access point

host.cli.sendInterval double uniform(0s,1s)

Interval between sending requests

host.cli.reqLength int 100B

Length of request packets

host.cli.respLength int 1KiB

Length of response packets

host.cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

host.cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

host.srv.displayStringTextFormat string ""

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

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

Extra time after lifecycle stop operation is finished

host.srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

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

host.dp.interfaceTableModule string

Module path to the ~InterfaceTable module

host.dp.forwardServiceRegistration bool true
host.dp.forwardProtocolRegistration bool true
host.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

host.dp.serviceMapping object {}

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

host.dp.protocolMapping object {}

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

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

host.li.interfaceTableModule string

Module path to the ~InterfaceTable module

host.li.forwardServiceRegistration bool true
host.li.forwardProtocolRegistration bool true
host.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

host.li.serviceMapping object {}

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

host.li.protocolMapping object {}

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

host.eth.bitrate double
hub.displayStringTextFormat string ""

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

hhost.status.displayStringTextFormat string ""

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

hhost.status.initialStatus string "UP"

TODO @signal, @statistic

hhost.interfaceTable.displayStringTextFormat string ""

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

hhost.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

hhost.cli.displayStringTextFormat string ""

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

hhost.cli.interfaceTableModule string
hhost.cli.destAddress string ""

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

hhost.cli.startTime double this.sendInterval

Time of sending the first request

hhost.cli.stopTime double -1s

Time of finishing sending, negative values mean forever

hhost.cli.localSAP int 0xf0

Local service access point

hhost.cli.remoteSAP int 0xf1

Remote service access point

hhost.cli.sendInterval double uniform(0s,1s)

Interval between sending requests

hhost.cli.reqLength int 100B

Length of request packets

hhost.cli.respLength int 1KiB

Length of response packets

hhost.cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

hhost.cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

hhost.srv.displayStringTextFormat string ""

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

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

Extra time after lifecycle stop operation is finished

hhost.srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

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

hhost.dp.interfaceTableModule string

Module path to the ~InterfaceTable module

hhost.dp.forwardServiceRegistration bool true
hhost.dp.forwardProtocolRegistration bool true
hhost.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

hhost.dp.serviceMapping object {}

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

hhost.dp.protocolMapping object {}

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

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

hhost.li.interfaceTableModule string

Module path to the ~InterfaceTable module

hhost.li.forwardServiceRegistration bool true
hhost.li.forwardProtocolRegistration bool true
hhost.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

hhost.li.serviceMapping object {}

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

hhost.li.protocolMapping object {}

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

hhost.eth.bitrate double
tap.displayStringTextFormat string ""

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

bhost.status.displayStringTextFormat string ""

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

bhost.status.initialStatus string "UP"

TODO @signal, @statistic

bhost.interfaceTable.displayStringTextFormat string ""

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

bhost.interfaceTable.displayAddresses bool false

Whether to display IP addresses on links

bhost.cli.displayStringTextFormat string ""

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

bhost.cli.interfaceTableModule string
bhost.cli.destAddress string ""

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

bhost.cli.startTime double this.sendInterval

Time of sending the first request

bhost.cli.stopTime double -1s

Time of finishing sending, negative values mean forever

bhost.cli.localSAP int 0xf0

Local service access point

bhost.cli.remoteSAP int 0xf1

Remote service access point

bhost.cli.sendInterval double uniform(0s,1s)

Interval between sending requests

bhost.cli.reqLength int 100B

Length of request packets

bhost.cli.respLength int 1KiB

Length of response packets

bhost.cli.stopOperationExtraTime double -1s

Extra time after lifecycle stop operation finished

bhost.cli.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

bhost.srv.displayStringTextFormat string ""

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

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

Extra time after lifecycle stop operation is finished

bhost.srv.stopOperationTimeout double 2s

Timeout value for lifecycle stop operation

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

bhost.dp.interfaceTableModule string

Module path to the ~InterfaceTable module

bhost.dp.forwardServiceRegistration bool true
bhost.dp.forwardProtocolRegistration bool true
bhost.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

bhost.dp.serviceMapping object {}

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

bhost.dp.protocolMapping object {}

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

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

bhost.li.interfaceTableModule string

Module path to the ~InterfaceTable module

bhost.li.forwardServiceRegistration bool true
bhost.li.forwardProtocolRegistration bool true
bhost.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

bhost.li.serviceMapping object {}

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

bhost.li.protocolMapping object {}

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

bhost.eth.bitrate double

Source code

//
// Several hosts and an Ethernet hub on a switch. One port of the hub
// connect to a 10Base2 segment. Part of ~LargeNet.
//
module LargeLAN
{
    parameters:
        int n; // number of hosts on the switch
        int h; // number of hosts on the hub
        int b; // number of hosts on the bus
        @display("i=old/cloud");
    gates:
        inout ethg;
    types:
        channel cabletobus extends DatarateChannel
        {
            parameters:
                delay = 0s;
                datarate = 10Mbps;
        }
    submodules:
        switch: EthernetSwitch {
            parameters:
                eth[0].duplexMode = false;
                @display("p=450,100");
        }
        host[n]: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=100,200,row,100");
        }
        hub: EthernetHub {
            parameters:
                @display("p=900,100");
        }
        hhost[h]: EthernetHost {
            parameters:
                csmacdSupport = true;
                eth.duplexMode = false;
                @display("p=1050,100,col,100");
        }
        tap[b+1]: WireJunction {
            parameters:
                @display("p=,,r,50");
        }
        bhost[b]: EthernetHost {
            parameters:
                csmacdSupport = true;
                eth.duplexMode = false;
                @display("p=100,400,row,100");
        }
    connections:
        switch.ethg++ <--> cabletobus <--> hub.ethg++;

        for i=0..n-1 {
            switch.ethg++ <--> cable <--> host[i].ethg;
        }

        switch.ethg++ <--> ethg;

        for i=0..h-1 {
            hub.ethg++ <--> cabletobus <--> hhost[i].ethg;
        }

        for i=0..b-1 {
            tap[i].port++ <--> cabletobus <--> bhost[i].ethg;
        }
        tap[b].port++ <--> cabletobus <--> hub.ethg++;

        for i=0..b-1 {
            tap[i].port++ <--> cabletobus <--> tap[i+1].port++;
        }
}

File: examples/ethernet/lans/LargeNet.ned