LteMacUe

Package: simu5g.stack.mac

compound module LteMacUe

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.

LteMacUe

Inheritance diagram

Known subclasses

Name

Type

Description

LteMacUeD2D

compound module

Extends LTE MAC functionalities at the User Equipment side to support device-to-device (D2D) communications. Specifically, it customizes LteMacUe functionalities to support the transmission and reception of MAC Protocol Data Units (PDUs), Channel Status Information (CSI), and Buffer Status Reports (BSRs) over a D2D link. It supports D2D multicast transmission to nearby UEs belonging to a given multicast group.

NrMacUe

compound module

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.

Extends

Name

Type

Description

LteMacBase

compound module

Base module for the Medium Access Control (MAC) layer of the LTE protocol stack.

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

8

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

3

ra-ResponseWindow: TTIs to wait before retrying RAC

retxBsrTimer

int

40

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

Properties

Name

Value

Description

class

LteMacUe

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

//
// 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.
//
module LteMacUe extends LteMacBase
{
    parameters:
        @class("LteMacUe");
        bool isNr = default(false);            // True for the NR leg (set by NrNicUe on the nrMac submodule)
        string collectorModule = default("");

        int numPreambles = default(64);        // Number of RACH preambles available for contention-based random access
        int maxRacAttempts = default(10);      // preambleTransMax; max RAC attempts (0 = give up after first failure)
        int racBackoffMin = default(0);        // Min random backoff (TTIs) after failed RAC
        int racBackoffMax = default(20);       // Max random backoff (TTIs) after failed RAC (0 = no backoff, instant retry)
        int raResponseWindow = default(3);     // ra-ResponseWindow: TTIs to wait before retrying RAC
        int retxBsrTimer = default(40);        // retxBSR-Timer: BSR retransmission timer (TTIs; 0 = disabled)
}

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