NrMacGnb¶
Package: simu5g.stack.mac
compound module NrMacGnb
Provides functionalities for the Medium Access Control (MAC) of the New Radio (NR) protocol stack at the gNodeB (gNB) side. In particular, it extends the LteMacEnb module by initializing the NR version of the uplink scheduler and using, by default, the NR version of the Adaptive Modulation and Coding (AMC) module.
Inheritance diagram¶
Known subclasses¶
Name |
Type |
Description |
|---|---|---|
compound module |
NR-gNB MAC with D2D support. Extends NrMacGnb with the device-to-device (D2D) deltas: it enhances resource allocation procedures to enable direct communication between UEs (network-assisted D2D). It is the NR counterpart of LteMacEnbD2D. |
Extends¶
Name |
Type |
Description |
|---|---|---|
compound module |
Extends the LteMacBase module by providing specific MAC functions on the eNodeB side. Specifically, it initializes and manages the scheduling classes responsible for resource allocation operations in both uplink and downlink directions, while also supporting Carrier Aggregation (CA). It manages the Random Access procedure (RAC) and the reception of Buffer Status Reports (BSRs) from UEs, as well as the transmission of scheduling grants to UEs allocated within the uplink bandwidth. For downlink connections, it notifies the Radio Link Control (RLC) layer when it is ready to receive MAC Service Data Units (SDUs) to build MAC Protocol Data Units (PDUs) and transmit them 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 |
|
rlcMuxModule |
string |
“^.rlcMux” |
Module references for accessing other stack layers |
bearerManagementModule |
string |
“^.rrc.bearerManagement” |
|
amcType |
string |
“NrAmc” |
AMC Type: “LteAmc”, “NrAmc” (the D2D NICs swap in the “LteAmcD2D”/”NrAmcD2D” leaves) |
amcMode |
string |
“AUTO” |
AMC pilot mode; supported values depend on the AMC implementation (LteAmc: “AUTO”, “D2D”) |
rbAllocationType |
string |
“localized” |
Resource allocation type (“distributed” or “localized”) |
summaryLowerBound |
double |
5ms |
Summary feedback confidence function lower bound |
summaryUpperBound |
double |
20ms |
Summary feedback confidence function upper bound |
fbhbCapacityDl |
int |
5 |
Feedback historical base capacity in DL (number of stored feedback samples per UE) |
fbhbCapacityUl |
int |
5 |
Feedback historical base capacity in UL (number of stored feedback samples per UE) |
cqiWeight |
double |
0.0 |
Wideband CQI generation parameter (0.0 means “use the mean value”) |
eNodeBCount |
int |
0 |
Number of eNodeBs - set to 0 if unknown |
schedulingDisciplineDl |
string |
“MAXCI” |
Scheduling discipline. See LteCommon.h for discipline meaning. ALLOCATOR_BESTFIT is the D2D frequency-reuse allocator: it is only constructible by the D2D uplink schedulers, so selecting it requires ulSchedulerType = LteSchedulerEnbUlD2D or NrSchedulerGnbUlD2D (and hence the Simu5G_D2D feature). Any other scheduler raises an error at setup. |
schedulingDisciplineUl |
string |
“MAXCI” |
|
ulSchedulerType |
string |
“NrSchedulerGnbUl” |
Scheduler Types |
dlSchedulerType |
string |
“LteSchedulerEnbDl” |
|
pfAlpha |
double |
0.95 |
Proportional Fair parameters |
pilotMode |
string |
“ROBUST_CQI” |
|
numPreambles |
int |
64 |
Number of RACH preambles available for contention-based random access |
cellInfoModule |
string |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
NrMacGnb |
|
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 |
|---|---|---|---|
avgServedBlocksDl |
|||
avgServedBlocksUl |
|||
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 |
|---|---|---|---|---|---|---|
avgServedBlocksDl |
Average number of allocated Resource Blocks in the Dl |
avgServedBlocksDl |
mean,vector |
blocks |
||
avgServedBlocksUl |
Average number of allocated Resource Blocks in the Dl |
avgServedBlocksUl |
mean,vector |
blocks |
||
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 gNodeB (gNB) side. In particular, it extends the
// ~LteMacEnb module by initializing the NR version of the uplink scheduler and
// using, by default, the NR version of the Adaptive Modulation and Coding (AMC) module.
//
module NrMacGnb extends LteMacEnb
{
parameters:
@class("NrMacGnb");
amcType = default("NrAmc");
harqProcesses = default(5);
ulSchedulerType = default("NrSchedulerGnbUl");
}