NrMacUe

Package: simu5g.stack.mac

compound module NrMacUe

Provides functionalities for the Medium Access Control (MAC) of the New Radio (NR) protocol stack at the User Equipment (UE) side. In particular, it extends the LteMacUe module by redefining functions to support different numerology parameterizations.

NrMacUe

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

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.

Known subclasses

Name

Type

Description

NrMacUeD2D

compound module

NR-UE MAC with D2D support. Extends NrMacUe with the device-to-device (D2D) deltas: it customizes the numerology-aware MAC to support the transmission and reception of MAC PDUs, CSI, and BSRs over a D2D link, including one-to-many D2D multicast transmission. It is the NR counterpart of LteMacUeD2D.

Extends

Name

Type

Description

LteMacUe

compound module

Extends the LteMacBase module by providing specific MAC functions at the User Equipment (UE) side. For uplink connections, this module manages the initiation of the Random Access procedure (RAC) and the sending of Buffer Status Reports (BSRs) to the eNodeBs. Once it receives an uplink scheduling grant from the eNodeB, it is responsible for managing the local connections’ scheduler and constructing MAC Protocol Data Units (PDUs) to be transmitted to the physical layer.

Parameters

Name

Type

Default value

Description

macNodeId

int

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

binderModule

string

“binder”

queueSize

int

2MiB

MAC Buffers queue size

harqProcesses

int

5

maxHarqRtx

int

3

harqFbEvaluationTimer

int

4

Number of slots for sending back HARQ FB

statDisplay

bool

false

isNr

bool

false

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

collectorModule

string

“”

numPreambles

int

64

Number of RACH preambles available for contention-based random access

maxRacAttempts

int

10

preambleTransMax; max RAC attempts (0 = give up after first failure)

racBackoffMin

int

0

Min random backoff (TTIs) after failed RAC

racBackoffMax

int

20

Max random backoff (TTIs) after failed RAC (0 = no backoff, instant retry)

raResponseWindow

int

20

ra-ResponseWindow: TTIs to wait before retrying RAC

retxBsrTimer

int

320

retxBSR-Timer: BSR retransmission timer (TTIs; 0 = disabled)

Properties

Name

Value

Description

class

NrMacUe

display

i=block/mac

Gates

Name

Direction

Size

Description

upperLayerIn

input

From RLC

upperLayerOut

output

To RLC

phyIn

input

From PHY

phyOut

output

To PHY

Signals

Name

Type

Unit

Description

grantSent

harqErrorRate_1st_Dl

harqErrorRate_1st_Ul

harqErrorRate_2nd_Dl

harqErrorRate_2nd_Ul

harqErrorRate_3rd_Dl

harqErrorRate_3rd_Ul

harqErrorRate_4th_Dl

harqErrorRate_4th_Ul

harqErrorRateDl

harqErrorRateUl

harqTxAttemptsDl

harqTxAttemptsUl

macBufferOverFlowDl

macBufferOverFlowUl

macCellPacketLossDl

macCellPacketLossUl

macDelayDl

macDelayUl

macPacketLossDl

macPacketLossUl

macPduAcked

macPduDiscarded

macThroughputDl

macThroughputUl

receivedPacketFromLowerLayer

receivedPacketFromUpperLayer

rlcPduDiscarded

sentPacketToLowerLayer

sentPacketToUpperLayer

ulMacPduArrived

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

harqErrorRate_1st_Dl

Harq Error Rate Dl (1st tx)

harqErrorRate_1st_Dl

mean,vector

harqErrorRate_1st_Ul

Harq Error Rate Ul (1st tx)

harqErrorRate_1st_Ul

mean,vector

harqErrorRate_2nd_Dl

Harq Error Rate Dl (2nd tx)

harqErrorRate_2nd_Dl

mean,vector

harqErrorRate_2nd_Ul

Harq Error Rate Ul (2nd tx)

harqErrorRate_2nd_Ul

mean,vector

harqErrorRate_3rd_Dl

Harq Error Rate Dl (3rd tx)

harqErrorRate_3rd_Dl

mean,vector

harqErrorRate_3rd_Ul

Harq Error Rate Ul (3rd tx)

harqErrorRate_3rd_Ul

mean,vector

harqErrorRate_4th_Dl

Harq Error Rate Dl (4th tx)

harqErrorRate_4th_Dl

mean,vector

harqErrorRate_4th_Ul

Harq Error Rate Ul (4th tx)

harqErrorRate_4th_Ul

mean,vector

harqErrorRateDl

Harq Error Rate Dl

harqErrorRateDl

mean,vector

harqErrorRateUl

Harq Error Rate Ul

harqErrorRateUl

mean,vector

harqTxAttemptsDl

Harq Tx Attempts Dl

harqTxAttemptsDl

mean,vector

harqTxAttemptsUl

Harq Tx Attempts Ul

harqTxAttemptsUl

mean,vector

macBufferOverFlowDl

Mac buffer overflow as function of time

macBufferOverFlowDl

mean

Byte/s

macBufferOverFlowUl

Mac buffer overflow as function of time

macBufferOverFlowUl

mean

Byte/s

macCellPacketLossDl

Mac Cell Packet Loss Dl

macCellPacketLossDl

mean

macCellPacketLossUl

Mac Cell Packet Loss Ul

macCellPacketLossUl

mean

macDelayDl

Delay at the MAC layer UL

macDelayDl

mean,vector

s

macDelayUl

Delay at the MAC layer UL

macDelayUl

mean,vector

s

macPacketLossDl

Mac Packet Loss Dl

macPacketLossDl

mean

macPacketLossUl

Mac Packet Loss Ul

macPacketLossUl

mean

macThroughputDl

Throughput at the MAC layer DL

macThroughputDl

simu5g_rateavg

Bps

macThroughputUl

Throughput at the MAC layer UL

macThroughputUl

simu5g_rateavg

Bps

receivedPacketFromLowerLayer

receivedPacketFromLowerLayer

count,”sum(packetBytes)”,”vector(packetBytes)”

none

receivedPacketFromUpperLayer

receivedPacketFromUpperLayer

count,”sum(packetBytes)”,”vector(packetBytes)”

none

sentPacketToLowerLayer

sentPacketToLowerLayer

count,”sum(packetBytes)”,”vector(packetBytes)”

none

sentPacketToUpperLayer

sentPacketToUpperLayer

count,”sum(packetBytes)”,”vector(packetBytes)”

none

Source code

//
// Provides functionalities for the Medium Access Control (MAC) of the
// New Radio (NR) protocol stack at the User Equipment (UE) side. In particular, it extends
// the ~LteMacUe module by redefining functions to support different numerology
// parameterizations.
//
module NrMacUe extends LteMacUe
{
    parameters:
        @class("NrMacUe");
        harqProcesses = default(5);
        raResponseWindow = default(20);        // NR: longer RA response window
        retxBsrTimer = default(320);           // NR: longer BSR retransmission timer
}

File: src/simu5g/stack/mac/NrMacUe.ned