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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef LTE_MAC_SAP_H
21#define LTE_MAC_SAP_H
22
23#include <ns3/packet.h>
24
25namespace ns3
26{
27
28/**
29 * Service Access Point (SAP) offered by the MAC to the RLC
30 * See Femto Forum MAC Scheduler Interface Specification v 1.11, Figure 1
31 *
32 * This is the MAC SAP Provider, i.e., the part of the SAP that contains the MAC methods called by
33 * the RLC
34 */
36{
37 public:
38 virtual ~LteMacSapProvider();
39
40 /**
41 * Parameters for LteMacSapProvider::TransmitPdu
42 *
43 */
45 {
46 Ptr<Packet> pdu; /**< the RLC PDU */
47 uint16_t rnti; /**< the C-RNTI identifying the UE */
48 uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */
49 uint8_t layer; /**< the layer value that was passed by the MAC in the call to
50 NotifyTxOpportunity that generated this PDU */
51 uint8_t harqProcessId; /**< the HARQ process id that was passed by the MAC in the call to
52 NotifyTxOpportunity that generated this PDU */
53 uint8_t componentCarrierId; /**< the component carrier id corresponding to the sending Mac
54 instance */
55 };
56
57 /**
58 * send an RLC PDU to the MAC for transmission. This method is to be
59 * called as a response to LteMacSapUser::NotifyTxOpportunity
60 *
61 * \param params TransmitPduParameters
62 */
63 virtual void TransmitPdu(TransmitPduParameters params) = 0;
64
65 /**
66 * Parameters for LteMacSapProvider::ReportBufferStatus
67 */
69 {
70 uint16_t rnti; /**< the C-RNTI identifying the UE */
71 uint8_t lcid; /**< the logical channel id corresponding to the sending RLC instance */
72 uint32_t txQueueSize; /**< the current size of the RLC transmission queue */
73 uint16_t txQueueHolDelay; /**< the Head Of Line delay of the transmission queue */
74 uint32_t retxQueueSize; /**< the current size of the RLC retransmission queue in bytes */
75 uint16_t retxQueueHolDelay; /**< the Head Of Line delay of the retransmission queue */
76 uint16_t
77 statusPduSize; /**< the current size of the pending STATUS RLC PDU message in bytes */
78 };
79
80 /**
81 * Report the RLC buffer status to the MAC
82 *
83 * \param params ReportBufferStatusParameters
84 */
86};
87
88/**
89 * Service Access Point (SAP) offered by the MAC to the RLC
90 * See Femto Forum MAC Scheduler Interface Specification v 1.11, Figure 1
91 *
92 * This is the MAC SAP User, i.e., the part of the SAP that contains the RLC methods called by the
93 * MAC
94 */
96{
97 public:
98 virtual ~LteMacSapUser();
99
100 /**
101 * Parameters for LteMacSapUser::NotifyTxOpportunity
102 *
103 */
105 {
106 /**
107 * \brief TxOpportunityParameters constructor
108 * \param bytes Bytes
109 * \param layer Layer
110 * \param harqId HarqID
111 * \param ccId Component carrier ID
112 * \param rnti RNTI
113 * \param lcId Logical Channel ID
114 */
116 uint8_t layer,
117 uint8_t harqId,
118 uint8_t ccId,
119 uint16_t rnti,
120 uint8_t lcId)
121 {
122 this->bytes = bytes;
123 this->layer = layer;
124 this->harqId = harqId;
125 this->componentCarrierId = ccId;
126 this->rnti = rnti;
127 this->lcid = lcId;
128 }
129
130 /**
131 * \brief TxOpportunityParameters default constructor (DEPRECATED)
132 */
134 {
135 }
136
137 uint32_t bytes; /**< the number of bytes to transmit */
138 uint8_t layer; /**< the layer of transmission (MIMO) */
139 uint8_t harqId; /**< the HARQ ID */
140 uint8_t componentCarrierId; /**< the component carrier id */
141 uint16_t rnti; /**< the C-RNTI identifying the UE */
142 uint8_t lcid; /**< the logical channel id */
143 };
144
145 /**
146 * Called by the MAC to notify the RLC that the scheduler granted a
147 * transmission opportunity to this RLC instance.
148 *
149 * \param params the TxOpportunityParameters
150 */
152
153 /**
154 * Called by the MAC to notify the RLC that an HARQ process related
155 * to this RLC instance has failed
156 *
157 * @todo eventual parameters to be defined
158 */
159 virtual void NotifyHarqDeliveryFailure() = 0;
160
161 /**
162 * Parameters for LteMacSapUser::ReceivePdu
163 *
164 */
166 {
167 /**
168 * \brief ReceivePduParameters default constructor (DEPRECATED)
169 */
171 {
172 }
173
174 /**
175 * \brief ReceivePduParameters constructor
176 * \param p Packet
177 * \param rnti RNTI
178 * \param lcid Logical Channel ID
179 */
180 ReceivePduParameters(const Ptr<Packet>& p, uint16_t rnti, uint8_t lcid)
181 {
182 this->p = p;
183 this->rnti = rnti;
184 this->lcid = lcid;
185 }
186
187 Ptr<Packet> p; /**< the RLC PDU to be received */
188 uint16_t rnti; /**< the C-RNTI identifying the UE */
189 uint8_t lcid; /**< the logical channel id */
190 };
191
192 /**
193 * Called by the MAC to notify the RLC of the reception of a new PDU
194 *
195 * \param params the ReceivePduParameters
196 */
197 virtual void ReceivePdu(ReceivePduParameters params) = 0;
198};
199
200/// EnbMacMemberLteMacSapProvider class
201template <class C>
203{
204 public:
205 /**
206 * Constructor
207 *
208 * \param mac the MAC class
209 */
211
212 // inherited from LteMacSapProvider
213 void TransmitPdu(TransmitPduParameters params) override;
215
216 private:
217 C* m_mac; ///< the MAC class
218};
219
220template <class C>
222 : m_mac(mac)
223{
224}
225
226template <class C>
227void
229{
230 m_mac->DoTransmitPdu(params);
231}
232
233template <class C>
234void
236{
237 m_mac->DoReportBufferStatus(params);
238}
239
240} // namespace ns3
241
242#endif // LTE_MAC_SAP_H
EnbMacMemberLteMacSapProvider class.
Definition: lte-mac-sap.h:203
void ReportBufferStatus(ReportBufferStatusParameters params) override
Report the RLC buffer status to the MAC.
Definition: lte-mac-sap.h:235
EnbMacMemberLteMacSapProvider(C *mac)
Constructor.
Definition: lte-mac-sap.h:221
void TransmitPdu(TransmitPduParameters params) override
send an RLC PDU to the MAC for transmission.
Definition: lte-mac-sap.h:228
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
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.
virtual ~LteMacSapProvider()
Definition: lte-mac-sap.cc:25
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
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()
Definition: lte-mac-sap.cc:29
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.
Definition: ptr.h:77
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:69
uint32_t txQueueSize
the current size of the RLC transmission queue
Definition: lte-mac-sap.h:72
uint16_t retxQueueHolDelay
the Head Of Line delay of the retransmission queue
Definition: lte-mac-sap.h:75
uint16_t txQueueHolDelay
the Head Of Line delay of the transmission queue
Definition: lte-mac-sap.h:73
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
Definition: lte-mac-sap.h:74
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-mac-sap.h:71
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:70
uint16_t statusPduSize
the current size of the pending STATUS RLC PDU message in bytes
Definition: lte-mac-sap.h:77
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:47
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-mac-sap.h:48
uint8_t componentCarrierId
the component carrier id corresponding to the sending Mac instance
Definition: lte-mac-sap.h:53
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:51
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:49
Parameters for LteMacSapUser::ReceivePdu.
Definition: lte-mac-sap.h:166
Ptr< Packet > p
the RLC PDU to be received
Definition: lte-mac-sap.h:187
uint8_t lcid
the logical channel id
Definition: lte-mac-sap.h:189
ReceivePduParameters()
ReceivePduParameters default constructor (DEPRECATED)
Definition: lte-mac-sap.h:170
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:188
ReceivePduParameters(const Ptr< Packet > &p, uint16_t rnti, uint8_t lcid)
ReceivePduParameters constructor.
Definition: lte-mac-sap.h:180
Parameters for LteMacSapUser::NotifyTxOpportunity.
Definition: lte-mac-sap.h:105
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:141
uint32_t bytes
the number of bytes to transmit
Definition: lte-mac-sap.h:137
uint8_t componentCarrierId
the component carrier id
Definition: lte-mac-sap.h:140
uint8_t layer
the layer of transmission (MIMO)
Definition: lte-mac-sap.h:138
TxOpportunityParameters(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t ccId, uint16_t rnti, uint8_t lcId)
TxOpportunityParameters constructor.
Definition: lte-mac-sap.h:115
uint8_t lcid
the logical channel id
Definition: lte-mac-sap.h:142
TxOpportunityParameters()
TxOpportunityParameters default constructor (DEPRECATED)
Definition: lte-mac-sap.h:133