Package: inet.examples.ethernet.lans
MediumLAN
compound moduleSeveral hosts and an Ethernet hub on a switch; part of ~LargeNet(1,2).
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.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 |
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