Compound Module EtherSwitch2

File: NetworkInterfaces/EtherSwitch/EtherSwitch2.ned

Model of an Ethernet switch built with EtherMAC2, which means that all ports are operating in strictly full-duplex mode. Use EtherSwitch if you need half-duplex operation on some ports.

This model does not contain the spanning tree algorithm.

relayUnit: relayUnitType like MACRelayUnit mac: EtherMAC2

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.

EtherSwitch2 EtherMAC2 MACRelayUnit

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.

EtherMAC2

Ethernet MAC which supports full duplex operation ONLY.

MACRelayUnit

Prototype for modules providing Ethernet switch functionality. These modules handle the mapping between ports and MAC addresses, and forward frames (EtherFrame) to appropriate ports.

Parameters:

Name Type Description
relayUnitType string

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

Gates:

Name Direction Description
in [ ] input
out [ ] output

Unassigned submodule parameters:

Name Type Description
relayUnit.addressTableFile string

set to empty string if not used

relayUnit.addressTableSize numeric

max size of address table

relayUnit.agingTime numeric

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

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.

mac[*].writeScalars bool

enable/disable recording statistics in omnetpp.sca

Source code:

module EtherSwitch2
    parameters:
        relayUnitType: string; // type of the MACRelayUnit; currently possible
                               // values are MACRelayUnitNP and MACRelayUnitPP
    gates:
        in: in[];
        out: out[];

    submodules:
        relayUnit: relayUnitType like MACRelayUnit;
            gatesizes:
                lowerLayerIn[sizeof(in)],
                lowerLayerOut[sizeof(in)];
            display: "i=greenbox;p=200,50";
        mac: EtherMAC2[sizeof(in)];
            parameters:
                promiscuous = true,
                txQueueLimit = 1000, // increase if needed
                queueModule = "";
            display: "i=block/queue;p=70,150,row;q=queue";
    connections:
        for i=0..sizeof(in)-1 do
            mac[i].upperLayerIn <-- relayUnit.lowerLayerOut[i];
            mac[i].upperLayerOut --> relayUnit.lowerLayerIn[i];
            mac[i].physIn <-- in[i];
            mac[i].physOut --> out[i];
        endfor;
endmodule