Ieee8021dRelay

Package: inet.linklayer.ieee8021d.relay

Ieee8021dRelay

simple module

This modul forwards frames (EtherFrame) based on their destination MAC addresses to appropriate ports.

It can work in two mode:

  • STP unaware mode (If no module connected to its STP gate): Looks up the frames destination address in the MACAddressTable, if it found the address, sends through that port, or otherwise broadcasts it.
  • STP aware mode (If an STP or RSTP module connected to its STP gate): Handles BPDU frames. If relaying a message also checks the port's status in the InterfaceTable.

See also: EtherFrame, MacAddressTable, Stp, Rstp

Ieee8021dRelay

Inheritance diagram

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

Parameters

Name Type Default value Description
interfaceTableModule string "^.interfaceTable"

The path to the InterfaceTable module

macTableModule string "^.macTable"

The path to the MacAddressTable module

hasStp bool

Properties

Name Value Description
display i=block/broadcast;bgb=425,114

Gates

Name Direction Size Description
ifIn input
ifOut output
upperLayerIn input
upperLayerOut output

Signals

Name Type Unit
packetReceivedFromLower cPacket
packetReceivedFromUpper cPacket
packetSentToLower cPacket

Source code

//
// This modul forwards frames (~EtherFrame) based on their destination MAC addresses to appropriate ports.
//
// It can work in two mode:
// - STP unaware mode (If no module connected to its STP gate):
//     Looks up the frames destination address in the ~MACAddressTable, if it found the address, sends through
//	   that port, or otherwise broadcasts it.
// - STP aware mode (If an ~STP or ~RSTP module connected to its STP gate):
//     Handles BPDU frames.
//     If relaying a message also checks the port's status in the InterfaceTable.
//
// @see EtherFrame, MacAddressTable, Stp, Rstp
//
simple Ieee8021dRelay like IMacRelayUnit
{
    parameters:
        @display("i=block/broadcast;bgb=425,114");
        string interfaceTableModule = default("^.interfaceTable"); // The path to the InterfaceTable module
        string macTableModule = default("^.macTable");             // The path to the MacAddressTable module
        @signal[packetSentToLower](type=cPacket);
        @signal[packetReceivedFromLower](type=cPacket);
        @signal[packetReceivedFromUpper](type=cPacket);

        bool hasStp;

    gates:
        input ifIn;
        output ifOut;
        input upperLayerIn;
        output upperLayerOut;
}

File: src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.ned