NrNicUe

Package: simu5g.stack

NrNicUe

compound module

Defines a User Equipment (UE) network interface card that supports both LTE and NR (New Radio) technologies. It extends the LteNicUe module by adding additional submodules and parameters to support NR-specific functionalities. D2D support is added by the NrNicUeD2D subtype.

The PDCP and RLC entities are missing from the submodules on purpose: the RRC layer's BearerManagement creates them per bearer at run time.

pcapRecorder[numPcapRecorders] : PcapRecorder
[from inet] ↗

Records PCAP traces of frames sent/received by other modules within the same host.

Source:
pcapRecorder[numPcapRecorders]: PcapRecorder {
    parameters:
        moduleNamePatterns = ".^";
        @display("p=100,100;is=s");
} clock : like IClock

IClock [from inet] ↗: This module interface is implemented by clock models.

Source:
clock: <default("")> like IClock if typename != "" {
    parameters:
        @display("p=100,200;is=s");
} handoverPacketHolder : like IHandoverPacketHolder

IHandoverPacketHolder: Manages packet buffering/tunnelling during handover

Source:
handoverPacketHolder: <> like IHandoverPacketHolder {
    @display("p=440,50;is=s");
} ip2nic : like INetworkLayer2CellularNic

Ip2Nic: Bridges the IP network layer and the cellular protocol stack, handling bidirectional packet flow.

INetworkLayer2CellularNic: The INetworkLayer2CellularNic module interface serves as an intermediary between the network layer...

Source:
ip2nic: <default("Ip2Nic")> like INetworkLayer2CellularNic {
    nodeType = parent.nodeType;
    @display("p=310,120");
} rrc : like IRrc

Rrc: RRC (Radio Resource Control) layer for LTE/NR networks.

IRrc: Interface for the RRC (Radio Resource Control) layer of the LTE/NR Stack.

Source:
rrc: <default("Rrc")> like IRrc {
    @display("p=80,60,col;g=left");
} pdcpMux : like IPdcpMux

PdcpMux: Upper-layer PDCP packet dispatcher.

