Package: simu5g.stack.mac
LteMacEnb
compound moduleExtends 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.
Usage diagram
The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Known subclasses
| Name | Type | Description |
|---|---|---|
| LteMacEnbD2D | compound module |
Extends LTE MAC functionalities at the eNodeB side to support device-to-device (D2D) communications. Specifically, it enhances resource allocation procedures to enable direct communication between User Equipments (UEs), i.e., it allocates resources for D2D transmissions. Network-assisted D2D is only implemented (out-of-coverage D2D is not supported). |
| NrMacGnb | compound module |
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. |
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 | |
| harqProcesses | int | 8 | |
| 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 | "LteAmc" |
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 | "LteSchedulerEnbUl" |
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 |
|---|---|---|
| display | i=block/mac | |
| class | LteMacEnb |
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 | |||
| avgServedBlocksDl | |||
| avgServedBlocksUl |
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 | |||
| 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 |
Source code
// // 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. // module LteMacEnb extends LteMacBase { parameters: @class("LteMacEnb"); // Module references for accessing other stack layers string rlcMuxModule = default("^.rlcMux"); string bearerManagementModule = default("^.rrc.bearerManagement"); //# volatile xml optSolution = default(xmldoc("solution.sol")); //# AMC Parameters // AMC Type: "LteAmc", "NrAmc" (the D2D NICs swap in the "LteAmcD2D"/"NrAmcD2D" leaves) string amcType @enum(LteAmc,NrAmc,LteAmcD2D,NrAmcD2D) = default("LteAmc"); // AMC pilot mode; supported values depend on the AMC implementation (LteAmc: "AUTO", "D2D") string amcMode = default("AUTO"); // Resource allocation type ("distributed" or "localized") string rbAllocationType @enum(distributed,localized) = default("localized"); // Summary feedback confidence function lower bound double summaryLowerBound @unit(s) = default(5ms); // Summary feedback confidence function upper bound double summaryUpperBound @unit(s) = default(20ms); // Feedback historical base capacity in DL (number of stored feedback samples per UE) int fbhbCapacityDl = default(5); // Feedback historical base capacity in UL (number of stored feedback samples per UE) int fbhbCapacityUl = default(5); // Wideband CQI generation parameter (0.0 means "use the mean value") double cqiWeight = default(0.0); // Number of eNodeBs - set to 0 if unknown int eNodeBCount = default(0); //# eNB scheduler parameters // 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. string schedulingDisciplineDl @enum(DRR,PF,MAXCI,MAXCI_MB,MAXCI_OPT_MB,MAXCI_COMP,ALLOCATOR_BESTFIT,QOS_PF) = default("MAXCI"); string schedulingDisciplineUl @enum(DRR,PF,MAXCI,MAXCI_MB,MAXCI_OPT_MB,MAXCI_COMP,ALLOCATOR_BESTFIT,QOS_PF) = default("MAXCI"); // Scheduler Types string ulSchedulerType @enum(LteSchedulerEnbUl,NrSchedulerGnbUl,LteSchedulerEnbUlD2D,NrSchedulerGnbUlD2D) = default("LteSchedulerEnbUl"); string dlSchedulerType @enum(LteSchedulerEnbDl) = default("LteSchedulerEnbDl"); // Proportional Fair parameters double pfAlpha = default(0.95); string pilotMode @enum(IN_CQI,MAX_CQI,AVG_CQI,MEDIAN_CQI,ROBUST_CQI) = default("ROBUST_CQI"); int numPreambles = default(64); // Number of RACH preambles available for contention-based random access string cellInfoModule; //# Statistics related to resource blocks occupancy @signal[avgServedBlocksDl]; @statistic[avgServedBlocksDl](title="Average number of allocated Resource Blocks in the Dl"; unit="blocks"; source="avgServedBlocksDl"; record=mean,vector); @signal[avgServedBlocksUl]; @statistic[avgServedBlocksUl](title="Average number of allocated Resource Blocks in the Dl"; unit="blocks"; source="avgServedBlocksUl"; record=mean,vector); submodules: amc: <amcType> like ILteAmc { @display("p=60,140"); } schedulerDl: <dlSchedulerType> like ILteSchedulerEnbDl { @display("p=60,60"); } schedulerUl: <ulSchedulerType> like ILteSchedulerEnbUl { @display("p=180,60"); } }File: src/simu5g/stack/mac/LteMacEnb.ned