MediumLAN

Package: inet.examples.ethernet.lans

MediumLAN

compound module

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

EthernetSwitch EthernetHost EthernetHub EthernetHost

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

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.displayAddresses bool false

whether to display IP addresses on links

switch.l2NodeConfigurator.interfaceTableModule string
switch.l2NodeConfigurator.l2ConfiguratorModule string "l2NetworkConfigurator"

the absolute path to the ~L2NetworkConfigurator; use "" if there is no configurator

switch.status.initialStatus string "UP"

TODO @signal, @statistic

switch.pcapRecorder.verbose bool true

whether to log packets on the module output

switch.pcapRecorder.pcapFile string ""

the PCAP file to be written

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

maximum number of bytes to record per packet

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

space-separated list of outbound packet signals to subscribe to

switch.pcapRecorder.receivingSignalNames string "packetReceivedFromLower"

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.pcapRecorder.displayStringTextFormat string "rec: %n pks"
switch.stp.helloTime double
switch.stp.forwardDelay double
switch.stp.maxAge double
switch.stp.bridgePriority int
switch.stp.visualize bool
switch.sc.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

switch.sc.forwardServiceRegistration bool true
switch.sc.forwardProtocolRegistration bool true
switch.cb.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

switch.cb.forwardServiceRegistration bool true
switch.cb.forwardProtocolRegistration bool true
switch.bl.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

switch.cutthrough.forwardServiceRegistration bool true
switch.cutthrough.forwardProtocolRegistration bool true
switch.eth.bitrate double
host.status.initialStatus string "UP"

TODO @signal, @statistic

host.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

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

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

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

determines the text that is written on top of the submodule

host.li.forwardServiceRegistration bool true
host.li.forwardProtocolRegistration bool true
host.eth.bitrate double
hhost.status.initialStatus string "UP"

TODO @signal, @statistic

hhost.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

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

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

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

determines the text that is written on top of the submodule

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

Source code

//
// Several hosts and an Ethernet hub on a switch; part of ~LargeNet.
//
module MediumLAN
{
    parameters:
        int n; // number of hosts on the switch
        int h; // number of hosts on the hub
        @display("i=old/cloud");
    gates:
        inout ethg;
    submodules:
        switch: EthernetSwitch {
            parameters:
                numEthInterfaces = parent.n+2;
                eth[0].duplexMode = false;
                @display("p=625,100");
        }
        host[n]: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=100,200,row,150");
        }
        hub: EthernetHub {
            parameters:
                @display("p=625,300");
        }
        hhost[h]: EthernetHost {
            parameters:
                csmacdSupport = true;
                eth.duplexMode = false;
                @display("p=325,400,row,150");
        }
    connections:
        // half-duplex:
        switch.ethg[0] <--> cable <--> hub.ethg++;

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

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


File: examples/ethernet/lans/LargeNet.ned