IPdcpMux: Module interface for the upper-layer PDCP packet dispatcher of a cellular NIC (see ~PdcpMux for the...

Source:
pdcpMux: <default("PdcpMux")> like IPdcpMux {
    @display("p=310,190;is=s");
} rlcMux : like IRlcMux

RlcMux: Lower-layer RLC packet dispatcher.

IRlcMux: Module interface for the lower-layer RLC packet dispatcher of a cellular NIC (see ~RlcMux for the...

Source:
rlcMux: <default("RlcMux")> like IRlcMux {
    @display("p=310,430;is=s");
} mac : like ILteMac

ILteMac: Interface for the Medium Access Control (MAC) layer of the LTE Stack.

Source:
mac: <> like ILteMac {
    @display("p=310,510");
} phy : like IPhy

IPhy: Interface for the Physical (PHY) layer of the LTE/NR protocol stack.

Source:
phy: <> like IPhy {
    @display("p=310,600");
} channelModel[numCarriers] : like IChannelModel

IChannelModel: Provides the interface for modules implementing the model of the radio channel.

Source:
channelModel[numCarriers]: <channelModelType> like IChannelModel {
    @display("p=80,60,col;g=left");
} packetFlowObserver : like IPacketFlowObserver

Source:
packetFlowObserver: <default("")> like IPacketFlowObserver if hasRniSupport {
    @display("p=80,60,col;g=left");
} dlFbGen : LteDlFeedbackGenerator

This is the Lte Downlink Feedback Generator.

Source:
dlFbGen: LteDlFeedbackGenerator {
    @display("p=80,60,col;g=left");
} qosFlowClassifier : like IQosFlowClassifier

QosFlowClassifier: Classifies a UE's uplink packets to QoS flows: the uplink counterpart of ~TrafficFlowFilter's QFI...

IQosFlowClassifier: Interface for the UE's uplink QoS-flow classifier (see ~QosFlowClassifier).

Source:
qosFlowClassifier: <default("QosFlowClassifier")> like IQosFlowClassifier if hasSdap {
    @display("p=440,120;is=s");
} sdap : like INrSdap

NrSdap: Implements the SDAP Protocol.

INrSdap: Interface for SDAP protocol implementations.

Source:
sdap: <default("NrSdap")> like INrSdap if hasSdap {
    @display("p=230,155");
} reflectiveQosTable : like IReflectiveQosTable

ReflectiveQosTable: ReflectiveQosTable maintains a table of QoS flow mappings for reflective QoS.

IReflectiveQosTable: Interface for Reflective QoS Table modules.

Source:
reflectiveQosTable: <default("ReflectiveQosTable")> like IReflectiveQosTable if useReflectiveQos && hasSdap {
    @display("p=80,60,col;g=left");
} nrRlcMux : like IRlcMux

RlcMux: Lower-layer RLC packet dispatcher.

IRlcMux: Module interface for the lower-layer RLC packet dispatcher of a cellular NIC (see ~RlcMux for the...

Source:
nrRlcMux: <default("RlcMux")> like IRlcMux {
    @display("p=570,430;is=s");
} nrMac : like ILteMac

NrMacUe: Provides functionalities for the Medium Access Control (MAC) of the New Radio (NR) protocol stack...

ILteMac: Interface for the Medium Access Control (MAC) layer of the LTE Stack.

Source:
nrMac: <default("NrMacUe")> like ILteMac {
    @display("p=570,510");
} nrPhy : like IPhy

PhyUe: Extends the ~PhyBase module by providing specific PHY functions on the User Equipment (UE) side.

IPhy: Interface for the Physical (PHY) layer of the LTE/NR protocol stack.

Source:
nrPhy: <default("PhyUe")> like IPhy {
    @display("p=570,600");
} nrChannelModel[numNrCarriers] : like IChannelModel

IChannelModel: Provides the interface for modules implementing the model of the radio channel.

Source:
nrChannelModel[numNrCarriers]: <nrChannelModelType> like IChannelModel {
    @display("p=80,60,col;g=left");
} nrDlFbGen : LteDlFeedbackGenerator

This is the Lte Downlink Feedback Generator.

Source:
nrDlFbGen: LteDlFeedbackGenerator {
    @display("p=80,60,col;g=left");
    phyModule = "^.nrPhy";
} nrPacketFlowObserver : like IPacketFlowObserver

NrPacketFlowObserverUe: This module is responsible for keeping tracking the flow of SDUs in the stack, and compute...

Source:
nrPacketFlowObserver: <default("NrPacketFlowObserverUe")> like IPacketFlowObserver if hasRniSupport {
    @display("p=80,60,col;g=left");
    macModule = "^.nrMac";
    rlcModule = "^";
    isNrObserver = true;
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

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

Known subclasses

Name Type Description
NrNicUeD2D compound module

Device-to-Device (D2D) capable NR User Equipment network interface. It extends NrNicUe by swapping in the D2D-capable NR MAC/PHY leaves and enabling the D2D mode controller, allowing direct UE-to-UE communication without routing traffic through the gNodeB. It is the NR counterpart of LteNicUeD2D.

Extends

Name Type Description
LteNicUe compound module

The LteNicUe module is a network interface that provides LTE connectivity within a UE (User Equipment). It implements the data and signaling planes of the LTE stack, which includes PDCP, RLC, MAC, and PHY layers. The parameters and submodules allow customization of the UE's behavior.

Parameters

Name Type Default value Description
displayStringTextFormat string "%a (%i)\n%m"
recordPcap bool false
numPcapRecorders int recordPcap ? 1 : 0
isWireless bool true
interfaceTableModule string
routingTableModule string
hasRniSupport bool false
nodeType string
processingDelayIn double 0s

Additional processing delay for incoming ip packets

processingDelayOut double 0s

Additional processing delay for outgoing ip packets

channelModelType string "StochasticChannelModel"
dualConnectivityEnabled bool false
numCarriers int 1
address string "auto"
hasSdap bool false

Whether the stack has an SDAP layer: true on 5GC (Upf) networks, false on EPC/EN-DC ones; the network sets it per its core

useReflectiveQos bool false
nrChannelModelType string "Tr38901ChannelModel"
numNrCarriers int 1

Properties

Name Value Description
networkInterface
lifecycleSupport
class NonlayoutingNetworkInterface
display i=block/ifcard;bgb=800,650;bgl=3

Gates

Name Direction Size Description
upperLayerIn input
upperLayerOut output
radioIn input

To receive messages sent using sendDirect()

nrRadioIn input

For NR support

x2 [ ] inout

Optional X2 manager

Signals

Name Type Unit Description
packetDropped inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode Description
packetDropInterfaceDown packet drops: interface down packetDropReasonIsInterfaceDown(packetDropped) count, sum(packetBytes), vector(packetBytes) none
packetDropNoCarrier packet drops: no carrier packetDropReasonIsNoCarrier(packetDropped) count, sum(packetBytes), vector(packetBytes) none

Unassigned submodule parameters

Name Type Default value Description
pcapRecorder.verbose bool true

whether to log packets on the module output

pcapRecorder.pcapFile string ""

the PCAP file to be written

pcapRecorder.fileFormat string "pcapng"
pcapRecorder.snaplen int 65535

maximum number of bytes to record per packet

pcapRecorder.dumpBadFrames bool true

enable dump of frames with hasBitError

pcapRecorder.sendingSignalNames string "packetSentToLower"

space-separated list of outbound packet signals to subscribe to

pcapRecorder.receivingSignalNames string "packetReceivedFromLower"

space-separated list of inbound packet signals to subscribe to

pcapRecorder.dumpProtocols string "ethernetmac ppp ieee80211mac"

space-separated list of protocol names as defined in the Protocol class

pcapRecorder.packetFilter object "*"

which packets are considered, matches all packets by default

pcapRecorder.helpers string ""

usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype currently available: "inet::AckingMacToEthernetPcapRecorderHelper"

pcapRecorder.alwaysFlush bool false

flush the pcapFile after each write to ensure that all packets are captured in case of a crash

pcapRecorder.displayStringTextFormat string "rec: %n pks"
ip2nic.isNr bool
rlcMux.bearerManagementModule string
packetFlowObserver.macModule string
packetFlowObserver.pdcpModule string
packetFlowObserver.rlcModule string
packetFlowObserver.isNrObserver bool
packetFlowObserver.pfmType string
dlFbGen.isNr bool false

True for the NR leg (set by NrNicUe on the nrDlFbGen submodule)

dlFbGen.macNodeId int

MacNodeId of the stack leg this generator belongs to (set by the NIC)

dlFbGen.feedbackType string "ALLBANDS"

Can be ALLBANDS, PREFERRED, WIDEBAND

dlFbGen.rbAllocationType string "localized"

Resource allocation type ("distributed" or "localized")

dlFbGen.fbPeriod int 6tti

Period for Periodic feedback in TTI

dlFbGen.fbDelay int 1tti

Time interval between sensing and transmission in TTI

dlFbGen.usePeriodic bool true

Whether periodic feedback is used in addition to aperiodic feedback

dlFbGen.initialTxMode string "SINGLE_ANTENNA_PORT0"

Initial txMode (see LteCommon.h)

dlFbGen.binderModule string "binder"
dlFbGen.phyModule string "^.phy"
sdap.nodeRole string

Node role: "UE" or "gNB" - determines reflective QoS behavior

sdap.useReflectiveQos bool

UE only

sdap.reflectiveQosTableModule string

UE only: path to ReflectiveQosTable module (empty = disabled)

nrRlcMux.bearerManagementModule string
nrDlFbGen.isNr bool false

True for the NR leg (set by NrNicUe on the nrDlFbGen submodule)

nrDlFbGen.macNodeId int

MacNodeId of the stack leg this generator belongs to (set by the NIC)

nrDlFbGen.feedbackType string "ALLBANDS"

Can be ALLBANDS, PREFERRED, WIDEBAND

nrDlFbGen.rbAllocationType string "localized"

Resource allocation type ("distributed" or "localized")

nrDlFbGen.fbPeriod int 6tti

Period for Periodic feedback in TTI

nrDlFbGen.fbDelay int 1tti

Time interval between sensing and transmission in TTI

nrDlFbGen.usePeriodic bool true

Whether periodic feedback is used in addition to aperiodic feedback

nrDlFbGen.initialTxMode string "SINGLE_ANTENNA_PORT0"

Initial txMode (see LteCommon.h)

nrDlFbGen.binderModule string "binder"
nrPacketFlowObserver.pdcpModule string
nrPacketFlowObserver.pfmType string

Source code

//
// Defines a User Equipment (UE) network interface card that
// supports both LTE and NR (New Radio) technologies. It extends the
// LteNicUe module by adding additional submodules and parameters to
// support NR-specific functionalities. D2D support is added by the
// ~NrNicUeD2D subtype.
//
// The PDCP and RLC entities are missing from the submodules on purpose: the RRC
// layer's ~BearerManagement creates them per bearer at run time.
//
module NrNicUe extends LteNicUe
{
    parameters:
        bool hasSdap = default(false);  // Whether the stack has an SDAP layer: true on 5GC (Upf) networks, false on EPC/EN-DC ones; the network sets it per its core
        bool useReflectiveQos = default(false);
        ip2nic.hasSdap = default(this.hasSdap);
        sdap.nodeRole = default("UE");
        sdap.useReflectiveQos = default(this.useReflectiveQos);
        sdap.reflectiveQosTableModule = default(this.useReflectiveQos ? "^.reflectiveQosTable" : "");
        string nrChannelModelType = default("Tr38901ChannelModel");

        packetFlowObserver.typename = default("PacketFlowObserverUe");

        int numNrCarriers = default(1);

        ip2nic.isNr = default(true);
        rrc.bearerManagement.pdcpEntityModuleType = default("simu5g.stack.pdcp.NrPdcpEntity");

        rrc.hasNrHandoverController = true;
        rrc.nrHandoverController.isNr = true;
        nrMac.isNr = true;
        nrPhy.isNr = true;
        nrDlFbGen.isNr = true;
        // The NR leg's modules take their MacNodeId from the node's NR id
        rrc.nrHandoverController.macNodeId = parent.nrMacNodeId;
        nrMac.macNodeId = parent.nrMacNodeId;
        nrPhy.macNodeId = parent.nrMacNodeId;
        nrDlFbGen.macNodeId = parent.nrMacNodeId;
        rrc.nrHandoverController.otherHandoverControllerModule = "^.handoverController";
        nrPhy.channelModelModule = "^.nrChannelModel[0]";
        nrPhy.feedbackGeneratorModule = "^.nrDlFbGen";
        nrPhy.handoverControllerModule = "^.rrc.nrHandoverController";
        rrc.nrHandoverController.macModule = "^.^.nrMac";
        rrc.nrHandoverController.feedbackGeneratorModule = "^.^.nrDlFbGen";
        rrc.handoverController.otherHandoverControllerModule = "^.nrHandoverController";

    submodules:
        // uplink QoS-flow classification (the TrafficFlowFilter's uplink counterpart),
        // where uplink traffic enters the stack
        qosFlowClassifier: <default("QosFlowClassifier")> like IQosFlowClassifier if hasSdap {
            @display("p=440,120;is=s");
        }
        sdap: <default("NrSdap")> like INrSdap if hasSdap {
            @display("p=230,155");
        }
        reflectiveQosTable: <default("ReflectiveQosTable")> like IReflectiveQosTable if useReflectiveQos && hasSdap {
            @display("p=80,60,col;g=left");
        }
        // NR RLC submodules (flattened from former LteRlc compound)
        nrRlcMux: <default("RlcMux")> like IRlcMux {
            @display("p=570,430;is=s");
        }
        // MAC Layer
        nrMac: <default("NrMacUe")> like ILteMac {
            @display("p=570,510");
        }
        // PHY Layer
        nrPhy: <default("PhyUe")> like IPhy {
            @display("p=570,600");
        }
        // NR Channel Model
        nrChannelModel[numNrCarriers]: <nrChannelModelType> like IChannelModel {
            @display("p=80,60,col;g=left");
        }

        // Feedback generator submodule
        nrDlFbGen: LteDlFeedbackGenerator {
            @display("p=80,60,col;g=left");
            phyModule = "^.nrPhy";
        }

        nrPacketFlowObserver: <default("NrPacketFlowObserverUe")> like IPacketFlowObserver if hasRniSupport {
            @display("p=80,60,col;g=left");
            macModule = "^.nrMac";
            rlcModule = "^";
            isNrObserver = true;
        }

    connections:

        //# NR RLC <-> MAC
        nrRlcMux.macOut --> nrMac.upperLayerIn;
        nrRlcMux.macIn <-- nrMac.upperLayerOut;

        //#
        //# Connections from LTE Stack to radio interface
        //#
        nrMac.phyOut --> nrPhy.upperGateIn;
        nrMac.phyIn <-- nrPhy.upperGateOut;

        //# external: lower connection
        nrRadioIn --> nrPhy.radioIn;

        //# uplink QoS-flow classifier (optional, spliced above ip2nic)
        handoverPacketHolder.stackOut --> { @reconnect; } --> qosFlowClassifier.upperLayerIn if hasSdap;
        qosFlowClassifier.lowerLayerOut --> ip2nic.upperLayerIn if hasSdap;

        //# SDAP layer (optional, spliced between ip2nic and pdcpMux)
        ip2nic.stackOut --> { @reconnect; } --> sdap.upperLayerIn if hasSdap;
        sdap.pdcpOut --> pdcpMux.upperLayerIn if hasSdap;
        pdcpMux.upperLayerOut --> { @reconnect; } --> sdap.pdcpIn if hasSdap;
        sdap.upperLayerOut --> ip2nic.stackIn if hasSdap;
}
File: src/simu5g/stack/NrNicUe.ned