SwitchedLAN

Package: inet.examples.ethernet.lans

SwitchedLAN

network

Sample Ethernet LAN: four hosts connected to a switch.

EthernetHost EthernetHost EthernetHost EthernetHost EthernetSwitch

Usage diagram

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

Properties

Name Value Description
isNetwork

Unassigned submodule parameters

Name Type Default value Description
hostA.status.initialStatus string "UP"

TODO @signal, @statistic

hostA.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

hostA.cli.interfaceTableModule string
hostA.cli.destAddress string ""

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

hostA.cli.startTime double this.sendInterval

time of sending the first request

hostA.cli.stopTime double -1s

time of finishing sending, negative values mean forever

hostA.cli.localSAP int 0xf0

local service access point

hostA.cli.remoteSAP int 0xf1

remote service access point

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

interval between sending requests

hostA.cli.reqLength int 100B

length of request packets

hostA.cli.respLength int 1KiB

length of response packets

hostA.cli.stopOperationExtraTime double -1s

extra time after lifecycle stop operation finished

hostA.cli.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

extra time after lifecycle stop operation finished

hostA.srv.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

hostA.li.forwardServiceRegistration bool true
hostA.li.forwardProtocolRegistration bool true
hostA.eth.bitrate double
hostB.status.initialStatus string "UP"

TODO @signal, @statistic

hostB.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

hostB.cli.interfaceTableModule string
hostB.cli.destAddress string ""

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

hostB.cli.startTime double this.sendInterval

time of sending the first request

hostB.cli.stopTime double -1s

time of finishing sending, negative values mean forever

hostB.cli.localSAP int 0xf0

local service access point

hostB.cli.remoteSAP int 0xf1

remote service access point

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

interval between sending requests

hostB.cli.reqLength int 100B

length of request packets

hostB.cli.respLength int 1KiB

length of response packets

hostB.cli.stopOperationExtraTime double -1s

extra time after lifecycle stop operation finished

hostB.cli.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

extra time after lifecycle stop operation finished

hostB.srv.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

hostB.li.forwardServiceRegistration bool true
hostB.li.forwardProtocolRegistration bool true
hostB.eth.bitrate double
hostC.status.initialStatus string "UP"

TODO @signal, @statistic

hostC.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

hostC.cli.interfaceTableModule string
hostC.cli.destAddress string ""

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

hostC.cli.startTime double this.sendInterval

time of sending the first request

hostC.cli.stopTime double -1s

time of finishing sending, negative values mean forever

hostC.cli.localSAP int 0xf0

local service access point

hostC.cli.remoteSAP int 0xf1

remote service access point

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

interval between sending requests

hostC.cli.reqLength int 100B

length of request packets

hostC.cli.respLength int 1KiB

length of response packets

hostC.cli.stopOperationExtraTime double -1s

extra time after lifecycle stop operation finished

hostC.cli.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

extra time after lifecycle stop operation finished

hostC.srv.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

hostC.li.forwardServiceRegistration bool true
hostC.li.forwardProtocolRegistration bool true
hostC.eth.bitrate double
hostD.status.initialStatus string "UP"

TODO @signal, @statistic

hostD.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

hostD.cli.interfaceTableModule string
hostD.cli.destAddress string ""

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

hostD.cli.startTime double this.sendInterval

time of sending the first request

hostD.cli.stopTime double -1s

time of finishing sending, negative values mean forever

hostD.cli.localSAP int 0xf0

local service access point

hostD.cli.remoteSAP int 0xf1

remote service access point

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

interval between sending requests

hostD.cli.reqLength int 100B

length of request packets

hostD.cli.respLength int 1KiB

length of response packets

hostD.cli.stopOperationExtraTime double -1s

extra time after lifecycle stop operation finished

hostD.cli.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

extra time after lifecycle stop operation finished

hostD.srv.stopOperationTimeout double 2s

timeout value for lifecycle stop operation

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

determines the text that is written on top of the submodule

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

determines the text that is written on top of the submodule

hostD.li.forwardServiceRegistration bool true
hostD.li.forwardProtocolRegistration bool true
hostD.eth.bitrate double
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

Source code

//
// Sample Ethernet LAN: four hosts connected to a switch.
//
network SwitchedLAN
{
    types:
        channel C extends DatarateChannel
        {
            delay = 0.1us;
            datarate = 100Mbps;
        }
    submodules:
        hostA: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=250,100");
        }
        hostB: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=400,200");
        }
        hostC: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=250,300");
        }
        hostD: EthernetHost {
            parameters:
                csmacdSupport = false;
                eth.duplexMode = true;
                @display("p=100,200");
        }
        switch: EthernetSwitch {
            parameters:
                @display("p=250,200");
            gates:
                ethg[4];
        }
    connections:
        switch.ethg[0] <--> C <--> hostA.ethg;
        switch.ethg[1] <--> C <--> hostB.ethg;
        switch.ethg[2] <--> C <--> hostC.ethg;
        switch.ethg[3] <--> C <--> hostD.ethg;
}


File: examples/ethernet/lans/Networks.ned