LteMacUeD2D

Package: simu5g.stack.d2d.mac

compound module LteMacUeD2D

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.

LteMacUeD2D

Inheritance diagram

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

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)

usePreconfiguredTxParams

bool

false

d2dCqi

int

7

Properties

Name

Value

Description

class

LteMacUeD2D

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_D2D

harqErrorRate_1st_Dl

harqErrorRate_1st_Ul

harqErrorRate_2nd_D2D

harqErrorRate_2nd_Dl

harqErrorRate_2nd_Ul

harqErrorRate_3rd_D2D

harqErrorRate_3rd_Dl

harqErrorRate_3rd_Ul

harqErrorRate_4th_D2D

harqErrorRate_4th_Dl

harqErrorRate_4th_Ul

harqErrorRateD2D

harqErrorRateDl

harqErrorRateUl

harqTxAttemptsDl

harqTxAttemptsUl

macBufferOverFlowD2D

macBufferOverFlowDl

macBufferOverFlowUl

macCellPacketLossDl

macCellPacketLossUl

macDelayD2D

macDelayDl

macDelayUl

macPacketLossD2D

macPacketLossDl

macPacketLossUl

macPduAcked

macPduDiscarded

macThroughputD2D

macThroughputDl

macThroughputUl

rcvdD2DModeSwitchNotification

receivedPacketFromLowerLayer

receivedPacketFromUpperLayer

rlcPduDiscarded

sentPacketToLowerLayer

sentPacketToUpperLayer

ulMacPduArrived

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

harqErrorRate_1st_D2D

Harq Error Rate D2D (1st Tx)

harqErrorRate_1st_D2D

mean,vector

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_D2D

Harq Error Rate D2D (2nd Tx)

harqErrorRate_2nd_D2D

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_D2D

Harq Error Rate D2D (3rd Tx)

harqErrorRate_3rd_D2D

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_D2D

Harq Error Rate D2D (4th Tx)

harqErrorRate_4th_D2D

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

harqErrorRateD2D

Harq Error Rate D2D

harqErrorRateD2D

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

macBufferOverFlowD2D

Mac buffer overflow as function of time

macBufferOverFlowD2D

mean

Byte/s

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

macDelayD2D

Delay at the MAC layer D2D

macDelayD2D

mean,vector

s

macDelayDl

Delay at the MAC layer UL

macDelayDl

mean,vector

s

macDelayUl

Delay at the MAC layer UL

macDelayUl

mean,vector

s

macPacketLossD2D

Mac Packet Loss D2D

macPacketLossD2D

mean

macPacketLossDl

Mac Packet Loss Dl

macPacketLossDl

mean

macPacketLossUl

Mac Packet Loss Ul

macPacketLossUl

mean

macThroughputD2D

Throughput at the MAC layer D2D

macThroughputD2D

simu5g_rateavg

Bps

macThroughputDl

Throughput at the MAC layer DL

macThroughputDl

simu5g_rateavg

Bps

macThroughputUl

Throughput at the MAC layer UL

macThroughputUl

simu5g_rateavg

Bps

rcvdD2DModeSwitchNotification

Reception of mode switch notification (tx side)

rcvdD2DModeSwitchNotification

count,vector

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 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.
//
module LteMacUeD2D extends LteMacUe
{
    parameters:
        @class("LteMacUeD2D");

        bool usePreconfiguredTxParams = default(false);
        int d2dCqi = default(7);

        @signal[harqErrorRate_1st_D2D];
        @statistic[harqErrorRate_1st_D2D](title="Harq Error Rate D2D (1st Tx)"; unit=""; source="harqErrorRate_1st_D2D"; record=mean,vector);
        @signal[harqErrorRate_2nd_D2D];
        @statistic[harqErrorRate_2nd_D2D](title="Harq Error Rate D2D (2nd Tx)"; unit=""; source="harqErrorRate_2nd_D2D"; record=mean,vector);
        @signal[harqErrorRate_3rd_D2D];
        @statistic[harqErrorRate_3rd_D2D](title="Harq Error Rate D2D (3rd Tx)"; unit=""; source="harqErrorRate_3rd_D2D"; record=mean,vector);
        @signal[harqErrorRate_4th_D2D];
        @statistic[harqErrorRate_4th_D2D](title="Harq Error Rate D2D (4th Tx)"; unit=""; source="harqErrorRate_4th_D2D"; record=mean,vector);
        @signal[harqErrorRateD2D];
        @statistic[harqErrorRateD2D](title="Harq Error Rate D2D"; unit=""; source="harqErrorRateD2D"; record=mean,vector);
        @signal[macPacketLossD2D];
        @statistic[macPacketLossD2D](title="Mac Packet Loss D2D"; unit=""; source="macPacketLossD2D"; record=mean);
        @signal[macDelayD2D];
        @statistic[macDelayD2D](title="Delay at the MAC layer D2D"; unit="s"; source="macDelayD2D"; record=mean,vector);
        @signal[macThroughputD2D];
        @statistic[macThroughputD2D](title="Throughput at the MAC layer D2D"; unit="Bps"; source="macThroughputD2D"; record=simu5g_rateavg);
        @signal[macBufferOverFlowD2D];
        @statistic[macBufferOverFlowD2D](title="Mac buffer overflow as function of time"; unit="Byte/s"; source="macBufferOverFlowD2D"; record=mean);

        @signal[rcvdD2DModeSwitchNotification];
        @statistic[rcvdD2DModeSwitchNotification](title="Reception of mode switch notification (tx side)"; unit=""; source="rcvdD2DModeSwitchNotification"; record=count,vector);
}

File: src/simu5g/stack/d2d/mac/LteMacUeD2D.ned