A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-mac-sap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef LTE_MAC_SAP_H
10#define LTE_MAC_SAP_H
11
12#include <ns3/packet.h>
13
14namespace ns3
15{
16
17/**
18 * Service Access Point (SAP) offered by the MAC to the RLC
19 * See Femto Forum MAC Scheduler Interface Specification v 1.11, Figure 1
20 *
21 * This is the MAC SAP Provider, i.e., the part of the SAP that contains the MAC methods called by
22 * the RLC
23 */
25{
26 public:
27 virtual ~LteMacSapProvider();
28
29 /**
30 * Parameters for LteMacSapProvider::TransmitPdu
31 *
32 */
34 {
35 Ptr<Packet> pdu; /**< the RLC PDU */
36 uint16_t rnti; /**< the C-RNTI identifying the UE */
37 uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */
38 uint8_t layer; /**< the layer value that was passed by the MAC in the call to
39 NotifyTxOpportunity that generated this PDU */
40 uint8_t harqProcessId; /**< the HARQ process id that was passed by the MAC in the call to
41 NotifyTxOpportunity that generated this PDU */
42 uint8_t componentCarrierId; /**< the component carrier id corresponding to the sending Mac
43 instance */
44 };
45
46 /**
47 * send an RLC PDU to the MAC for transmission. This method is to be
48 * called as a response to LteMacSapUser::NotifyTxOpportunity
49 *
50 * \param params TransmitPduParameters
51 */
52 virtual void TransmitPdu(TransmitPduParameters params) = 0;
53
54 /**
55 * Parameters for LteMacSapProvider::ReportBufferStatus
56 */
58 {
59 uint16_t rnti; /**< the C-RNTI identifying the UE */
60 uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */
61 uint32_t txQueueSize; /**< the current size of the RLC transmission queue */
62 uint16_t txQueueHolDelay; /**< the Head Of Line delay of the transmission queue */
63 uint32_t retxQueueSize; /**< the current size of the RLC retransmission queue in bytes */
64 uint16_t retxQueueHolDelay; /**< the Head Of Line delay of the retransmission queue */
65 uint16_t
66 statusPduSize; /**< the current size of the pending STATUS RLC PDU message in bytes */
67 };
68
69 /**
70 * Report the RLC buffer status to the MAC
71 *
72 * \param params ReportBufferStatusParameters
73 */
75};
76
77/**
78 * Service Access Point (SAP) offered by the MAC to the RLC
79 * See Femto Forum MAC Scheduler Interface Specification v 1.11, Figure 1
80 *
81 * This is the MAC SAP User, i.e., the part of the SAP that contains the RLC methods called by the
82 * MAC
83 */
85{
86 public:
87 virtual ~LteMacSapUser();
88
89 /**
90 * Parameters for LteMacSapUser::NotifyTxOpportunity
91 *
92 */
94 {
95 /**
96 * \brief TxOpportunityParameters constructor
97 * \param bytes Bytes
98 * \param layer Layer
99 * \param harqId HarqID
100 * \param ccId Component carrier ID
101 * \param rnti RNTI
102 * \param lcId Logical Channel ID
103 */
105 uint8_t layer,
106 uint8_t harqId,
107 uint8_t ccId,
108 uint16_t rnti,
109 uint8_t lcId)
110 {
111 this->bytes = bytes;
112 this->layer = layer;
113 this->harqId = harqId;
114 this->componentCarrierId = ccId;
115 this->rnti = rnti;
116 this->lcid = lcId;
117 }
118
119 /**
120 * \brief TxOpportunityParameters default constructor (DEPRECATED)
121 */
125
126 uint32_t bytes; /**< the number of bytes to transmit */
127 uint8_t layer; /**< the layer of transmission (MIMO) */
128 uint8_t harqId; /**< the HARQ ID */
129 uint8_t componentCarrierId; /**< the component carrier id */
130 uint16_t rnti; /**< the C-RNTI identifying the UE */
131 uint8_t lcid; /**< the logical channel id */
132 };
133
134 /**
135 * Called by the MAC to notify the RLC that the scheduler granted a
136 * transmission opportunity to this RLC instance.
137 *
138 * \param params the TxOpportunityParameters
139 */
141
142 /**
143 * Called by the MAC to notify the RLC that an HARQ process related
144 * to this RLC instance has failed
145 *
146 * @todo eventual parameters to be defined
147 */
148 virtual void NotifyHarqDeliveryFailure() = 0;
149
150 /**
151 * Parameters for LteMacSapUser::ReceivePdu
152 *
153 */
155 {
156 /**
157 * \brief ReceivePduParameters default constructor (DEPRECATED)
158 */
160 {
161 }
162
163 /**
164 * \brief ReceivePduParameters constructor
165 * \param p Packet
166 * \param rnti RNTI
167 * \param lcid Logical Channel ID
168 */
169 ReceivePduParameters(const Ptr<Packet>& p, uint16_t rnti, uint8_t lcid)
170 {
171 this->p = p;
172 this->rnti = rnti;
173 this->lcid = lcid;
174 }
175
176 Ptr<Packet> p; /**< the RLC PDU to be received */
177 uint16_t rnti; /**< the C-RNTI identifying the UE */
178 uint8_t lcid; /**< the logical channel id */
179 };
180
181 /**
182 * Called by the MAC to notify the RLC of the reception of a new PDU
183 *
184 * \param params the ReceivePduParameters
185 */
186 virtual void ReceivePdu(ReceivePduParameters params) = 0;
187};
188
189/// EnbMacMemberLteMacSapProvider class
190template <class C>
192{
193 public:
194 /**
195 * Constructor
196 *
197 * \param mac the MAC class
198 */
200
201 // inherited from LteMacSapProvider
202 void TransmitPdu(TransmitPduParameters params) override;
204
205 private:
206 C* m_mac; ///< the MAC class
207};
208
209template <class C>
214
215template <class C>
216void
218{
219 m_mac->DoTransmitPdu(params);
220}
221
222template <class C>
223void
225{
226 m_mac->DoReportBufferStatus(params);
227}
228
229} // namespace ns3
230
231#endif // LTE_MAC_SAP_H
EnbMacMemberLteMacSapProvider class.
void ReportBufferStatus(ReportBufferStatusParameters params) override
Report the RLC buffer status to the MAC.
EnbMacMemberLteMacSapProvider(C *mac)
Constructor.
void TransmitPdu(TransmitPduParameters params) override
send an RLC PDU to the MAC for transmission.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:25
virtual void TransmitPdu(TransmitPduParameters params)=0
send an RLC PDU to the MAC for transmission.
virtual void ReportBufferStatus(ReportBufferStatusParameters params)=0
Report the RLC buffer status to the MAC.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition lte-mac-sap.h:85
virtual void NotifyTxOpportunity(TxOpportunityParameters params)=0
Called by the MAC to notify the RLC that the scheduler granted a transmission opportunity to this RLC...
virtual ~LteMacSapUser()
virtual void NotifyHarqDeliveryFailure()=0
Called by the MAC to notify the RLC that an HARQ process related to this RLC instance has failed.
virtual void ReceivePdu(ReceivePduParameters params)=0
Called by the MAC to notify the RLC of the reception of a new PDU.
Smart pointer class similar to boost::intrusive_ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition lte-mac-sap.h:58
uint32_t txQueueSize
the current size of the RLC transmission queue
Definition lte-mac-sap.h:61
uint16_t retxQueueHolDelay
the Head Of Line delay of the retransmission queue
Definition lte-mac-sap.h:64
uint16_t txQueueHolDelay
the Head Of Line delay of the transmission queue
Definition lte-mac-sap.h:62
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
Definition lte-mac-sap.h:63
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition lte-mac-sap.h:60
uint16_t rnti
the C-RNTI identifying the UE
Definition lte-mac-sap.h:59
uint16_t statusPduSize
the current size of the pending STATUS RLC PDU message in bytes
Definition lte-mac-sap.h:66
Parameters for LteMacSapProvider::TransmitPdu.
Definition lte-mac-sap.h:34
uint16_t rnti
the C-RNTI identifying the UE
Definition lte-mac-sap.h:36
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition lte-mac-sap.h:37
uint8_t componentCarrierId
the component carrier id corresponding to the sending Mac instance
Definition lte-mac-sap.h:42
uint8_t harqProcessId
the HARQ process id that was passed by the MAC in the call to NotifyTxOpportunity that generated this...
Definition lte-mac-sap.h:40
uint8_t layer
the layer value that was passed by the MAC in the call to NotifyTxOpportunity that generated this PDU
Definition lte-mac-sap.h:38
Parameters for LteMacSapUser::ReceivePdu.
Ptr< Packet > p
the RLC PDU to be received
uint8_t lcid
the logical channel id
ReceivePduParameters()
ReceivePduParameters default constructor (DEPRECATED)
uint16_t rnti
the C-RNTI identifying the UE
ReceivePduParameters(const Ptr< Packet > &p, uint16_t rnti, uint8_t lcid)
ReceivePduParameters constructor.
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition lte-mac-sap.h:94
uint16_t rnti
the C-RNTI identifying the UE
uint32_t bytes
the number of bytes to transmit
uint8_t componentCarrierId
the component carrier id
uint8_t layer
the layer of transmission (MIMO)
TxOpportunityParameters(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t ccId, uint16_t rnti, uint8_t lcId)
TxOpportunityParameters constructor.
uint8_t lcid
the logical channel id
TxOpportunityParameters()
TxOpportunityParameters default constructor (DEPRECATED)