EthernetSessionBridge

Package: simu5g.corenetwork.ethernetSessionBridge

compound module EthernetSessionBridge

The Ethernet bridge of a Upf, which forwards the traffic of its Ethernet PDU sessions “based on detected MAC addresses” (TS 23.501 5.8.2.5.3): one learning bridge per UPF, whose ports are the Ethernet sessions the UPF anchors and one N6 Ethernet interface, the node’s dnEth (TS 23.501 5.8.2.5.3, NOTE 2), which is connected to lowerLayerIn/Out: a submodule of the node, but a port of this bridge, registered in its interface table. A session’s uplink frames enter the bridge on the session’s port; the bridge learns their source addresses, forwards known unicast to the port of the destination (another session: switched locally, not via N6; or dnEth), floods unknown unicast, broadcast and multicast to every port but the ingress, and drops a frame whose destination is on its ingress port. Learning is per VLAN.

The bridge is INET’s layered BridgingLayer over its own interface table and MAC table, so the session ports and dnEth get no IP configuration and no routes, and the bridge floods among them only. A session port (EthernetSessionPort) is created when the session is established at the UPF and deleted when it is released, its MAC table entries flushed first; EthernetSessionMux does both, on the calls of the node’s UserPlaneNodeControl, and connects the ports’ lower sides to the node’s GTP-U path: uplink frames from GtpUser, downlink frames to the TrafficFlowFilter, each tagged with its session (SessionTag).

The frames carry their FCS inside the bridge; GtpUser rebuilds it where a frame leaves the tunnel and strips it where one enters, after the traffic flow filter has classified the full frame (TS 23.501 5.6.10.2: the 5GS does not carry the FCS).

Not modeled (TS 23.501 5.8.2.5.3): flooding scoped to a VLAN (frames are flooded across VLANs), ARP/ND proxying, allowed VLAN/MAC lists, S-/C-TAG handling, the reporting of learned MAC addresses to the SMF, PSA relocation, 5G VN groups.

EthernetSessionBridgecb.out++ --> bridging.upperLayerInbridging.upperLayerOut --> cb.in++bridging.lowerLayerOut --> bl.in++bl.out++ --> bridging.lowerLayerInbl.out++ --> ethernet.upperLayerInethernet.upperLayerOut --> bl.in++bl.out++ --> ieee8021q.upperLayerInieee8021q.upperLayerOut --> bl.in++bl.out++ --> li.in++li.out++ --> bl.in++ethernet.lowerLayerOut --> li.in++li.out++ --> ethernet.lowerLayerInieee8021q.lowerLayerOut --> li.in++li.out++ --> ieee8021q.lowerLayerInli.out++ --> lowerLayerOutlowerLayerIn --> li.in++sessionIn --> sessionMux.sessionInsessionMux.sessionOut --> sessionOutmacTable: inet.linklayer.ethernet.common.MacForwardingTable (like IMacForwardingTable) MacForwardingTable: Handles the mapping between ports and MAC addresses. IMacForwardingTable: Interface for MAC address tables, used by MAC relay units in Ethenet switches. Source: macTable: <default("MacForwardingTable")> like IMacForwardingTable { @display("p=100,100;is=s"); }macTableinterfaceTable: inet.networklayer.common.InterfaceTable Keeps the table of network interfaces. Source: interfaceTable: InterfaceTable { @display("p=100,200;is=s"); }interfaceTablesessionMux: simu5g.corenetwork.ethernetSessionBridge.EthernetSessionMux The bridge's entry point and multiplexer: creates an ~EthernetSessionPort per Ethernet PDU sessio... Source: sessionMux: EthernetSessionMux { portDisplayString = default("p=500,420,row,100;g=sessionPorts"); @display("p=600,520"); }sessionMuxcb: inet.common.MessageDispatcher Facilitates the interconnection of applications, protocols, and network interfaces, dispatching m... Source: cb: MessageDispatcher { @display("p=400,50;b=700,5,,,,1"); }cbbridging: inet.linklayer.ethernet.common.BridgingLayer (like IProtocolLayer) BridgingLayer: Provides various layer 2 services such as packet forwarding, interface selection, virtual LAN han... IProtocolLayer: Interface for all protocol layer modules that connect to a higher and to a lower protocol layer,... Source: bridging: <default("BridgingLayer")> like IProtocolLayer { @display("p=400,120"); }bridgingbl: inet.common.MessageDispatcher Facilitates the interconnection of applications, protocols, and network interfaces, dispatching m... Source: bl: MessageDispatcher { @display("p=400,190;b=700,5,,,,1"); }blethernet: inet.linklayer.ethernet.modular.EthernetLayer (like IEthernetLayer) IEthernetLayer: Module interface for Ethernet protocol layer implementations. Source: ethernet: <default("EthernetLayer")> like IEthernetLayer { @display("p=300,260"); }ethernetieee8021q: inet.linklayer.ieee8021q.Ieee8021qProtocol (like IIeee8021qLayer) Ieee8021qProtocol: Implements the IEEE 802.1Q protocol encapsulation/decapsulation. Source: ieee8021q: <default("Ieee8021qProtocol")> like IIeee8021qLayer { @display("p=500,260"); }ieee8021qli: inet.common.MessageDispatcher Facilitates the interconnection of applications, protocols, and network interfaces, dispatching m... Source: li: MessageDispatcher { @display("p=400,330;b=700,5,,,,1"); }li

