Compound Module LargeLAN

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

Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment. Part of LargeNet(1,2).

EtherSwitch EtherHost EtherHub EtherHost EtherBus EtherHost

Usage diagram:

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

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Networks:

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.status.initialStatus string "UP"

TODO @signal, @statistic

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

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

switch.interfaceTable.displayAddresses bool false

whether to display IP addresses on links

switch.macTable.agingTime double
switch.macTable.addressTableFile string
switch.stp.helloTime double
switch.stp.forwardDelay double
switch.stp.maxAge double
switch.stp.bridgePriority int
switch.stp.visualize bool
host.status.initialStatus string "UP"

TODO @signal, @statistic

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
host.cli.remoteSAP int 0xf1
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.srv.localSAP int 0xf1
host.queue.pauseQueue.frameCapacity int 100
host.mac.promiscuous bool

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

host.mac.address string

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

host.mac.duplexMode bool

selects full-duplex (true) or half-duplex (false) operation

host.mac.txQueueLimit int

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

host.mac.mtu int
hhost.status.initialStatus string "UP"

TODO @signal, @statistic

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
hhost.cli.remoteSAP int 0xf1
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.srv.localSAP int 0xf1
hhost.queue.pauseQueue.frameCapacity int 100
hhost.mac.promiscuous bool

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

hhost.mac.address string

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

hhost.mac.duplexMode bool

selects full-duplex (true) or half-duplex (false) operation

hhost.mac.txQueueLimit int

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

hhost.mac.mtu int
bhost.status.initialStatus string "UP"

TODO @signal, @statistic

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
bhost.cli.remoteSAP int 0xf1
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.srv.localSAP int 0xf1
bhost.queue.pauseQueue.frameCapacity int 100
bhost.mac.promiscuous bool

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

bhost.mac.address string

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

bhost.mac.duplexMode bool

selects full-duplex (true) or half-duplex (false) operation

bhost.mac.txQueueLimit int

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

bhost.mac.mtu int

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 = 0;
                datarate = 10Mbps;
        }
    submodules:
        switch: EtherSwitch {
            @display("is=s");
        }
        host[n]: EtherHost {
            @display("is=s");
        }
        hub: EtherHub {
            @display("is=s");
        }
        hhost[h]: EtherHost {
            @display("is=s");
        }
        bus: EtherBus {
            parameters:
                positions = "5 10 15"; // every 5 meters
                propagationSpeed = 2e8 mps;  // 1us = 200m
                @display("b=424,6;o=#408060");
        }
        bhost[b]: EtherHost {
            parameters:
                @display("is=s;p=,r");
        }
    connections:
        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;
        }

        switch.ethg++ <--> cabletobus <--> hub.ethg++;

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

        bus.ethg++ <--> cabletobus <--> hub.ethg++;
}