Package: simu5g.stack.d2d.mac
NrMacUeD2D
compound moduleNR-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.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Extends
| Name | Type | Description |
|---|---|---|
| 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. |
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 | |
| 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) |
| usePreconfiguredTxParams | bool | false | |
| d2dCqi | int | 7 |
Properties
| Name | Value | Description |
|---|---|---|
| display | i=block/mac | |
| class | NrMacUeD2D |
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 |
|---|---|---|---|
| macDelayDl | |||
| macThroughputDl | |||
| macDelayUl | |||
| macThroughputUl | |||
| macCellPacketLossDl | |||
| macCellPacketLossUl | |||
| macPacketLossUl | |||
| macPacketLossDl | |||
| macBufferOverFlowDl | |||
| macBufferOverFlowUl | |||
| harqErrorRateUl | |||
| harqErrorRateDl | |||
| harqTxAttemptsDl | |||
| harqTxAttemptsUl | |||
| harqErrorRate_1st_Ul | |||
| harqErrorRate_1st_Dl | |||
| harqErrorRate_2nd_Ul | |||
| harqErrorRate_2nd_Dl | |||
| harqErrorRate_3rd_Ul | |||
| harqErrorRate_3rd_Dl | |||
| harqErrorRate_4th_Ul | |||
| harqErrorRate_4th_Dl | |||
| receivedPacketFromUpperLayer | |||
| receivedPacketFromLowerLayer | |||
| sentPacketToUpperLayer | |||
| sentPacketToLowerLayer | |||
| macPduAcked | |||
| macPduDiscarded | |||
| rlcPduDiscarded | |||
| grantSent | |||
| ulMacPduArrived | |||
| harqErrorRate_1st_D2D | |||
| harqErrorRate_2nd_D2D | |||
| harqErrorRate_3rd_D2D | |||
| harqErrorRate_4th_D2D | |||
| harqErrorRateD2D | |||
| macPacketLossD2D | |||
| macDelayD2D | |||
| macThroughputD2D | |||
| macBufferOverFlowD2D | |||
| rcvdD2DModeSwitchNotification |
Statistics
| Name | Title | Source | Record | Unit | Interpolation Mode | Description |
|---|---|---|---|---|---|---|
| macDelayDl | Delay at the MAC layer UL | macDelayDl | mean, vector | s | ||
| macThroughputDl | Throughput at the MAC layer DL | macThroughputDl | simu5g_rateavg | Bps | ||
| macDelayUl | Delay at the MAC layer UL | macDelayUl | mean, vector | s | ||
| macThroughputUl | Throughput at the MAC layer UL | macThroughputUl | simu5g_rateavg | Bps | ||
| macCellPacketLossDl | Mac Cell Packet Loss Dl | macCellPacketLossDl | mean | |||
| macCellPacketLossUl | Mac Cell Packet Loss Ul | macCellPacketLossUl | mean | |||
| macPacketLossUl | Mac Packet Loss Ul | macPacketLossUl | mean | |||
| macPacketLossDl | Mac Packet Loss Dl | macPacketLossDl | mean | |||
| macBufferOverFlowDl | Mac buffer overflow as function of time | macBufferOverFlowDl | mean | Byte/s | ||
| macBufferOverFlowUl | Mac buffer overflow as function of time | macBufferOverFlowUl | mean | Byte/s | ||
| harqErrorRateUl | Harq Error Rate Ul | harqErrorRateUl | mean, vector | |||
| harqErrorRateDl | Harq Error Rate Dl | harqErrorRateDl | mean, vector | |||
| harqTxAttemptsDl | Harq Tx Attempts Dl | harqTxAttemptsDl | mean, vector | |||
| harqTxAttemptsUl | Harq Tx Attempts Ul | harqTxAttemptsUl | mean, vector | |||
| harqErrorRate_1st_Ul | Harq Error Rate Ul (1st tx) | harqErrorRate_1st_Ul | mean, vector | |||
| harqErrorRate_1st_Dl | Harq Error Rate Dl (1st tx) | harqErrorRate_1st_Dl | mean, vector | |||
| harqErrorRate_2nd_Ul | Harq Error Rate Ul (2nd tx) | harqErrorRate_2nd_Ul | mean, vector | |||
| harqErrorRate_2nd_Dl | Harq Error Rate Dl (2nd tx) | harqErrorRate_2nd_Dl | mean, vector | |||
| harqErrorRate_3rd_Ul | Harq Error Rate Ul (3rd tx) | harqErrorRate_3rd_Ul | mean, vector | |||
| harqErrorRate_3rd_Dl | Harq Error Rate Dl (3rd tx) | harqErrorRate_3rd_Dl | mean, vector | |||
| harqErrorRate_4th_Ul | Harq Error Rate Ul (4th tx) | harqErrorRate_4th_Ul | mean, vector | |||
| harqErrorRate_4th_Dl | Harq Error Rate Dl (4th tx) | harqErrorRate_4th_Dl | mean, vector | |||
| receivedPacketFromUpperLayer | receivedPacketFromUpperLayer | count, sum(packetBytes), vector(packetBytes) | none | |||
| receivedPacketFromLowerLayer | receivedPacketFromLowerLayer | count, sum(packetBytes), vector(packetBytes) | none | |||
| sentPacketToUpperLayer | sentPacketToUpperLayer | count, sum(packetBytes), vector(packetBytes) | none | |||
| sentPacketToLowerLayer | sentPacketToLowerLayer | count, sum(packetBytes), vector(packetBytes) | none | |||
| harqErrorRate_1st_D2D | Harq Error Rate D2D (1st Tx) | harqErrorRate_1st_D2D | mean, vector | |||
| harqErrorRate_2nd_D2D | Harq Error Rate D2D (2nd Tx) | harqErrorRate_2nd_D2D | mean, vector | |||
| harqErrorRate_3rd_D2D | Harq Error Rate D2D (3rd Tx) | harqErrorRate_3rd_D2D | mean, vector | |||
| harqErrorRate_4th_D2D | Harq Error Rate D2D (4th Tx) | harqErrorRate_4th_D2D | mean, vector | |||
| harqErrorRateD2D | Harq Error Rate D2D | harqErrorRateD2D | mean, vector | |||
| macPacketLossD2D | Mac Packet Loss D2D | macPacketLossD2D | mean | |||
| macDelayD2D | Delay at the MAC layer D2D | macDelayD2D | mean, vector | s | ||
| macThroughputD2D | Throughput at the MAC layer D2D | macThroughputD2D | simu5g_rateavg | Bps | ||
| macBufferOverFlowD2D | Mac buffer overflow as function of time | macBufferOverFlowD2D | mean | Byte/s | ||
| rcvdD2DModeSwitchNotification | Reception of mode switch notification (tx side) | rcvdD2DModeSwitchNotification | count, vector |
Source code
// // 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. // module NrMacUeD2D extends NrMacUe { parameters: @class("NrMacUeD2D"); 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/NrMacUeD2D.ned