Usage diagram

Used in compound modules

Name

Type

Description

Upf

compound module

Implements the 5G Core User Plane Function (UPF).

Properties

Name

Value

Description

display

i=block/switch;bgb=700,600

Gates

Name

Direction

Size

Description

sessionIn

input

uplink frames of the sessions, from GtpUser (the ethernetmac service, which the session mux registers)

sessionOut

output

downlink frames of the sessions, to the TrafficFlowFilter

lowerLayerOut

output

to the N6 Ethernet interface (the node’s dnEth)

lowerLayerIn

input

from the N6 Ethernet interface

Unassigned submodule parameters

Name

Type

Default value

Description

macTable ↗.displayStringTextFormat

string

“addr: %a\nvlan: %v”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

macTable ↗.agingTime

double

120s

macTable ↗.forwardingTable

object

[]

macTable ↗.forwardingTableFile

string

“”

macTable ↗.interfaceTableModule

string

interfaceTable ↗.displayStringTextFormat

string

“{numInterfaces} interfaces”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

interfaceTable ↗.displayAddresses

bool

false

Whether to display IP addresses on links

sessionMux.interfaceTableModule

string

The bridge’s interface table, which the session ports are registered in

sessionMux.macTableModule

string

The bridge’s MAC table, flushed of a released session’s port

sessionMux.portModuleType

string

“simu5g.corenetwork.ethernetSessionBridge.EthernetSessionPort”

The module type of the session ports

sessionMux.portDisplayString

string

“p=500,420,row,100;g=sessionPorts”

Display string of the session ports (their place in the bridge’s layout)

cb ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

cb ↗.interfaceTableModule

string

Module path to the InterfaceTable ↗ module

cb ↗.forwardServiceRegistration

bool

true

cb ↗.forwardProtocolRegistration

bool

true

cb ↗.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

cb ↗.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

cb ↗.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

bridging ↗.directionReverser ↗.fork ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bridging ↗.directionReverser ↗.fork ↗.interfaceTableModule

string

Module path to the InterfaceTable ↗ module

bridging ↗.directionReverser ↗.fork ↗.forwardProtocolRegistration

bool

true

bridging ↗.directionReverser ↗.fork ↗.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

bridging ↗.directionReverser ↗.fork ↗.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

bridging ↗.directionReverser ↗.fork ↗.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

bridging ↗.directionReverser ↗.reverser ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bridging ↗.directionReverser ↗.reverser ↗.forwardVlan

bool

true

bridging ↗.directionReverser ↗.reverser ↗.forwardPcp

bool

true

bridging ↗.directionReverser ↗.reverser ↗.excludeEncapsulationProtocols

object

[]

bridging ↗.directionReverser ↗.join ↗.displayStringTextFormat

string

“passed %p pk (%l)”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bridging ↗.directionReverser ↗.join ↗.forwardServiceRegistration

bool

true

bridging ↗.interfaceRelay ↗.learner ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bridging ↗.interfaceRelay ↗.learner ↗.macTableModule

