MacRelayUnitBase

Package: inet.linklayer.base

simple module MacRelayUnitBase

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.

See also: IMacForwardingTable

inet.linklayer.base.MacRelayUnitBaseMacRelayUnitBasesimple

Inheritance diagram

Known subclasses

Name

Type

Description

MacRelayUnit

simple module

Implements Ethernet switch functionality by relaying frames between different ports based on destination MAC addresses. Maintains a MAC address table that maps addresses to ports, learns addresses from incoming frames, and forwards frames appropriately. Handles unicast, multicast, and broadcast traffic according to standard Ethernet switching rules, with support for VLANs.

Ieee8021dRelay

simple module

Forwards frames (~EtherFrame) based on their destination MAC addresses to appropriate ports.

Extends

Name

Type

Description

SimpleModule

simple module

Base module for all INET simple modules.

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

MacRelayUnitBase

display

i=block/switch

Gates

Name

Direction

Size

Description

lowerLayerIn

input

lowerLayerOut

output

upperLayerIn

input

upperLayerOut

output

Signals

Name

Type

Unit

Description

packetDropped

inet::Packet

packetReceivedFromLower

inet::Packet

packetReceivedFromUpper

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

//
// 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.
//
// @see IMacForwardingTable
//
simple MacRelayUnitBase extends SimpleModule
{
    parameters:
        @class(MacRelayUnitBase);
        string macTableModule;
        string interfaceTableModule;
        displayStringTextFormat = default("proc: %p\ndisc: %d");
        @display("i=block/switch");
        @signal[packetSentToLower](type=inet::Packet);
        @signal[packetReceivedFromUpper](type=inet::Packet);
        @signal[packetReceivedFromLower](type=inet::Packet);
        @signal[packetDropped](type=inet::Packet);
        @statistic[packetDropped](title="packets dropped"; record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none);
    gates:
        input lowerLayerIn;
        output lowerLayerOut;
        input upperLayerIn;
        output upperLayerOut;
}

File: src/inet/linklayer/base/MacRelayUnitBase.ned