A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-ue-rrc.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  */
20 
21 #ifndef LTE_UE_RRC_H
22 #define LTE_UE_RRC_H
23 
24 #include <ns3/object.h>
25 #include <ns3/packet.h>
26 #include <ns3/lte-ue-cmac-sap.h>
27 #include <ns3/lte-pdcp-sap.h>
28 #include <ns3/lte-as-sap.h>
29 #include <ns3/lte-ue-cphy-sap.h>
30 #include <ns3/lte-rrc-sap.h>
31 #include <ns3/traced-callback.h>
32 
33 #include <map>
34 #include <set>
35 
36 namespace ns3 {
37 
38 class LteRlc;
39 class LteMacSapProvider;
40 class LteUeCmacSapUser;
41 class LteUeCmacSapProvider;
42 class LteDataRadioBearerInfo;
43 class LteSignalingRadioBearerInfo;
44 class LteEnbRrc;
45 
50 class LteUeRrc : public Object
51 {
52 
59 
60 public:
61 
66  enum State
67  {
77  };
78 
79 
84  LteUeRrc ();
85 
86 
90  virtual ~LteUeRrc ();
91 
92 
93  // inherited from Object
94 private:
95  virtual void DoInitialize (void);
96  virtual void DoDispose (void);
97 public:
98  static TypeId GetTypeId (void);
99 
100 
107 
114 
121 
128 
129 
136 
143 
152 
158  void SetAsSapUser (LteAsSapUser* s);
159 
166 
171  void SetImsi (uint64_t imsi);
172 
177  uint64_t GetImsi (void);
178 
179 
184  uint16_t GetRnti () const;
185 
186 
191  uint16_t GetCellId () const;
192 
193 
197  uint8_t GetUlBandwidth () const;
198 
202  uint8_t GetDlBandwidth () const;
203 
207  uint16_t GetDlEarfcn () const;
208 
212  uint16_t GetUlEarfcn () const;
213 
218  State GetState ();
219 
225  void SetUseRlcSm (bool val);
226 
227 
228 private:
229 
230 
231  // PDCP SAP methods
233 
234  // CMAC SAP methods
235  void DoSetTemporaryCellRnti (uint16_t rnti);
238 
239  // LTE AS SAP methods
240  void DoForceCampedOnEnb (uint16_t cellId, uint16_t earfcn);
241  void DoConnect ();
242  void DoSendData (Ptr<Packet> packet, uint8_t bid);
243  void DoDisconnect ();
244 
245  // CPHY SAP methods
248 
249  // RRC SAP methods
259 
260 
261  // internal methods
264  void SendMeasurementReport (uint8_t measId);
265  void StartConnection ();
266  void LeaveConnectedMode ();
267  void DisposeOldSrb1 ();
268  uint8_t Bid2Drbid (uint8_t bid);
269  void SwitchToState (State s);
270 
271  std::map<uint8_t, uint8_t> m_bid2DrbidMap;
272 
275 
278 
281 
284 
287 
289 
290  uint64_t m_imsi;
291  uint16_t m_rnti;
292  uint16_t m_cellId;
293 
297  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
298 
300 
302 
303  uint8_t m_dlBandwidth;
304  uint8_t m_ulBandwidth;
306  uint16_t m_dlEarfcn;
307  uint16_t m_ulEarfcn;
309  // imsi cellid rnti
311  // imsi cellid rnti
313  // imsi cellid rnti
315  // imsi cellid rnti
317  // imsi cellid rnti targetCellId
319  // imsi cellid rnti
321 
334  {
335  std::map<uint8_t, LteRrcSap::MeasIdToAddMod> measIdList;
336  std::map<uint8_t, LteRrcSap::MeasObjectToAddMod> measObjectList;
337  std::map<uint8_t, LteRrcSap::ReportConfigToAddMod> reportConfigList;
339  double aRsrp;
340  double aRsrq;
341  };
342 
344  {
345  uint8_t measId;
346  std::set<uint16_t> cellsTriggeredList; // note: only EUTRA is
347  // supported
350  };
351 
353  // measId
354  std::map<uint8_t, VarMeasReport> m_varMeasReportList;
355 
356  struct MeasValues
357  {
358  double rsrp;
359  double rsrq;
361  };
362 
364  std::map<uint16_t, MeasValues> m_storedMeasValues;
365 
366 
367 };
368 
369 
370 } // namespace ns3
371 
372 #endif // LTE_UE_RRC_H