string

Relative module path of MAC table

bridging ↗.interfaceRelay ↗.learner ↗.interfaceTableModule

string

Relative module path of the interface table

bridging ↗.interfaceRelay ↗.selector ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bridging ↗.interfaceRelay ↗.selector ↗.macTableModule

string

Relative module path of MAC table

bridging ↗.interfaceRelay ↗.selector ↗.interfaceTableModule

string

Relative module path of interface table

bl ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

bl ↗.interfaceTableModule

string

Module path to the InterfaceTable ↗ module

bl ↗.forwardServiceRegistration

bool

true

bl ↗.forwardProtocolRegistration

bool

true

bl ↗.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

bl ↗.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

bl ↗.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

ethernet ↗.socketTable ↗.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.socketCommandProcessor ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.socketCommandProcessor ↗.socketTableModule

string

ethernet ↗.macHeaderInserter ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.macHeaderInserter ↗.interfaceTableModule

string

ethernet ↗.paddingInserter ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.paddingInserter ↗.minLength

int

ethernet ↗.paddingInserter ↗.roundingLength

int

1B

ethernet ↗.paddingInserter ↗.insertionPosition

string

“back”

ethernet ↗.fcsInserter ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.fcsInserter ↗.fcsMode

string

“declared”

ethernet ↗.socketPacketProcessor ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.socketPacketProcessor ↗.socketTableModule

string

ethernet ↗.macHeaderChecker ↗.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.macHeaderChecker ↗.backpressure

bool

false

ethernet ↗.macHeaderChecker ↗.interfaceTableModule

string

ethernet ↗.macHeaderChecker ↗.promiscuous

bool

false

ethernet ↗.fcsChecker ↗.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ethernet ↗.fcsChecker ↗.backpressure

bool

false

ethernet ↗.fcsChecker ↗.popFcs

bool

true

ieee8021q ↗.socketTable ↗.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ieee8021q ↗.socketCommandProcessor ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ieee8021q ↗.socketCommandProcessor ↗.socketTableModule

string

ieee8021q ↗.qTagHeaderInserter ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ieee8021q ↗.qTagHeaderInserter ↗.vlanTagType

string

“c”

ieee8021q ↗.qTagHeaderInserter ↗.nextProtocol

string

“ethernetmac”

ieee8021q ↗.qTagHeaderInserter ↗.defaultVlanId

int

-1

ieee8021q ↗.qTagHeaderInserter ↗.defaultPcp

int

-1

ieee8021q ↗.qTagHeaderInserter ↗.defaultUserPriority

int

-1

ieee8021q ↗.qTagHeaderInserter ↗.defaultDropEligible

int

-1

<0: unspecified, 0: false, >0: true

ieee8021q ↗.socketPacketProcessor ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ieee8021q ↗.socketPacketProcessor ↗.socketTableModule

string

ieee8021q ↗.qTagHeaderChecker ↗.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

ieee8021q ↗.qTagHeaderChecker ↗.backpressure

bool

false

ieee8021q ↗.qTagHeaderChecker ↗.vlanTagType

string

“c”

ieee8021q ↗.qTagHeaderChecker ↗.vlanIdFilter

object

[]

li ↗.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

li ↗.interfaceTableModule

string

Module path to the InterfaceTable ↗ module

li ↗.forwardServiceRegistration

bool

true

li ↗.forwardProtocolRegistration

bool

true

li ↗.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

li ↗.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

li ↗.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

Source code

