MacRelayUnit

Package: inet.linklayer.ethernet.common

MacRelayUnit

simple module

C++ definition

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.

Inheritance diagram

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

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 MacRelayUnit
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

//
// 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.
//
simple MacRelayUnit extends MacRelayUnitBase like IMacRelayUnit
{
    parameters:
        @class(MacRelayUnit);
}
File: src/inet/linklayer/ethernet/common/MacRelayUnit.ned