Simple Module Switch

File: src/tcpipmodel/Switch.ned

Models an Ethernet switch (multiport bridge).

It supports broadcasts and MAC address learning. Note that it also has, like a real switch, a limited number of buffers. In case a lot of frames arrive simultaneously, some frames may get dropped due to buffer overflows.

In order to support autoconfiguration of IP addresses, a switch carries a network prefix as address range. Attached hosts will get automatically addresses that are allocated from this range.

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.

Switch

Parameters:

Name Type Description
net string

subnet address (used for IP address autoconfiguration)

netmask string

netmask (used for IP address autoconfiguration)

Gates:

Name Direction Description
med_in [ ] input
med_out [ ] output

Source code:

simple Switch
    parameters:
        net : string, // subnet address (used for IP address autoconfiguration)
        netmask : string; // netmask (used for IP address autoconfiguration)
    gates:
        in: med_in[];
        out: med_out[];
endsimple