//
// The Ethernet bridge of a ~Upf, which forwards the traffic of its Ethernet PDU sessions
// "based on detected MAC addresses" (TS 23.501 5.8.2.5.3): one learning bridge per UPF,
// whose ports are the Ethernet sessions the UPF anchors and one N6 Ethernet interface,
// the node's dnEth (TS 23.501 5.8.2.5.3, NOTE 2), which is connected to lowerLayerIn/Out:
// a submodule of the node, but a port of this bridge, registered in its interface table. A session's uplink frames enter the bridge on the
// session's port; the bridge learns their source addresses, forwards known unicast to
// the port of the destination (another session: switched locally, not via N6; or dnEth),
// floods unknown unicast, broadcast and multicast to every port but the ingress, and
// drops a frame whose destination is on its ingress port. Learning is per VLAN.
//
// The bridge is INET's layered BridgingLayer over its own interface table and
// MAC table, so the session ports and dnEth get no IP configuration and no routes, and
// the bridge floods among them only. A session port (~EthernetSessionPort) is created
// when the session is established at the UPF and deleted when it is released, its MAC
// table entries flushed first; ~EthernetSessionMux does both, on the calls of the node's
// ~UserPlaneNodeControl, and connects the ports' lower sides to the node's GTP-U path:
// uplink frames from ~GtpUser, downlink frames to the ~TrafficFlowFilter, each tagged
// with its session (~SessionTag).
//
// The frames carry their FCS inside the bridge; ~GtpUser rebuilds it where a frame leaves
// the tunnel and strips it where one enters, after the traffic flow filter has classified
// the full frame (TS 23.501 5.6.10.2: the 5GS does not carry the FCS).
//
// Not modeled (TS 23.501 5.8.2.5.3): flooding scoped to a VLAN (frames are flooded across
// VLANs), ARP/ND proxying, allowed VLAN/MAC lists, S-/C-TAG handling, the reporting of
// learned MAC addresses to the SMF, PSA relocation, 5G VN groups.
//
module EthernetSessionBridge
{
    parameters:
        @display("i=block/switch;bgb=700,600");
        **.interfaceTableModule = default(absPath(".interfaceTable"));
        **.macTableModule = default(absPath(".macTable"));
        *.fcsMode = "declared";
        ethernet.*.promiscuous = true;
        ethernet.registerProtocol = true;
    gates:
        input sessionIn;       // uplink frames of the sessions, from ~GtpUser (the ethernetmac service, which the session mux registers)
        output sessionOut;     // downlink frames of the sessions, to the ~TrafficFlowFilter
        output lowerLayerOut;  // to the N6 Ethernet interface (the node's dnEth)
        input lowerLayerIn;    // from the N6 Ethernet interface
    submodules:
        macTable: <default("MacForwardingTable")> like IMacForwardingTable {
            @display("p=100,100;is=s");
        }
        interfaceTable: InterfaceTable {
            @display("p=100,200;is=s");
        }
        sessionMux: EthernetSessionMux {
            portDisplayString = default("p=500,420,row,100;g=sessionPorts");
            @display("p=600,520");
        }
        cb: MessageDispatcher {
            @display("p=400,50;b=700,5,,,,1");
        }
        bridging: <default("BridgingLayer")> like IProtocolLayer {
            @display("p=400,120");
        }
        bl: MessageDispatcher {
            @display("p=400,190;b=700,5,,,,1");
        }
        ethernet: <default("EthernetLayer")> like IEthernetLayer {
            @display("p=300,260");
        }
        ieee8021q: <default("Ieee8021qProtocol")> like IIeee8021qLayer {
            @display("p=500,260");
        }
        li: MessageDispatcher {
            @display("p=400,330;b=700,5,,,,1");
        }
    connections allowunconnected:
        cb.out++ --> bridging.upperLayerIn;
        bridging.upperLayerOut --> cb.in++;
        bridging.lowerLayerOut --> bl.in++;
        bl.out++ --> bridging.lowerLayerIn;
        bl.out++ --> ethernet.upperLayerIn;
        ethernet.upperLayerOut --> bl.in++;
        bl.out++ --> ieee8021q.upperLayerIn;
        ieee8021q.upperLayerOut --> bl.in++;
        bl.out++ --> li.in++;
        li.out++ --> bl.in++;
        ethernet.lowerLayerOut --> li.in++;
        li.out++ --> ethernet.lowerLayerIn;
        ieee8021q.lowerLayerOut --> li.in++;
        li.out++ --> ieee8021q.lowerLayerIn;
        li.out++ --> { @display("m=s"); } --> lowerLayerOut;
        lowerLayerIn --> { @display("m=s"); } --> li.in++;
        sessionIn --> sessionMux.sessionIn;
        sessionMux.sessionOut --> sessionOut;
}

File: src/simu5g/corenetwork/ethernetSessionBridge/EthernetSessionBridge.ned