EthernetSessionBridge

Package: simu5g.corenetwork.ethernetSessionBridge

EthernetSessionBridge

compound module

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.

macTable : like IMacForwardingTable

MacForwardingTable [from inet] ↗: Handles the mapping between ports and MAC addresses.

IMacForwardingTable [from inet] ↗: 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");
} interfaceTable : InterfaceTable
[from inet] ↗

Keeps the table of network interfaces.

Source:
interfaceTable: InterfaceTable {
    @display("p=100,200;is=s");
} sessionMux : EthernetSessionMux

The bridge's entry point and multiplexer: creates an ~EthernetSessionPort per Ethernet PDU session...

Source:
sessionMux: EthernetSessionMux {
    portDisplayString = default("p=500,420,row,100;g=sessionPorts");
    @display("p=600,520");
} cb : MessageDispatcher
[from inet] ↗

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
cb: MessageDispatcher {
    @display("p=400,50;b=700,5,,,,1");
} bridging : like IProtocolLayer

BridgingLayer [from inet] ↗: Provides various layer 2 services such as packet forwarding, interface selection, virtual LAN...

IProtocolLayer [from inet] ↗: 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");
} bl : MessageDispatcher
[from inet] ↗

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
bl: MessageDispatcher {
    @display("p=400,190;b=700,5,,,,1");
} ethernet : like IEthernetLayer

EthernetLayer [from inet] ↗

IEthernetLayer [from inet] ↗: Module interface for Ethernet protocol layer implementations.

Source:
ethernet: <default("EthernetLayer")> like IEthernetLayer {
    @display("p=300,260");
} ieee8021q : like IIeee8021qLayer

Ieee8021qProtocol [from inet] ↗: Implements the IEEE 802.1Q protocol encapsulation/decapsulation.

IIeee8021qLayer [from inet] ↗

Source:
ieee8021q: <default("Ieee8021qProtocol")> like IIeee8021qLayer {
    @display("p=500,260");
} li : MessageDispatcher
[from inet] ↗

Facilitates the interconnection of applications, protocols, and network interfaces, dispatching...

Source:
li: MessageDispatcher {
    @display("p=400,330;b=700,5,,,,1");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the 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.agingTime double
macTable.forwardingTableFile 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

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

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