Network HubLAN

Package: inet.examples.ethernet.lans
File: examples/ethernet/lans/Networks.ned

Sample Ethernet LAN: four hosts connected by a hub.

EtherHost EtherHost EtherHost EtherHost EtherHub

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Properties:

Name Value Description
isNetwork

Unassigned submodule parameters:

Name Type Default value Description
hostA.cli.destAddress string ""

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

hostA.cli.startTime double this.waitTime

time of sending the first request

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

interval between sending requests

hostA.cli.reqLength int 100B

length of request packets

hostA.cli.respLength int 1KB

length of response packets

hostA.mac.promiscuous bool false

if true, all packets are received, otherwise only the ones with matching destination MAC address

hostA.mac.address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

hostA.mac.txrate double 100Mbps

maximum data rate supported by this station (bit/s); actually chosen speed may be lower due to auto- configuration. 0 means fully auto-configured.

hostA.mac.duplexEnabled bool true

whether duplex mode can be enabled or not; whether MAC will actually use duplex mode depends on the result of the auto-configuration process (duplex is only possible with DTE-to-DTE connection).

hostA.mac.txQueueLimit int 1000

maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule==""

hostA.mac.mtu int 1500
hostB.cli.destAddress string ""

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

hostB.cli.startTime double this.waitTime

time of sending the first request

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

interval between sending requests

hostB.cli.reqLength int 100B

length of request packets

hostB.cli.respLength int 1KB

length of response packets

hostB.mac.promiscuous bool false

if true, all packets are received, otherwise only the ones with matching destination MAC address

hostB.mac.address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

hostB.mac.txrate double 100Mbps

maximum data rate supported by this station (bit/s); actually chosen speed may be lower due to auto- configuration. 0 means fully auto-configured.

hostB.mac.duplexEnabled bool true

whether duplex mode can be enabled or not; whether MAC will actually use duplex mode depends on the result of the auto-configuration process (duplex is only possible with DTE-to-DTE connection).

hostB.mac.txQueueLimit int 1000

maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule==""

hostB.mac.mtu int 1500
hostC.cli.destAddress string ""

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

hostC.cli.startTime double this.waitTime

time of sending the first request

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

interval between sending requests

hostC.cli.reqLength int 100B

length of request packets

hostC.cli.respLength int 1KB

length of response packets

hostC.mac.promiscuous bool false

if true, all packets are received, otherwise only the ones with matching destination MAC address

hostC.mac.address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

hostC.mac.txrate double 100Mbps

maximum data rate supported by this station (bit/s); actually chosen speed may be lower due to auto- configuration. 0 means fully auto-configured.

hostC.mac.duplexEnabled bool true

whether duplex mode can be enabled or not; whether MAC will actually use duplex mode depends on the result of the auto-configuration process (duplex is only possible with DTE-to-DTE connection).

hostC.mac.txQueueLimit int 1000

maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule==""

hostC.mac.mtu int 1500
hostD.cli.destAddress string ""

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

hostD.cli.startTime double this.waitTime

time of sending the first request

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

interval between sending requests

hostD.cli.reqLength int 100B

length of request packets

hostD.cli.respLength int 1KB

length of response packets

hostD.mac.promiscuous bool false

if true, all packets are received, otherwise only the ones with matching destination MAC address

hostD.mac.address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

hostD.mac.txrate double 100Mbps

maximum data rate supported by this station (bit/s); actually chosen speed may be lower due to auto- configuration. 0 means fully auto-configured.

hostD.mac.duplexEnabled bool true

whether duplex mode can be enabled or not; whether MAC will actually use duplex mode depends on the result of the auto-configuration process (duplex is only possible with DTE-to-DTE connection).

hostD.mac.txQueueLimit int 1000

maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule==""

hostD.mac.mtu int 1500

Source code:

//
// Sample Ethernet LAN: four hosts connected by a hub.
//
network HubLAN
{
    submodules:
        hostA: EtherHost {
            parameters:
                @display("p=161,55");
        }
        hostB: EtherHost {
            parameters:
                @display("p=253,125");
        }
        hostC: EtherHost {
            parameters:
                @display("p=158,199");
        }
        hostD: EtherHost {
            parameters:
                @display("p=59,127");
        }
        hub: EtherHub {
            parameters:
                @display("p=162,124");
            gates:
                ethg[4];
        }
    connections:
        hub.ethg[0] <--> {  delay = 0.1us; } <--> hostA.ethg;
        hub.ethg[1] <--> {  delay = 0.3us; } <--> hostB.ethg;
        hub.ethg[2] <--> {  delay = 0.4us; } <--> hostC.ethg;
        hub.ethg[3] <--> {  delay = 0.2us; } <--> hostD.ethg;
}