LteMacBase Class Reference¶
|
Simu5G
|
#include <LteMacBase.h>
Public Member Functions | |
| ~LteMacBase () override | |
| virtual void | deleteQueues (MacNodeId nodeId) |
| virtual void | deleteQueuesRadioLinkFailure (MacNodeId nodeId) |
| LogicalCid | drbIdToLcid (DrbId drbId) |
| DrbId | lcidToDrbId (LogicalCid lcid) |
| virtual MacCid | ctrlInfoToMacCid (const FlowControlInfo *info) |
| virtual void | sendUpperPackets (cPacket *pkt) |
| virtual void | createOutgoingConnection (MacCid cid, const FlowDescriptor &connInfo) |
| virtual void | deleteOutgoingConnection (MacCid cid) |
| virtual void | clearOutgoingConnectionBuffers (MacCid cid) |
| virtual void | createIncomingConnection (MacCid cid, const FlowDescriptor &connInfo) |
| virtual void | configureLogicalChannel (MacCid cid, const LogicalChannelConfig &cfg) |
| const LogicalChannelConfig * | findLogicalChannelConfig (MacCid cid) const |
| const LogicalChannelConfig & | getLogicalChannelConfig (MacCid cid) const |
Protected Member Functions | |
| void | initialize (int stage) override |
| void | handleMessage (cMessage *msg) override |
| void | deleteModule () override |
| virtual void | handleSelfMessage ()=0 |
| virtual void | sendLowerPackets (cPacket *pkt) |
| virtual bool | bufferizePacket (cPacket *pkt) |
| virtual void | handleUpperMessage (cPacket *pkt) |
| virtual void | macHandleFeedbackPkt (cPacket *pkt) |
| virtual void | fromRlc (cPacket *pkt) |
| Upper Layer Handler. | |
| virtual void | fromPhy (cPacket *pkt) |
| Lower Layer Handler. | |
| virtual LteHarqBufferRx * | createRxHarqBuffer (MacNodeId src, const UserControlInfo *userInfo) |
| virtual void | recordBufferOverflow (Direction dir, double sample) |
| Records the buffer-overflow statistic for a dropped packet of the given direction. | |
Protected Attributes | |
| cGate * | upOutGate_ = nullptr |
| MAC <– RLC. | |
| cGate * | downInGate_ = nullptr |
| MAC --> RLC. | |
| cGate * | downOutGate_ = nullptr |
| MAC <– PHY. | |
| int | harqProcesses_ |
| MAC --> PHY. | |
| cMessage * | ttiTick_ = nullptr |
| TTI self message. | |
| double | ttiPeriod_ = TTI |
| TTI for this node. | |
| MacNodeId | nodeId_ = NODEID_NONE |
| MacNodeId. | |
| MacCellId | cellId_ |
| MacCellId. | |
| unsigned int | queueSize_ |
| Mac Buffers maximum queue size. | |
| std::map< MacCid, OutgoingConnectionInfo > | connDescOut_ |
| Consolidated outgoing connection information (replaces mbuf_, macBuffers_, and connDesc_) | |
| std::map< GHz, MacPduList > | macPduList_ |
| List of pdus finalized for each user on each codeword (one entry per carrier) | |
| std::map< GHz, HarqTxBuffers > | harqTxBuffers_ |
| Harq Tx Buffers (one entry per carrier) | |
| std::map< GHz, HarqRxBuffers > | harqRxBuffers_ |
| Harq Rx Buffers (one entry per carrier) | |
| std::map< MacCid, LogicalChannelConfig > | lcConfig_ |
Detailed Description
MAC Layer.
This is the MAC layer of LTE Stack: it performs buffering/sending packets.
On each TTI, the handleSelfMessage() is called to perform scheduling and other tasks
Constructor & Destructor Documentation
◆ ~LteMacBase()
|
override |
Deletes MAC Buffers
Member Function Documentation
◆ deleteQueues()
|
virtual |
deleteQueues() must be called on handover to delete queues for a given user
- Parameters
-
nodeId Id of the node whose queues are deleted
Reimplemented in D2dEnbMacBase< LteMacEnb >, and D2dEnbMacBase< NrMacGnb >.
◆ deleteQueuesRadioLinkFailure()
|
virtual |
Tear down all MAC/HARQ/connection state for a node after an RLC-detected radio link failure (TS 38.322 5.3.2 / TS 36.322 5.2.1: indicate max retransmissions to upper layers). Marks HARQ reset so any in-flight feedback for the node is dropped this TTI (isHarqReset()), then calls the (virtual) deleteQueues(). Driven by BearerManagement::handleRadioLinkFailure.
◆ drbIdToLcid()
|
inline |
Maps a DRB ID to the corresponding Logical Channel ID. Currently a 1:1 mapping.
Referenced by ctrlInfoToMacCid().
◆ lcidToDrbId()
|
inline |
Maps a Logical Channel ID to the corresponding DRB ID. Currently a 1:1 mapping.
◆ ctrlInfoToMacCid()
|
inlinevirtual |
Extracts a MacCid from FlowControlInfo. Converts DrbId (from PDCP/RLC) to LogicalCid (MAC layer).
References drbIdToLcid().
◆ sendUpperPackets()
|
virtual |
sendUpperPackets() is used to send packets to upper layer
- Parameters
-
pkt Packet to send
◆ initialize()
|
overrideprotected |
Grabs NED parameters, initializes gates and the TTI self message
◆ handleMessage()
|
overrideprotected |
Analyze gate of incoming packet and call proper handler
◆ deleteModule()
|
overrideprotected |
Statistics recording Deleting the module
Method is overridden to cancel the periodic TTI self-message, afterwards the deleteModule method of cSimpleModule is called.
◆ handleSelfMessage()
|
protectedpure virtual |
Main loop of the Mac level, calls the scheduler and every other function every TTI: must be reimplemented by derived classes
◆ sendLowerPackets()
|
protectedvirtual |
sendLowerPackets() is used to send packets to lower layer
- Parameters
-
pkt Packet to send
◆ createOutgoingConnection()
|
virtual |
createOutgoingConnection() creates MAC queues and buffers for a given CID and registers the outgoing connection if they don't already exist
◆ deleteOutgoingConnection()
|
virtual |
deleteOutgoingConnection() deletes MAC queues and buffers for a given CID and unregisters the outgoing connection
- Parameters
-
cid Connection identifier to delete
- Exceptions
-
cRuntimeError if the connection does not exist
◆ clearOutgoingConnectionBuffers()
|
virtual |
clearOutgoingConnectionBuffers() empties the MAC queues and virtual buffers for a given CID without destroying the connection. Used during D2D mode switch to preserve the connection for potential mode switch back.
◆ createIncomingConnection()
|
virtual |
createIncomingConnection() registers an incoming connection for a given CID if it doesn't already exist
◆ configureLogicalChannel()
|
virtual |
configureLogicalChannel() records the RLC/logical-channel configuration of a channel (MacCid = remote node + LCID), as pushed by the configuring entity (RRC) at bearer establishment. Upsert: re-establishment re-pushes the same values.
◆ findLogicalChannelConfig()
|
inline |
findLogicalChannelConfig() returns the configuration pushed for a channel, or nullptr if the channel has none (e.g. a configured bearer that is not established yet).
References lcConfig_.
◆ getLogicalChannelConfig()
| const LogicalChannelConfig & getLogicalChannelConfig | ( | MacCid | cid | ) | const |
getLogicalChannelConfig() returns the configuration pushed for a channel.
- Exceptions
-
cRuntimeError if the channel has no configuration (a push path was missed)
◆ bufferizePacket()
|
protectedvirtual |
bufferizePacket() is called every time a packet is received from the upper layer
Referenced by handleUpperMessage().
◆ handleUpperMessage()
|
inlineprotectedvirtual |
handleUpperMessage() is called every time a packet is received from the upper layer
References bufferizePacket().
◆ macHandleFeedbackPkt()
|
inlineprotectedvirtual |
macHandleFeedbackPkt is called every time a feedback pkt arrives on MAC
◆ fromRlc()
|
protectedvirtual |
Upper Layer Handler.
◆ fromPhy()
|
protectedvirtual |
Lower Layer Handler.
Reimplemented in D2dEnbMacBase< LteMacEnb >, and D2dEnbMacBase< NrMacGnb >.
Referenced by D2dEnbMacBase< Base >::fromPhy().
◆ createRxHarqBuffer()
|
protectedvirtual |
Factory for the RX HARQ buffer created upon first reception from a node. The base implementation supports the DL and UL directions only.
Reimplemented in D2dEnbMacBase< LteMacEnb >, D2dEnbMacBase< NrMacGnb >, D2dUeMacBase< LteMacUe >, and D2dUeMacBase< NrMacUe >.
◆ recordBufferOverflow()
|
protectedvirtual |
Records the buffer-overflow statistic for a dropped packet of the given direction.
Reimplemented in D2dUeMacBase< LteMacUe >, and D2dUeMacBase< NrMacUe >.
Member Data Documentation
◆ upOutGate_
|
protected |
MAC <– RLC.
◆ downInGate_
|
protected |
MAC --> RLC.
◆ downOutGate_
|
protected |
MAC <– PHY.
◆ harqProcesses_
|
protected |
MAC --> PHY.
◆ ttiTick_
|
protected |
TTI self message.
◆ ttiPeriod_
|
protected |
TTI for this node.
◆ nodeId_
|
protected |
MacNodeId.
◆ cellId_
◆ queueSize_
|
protected |
Mac Buffers maximum queue size.
◆ connDescOut_
|
protected |
Consolidated outgoing connection information (replaces mbuf_, macBuffers_, and connDesc_)
◆ macPduList_
|
protected |
List of pdus finalized for each user on each codeword (one entry per carrier)
◆ harqTxBuffers_
|
protected |
Harq Tx Buffers (one entry per carrier)
◆ harqRxBuffers_
|
protected |
Harq Rx Buffers (one entry per carrier)
◆ lcConfig_
|
protected |
Per-channel RLC/logical-channel configuration pushed by the configuring entity (RRC) at bearer establishment; shared by the outgoing and incoming direction.
Referenced by findLogicalChannelConfig().
Generated by