Package: inet.linklayer.ieee8021d.relay
Ieee8021dRelay
simple moduleForwards frames (~EtherFrame) based on their destination MAC addresses to appropriate ports.
It can work in two modes:
- STP unaware mode (If no module is connected to its STP gate): Looks up the frame's destination address in the ~MacForwardingTable. If it finds the address, it sends it through that port; otherwise, it broadcasts it.
- STP aware mode (If an ~Stp or ~Rstp module is connected to its STP gate): Handles BPDU frames. If relaying a message, it also checks the port's status in the InterfaceTable.
<b>See also:</b> ~EtherFrame, ~MacForwardingTable, ~Stp, ~Rstp
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Known subclasses
| Name | Type | Description |
|---|---|---|
| MrpRelay | simple module |
Relay unit with support for the Media Redundancy Protocol (MRP), defined in IEC 62439-2. |
Extends
| Name | Type | Description |
|---|---|---|
| MacRelayUnitBase | simple module |
Abstract base module for MAC relay unit implementations (Ethernet switches). Provides core functionality for MAC address learning and frame forwarding in bridged Ethernet networks. Contains functionality for maintaining a MAC address table that maps addresses to ports, learning addresses from incoming frames, and forwarding frames to appropriate interfaces. It is able to handle unicast, multicast, and broadcast traffic according to standard Ethernet switching rules. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| displayStringTextFormat | string | "proc: %p\ndisc: %d" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| macTableModule | string | ||
| interfaceTableModule | string |
Properties
| Name | Value | Description |
|---|---|---|
| class | Ieee8021dRelay | |
| display | i=block/switch |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| lowerLayerIn | input | ||
| lowerLayerOut | output | ||
| upperLayerIn | input | ||
| upperLayerOut | output |
Signals
| Name | Type | Unit | Description |
|---|---|---|---|
| packetReceivedFromUpper | inet::Packet | ||
| packetReceivedFromLower | inet::Packet | ||
| packetDropped | inet::Packet | ||
| packetSentToLower | inet::Packet |
Statistics
| Name | Title | Source | Record | Unit | Interpolation Mode | Description |
|---|---|---|---|---|---|---|
| packetDropped | packets dropped | count, sum(packetBytes), vector(packetBytes) | none |
Source code
// // Forwards frames (~EtherFrame) based on their destination MAC addresses to appropriate ports. // // It can work in two modes: // - STP unaware mode (If no module is connected to its STP gate): // Looks up the frame's destination address in the ~MacForwardingTable. If it finds the address, it sends it through // that port; otherwise, it broadcasts it. // - STP aware mode (If an ~Stp or ~Rstp module is connected to its STP gate): // Handles BPDU frames. // If relaying a message, it also checks the port's status in the `InterfaceTable`. // // @see ~EtherFrame, ~MacForwardingTable, ~Stp, ~Rstp // simple Ieee8021dRelay extends MacRelayUnitBase like IMacRelayUnit { parameters: @class(Ieee8021dRelay); }File: src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.ned