Compound Module MediumLAN

File: Examples/Ethernet/LANs/LargeNet.ned

Several hosts and an Ethernet hub on a switch

switch: EtherSwitch host: EtherHost hub: EtherHub hhost: EtherHost

Usage diagram:

The following diagram shows usage relationships between modules, networks and channels. Unresolved module (and channel) types are missing from the diagram. Click here to see the full picture.

Contains the following modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

EtherHost

Example host model with one Ethernet port and several traffic generators to create traffic in the test network.

EtherHub

A generic wiring hub model.

EtherSwitch

Model of an Ethernet switch.

Contains the following channels:

cable (no description)

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

LargeNet

A large Ethernet LAN -- see model description here.

Parameters:

Name Type Description
n numeric const

number of hosts on the switch

h numeric const

number of hosts on the hub

Gates:

Name Direction Description
in input
out output

Unassigned submodule parameters:

Name Type Description
switch.relayUnitType string

type of the MACRelayUnit; currently possible values are MACRelayUnitNP and MACRelayUnitPP

switch.relayUnit.addressTableFile string

set to empty string if not used

switch.relayUnit.addressTableSize numeric

max size of address table

switch.relayUnit.agingTime numeric

max idle time for address table entries (if expires, entry is removed from the table)

switch.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.

switch.mac[*].txrate numeric

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

switch.mac[*].duplexEnabled bool

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).

switch.mac[*].writeScalars bool

enable/disable recording statistics in omnetpp.sca

host[*].cli.destStation string

module path name of destination station (must be blank if destAddress is given)

host[*].cli.destAddress string

destination MAC address (must be blank if destStation is given)

host[*].cli.waitTime numeric

interarrival time between sending requests; may be random value

host[*].cli.reqLength numeric

length of request packets (bytes); may be random value

host[*].cli.respLength numeric

length of response packets (bytes); may be random value

host[*].cli.writeScalars bool

enable/disable recording statistics in omnetpp.sca

host[*].srv.writeScalars bool

enable/disable recording statistics in omnetpp.sca

host[*].llc.writeScalars bool

enable/disable recording statistics in omnetpp.sca

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.txrate numeric

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

host[*].mac.duplexEnabled bool

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).

host[*].mac.writeScalars bool

enable/disable recording statistics in omnetpp.sca

hub.writeScalars bool

enable/disable recording statistics in omnetpp.sca

hhost[*].cli.destStation string

module path name of destination station (must be blank if destAddress is given)

hhost[*].cli.destAddress string

destination MAC address (must be blank if destStation is given)

hhost[*].cli.waitTime numeric

interarrival time between sending requests; may be random value

hhost[*].cli.reqLength numeric

length of request packets (bytes); may be random value

hhost[*].cli.respLength numeric

length of response packets (bytes); may be random value

hhost[*].cli.writeScalars bool

enable/disable recording statistics in omnetpp.sca

hhost[*].srv.writeScalars bool

enable/disable recording statistics in omnetpp.sca

hhost[*].llc.writeScalars bool

enable/disable recording statistics in omnetpp.sca

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.txrate numeric

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

hhost[*].mac.duplexEnabled bool

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).

hhost[*].mac.writeScalars bool

enable/disable recording statistics in omnetpp.sca

Source code:

module MediumLAN
    parameters:
        n: numeric const, // number of hosts on the switch
        h: numeric const; // number of hosts on the hub
    gates:
        in: in;
        out: out;
    submodules:
        switch: EtherSwitch;
            display: "i=switch2";
        host: EtherHost[n];
            display: "i=device/pc2_s";
        hub: EtherHub;
            display: "i=device/switch";
        hhost: EtherHost[h];
            display: "i=device/pc2_s";
    connections:
        for i=0..n-1 do
            switch.out++ --> cable --> host[i].in;
            switch.in++ <-- cable <-- host[i].out;
        endfor

        switch.out++ --> out;
        switch.in++ <-- in;

        for i=0..h-1 do
            hub.out++ --> cable --> hhost[i].in;
            hub.in++ <-- cable <-- hhost[i].out;
        endfor

        switch.out++ --> cable --> hub.in++;
        switch.in++ <-- cable <-- hub.out++;

endmodule