A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-mac.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 * Author: Marco Miozzo <mmiozzo@cttc.es>
19 */
20
21#ifndef LTE_UE_MAC_ENTITY_H
22#define LTE_UE_MAC_ENTITY_H
23
24#include "ff-mac-common.h"
25#include "lte-mac-sap.h"
26#include "lte-ue-cmac-sap.h"
27#include "lte-ue-phy-sap.h"
28
29#include <ns3/event-id.h>
30#include <ns3/nstime.h>
31#include <ns3/packet-burst.h>
32#include <ns3/packet.h>
33#include <ns3/traced-callback.h>
34
35#include <map>
36#include <vector>
37
38namespace ns3
39{
40
41class UniformRandomVariable;
42
43class LteUeMac : public Object
44{
51
52 public:
57 static TypeId GetTypeId();
58
59 LteUeMac();
60 ~LteUeMac() override;
61 void DoDispose() override;
62
73 typedef void (*RaResponseTimeoutTracedCallback)(uint64_t imsi,
74 bool contention,
75 uint8_t preambleTxCounter,
76 uint8_t maxPreambleTxLimit);
77
93
98 void SetComponentCarrierId(uint8_t index);
99
105
111
118 void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo);
119
128 int64_t AssignStreams(int64_t stream);
129
130 private:
131 // forwarded from MAC SAP
144
145 // forwarded from UE CMAC SAP
161 void DoSetRnti(uint16_t rnti);
170 uint8_t rapId,
171 uint8_t prachMask);
179 void DoAddLc(uint8_t lcId,
181 LteMacSapUser* msu);
187 void DoRemoveLc(uint8_t lcId);
191 void DoReset();
202 void DoSetImsi(uint64_t imsi);
203
204 // forwarded from PHY SAP
217
218 // internal methods
226 void SendRaPreamble(bool contention);
234 void RecvRaResponse(BuildRarListElement_s raResponse);
240 void RaResponseTimeout(bool contention);
245
248
249 private:
251 struct LcInfo
252 {
255 };
256
257 std::map<uint8_t, LcInfo> m_lcInfoMap;
258
260
263
266
267 std::map<uint8_t, LteMacSapProvider::ReportBufferStatusParameters>
269
272
274
276 std::vector<Ptr<PacketBurst>>
278 std::vector<uint8_t> m_miUlHarqProcessesPacketTimer;
279
280 uint16_t m_rnti;
281 uint16_t m_imsi;
282
290
293 uint8_t m_raRnti;
295
302};
303
304} // namespace ns3
305
306#endif // LTE_UE_MAC_ENTITY
An identifier for simulation events.
Definition: event-id.h:55
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:36
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:96
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
Service Access Point (SAP) offered by the UE MAC to the UE RRC.
uint8_t m_raRnti
RA RNTI.
Definition: lte-ue-mac.h:293
std::vector< Ptr< PacketBurst > > m_miUlHarqProcessesPacket
Packets under transmission of the UL HARQ processes.
Definition: lte-ue-mac.h:277
LteUePhySapUser * m_uePhySapUser
UE Phy SAP user.
Definition: lte-ue-mac.h:265
uint8_t m_componentCarrierId
component carrier Id --> used to address sap
Definition: lte-ue-mac.h:247
void RaResponseTimeout(bool contention)
RA response timeout function.
Definition: lte-ue-mac.cc:491
LteUeCmacSapProvider::RachConfig m_rachConfig
RACH configuration.
Definition: lte-ue-mac.h:284
uint32_t m_frameNo
frame number
Definition: lte-ue-mac.h:291
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Forwarded from LteUePhySapUser: trigger the start from a new frame.
Definition: lte-ue-mac.cc:917
void SendReportBufferStatus()
Send report buffer status.
Definition: lte-ue-mac.cc:354
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report buffers status function.
Definition: lte-ue-mac.cc:332
TracedCallback< uint64_t, bool, uint8_t, uint8_t > m_raResponseTimeoutTrace
The RaResponseTimeout trace source.
Definition: lte-ue-mac.h:301
LteUePhySapProvider * m_uePhySapProvider
UE Phy SAP provider.
Definition: lte-ue-mac.h:264
void SetLteUePhySapProvider(LteUePhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-ue-mac.cc:289
Time m_bsrPeriodicity
BSR periodicity.
Definition: lte-ue-mac.h:270
void RefreshHarqProcessesPacketBuffer()
Refresh HARQ processes packet buffer function.
Definition: lte-ue-mac.cc:893
uint16_t m_imsi
IMSI.
Definition: lte-ue-mac.h:281
EventId m_noRaResponseReceivedEvent
no RA response received event ID
Definition: lte-ue-mac.h:288
LteUeCmacSapProvider * m_cmacSapProvider
CMAC SAP provider.
Definition: lte-ue-mac.h:262
uint8_t m_preambleTransmissionCounter
preamble tranamission counter
Definition: lte-ue-mac.h:286
Ptr< UniformRandomVariable > m_raPreambleUniformVariable
RA preamble random variable.
Definition: lte-ue-mac.h:289
void SetComponentCarrierId(uint8_t index)
Set the component carried ID.
Definition: lte-ue-mac.cc:313
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: lte-ue-mac.cc:937
void DoConfigureRach(LteUeCmacSapProvider::RachConfig rc)
Configure RACH function.
Definition: lte-ue-mac.cc:522
LteUePhySapUser * GetLteUePhySapUser()
Get the PHY SAP user.
Definition: lte-ue-mac.cc:283
bool m_rachConfigured
is RACH configured?
Definition: lte-ue-mac.h:283
void DoRemoveLc(uint8_t lcId)
Remove LC function.
Definition: lte-ue-mac.cc:587
void RecvRaResponse(BuildRarListElement_s raResponse)
Receive the RA response function.
Definition: lte-ue-mac.cc:448
void DoReceivePhyPdu(Ptr< Packet > p)
Receive Phy PDU function.
Definition: lte-ue-mac.cc:629
uint8_t m_raPreambleId
RA preamble ID.
Definition: lte-ue-mac.h:285
void DoNotifyConnectionSuccessful()
Notify MAC about the successful RRC connection establishment.
Definition: lte-ue-mac.cc:622
Time m_bsrLast
BSR last.
Definition: lte-ue-mac.h:271
std::vector< uint8_t > m_miUlHarqProcessesPacketTimer
timer for packet life in the buffer
Definition: lte-ue-mac.h:278
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive LTE control message function.
Definition: lte-ue-mac.cc:653
uint16_t m_rnti
RNTI.
Definition: lte-ue-mac.h:280
static TypeId GetTypeId()
Get the type ID.
Definition: lte-ue-mac.cc:223
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU function.
Definition: lte-ue-mac.cc:319
uint32_t m_subframeNo
subframe number
Definition: lte-ue-mac.h:292
std::map< uint8_t, LteMacSapProvider::ReportBufferStatusParameters > m_ulBsrReceived
BSR received from RLC (the last one)
Definition: lte-ue-mac.h:268
void DoDispose() override
Destructor implementation.
Definition: lte-ue-mac.cc:272
void DoReset()
Reset function.
Definition: lte-ue-mac.cc:596
~LteUeMac() override
Definition: lte-ue-mac.cc:266
LteUeCmacSapUser * m_cmacSapUser
CMAC SAP user.
Definition: lte-ue-mac.h:261
bool m_freshUlBsr
true when a BSR has been received in the last TTI
Definition: lte-ue-mac.h:273
LteMacSapProvider * GetLteMacSapProvider()
Get the LTE MAC SAP provider.
Definition: lte-ue-mac.cc:295
void DoStartNonContentionBasedRandomAccessProcedure(uint16_t rnti, uint8_t rapId, uint8_t prachMask)
Start non contention based random access procedure function.
Definition: lte-ue-mac.cc:556
LteUeCmacSapProvider * GetLteUeCmacSapProvider()
Get the LTE CMAC SAP provider.
Definition: lte-ue-mac.cc:307
bool m_waitingForRaResponse
waiting for RA response
Definition: lte-ue-mac.h:294
void DoAddLc(uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)
Add LC function.
Definition: lte-ue-mac.cc:572
uint8_t m_harqProcessId
HARQ process ID.
Definition: lte-ue-mac.h:275
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
Definition: lte-ue-mac.h:259
void RandomlySelectAndSendRaPreamble()
Randomly select and send RA preamble function.
Definition: lte-ue-mac.cc:404
void DoStartContentionBasedRandomAccessProcedure()
Start contention based random access procedure function.
Definition: lte-ue-mac.cc:530
void(* RaResponseTimeoutTracedCallback)(uint64_t imsi, bool contention, uint8_t preambleTxCounter, uint8_t maxPreambleTxLimit)
TracedCallback signature for RA response timeout events exporting IMSI, contention flag,...
Definition: lte-ue-mac.h:73
uint16_t m_backoffParameter
backoff parameter
Definition: lte-ue-mac.h:287
void StartWaitingForRaResponse()
Start waiting for RA response function.
Definition: lte-ue-mac.cc:441
void DoSetRnti(uint16_t rnti)
Set RNTI.
Definition: lte-ue-mac.cc:542
void DoSetImsi(uint64_t imsi)
Set IMSI.
Definition: lte-ue-mac.cc:549
void SendRaPreamble(bool contention)
Send RA preamble function.
Definition: lte-ue-mac.cc:417
void SetLteUeCmacSapUser(LteUeCmacSapUser *s)
Set the LTE UE CMAC SAP user.
Definition: lte-ue-mac.cc:301
std::map< uint8_t, LcInfo > m_lcInfoMap
logical channel info map
Definition: lte-ue-mac.h:257
Service Access Point (SAP) offered by the UE-PHY to the UE-MAC.
Service Access Point (SAP) offered by the PHY to the MAC.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
UeMemberLteMacSapProvider class.
Definition: lte-ue-mac.cc:139
UeMemberLteUeCmacSapProvider class.
Definition: lte-ue-mac.cc:48
UeMemberLteUePhySapUser.
Definition: lte-ue-mac.cc:177
Every class exported by the ns3 library is enclosed in the ns3 namespace.
See section 4.3.10 buildRARListElement.
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:69
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45
LcInfo structure.
Definition: lte-ue-mac.h:252
LteUeCmacSapProvider::LogicalChannelConfig lcConfig
logical channel config
Definition: lte-ue-mac.h:253
LteMacSapUser * macSapUser
MAC SAP user.
Definition: lte-ue-mac.h:254