A Discrete-Event Network Simulator
API
lte-ue-mac.h
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Nicola Baldo <nbaldo@cttc.es>
19 * Author: Marco Miozzo <mmiozzo@cttc.es>
20 */
21
22#ifndef LTE_UE_MAC_ENTITY_H
23#define LTE_UE_MAC_ENTITY_H
24
25
26
27#include <map>
28
29#include <ns3/lte-mac-sap.h>
30#include <ns3/lte-ue-cmac-sap.h>
31#include <ns3/lte-ue-phy-sap.h>
32#include <ns3/nstime.h>
33#include <ns3/event-id.h>
34#include <vector>
35#include <ns3/packet.h>
36#include <ns3/packet-burst.h>
37#include <ns3/traced-callback.h>
38
39
40namespace ns3 {
41
42class UniformRandomVariable;
43
44class LteUeMac : public Object
45{
52
53public:
58 static TypeId GetTypeId (void);
59
60 LteUeMac ();
61 virtual ~LteUeMac ();
62 virtual void DoDispose (void);
63
75 (uint64_t imsi, bool contention, uint8_t preambleTxCounter, uint8_t maxPreambleTxLimit);
76
92
97 void SetComponentCarrierId (uint8_t index);
98
104
110
117 void DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo);
118
127 int64_t AssignStreams (int64_t stream);
128
129private:
130 // forwarded from MAC SAP
143
144 // forwarded from UE CMAC SAP
160 void DoSetRnti (uint16_t rnti);
168 void DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t rapId, uint8_t prachMask);
176 void DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu);
182 void DoRemoveLc (uint8_t lcId);
186 void DoReset ();
197 void DoSetImsi (uint64_t imsi);
198
199 // forwarded from PHY SAP
212
213 // internal methods
221 void SendRaPreamble (bool contention);
229 void RecvRaResponse (BuildRarListElement_s raResponse);
235 void RaResponseTimeout (bool contention);
237 void SendReportBufferStatus (void);
240
243
244private:
245
247 struct LcInfo
248 {
251 };
252
253 std::map <uint8_t, LcInfo> m_lcInfoMap;
254
256
259
262
263 std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters> m_ulBsrReceived;
264
265
268
270
272 std::vector < Ptr<PacketBurst> > m_miUlHarqProcessesPacket;
273 std::vector < uint8_t > m_miUlHarqProcessesPacketTimer;
274
275 uint16_t m_rnti;
276 uint16_t m_imsi;
277
285
288 uint8_t m_raRnti;
290
297};
298
299} // namespace ns3
300
301#endif // LTE_UE_MAC_ENTITY
An identifier for simulation events.
Definition: event-id.h:54
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:37
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:288
LteUePhySapUser * m_uePhySapUser
UE Phy SAP user.
Definition: lte-ue-mac.h:261
uint8_t m_componentCarrierId
component carrier Id --> used to address sap
Definition: lte-ue-mac.h:242
std::vector< uint8_t > m_miUlHarqProcessesPacketTimer
timer for packet life in the buffer
Definition: lte-ue-mac.h:273
void RaResponseTimeout(bool contention)
RA response timeout function.
Definition: lte-ue-mac.cc:501
LteUeCmacSapProvider::RachConfig m_rachConfig
RACH configuration.
Definition: lte-ue-mac.h:279
uint32_t m_frameNo
frame number
Definition: lte-ue-mac.h:286
void DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Forwarded from LteUePhySapUser: trigger the start from a new frame.
Definition: lte-ue-mac.cc:898
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report buffers status function.
Definition: lte-ue-mac.cc:345
TracedCallback< uint64_t, bool, uint8_t, uint8_t > m_raResponseTimeoutTrace
The RaResponseTimeout trace source.
Definition: lte-ue-mac.h:296
LteUePhySapProvider * m_uePhySapProvider
UE Phy SAP provider.
Definition: lte-ue-mac.h:260
void SetLteUePhySapProvider(LteUePhySapProvider *s)
Set the PHY SAP Provider.
Definition: lte-ue-mac.cc:301
Time m_bsrPeriodicity
BSR periodicity.
Definition: lte-ue-mac.h:266
uint16_t m_imsi
IMSI.
Definition: lte-ue-mac.h:276
EventId m_noRaResponseReceivedEvent
no RA response received event ID
Definition: lte-ue-mac.h:283
static TypeId GetTypeId(void)
Get the type ID.
Definition: lte-ue-mac.cc:233
LteUeCmacSapProvider * m_cmacSapProvider
CMAC SAP provider.
Definition: lte-ue-mac.h:258
uint8_t m_preambleTransmissionCounter
preamble tranamission counter
Definition: lte-ue-mac.h:281
LteMacSapProvider * GetLteMacSapProvider(void)
Get the LTE MAC SAP provider.
Definition: lte-ue-mac.cc:308
Ptr< UniformRandomVariable > m_raPreambleUniformVariable
RA preamble random variable.
Definition: lte-ue-mac.h:284
void RefreshHarqProcessesPacketBuffer(void)
Refresh HARQ processes packet buffer function.
Definition: lte-ue-mac.cc:873
void SetComponentCarrierId(uint8_t index)
Set the component carried ID.
Definition: lte-ue-mac.cc:326
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:919
void DoConfigureRach(LteUeCmacSapProvider::RachConfig rc)
Configure RACH function.
Definition: lte-ue-mac.cc:530
LteUePhySapUser * GetLteUePhySapUser()
Get the PHY SAP user.
Definition: lte-ue-mac.cc:295
bool m_rachConfigured
is RACH configured?
Definition: lte-ue-mac.h:278
void DoRemoveLc(uint8_t lcId)
Remove LC function.
Definition: lte-ue-mac.cc:589
void RecvRaResponse(BuildRarListElement_s raResponse)
Receive the RA response function.
Definition: lte-ue-mac.cc:458
void DoReceivePhyPdu(Ptr< Packet > p)
Receive Phy PDU function.
Definition: lte-ue-mac.cc:631
uint8_t m_raPreambleId
RA preamble ID.
Definition: lte-ue-mac.h:280
void DoNotifyConnectionSuccessful()
Notify MAC about the successful RRC connection establishment.
Definition: lte-ue-mac.cc:624
Time m_bsrLast
BSR last.
Definition: lte-ue-mac.h:267
void DoReceiveLteControlMessage(Ptr< LteControlMessage > msg)
Receive LTE control message function.
Definition: lte-ue-mac.cc:656
uint16_t m_rnti
RNTI.
Definition: lte-ue-mac.h:275
virtual void DoDispose(void)
Destructor implementation.
Definition: lte-ue-mac.cc:283
void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU function.
Definition: lte-ue-mac.cc:332
uint32_t m_subframeNo
subframe number
Definition: lte-ue-mac.h:287
std::map< uint8_t, LteMacSapProvider::ReportBufferStatusParameters > m_ulBsrReceived
BSR received from RLC (the last one)
Definition: lte-ue-mac.h:263
virtual ~LteUeMac()
Definition: lte-ue-mac.cc:277
void DoReset()
Reset function.
Definition: lte-ue-mac.cc:598
LteUeCmacSapUser * m_cmacSapUser
CMAC SAP user.
Definition: lte-ue-mac.h:257
bool m_freshUlBsr
true when a BSR has been received in the last TTI
Definition: lte-ue-mac.h:269
void DoStartNonContentionBasedRandomAccessProcedure(uint16_t rnti, uint8_t rapId, uint8_t prachMask)
Start non contention based random access procedure function.
Definition: lte-ue-mac.cc:565
bool m_waitingForRaResponse
waiting for RA response
Definition: lte-ue-mac.h:289
void SendReportBufferStatus(void)
Send report buffer status.
Definition: lte-ue-mac.cc:367
void DoAddLc(uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser *msu)
Add LC function.
Definition: lte-ue-mac.cc:577
uint8_t m_harqProcessId
HARQ process ID.
Definition: lte-ue-mac.h:271
LteMacSapProvider * m_macSapProvider
MAC SAP provider.
Definition: lte-ue-mac.h:255
void RandomlySelectAndSendRaPreamble()
Randomly select and send RA preamble function.
Definition: lte-ue-mac.cc:417
void DoStartContentionBasedRandomAccessProcedure()
Start contention based random access procedure function.
Definition: lte-ue-mac.cc:538
LteUeCmacSapProvider * GetLteUeCmacSapProvider(void)
Get the LTE CMAC SAP provider.
Definition: lte-ue-mac.cc:320
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:75
uint16_t m_backoffParameter
backoff parameter
Definition: lte-ue-mac.h:282
void StartWaitingForRaResponse()
Start waiting for RA response function.
Definition: lte-ue-mac.cc:451
void DoSetRnti(uint16_t rnti)
Set RNTI.
Definition: lte-ue-mac.cc:550
void DoSetImsi(uint64_t imsi)
Set IMSI.
Definition: lte-ue-mac.cc:557
void SendRaPreamble(bool contention)
Send RA preamble function.
Definition: lte-ue-mac.cc:429
void SetLteUeCmacSapUser(LteUeCmacSapUser *s)
Set the LTE UE CMAC SAP user.
Definition: lte-ue-mac.cc:314
std::map< uint8_t, LcInfo > m_lcInfoMap
logical channel info map
Definition: lte-ue-mac.h:253
std::vector< Ptr< PacketBurst > > m_miUlHarqProcessesPacket
Packets under transmission of the UL HARQ processes.
Definition: lte-ue-mac.h:272
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:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
a unique identifier for an interface.
Definition: type-id.h:59
UeMemberLteMacSapProvider class.
Definition: lte-ue-mac.cc:140
UeMemberLteUeCmacSapProvider class.
Definition: lte-ue-mac.cc:53
UeMemberLteUePhySapUser.
Definition: lte-ue-mac.cc:182
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:68
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:46
LcInfo structure.
Definition: lte-ue-mac.h:248
LteUeCmacSapProvider::LogicalChannelConfig lcConfig
logical channel config
Definition: lte-ue-mac.h:249
LteMacSapUser * macSapUser
MAC SAP user.
Definition: lte-ue-mac.h:250