View | Details | Raw Unified | Return to bug 938
Collapse All | Expand All

(-)a/src/lte/helper/lte-helper.h (-89 / +200 lines)
 Lines 50-56    Link Here 
50
50
51
/**
51
/**
52
 * \ingroup lte
52
 * \ingroup lte
53
 * \brief Creation and configuration of LTE entities
53
 * Creation and configuration of LTE entities. One LteHelper instance is
54
 * typically enough for an LTE simulation. To create it:
55
 *
56
 *     Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
57
 *
58
 * The general responsibility of the helper is to create various LTE objects
59
 * and arrange them together to make the whole LTE system. The overall
60
 * arrangement would look like the following:
61
 * - Downlink spectrum channel
62
 *   + Path loss model
63
 *   + Fading model
64
 * - Uplink spectrum channel
65
 *   + Path loss model
66
 *   + Fading model
67
 * - eNodeB node(s)
68
 *   + Mobility model
69
 *   + eNodeB device(s)
70
 *     * Antenna model
71
 *     * eNodeB PHY (includes spectrum PHY, interference model, HARQ model)
72
 *     * eNodeB MAC
73
 *     * eNodeB RRC (includes RRC protocol)
74
 *     * Scheduler
75
 *     * Handover algorithm
76
 *     * FFR (frequency reuse) algorithm
77
 *     * ANR (automatic neighbour relation)
78
 *   + EPC related models (EPC application, Internet stack, X2 interface)
79
 * - UE node(s)
80
 *   + Mobility model
81
 *   + UE device(s)
82
 *     * Antenna model
83
 *     * UE PHY (includes spectrum PHY, interference model, HARQ model)
84
 *     * UE MAC
85
 *     * UE RRC (includes RRC protocol)
86
 *     * NAS
87
 * - EPC helper
88
 * - Various statistics calculator objects
89
 *
90
 * Spetrum channels are created automatically: one for DL, and one for UL.
91
 * eNodeB devices are created by calling InstallEnbDevice(), while UE devices
92
 * are created by calling InstallUeDevice(). EPC helper can be set by using
93
 * SetEpcHelper().
54
 */
94
 */
55
class LteHelper : public Object
95
class LteHelper : public Object
56
{
96
{
 Lines 61-70    Link Here 
61
  static TypeId GetTypeId (void);
101
  static TypeId GetTypeId (void);
62
  virtual void DoDispose (void);
102
  virtual void DoDispose (void);
63
103
64
65
  /** 
104
  /** 
66
   * Set the EpcHelper to be used to setup the EPC network in
105
   * Set the EpcHelper to be used to setup the EPC network in
67
   * conjunction with the setup of the LTE radio access network 
106
   * conjunction with the setup of the LTE radio access network.
68
   *
107
   *
69
   * \note if no EpcHelper is ever set, then LteHelper will default
108
   * \note if no EpcHelper is ever set, then LteHelper will default
70
   * to creating an LTE-only simulation with no EPC, using LteRlcSm as
109
   * to creating an LTE-only simulation with no EPC, using LteRlcSm as
 Lines 78-91    Link Here 
78
  void SetEpcHelper (Ptr<EpcHelper> h);
117
  void SetEpcHelper (Ptr<EpcHelper> h);
79
118
80
  /** 
119
  /** 
120
   * Set the type of path loss model to be used for both DL and UL channels.
81
   * 
121
   * 
82
   * 
122
   * \param type type of path loss model, must be a type name of any class
83
   * \param type the type of pathloss model to be used for the eNBs
123
   *             inheriting from ns3::PropagationLossModel, for example:
124
   *             "ns3::FriisPropagationLossModel"
84
   */
125
   */
85
  void SetPathlossModelType (std::string type);
126
  void SetPathlossModelType (std::string type);
86
127
87
  /**
128
  /**
88
   * set an attribute for the pathloss model to be created
129
   * Set an attribute for the path loss models to be created.
89
   * 
130
   * 
90
   * \param n the name of the attribute
131
   * \param n the name of the attribute
91
   * \param v the value of the attribute
132
   * \param v the value of the attribute
 Lines 93-100    Link Here 
93
  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
134
  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
94
135
95
  /** 
136
  /** 
137
   * Set the type of scheduler to be used by eNodeB devices.
96
   * 
138
   * 
97
   * \param type the type of scheduler to be used for the eNBs
139
   * \param type type of scheduler, must be a type name of any class
140
   *             inheriting from ns3::FfMacScheduler, for example:
141
   *             "ns3::PfFfMacScheduler"
142
   *
143
   * Equivalent with setting the `Scheduler` attribute.
98
   */
144
   */
99
  void SetSchedulerType (std::string type);
145
  void SetSchedulerType (std::string type);
100
146
 Lines 105-111    Link Here 
105
  std::string GetSchedulerType () const; 
151
  std::string GetSchedulerType () const; 
106
152
107
  /**
153
  /**
108
   * set an attribute for the scheduler to be created
154
   * Set an attribute for the scheduler to be created.
109
   * 
155
   * 
110
   * \param n the name of the attribute
156
   * \param n the name of the attribute
111
   * \param v the value of the attribute
157
   * \param v the value of the attribute
 Lines 113-120    Link Here 
113
  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
159
  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
114
160
115
  /**
161
  /**
162
   * Set the type of FFR algorithm to be used by eNodeB devices.
116
   *
163
   *
117
   * \param type the type of FFR algorithm to be used for the eNBs
164
   * \param type type of FFR algorithm, must be a type name of any class
165
   *             inheriting from ns3::LteFfrAlgorithm, for example:
166
   *             "ns3::LteFrNoOpAlgorithm"
167
   *
168
   * Equivalent with setting the `FfrAlgorithm` attribute.
118
   */
169
   */
119
  void SetFfrAlgorithmType (std::string type);
170
  void SetFfrAlgorithmType (std::string type);
120
171
 Lines 125-131    Link Here 
125
  std::string GetFfrAlgorithmType () const;
176
  std::string GetFfrAlgorithmType () const;
126
177
127
  /**
178
  /**
128
   * set an attribute for the FFR algorithm to be created
179
   * Set an attribute for the FFR algorithm to be created.
129
   *
180
   *
130
   * \param n the name of the attribute
181
   * \param n the name of the attribute
131
   * \param v the value of the attribute
182
   * \param v the value of the attribute
 Lines 133-140    Link Here 
133
  void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v);
184
  void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v);
134
185
135
  /**
186
  /**
187
   * Set the type of handover algorithm to be used by eNodeB devices.
136
   *
188
   *
137
   * \param type the type of handover algorithm to be used for the eNBs
189
   * \param type type of handover algorithm, must be a type name of any class
190
   *             inheriting from ns3::LteHandoverAlgorithm, for example:
191
   *             "ns3::NoOpHandoverAlgorithm"
192
   *
193
   * Equivalent with setting the `HandoverAlgorithm` attribute.
138
   */
194
   */
139
  void SetHandoverAlgorithmType (std::string type);
195
  void SetHandoverAlgorithmType (std::string type);
140
196
 Lines 145-151    Link Here 
145
  std::string GetHandoverAlgorithmType () const;
201
  std::string GetHandoverAlgorithmType () const;
146
202
147
  /**
203
  /**
148
   * set an attribute for the handover algorithm to be created
204
   * Set an attribute for the handover algorithm to be created.
149
   *
205
   *
150
   * \param n the name of the attribute
206
   * \param n the name of the attribute
151
   * \param v the value of the attribute
207
   * \param v the value of the attribute
 Lines 153-195    Link Here 
153
  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
209
  void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v);
154
210
155
  /**
211
  /**
156
   * set an attribute for the LteEnbNetDevice to be created
212
   * Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
157
   * 
213
   * 
158
   * \param n the name of the attribute
214
   * \param n the name of the attribute.
159
   * \param v the value of the attribute
215
   * \param v the value of the attribute
160
   */
216
   */
161
  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
217
  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
162
218
163
  /** 
219
  /** 
220
   * Set the type of antenna model to be used by eNodeB devices.
164
   * 
221
   * 
165
   * \param type the type of AntennaModel to be used for the eNBs
222
   * \param type type of antenna model, must be a type name of any class
223
   *             inheriting from ns3::AntennaModel, for example:
224
   *             "ns3::IsotropicAntennaModel"
166
   */
225
   */
167
  void SetEnbAntennaModelType (std::string type);
226
  void SetEnbAntennaModelType (std::string type);
168
227
169
  /**
228
  /**
170
   * set an attribute for the AntennaModel to be used for the eNBs
229
   * Set an attribute for the eNodeB antenna model to be created.
171
   * 
230
   * 
172
   * \param n the name of the attribute
231
   * \param n the name of the attribute.
173
   * \param v the value of the attribute
232
   * \param v the value of the attribute
174
   */
233
   */
175
  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
234
  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
176
235
177
  /**
236
  /**
178
   * set an attribute for the LteUeNetDevice to be created
237
   * Set an attribute for the UE devices (LteUeNetDevice) to be created.
179
   *
238
   *
180
   * \param n the name of the attribute
239
   * \param n the name of the attribute.
181
   * \param v the value of the attribute
240
   * \param v the value of the attribute
182
   */
241
   */
183
  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
242
  void SetUeDeviceAttribute (std::string n, const AttributeValue &v);
184
243
185
  /** 
244
  /** 
245
   * Set the type of antenna model to be used by UE devices.
186
   * 
246
   * 
187
   * \param type the type of AntennaModel to be used for the UEs
247
   * \param type type of antenna model, must be a type name of any class
248
   *             inheriting from ns3::AntennaModel, for example:
249
   *             "ns3::IsotropicAntennaModel"
188
   */
250
   */
189
  void SetUeAntennaModelType (std::string type);
251
  void SetUeAntennaModelType (std::string type);
190
252
191
  /**
253
  /**
192
   * set an attribute for the AntennaModel to be used for the UEs
254
   * Set an attribute for the UE antenna model to be created.
193
   * 
255
   * 
194
   * \param n the name of the attribute
256
   * \param n the name of the attribute
195
   * \param v the value of the attribute
257
   * \param v the value of the attribute
 Lines 197-209    Link Here 
197
  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
259
  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
198
260
199
  /** 
261
  /** 
200
   * 
262
   * Set the type of spectrum channel to be used in both DL and UL.
201
   * \param type the type of SpectrumChannel to be used for the UEs
263
   *
264
   * \param type type of spectrum channel model, must be a type name of any
265
   *             class inheriting from ns3::SpectrumChannel, for example:
266
   *             "ns3::MultiModelSpectrumChannel"
202
   */
267
   */
203
  void SetSpectrumChannelType (std::string type);
268
  void SetSpectrumChannelType (std::string type);
204
269
205
  /**
270
  /**
206
   * set an attribute for the SpectrumChannel to be used for the UEs
271
   * Set an attribute for the spectrum channel to be created (both DL and UL).
207
   * 
272
   * 
208
   * \param n the name of the attribute
273
   * \param n the name of the attribute
209
   * \param v the value of the attribute
274
   * \param v the value of the attribute
 Lines 211-229    Link Here 
211
  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
276
  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
212
277
213
  /**
278
  /**
214
   * create a set of eNB devices
279
   * Create a set of eNodeB devices.
215
   *
280
   *
216
   * \param c the node container where the devices are to be installed
281
   * \param c the node container where the devices are to be installed
217
   *
218
   * \return the NetDeviceContainer with the newly created devices
282
   * \return the NetDeviceContainer with the newly created devices
219
   */
283
   */
220
  NetDeviceContainer InstallEnbDevice (NodeContainer c);
284
  NetDeviceContainer InstallEnbDevice (NodeContainer c);
221
285
222
  /**
286
  /**
223
   * create a set of UE devices
287
   * Create a set of UE devices.
224
   *
288
   *
225
   * \param c the node container where the devices are to be installed
289
   * \param c the node container where the devices are to be installed
226
   *
227
   * \return the NetDeviceContainer with the newly created devices
290
   * \return the NetDeviceContainer with the newly created devices
228
   */
291
   */
229
  NetDeviceContainer InstallUeDevice (NodeContainer c);
292
  NetDeviceContainer InstallUeDevice (NodeContainer c);
 Lines 328-334    Link Here 
328
  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
391
  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
329
392
330
  /**
393
  /**
331
   * Activate a dedicated EPS bearer on a given set of UE devices
394
   * Activate a dedicated EPS bearer on a given set of UE devices.
332
   *
395
   *
333
   * \param ueDevices the set of UE devices
396
   * \param ueDevices the set of UE devices
334
   * \param bearer the characteristics of the bearer to be activated
397
   * \param bearer the characteristics of the bearer to be activated
 Lines 337-360    Link Here 
337
  void ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft);
400
  void ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft);
338
401
339
  /**
402
  /**
340
   * Activate a dedicated EPS bearer on a given UE device
403
   * Activate a dedicated EPS bearer on a given UE device.
341
   *
404
   *
342
   * \param ueDevice the UE device
405
   * \param ueDevice the UE device
343
   * \param bearer the characteristics of the bearer to be activated
406
   * \param bearer the characteristics of the bearer to be activated
344
   * \param tft the Traffic Flow Template that identifies the traffic to go on this bearer
407
   * \param tft the Traffic Flow Template that identifies the traffic to go on this bearer.
345
   */
408
   */
346
  void ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
409
  void ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
347
410
348
349
  /**
411
  /**
350
   * Create an X2 interface between all the eNBs in a given set
412
   * Create an X2 interface between all the eNBs in a given set.
351
   *
413
   *
352
   * \param enbNodes the set of eNB nodes
414
   * \param enbNodes the set of eNB nodes
353
   */
415
   */
354
  void AddX2Interface (NodeContainer enbNodes);
416
  void AddX2Interface (NodeContainer enbNodes);
355
417
356
  /**
418
  /**
357
   * Create an X2 interface between two eNBs
419
   * Create an X2 interface between two eNBs.
358
   *
420
   *
359
   * \param enbNode1 one eNB of the X2 interface
421
   * \param enbNode1 one eNB of the X2 interface
360
   * \param enbNode2 the other eNB of the X2 interface
422
   * \param enbNode2 the other eNB of the X2 interface
 Lines 362-411    Link Here 
362
  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
424
  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
363
425
364
  /**
426
  /**
365
   * \brief Manually trigger an X2-based handover of a UE between two eNBs at a
427
   * Manually trigger an X2-based handover.
366
   *        specific simulation time.
428
   *
367
   * \param hoTime when the Handover is initiated
429
   * \param hoTime when the handover shall be initiated
368
   * \param ueDev the UE that hands off, must be of the type LteUeNetDevice
430
   * \param ueDev the UE that hands off, must be of the type LteUeNetDevice
369
   * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice
431
   * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice
370
   *                     (originally the UE is attached to this eNB)
432
   *                     (originally the UE is attached to this eNB)
371
   * \param targetEnbDev target eNB, must be of the type LteEnbNetDevice
433
   * \param targetEnbDev target eNB, must be of the type LteEnbNetDevice
372
   *                     (the UE is finally connected to this eNB)
434
   *                     (the UE would be connected to this eNB after the
435
   *                     handover)
373
   *
436
   *
374
   * \warning Requires the use of EPC mode. See SetEpcHelper() method.
437
   * \warning Requires the use of EPC mode. See SetEpcHelper() method
375
   */
438
   */
376
  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
439
  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev,
377
                        Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
440
                        Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
378
441
379
442
380
  /** 
443
  /** 
381
   * Call ActivateDataRadioBearer (ueDevice, bearer) for each UE
444
   * Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
382
   * device in a given set
383
   * 
445
   * 
384
   * \param ueDevices the set of UE devices
446
   * \param ueDevices the set of UE devices
385
   * \param bearer
447
   * \param bearer the characteristics of the bearer to be activated
386
   */
448
   */
387
  void ActivateDataRadioBearer (NetDeviceContainer ueDevices,  EpsBearer bearer);
449
  void ActivateDataRadioBearer (NetDeviceContainer ueDevices,  EpsBearer bearer);
388
450
389
  /** 
451
  /** 
390
   * Activate a Data Radio Bearer for a simplified LTE-only simulation
452
   * Activate a Data Radio Bearer on a UE device (for LTE-only simulation).
391
   * without EPC. This method will schedule the actual activation of
453
   * This method will schedule the actual activation
392
   * the bearer so that it happens after the UE got connected.
454
   * the bearer so that it happens after the UE got connected.
393
   * 
455
   * 
394
   * \param ueDevice the device of the UE for which the radio bearer
456
   * \param ueDevice the UE device
395
   * is to be activated
396
   * \param bearer the characteristics of the bearer to be activated
457
   * \param bearer the characteristics of the bearer to be activated
397
   */
458
   */
398
  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice,  EpsBearer bearer);
459
  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice,  EpsBearer bearer);
399
460
400
  /** 
461
  /** 
462
   * Set the type of fading model to be used in both DL and UL.
401
   * 
463
   * 
402
   * 
464
   * \param type type of fading model, must be a type name of any class
403
   * \param model the fading model to be used
465
   *             inheriting from ns3::SpectrumPropagationLossModel, for
466
   *             example: "ns3::TraceFadingLossModel"
404
   */
467
   */
405
  void SetFadingModel (std::string model);
468
  void SetFadingModel (std::string type);
406
469
407
  /**
470
  /**
408
   * set an attribute of the fading model
471
   * Set an attribute for the fading model to be created (both DL and UL).
409
   *
472
   *
410
   * \param n the name of the attribute
473
   * \param n the name of the attribute
411
   * \param v the value of the attribute
474
   * \param v the value of the attribute
 Lines 413-420    Link Here 
413
  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
476
  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
414
477
415
  /**
478
  /**
416
   * Enables logging for all components of the LENA architecture
479
   * Enables full-blown logging for major components of the LENA architecture.
417
   *
418
   */
480
   */
419
  void EnableLogComponents (void);
481
  void EnableLogComponents (void);
420
482
 Lines 426-484    Link Here 
426
  void EnableTraces (void);
488
  void EnableTraces (void);
427
489
428
  /**
490
  /**
429
   * Enable trace sinks for PHY layer
491
   * Enable trace sinks for PHY layer.
430
   */
492
   */
431
  void EnablePhyTraces (void);
493
  void EnablePhyTraces (void);
432
494
433
434
435
  /**
495
  /**
436
   * Enable trace sinks for DL PHY layer
496
   * Enable trace sinks for DL PHY layer.
437
   */
497
   */
438
  void EnableDlPhyTraces (void);
498
  void EnableDlPhyTraces (void);
439
499
440
  /**
500
  /**
441
   * Enable trace sinks for UL PHY layer
501
   * Enable trace sinks for UL PHY layer.
442
   */
502
   */
443
  void EnableUlPhyTraces (void);
503
  void EnableUlPhyTraces (void);
444
504
445
  /**
505
  /**
446
   * Enable trace sinks for DL transmission PHY layer
506
   * Enable trace sinks for DL transmission PHY layer.
447
   */
507
   */
448
  void EnableDlTxPhyTraces (void);
508
  void EnableDlTxPhyTraces (void);
449
509
450
  /**
510
  /**
451
   * Enable trace sinks for UL transmission PHY layer
511
   * Enable trace sinks for UL transmission PHY layer.
452
   */
512
   */
453
  void EnableUlTxPhyTraces (void);
513
  void EnableUlTxPhyTraces (void);
454
514
455
  /**
515
  /**
456
   * Enable trace sinks for DL reception PHY layer
516
   * Enable trace sinks for DL reception PHY layer.
457
   */
517
   */
458
  void EnableDlRxPhyTraces (void);
518
  void EnableDlRxPhyTraces (void);
459
519
460
  /**
520
  /**
461
   * Enable trace sinks for UL reception PHY layer
521
   * Enable trace sinks for UL reception PHY layer.
462
   */
522
   */
463
  void EnableUlRxPhyTraces (void);
523
  void EnableUlRxPhyTraces (void);
464
524
465
  /**
525
  /**
466
   * Enable trace sinks for MAC layer
526
   * Enable trace sinks for MAC layer.
467
   */
527
   */
468
  void EnableMacTraces (void);
528
  void EnableMacTraces (void);
469
529
470
  /**
530
  /**
471
   * Enable trace sinks for DL MAC layer
531
   * Enable trace sinks for DL MAC layer.
472
   */
532
   */
473
  void EnableDlMacTraces (void);
533
  void EnableDlMacTraces (void);
474
534
475
  /**
535
  /**
476
   * Enable trace sinks for UL MAC layer
536
   * Enable trace sinks for UL MAC layer.
477
   */
537
   */
478
  void EnableUlMacTraces (void);
538
  void EnableUlMacTraces (void);
479
539
480
  /**
540
  /**
481
   * Enable trace sinks for RLC layer
541
   * Enable trace sinks for RLC layer.
482
   */
542
   */
483
  void EnableRlcTraces (void);
543
  void EnableRlcTraces (void);
484
544
 Lines 499-519    Link Here 
499
   */
559
   */
500
  Ptr<RadioBearerStatsCalculator> GetPdcpStats (void);
560
  Ptr<RadioBearerStatsCalculator> GetPdcpStats (void);
501
561
502
  enum LteEpsBearerToRlcMapping_t {RLC_SM_ALWAYS = 1,
503
                                   RLC_UM_ALWAYS = 2,
504
                                   RLC_AM_ALWAYS = 3,
505
                                   PER_BASED = 4};
506
507
  /**
562
  /**
508
  * Assign a fixed random variable stream number to the random variables
563
   * Assign a fixed random variable stream number to the random variables used.
509
  * used by this model. Return the number of streams (possibly zero) that
564
   *
510
  * have been assigned. The Install() method should have previously been
565
   * The InstallEnbDevice() or InstallUeDevice method should have previously
511
  * called by the user.
566
   * been called by the user on the given devices.
512
  *
567
   *
513
  * \param c NetDeviceContainer of the set of net devices for which the 
568
   * If TraceFadingLossModel has been set as the fading model type, this method
514
  *          LteNetDevice should be modified to use a fixed stream
569
   * will also assign a stream number to it, if none has been assigned before.
515
  * \param stream first stream index to use
570
   *
516
  * \return the number of stream indices assigned by this helper
571
   * \param c NetDeviceContainer of the set of net devices for which the
572
   *          LteNetDevice should be modified to use a fixed stream
573
   * \param stream first stream index to use
574
   * \return the number of stream indices (possibly zero) that have been assigned
517
  */
575
  */
518
  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
576
  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
519
577
 Lines 523-548    Link Here 
523
581
524
private:
582
private:
525
  /**
583
  /**
526
   * \brief Create an eNodeB device (LteEnbNetDevice) on the given node.
584
   * Create an eNodeB device (LteEnbNetDevice) on the given node.
527
   * \param n the node where the device is to be installed
585
   * \param n the node where the device is to be installed
528
   * \return pointer to the created device
586
   * \return pointer to the created device
529
   */
587
   */
530
  Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n);
588
  Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n);
531
589
532
  /**
590
  /**
533
   * \brief Create a UE device (LteUeNetDevice) on the given node.
591
   * Create a UE device (LteUeNetDevice) on the given node
534
   * \param n the node where the device is to be installed
592
   * \param n the node where the device is to be installed
535
   * \return pointer to the created device
593
   * \return pointer to the created device
536
   */
594
   */
537
  Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n);
595
  Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n);
538
596
539
  /**
597
  /**
540
   * \brief The actual function to trigger a manual handover.
598
   * The actual function to trigger a manual handover.
541
   * \param ueDev the UE that hands off, must be of the type LteUeNetDevice
599
   * \param ueDev the UE that hands off, must be of the type LteUeNetDevice
542
   * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice
600
   * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice
543
   *                     (originally the UE is attached to this eNB)
601
   *                     (originally the UE is attached to this eNB)
544
   * \param targetEnbDev target eNB, must be of the type LteEnbNetDevice
602
   * \param targetEnbDev target eNB, must be of the type LteEnbNetDevice
545
   *                     (the UE is finally connected to this eNB)
603
   *                     (the UE would be connected to this eNB after the
604
   *                     handover)
546
   *
605
   *
547
   * This method is normally scheduled by HandoverRequest() to run at a specific
606
   * This method is normally scheduled by HandoverRequest() to run at a specific
548
   * time where a manual handover is desired by the simulation user.
607
   * time where a manual handover is desired by the simulation user.
 Lines 551-599    Link Here 
551
                          Ptr<NetDevice> sourceEnbDev,
610
                          Ptr<NetDevice> sourceEnbDev,
552
                          Ptr<NetDevice> targetEnbDev);
611
                          Ptr<NetDevice> targetEnbDev);
553
612
613
  /// The downlink LTE channel used in the simulation.
554
  Ptr<SpectrumChannel> m_downlinkChannel;
614
  Ptr<SpectrumChannel> m_downlinkChannel;
615
  /// The uplink LTE channel used in the simulation.
555
  Ptr<SpectrumChannel> m_uplinkChannel;
616
  Ptr<SpectrumChannel> m_uplinkChannel;
556
617
  /// The path loss model used in the downlink channel.
557
  Ptr<Object> m_downlinkPathlossModel;
618
  Ptr<Object> m_downlinkPathlossModel;
619
  /// The path loss model used in the uplink channel.
558
  Ptr<Object> m_uplinkPathlossModel;
620
  Ptr<Object> m_uplinkPathlossModel;
559
621
622
  /// Factory of MAC scheduler object.
560
  ObjectFactory m_schedulerFactory;
623
  ObjectFactory m_schedulerFactory;
624
  /// Factory of FFR (frequency reuse) algorithm object.
561
  ObjectFactory m_ffrAlgorithmFactory;
625
  ObjectFactory m_ffrAlgorithmFactory;
626
  /// Factory of handover algorithm object.
562
  ObjectFactory m_handoverAlgorithmFactory;
627
  ObjectFactory m_handoverAlgorithmFactory;
563
  ObjectFactory m_propagationModelFactory;
628
  /// Factory of LteEnbNetDevice objects.
564
  ObjectFactory m_enbNetDeviceFactory;
629
  ObjectFactory m_enbNetDeviceFactory;
630
  /// Factory of antenna object for eNodeB.
565
  ObjectFactory m_enbAntennaModelFactory;
631
  ObjectFactory m_enbAntennaModelFactory;
632
  /// Factory for LteUeNetDevice objects.
566
  ObjectFactory m_ueNetDeviceFactory;
633
  ObjectFactory m_ueNetDeviceFactory;
634
  /// Factory of antenna object for UE.
567
  ObjectFactory m_ueAntennaModelFactory;
635
  ObjectFactory m_ueAntennaModelFactory;
568
636
  /// Factory of path loss model object for the downlink channel.
569
  ObjectFactory m_dlPathlossModelFactory;
637
  ObjectFactory m_dlPathlossModelFactory;
638
  /// Factory of path loss model object for the uplink channel.
570
  ObjectFactory m_ulPathlossModelFactory;
639
  ObjectFactory m_ulPathlossModelFactory;
571
640
  /// Factory of both the downlink and uplink LTE channels.
572
  ObjectFactory m_channelFactory;
641
  ObjectFactory m_channelFactory;
573
642
643
  /// Name of fading model type, e.g., "ns3::TraceFadingLossModel".
574
  std::string m_fadingModelType;
644
  std::string m_fadingModelType;
645
  /// Factory of fading model object for both the downlink and uplink channels.
575
  ObjectFactory m_fadingModelFactory;
646
  ObjectFactory m_fadingModelFactory;
647
  /// The fading model used in both the downlink and uplink channels.
576
  Ptr<SpectrumPropagationLossModel> m_fadingModule;
648
  Ptr<SpectrumPropagationLossModel> m_fadingModule;
649
  /**
650
   * True if a random variable stream number has been assigned for the fading
651
   * model. Used to prevent such assignment to be done more than once.
652
   */
577
  bool m_fadingStreamsAssigned;
653
  bool m_fadingStreamsAssigned;
578
654
655
  /// Container of PHY layer statistics.
579
  Ptr<PhyStatsCalculator> m_phyStats;
656
  Ptr<PhyStatsCalculator> m_phyStats;
657
  /// Container of PHY layer statistics related to transmission.
580
  Ptr<PhyTxStatsCalculator> m_phyTxStats;
658
  Ptr<PhyTxStatsCalculator> m_phyTxStats;
659
  /// Container of PHY layer statistics related to reception.
581
  Ptr<PhyRxStatsCalculator> m_phyRxStats;
660
  Ptr<PhyRxStatsCalculator> m_phyRxStats;
661
  /// Container of MAC layer statistics.
582
  Ptr<MacStatsCalculator> m_macStats;
662
  Ptr<MacStatsCalculator> m_macStats;
663
  /// Container of RLC layer statistics.
583
  Ptr<RadioBearerStatsCalculator> m_rlcStats;
664
  Ptr<RadioBearerStatsCalculator> m_rlcStats;
665
  /// Container of PDCP layer statistics.
584
  Ptr<RadioBearerStatsCalculator> m_pdcpStats;
666
  Ptr<RadioBearerStatsCalculator> m_pdcpStats;
667
  ///
585
  RadioBearerStatsConnector m_radioBearerStatsConnector;
668
  RadioBearerStatsConnector m_radioBearerStatsConnector;
586
669
670
  /**
671
   * Helper which provides implementation of core network. Initially empty
672
   * (i.e., LTE-only simulation without any core network) and then might be
673
   * set using SetEpcHelper().
674
   */
587
  Ptr<EpcHelper> m_epcHelper;
675
  Ptr<EpcHelper> m_epcHelper;
588
676
677
  /**
678
   * Keep track of the number of IMSI allocated. Increases by one every time a
679
   * new UE is installed (by InstallSingleUeDevice()). The first UE will have
680
   * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9).
681
   */
589
  uint64_t m_imsiCounter;
682
  uint64_t m_imsiCounter;
683
  /**
684
   * Keep track of the number of cell ID allocated. Increases by one every time
685
   * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB
686
   * will have a cell ID of 1. The maximum number of eNodeB is 65535.
687
   */
590
  uint16_t m_cellIdCounter;
688
  uint16_t m_cellIdCounter;
591
689
690
  /**
691
   * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for
692
   * RRC signaling. If false, LteRrcProtocolReal will be used.
693
   */
592
  bool m_useIdealRrc;
694
  bool m_useIdealRrc;
695
  /**
696
   * The `AnrEnabled` attribute. Activate or deactivate Automatic Neighbour
697
   * Relation function.
698
   */
593
  bool m_isAnrEnabled;
699
  bool m_isAnrEnabled;
700
  /**
701
   * The `UsePdschForCqiGeneration` attribute. If true, DL-CQI will be
702
   * calculated from PDCCH as signal and PDSCH as interference. If false,
703
   * DL-CQI will be calculated from PDCCH as signal and PDCCH as interference.
704
   */
705
  bool m_usePdschForCqiGeneration;
594
706
595
  bool m_usePdschForCqiGeneration;
707
}; // end of `class LteHelper`
596
};
597
708
598
709
599
} // namespace ns3
710
} // namespace ns3
(-)a/src/lte/helper/radio-environment-map-helper.h (-24 / +55 lines)
 Lines 37-44    Link Here 
37
class MobilityModel;
37
class MobilityModel;
38
38
39
/** 
39
/** 
40
 * Generates a 2D map of the SINR from the strongest transmitter in the downlink of an LTE FDD system.
40
 * Generates a 2D map of the SINR from the strongest transmitter in the
41
 * 
41
 * downlink of an LTE FDD system. For instructions on usage, please refer to
42
 * the User Documentation.
42
 */
43
 */
43
class RadioEnvironmentMapHelper : public Object
44
class RadioEnvironmentMapHelper : public Object
44
{
45
{
 Lines 70-123    Link Here 
70
71
71
private:
72
private:
72
73
74
  /**
75
   * Scheduled by Install() to perform the actual generation of map.
76
   *
77
   * If control channel is used for SINR calculation (the default), the delay
78
   * is 2.6 milliseconds from the start of simulation. Otherwise, if data
79
   * channel is used, the delay is 500.1 milliseconds from the start of
80
   * simulation.
81
   *
82
   * The method will divide the whole map into parts (each contains at most a
83
   * certain number of SINR listening points), and then call RunOneIteration()
84
   * on each part, one by one.
85
   */
73
  void DelayedInstall ();
86
  void DelayedInstall ();
87
88
  /**
89
   * Mobilize all the listeners to a specified area. Afterwards, schedule a
90
   * call to PrintAndReset() in 0.5 milliseconds.
91
   *
92
   * \param xMin X coordinate of the first SINR listening point to deploy.
93
   * \param xMax X coordinate of the last SINR listening point to deploy.
94
   * \param yMin Y coordinate of the first SINR listening point to deploy.
95
   * \param yMax Y coordinate of the last SINR listening point to deploy.
96
   */
74
  void RunOneIteration (double xMin, double xMax, double yMin, double yMax);
97
  void RunOneIteration (double xMin, double xMax, double yMin, double yMax);
98
99
  /// Go through every listener, write the computed SINR, and then reset it.
75
  void PrintAndReset ();
100
  void PrintAndReset ();
101
102
  /// Called when the map generation procedure has been completed.
76
  void Finalize ();
103
  void Finalize ();
77
104
78
105
  /// A complete Radio Environment Map is composed of many of this structure.
79
  struct RemPoint 
106
  struct RemPoint 
80
  {
107
  {
108
    /// Simplified listener which compute SINR over the DL channel.
81
    Ptr<RemSpectrumPhy> phy;
109
    Ptr<RemSpectrumPhy> phy;
110
    /// Position of the listener in the environment.
82
    Ptr<MobilityModel> bmm;
111
    Ptr<MobilityModel> bmm;
83
  };
112
  };
84
113
114
  /// List of listeners in the environment.
85
  std::list<RemPoint> m_rem;
115
  std::list<RemPoint> m_rem;
86
116
87
  double m_xMin;
117
  double m_xMin;   ///< The `XMin` attribute.
88
  double m_xMax;
118
  double m_xMax;   ///< The `XMax` attribute.
89
  uint16_t m_xRes;
119
  uint16_t m_xRes; ///< The `XRes` attribute.
90
  double m_xStep;
120
  double m_xStep;  ///< Distance along X axis between adjacent listening points.
91
121
92
  double m_yMin;
122
  double m_yMin;   ///< The `YMin` attribute.
93
  double m_yMax;
123
  double m_yMax;   ///< The `YMax` attribute.
94
  uint16_t m_yRes;
124
  uint16_t m_yRes; ///< The `YRes` attribute.
95
  double m_yStep;
125
  double m_yStep;  ///< Distance along Y axis between adjacent listening points.
96
126
97
  uint32_t m_maxPointsPerIteration;
127
  uint32_t m_maxPointsPerIteration;  ///< The `MaxPointsPerIteration` attribute.
98
128
99
  uint16_t m_earfcn;
129
  uint16_t m_earfcn;     ///< The `Earfcn` attribute.
100
  uint16_t m_bandwidth;
130
  uint16_t m_bandwidth;  ///< The `Bandwidth` attribute.
101
 
131
 
102
  double m_z;
132
  double m_z;  ///< The `Z` attribute.
103
133
104
  std::string m_channelPath;
134
  std::string m_channelPath;  ///< The `ChannelPath` attribute.
105
  std::string m_outputFile;
135
  std::string m_outputFile;   ///< The `OutputFile` attribute.
106
136
107
  bool m_stopWhenDone;
137
  bool m_stopWhenDone;   ///< The `StopWhenDone` attribute.
108
  
138
  
139
  /// The channel object taken from the `ChannelPath` attribute.
109
  Ptr<SpectrumChannel> m_channel;
140
  Ptr<SpectrumChannel> m_channel;
110
141
111
  double m_noisePower;
142
  double m_noisePower;  ///< The `NoisePower` attribute.
112
143
113
  std::ofstream m_outFile;
144
  std::ofstream m_outFile;  ///< Stream the output to a file.
114
145
115
  bool m_useDataChannel;
146
  bool m_useDataChannel;  ///< The `UseDataChannel` attribute.
116
  int32_t m_rbId;
147
  int32_t m_rbId;         ///< The `RbId` attribute.
117
148
118
};
149
}; // end of `class RadioEnvironmentMapHelper`
119
150
120
151
121
}
152
} // end of `namespace ns3`
122
153
123
#endif /* RADIO_ENVIRONMENT_MAP_HELPER_H */
154
#endif /* RADIO_ENVIRONMENT_MAP_HELPER_H */
(-)a/src/lte/model/a2-a4-rsrq-handover-algorithm.cc (-4 / +8 lines)
 Lines 66-78    Link Here 
66
    .SetParent<LteHandoverAlgorithm> ()
66
    .SetParent<LteHandoverAlgorithm> ()
67
    .AddConstructor<A2A4RsrqHandoverAlgorithm> ()
67
    .AddConstructor<A2A4RsrqHandoverAlgorithm> ()
68
    .AddAttribute ("ServingCellThreshold",
68
    .AddAttribute ("ServingCellThreshold",
69
                   "If the RSRQ of the serving cell is worse than this threshold, "
69
                   "If the RSRQ of the serving cell is worse than this "
70
                   "neighbour cells are consider for handover",
70
                   "threshold, neighbour cells are consider for handover. "
71
                   "Expressed in quantized range of [0..34] as per Section "
72
                   "9.1.7 of 3GPP TS 36.133.",
71
                   UintegerValue (30),
73
                   UintegerValue (30),
72
                   MakeUintegerAccessor (&A2A4RsrqHandoverAlgorithm::m_servingCellThreshold),
74
                   MakeUintegerAccessor (&A2A4RsrqHandoverAlgorithm::m_servingCellThreshold),
73
                   MakeUintegerChecker<uint8_t> (0, 34)) // RSRQ range is [0..34] as per Section 9.1.7 of 3GPP TS 36.133
75
                   MakeUintegerChecker<uint8_t> (0, 34))
74
    .AddAttribute ("NeighbourCellOffset",
76
    .AddAttribute ("NeighbourCellOffset",
75
                   "Minimum offset between serving and best neighbour cell to trigger the Handover",
77
                   "Minimum offset between the serving and the best neighbour "
78
                   "cell to trigger the handover. Expressed in quantized "
79
                   "range of [0..34] as per Section 9.1.7 of 3GPP TS 36.133.",
76
                   UintegerValue (1),
80
                   UintegerValue (1),
77
                   MakeUintegerAccessor (&A2A4RsrqHandoverAlgorithm::m_neighbourCellOffset),
81
                   MakeUintegerAccessor (&A2A4RsrqHandoverAlgorithm::m_neighbourCellOffset),
78
                   MakeUintegerChecker<uint8_t> ())
82
                   MakeUintegerChecker<uint8_t> ())
(-)a/src/lte/model/a2-a4-rsrq-handover-algorithm.h (-15 / +58 lines)
 Lines 80-88    Link Here 
80
class A2A4RsrqHandoverAlgorithm : public LteHandoverAlgorithm
80
class A2A4RsrqHandoverAlgorithm : public LteHandoverAlgorithm
81
{
81
{
82
public:
82
public:
83
  /**
83
  /// Creates an A2-A4-RSRQ handover algorithm instance.
84
   * \brief Creates an A2-A4-RSRQ handover algorithm instance.
85
   */
86
  A2A4RsrqHandoverAlgorithm ();
84
  A2A4RsrqHandoverAlgorithm ();
87
85
88
  virtual ~A2A4RsrqHandoverAlgorithm ();
86
  virtual ~A2A4RsrqHandoverAlgorithm ();
 Lines 106-146    Link Here 
106
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
104
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
107
105
108
private:
106
private:
109
  // Internal methods
107
  /**
108
   * Called when Event A2 is detected, then trigger a handover if needed.
109
   *
110
   * \param rnti The RNTI of the UE who reported the event.
111
   * \param servingCellRsrq The RSRQ of this cell as reported by the UE.
112
   */
110
  void EvaluateHandover (uint16_t rnti, uint8_t servingCellRsrq);
113
  void EvaluateHandover (uint16_t rnti, uint8_t servingCellRsrq);
114
115
  /**
116
   * Determines if a neighbour cell is a valid destination for handover.
117
   * Currently always return true.
118
   *
119
   * \param cellId The cell ID of the neighbour cell.
120
   * \return True if the cell is a valid destination for handover.
121
   */
111
  bool IsValidNeighbour (uint16_t cellId);
122
  bool IsValidNeighbour (uint16_t cellId);
123
124
  /**
125
   * Called when Event A4 is reported, then update the measurements table.
126
   * If the RNTI and/or cell ID is not found in the table, a corresponding
127
   * entry will be created. Only the latest measurements are stored in the
128
   * table.
129
   *
130
   * \param rnti The RNTI of the UE who reported the event.
131
   * \param cellId The cell ID of the measured cell.
132
   * \param rsrq The RSRQ of the cell as measured by the UE.
133
   */
112
  void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId,
134
  void UpdateNeighbourMeasurements (uint16_t rnti, uint16_t cellId,
113
                                    uint8_t rsrq);
135
                                    uint8_t rsrq);
114
136
115
  // The expected measurement identities
137
  /// The expected measurement identity for A2 measurements.
116
  uint8_t m_a2MeasId;
138
  uint8_t m_a2MeasId;
139
  /// The expected measurement identity for A4 measurements.
117
  uint8_t m_a4MeasId;
140
  uint8_t m_a4MeasId;
118
141
119
  /**
142
  /**
120
   * \brief Measurements reported by a UE for a cell ID.
143
   * Measurements reported by a UE for a cell ID. The values are quantized
121
   *
144
   * according 3GPP TS 36.133 section 9.1.4 and 9.1.7.
122
   * The values are quantized according 3GPP TS 36.133 section 9.1.4 and 9.1.7.
123
   */
145
   */
124
  class UeMeasure : public SimpleRefCount<UeMeasure>
146
  class UeMeasure : public SimpleRefCount<UeMeasure>
125
  {
147
  {
126
  public:
148
  public:
127
    uint16_t m_cellId;
149
    uint16_t m_cellId;  ///< Cell ID.
128
    uint8_t m_rsrp;
150
    uint8_t m_rsrp;     ///< RSRP in quantized format. \todo Can be removed?
129
    uint8_t m_rsrq;
151
    uint8_t m_rsrq;     ///< RSRQ in quantized format.
130
  };
152
  };
131
153
132
  //               cellId
154
  /**
155
   * Measurements reported by a UE for several cells. The structure is a map
156
   * indexed by the cell ID.
157
   */
133
  typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t;
158
  typedef std::map<uint16_t, Ptr<UeMeasure> > MeasurementRow_t;
134
  //               rnti
159
160
  /**
161
   * Measurements reported by several UEs. The structure is a map indexed by
162
   * the RNTI of the UE.
163
   */
135
  typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
164
  typedef std::map<uint16_t, MeasurementRow_t> MeasurementTable_t;
165
166
  /// Table of measurement reports from all UEs.
136
  MeasurementTable_t m_neighbourCellMeasures;
167
  MeasurementTable_t m_neighbourCellMeasures;
137
168
138
  // Class attributes
169
  /**
170
   * The `ServingCellThreshold` attribute. If the RSRQ of the serving cell is
171
   * worse than this threshold, neighbour cells are consider for handover.
172
   * Expressed in quantized range of [0..34] as per Section 9.1.7 of
173
   * 3GPP TS 36.133.
174
   */
139
  uint8_t m_servingCellThreshold;
175
  uint8_t m_servingCellThreshold;
176
177
  /**
178
   * The `NeighbourCellOffset` attribute. Minimum offset between the serving
179
   * and the best neighbour cell to trigger the handover. Expressed in
180
   * quantized range of [0..34] as per Section 9.1.7 of 3GPP TS 36.133.
181
   */
140
  uint8_t m_neighbourCellOffset;
182
  uint8_t m_neighbourCellOffset;
141
183
142
  // Handover Management SAPs
184
  /// Interface to the eNodeB RRC instance.
143
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
185
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
186
  /// Receive API calls from the eNodeB RRC instance.
144
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
187
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
145
188
146
}; // end of class A2A4RsrqHandoverAlgorithm
189
}; // end of class A2A4RsrqHandoverAlgorithm
(-)a/src/lte/model/a3-rsrp-handover-algorithm.h (-7 / +19 lines)
 Lines 65-73    Link Here 
65
class A3RsrpHandoverAlgorithm : public LteHandoverAlgorithm
65
class A3RsrpHandoverAlgorithm : public LteHandoverAlgorithm
66
{
66
{
67
public:
67
public:
68
  /**
68
  /// Creates a strongest cell handover algorithm instance.
69
   * \brief Creates a strongest cell handover algorithm instance.
70
   */
71
  A3RsrpHandoverAlgorithm ();
69
  A3RsrpHandoverAlgorithm ();
72
70
73
  virtual ~A3RsrpHandoverAlgorithm ();
71
  virtual ~A3RsrpHandoverAlgorithm ();
 Lines 91-108    Link Here 
91
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
89
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
92
90
93
private:
91
private:
94
  // Internal method
92
  /**
93
   * Determines if a neighbour cell is a valid destination for handover.
94
   * Currently always return true.
95
   *
96
   * \param cellId The cell ID of the neighbour cell.
97
   * \return True if the cell is a valid destination for handover.
98
   */
95
  bool IsValidNeighbour (uint16_t cellId);
99
  bool IsValidNeighbour (uint16_t cellId);
96
100
97
  // The expected measurement identity
101
  /// The expected measurement identity for A3 measurements.
98
  uint8_t m_measId;
102
  uint8_t m_measId;
99
103
100
  // Class attributes
104
  /**
105
   * The `Hysteresis` attribute. Handover margin (hysteresis) in dB (rounded to
106
   * the nearest multiple of 0.5 dB).
107
   */
101
  double m_hysteresisDb;
108
  double m_hysteresisDb;
109
  /**
110
   * The `TimeToTrigger` attribute. Time during which neighbour cell's RSRP
111
   * must continuously higher than serving cell's RSRP "
112
   */
102
  Time m_timeToTrigger;
113
  Time m_timeToTrigger;
103
114
104
  // Handover Management SAPs
115
  /// Interface to the eNodeB RRC instance.
105
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
116
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
117
  /// Receive API calls from the eNodeB RRC instance.
106
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
118
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
107
119
108
}; // end of class A3RsrpHandoverAlgorithm
120
}; // end of class A3RsrpHandoverAlgorithm
(-)a/src/lte/model/epc-ue-nas.cc (-1 / +5 lines)
 Lines 33-39    Link Here 
33
33
34
34
35
35
36
36
/// Map each of UE NAS states to its string representation.
37
static const std::string g_ueNasStateName[EpcUeNas::NUM_STATES] =
37
static const std::string g_ueNasStateName[EpcUeNas::NUM_STATES] =
38
{
38
{
39
  "OFF",
39
  "OFF",
 Lines 43-48    Link Here 
43
  "ACTIVE"
43
  "ACTIVE"
44
};
44
};
45
45
46
/**
47
 * \param s The UE NAS state.
48
 * \return The string representation of the given state.
49
 */
46
static inline const std::string & ToString (EpcUeNas::State s)
50
static inline const std::string & ToString (EpcUeNas::State s)
47
{
51
{
48
  return g_ueNasStateName[s];
52
  return g_ueNasStateName[s];
(-)a/src/lte/model/epc-ue-nas.h (+12 lines)
 Lines 179-194    Link Here 
179
179
180
  // internal methods
180
  // internal methods
181
  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
181
  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
182
  /**
183
   * Switch the UE RRC to the given state.
184
   * \param s the destination state
185
   */
182
  void SwitchToState (State s);
186
  void SwitchToState (State s);
183
187
188
  /// The current UE NAS state.
184
  State m_state;
189
  State m_state;
185
190
191
  /**
192
   * The `StateTransition` trace source. Fired upon every UE NAS state
193
   * transition. Exporting old state and new state.
194
   */
186
  TracedCallback<State, State> m_stateTransitionCallback;
195
  TracedCallback<State, State> m_stateTransitionCallback;
187
196
197
  /// The UE NetDevice.
188
  Ptr<NetDevice> m_device;
198
  Ptr<NetDevice> m_device;
189
199
200
  /// The unique UE identifier.
190
  uint64_t m_imsi;
201
  uint64_t m_imsi;
191
202
203
  /// Closed Subscriber Group identity.
192
  uint32_t m_csgId;
204
  uint32_t m_csgId;
193
205
194
  LteAsSapProvider* m_asSapProvider;
206
  LteAsSapProvider* m_asSapProvider;
(-)a/src/lte/model/lte-amc.cc (-24 / +38 lines)
 Lines 38-47    Link Here 
38
38
39
NS_OBJECT_ENSURE_REGISTERED (LteAmc);
39
NS_OBJECT_ENSURE_REGISTERED (LteAmc);
40
40
41
// from 3GPP R1-081483 "Conveying MCS and TB size via PDCCH"
41
/**
42
// file TBS_support.xls
42
 * Table of CQI index and its spectral efficiency. Taken from 3GPP TSG-RAN WG1
43
// tab "MCS table" (rounded to 2 decimal digits)
43
 * [R1-081483 Conveying MCS and TB size via PDCCH]
44
// the index in the vector (0-15) identifies the CQI value
44
 * (http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip)
45
 * file `TBS_support.xls` tab "MCS Table" (rounded to 2 decimal digits).
46
 * The index of the vector (range 0-15) identifies the CQI value.
47
 */
45
static const double SpectralEfficiencyForCqi[16] = {
48
static const double SpectralEfficiencyForCqi[16] = {
46
  0.0, // out of range
49
  0.0, // out of range
47
  0.15, 0.23, 0.38, 0.6, 0.88, 1.18,
50
  0.15, 0.23, 0.38, 0.6, 0.88, 1.18,
 Lines 49-61    Link Here 
49
  2.73, 3.32, 3.9, 4.52, 5.12, 5.55
52
  2.73, 3.32, 3.9, 4.52, 5.12, 5.55
50
};
53
};
51
54
52
53
#if 0 // currently unused
55
#if 0 // currently unused
54
// Table 7.1.7.1-1 of 3GPP TS 36.213 v8.8.0
56
/**
55
// the index in the vector (range 0-31; valid values 0-28) identifies the MCS index
57
 * Table of MCS index (IMCS) and its TBS index (ITBS). Taken from 3GPP TS
56
// note that this is similar to the one in R1-081483 but:
58
 * 36.213 v8.8.0 Table 7.1.7.1-1: _Modulation and TBS index table for PDSCH_.
57
//  1) a few values are different
59
 * The index of the vector (range 0-31; valid values 0-28) identifies the MCS
58
//  2) in R1-081483, a valid MCS index is in the range 1-30 (not 0-28)
60
 * index. Note that this is similar to the one in R1-081483, but:
61
 * - a few values are different; and
62
 * - in R1-081483, a valid MCS index is in the range of 1-30 (not 0-28).
63
 */
59
static const int ModulationSchemeForMcs[32] = {
64
static const int ModulationSchemeForMcs[32] = {
60
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
65
  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 
61
  4, 4, 4, 4, 4, 4, 4,
66
  4, 4, 4, 4, 4, 4, 4,
 Lines 66-77    Link Here 
66
};
71
};
67
#endif
72
#endif
68
73
69
74
/**
70
// from 3GPP R1-081483 "Conveying MCS and TB size via PDCCH"
75
 * Table of MCS index and its spectral efficiency. Taken from 3GPP TSG-RAN WG1
71
// file TBS_support.xls
76
 * [R1-081483 Conveying MCS and TB size via PDCCH]
72
// tab "MCS table" (rounded to 2 decimal digits)
77
 * (http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip)
73
// the index in the table corresponds to the MCS index according to the convention in TS 36.213
78
 * file `TBS_support.xls` tab "MCS Table" (rounded to 2 decimal digits).
74
// (i.e., the MCS index reported in R1-081483 minus one)
79
 * The index of the vector (range 0-31) corresponds to the MCS index according
80
 * to the convention in TS 36.213 (i.e., the MCS index reported in R1-081483
81
 * minus one)
82
 */
75
static const double SpectralEfficiencyForMcs[32] = {
83
static const double SpectralEfficiencyForMcs[32] = {
76
  0.15, 0.19, 0.23, 0.31, 0.38, 0.49, 0.6, 0.74, 0.88, 1.03, 1.18,
84
  0.15, 0.19, 0.23, 0.31, 0.38, 0.49, 0.6, 0.74, 0.88, 1.03, 1.18,
77
  1.33, 1.48, 1.7, 1.91, 2.16, 2.41, 2.57,
85
  1.33, 1.48, 1.7, 1.91, 2.16, 2.41, 2.57,
 Lines 79-98    Link Here 
79
  0, 0, 0
87
  0, 0, 0
80
};
88
};
81
89
82
// Table 7.1.7.1-1 of 3GPP TS 36.213 v8.8.0
90
/**
91
 * Table of MCS index (IMCS) and its TBS index (ITBS). Taken from 3GPP TS
92
 * 36.213 v8.8.0 Table 7.1.7.1-1: _Modulation and TBS index table for PDSCH_.
93
 * The index of the vector (range 0-28) identifies the MCS index.
94
 */
83
static const int McsToItbs[29] = {
95
static const int McsToItbs[29] = {
84
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18,
96
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18,
85
  19, 20, 21, 22, 23, 24, 25, 26
97
  19, 20, 21, 22, 23, 24, 25, 26
86
};
98
};
87
99
88
100
/**
89
// 3GPP TS 36.213 v8.8.0 Table 7.1.7.2.1-1: Transport block size table (dimension 27×110)
101
 * Table of number of physical resource blocks (NPRB), TBS index (ITBS), and
90
// for NPRB = 1 and Itbs = 6 the stadard returns 328, but it not consisent with the
102
 * their associated transport block size. Taken from 3GPP TS 36.213 v8.8.0
91
// other values, therefore we used 88 obtained following the sequence of NPRB = 1 values
103
 * Table 7.1.7.2.1-1: _Transport block size table (dimension 27×110)_.
104
 * \note For NPRB = 1 and ITBS = 6 the standard returns 328, but it is not
105
 *       consistent with the other values, therefore we use 88 obtained by
106
 *       following the sequence of NPRB = 1 values.
107
 */
92
static const int TransportBlockSizeTable [110][27] = {
108
static const int TransportBlockSizeTable [110][27] = {
93
109
  /* NPRB 001*/ { 16, 24, 32, 40, 56, 72, 88, 104, 120, 136, 144, 176, 208, 224, 256, 280, 328, 336, 376, 408, 440, 488, 520, 552, 584, 616, 712},
94
  /* NPRB 001*/
95
  { 16, 24, 32, 40, 56, 72, 88, 104, 120, 136, 144, 176, 208, 224, 256, 280, 328, 336, 376, 408, 440, 488, 520, 552, 584, 616, 712},
96
  /* NPRB 002*/ { 32, 56, 72, 104, 120, 144, 176, 224, 256, 296, 328, 376, 440, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1256, 1480},
110
  /* NPRB 002*/ { 32, 56, 72, 104, 120, 144, 176, 224, 256, 296, 328, 376, 440, 488, 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1256, 1480},
97
  /* NPRB 003*/ { 56, 88, 144, 176, 208, 224, 256, 328, 392, 456, 504, 584, 680, 744, 840, 904, 968, 1064, 1160, 1288, 1384, 1480, 1608, 1736, 1800, 1864, 2216},
111
  /* NPRB 003*/ { 56, 88, 144, 176, 208, 224, 256, 328, 392, 456, 504, 584, 680, 744, 840, 904, 968, 1064, 1160, 1288, 1384, 1480, 1608, 1736, 1800, 1864, 2216},
98
  /* NPRB 004*/ { 88, 144, 176, 208, 256, 328, 392, 472, 536, 616, 680, 776, 904, 1000, 1128, 1224, 1288, 1416, 1544, 1736, 1864, 1992, 2152, 2280, 2408, 2536, 2984},
112
  /* NPRB 004*/ { 88, 144, 176, 208, 256, 328, 392, 472, 536, 616, 680, 776, 904, 1000, 1128, 1224, 1288, 1416, 1544, 1736, 1864, 1992, 2152, 2280, 2408, 2536, 2984},
(-)a/src/lte/model/lte-amc.h (-11 / +28 lines)
 Lines 33-44    Link Here 
33
33
34
/**
34
/**
35
 * \ingroup lte
35
 * \ingroup lte
36
 * \brief The LteAmc class implements the Adaptive Modulation And Coding Scheme
36
 * Implements the Adaptive Modulation And Coding Scheme. As proposed in 3GPP
37
 * as proposed in 3GPP TSG-RAN WG1 - R1-081483
37
 * TSG-RAN WG1 [R1-081483 Conveying MCS and TB size via PDCCH]
38
 * http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip
38
 * (http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip).
39
 *
39
 *
40
 * \note All the methods of this class are static, so you'll never
40
 * \note All the methods of this class are static, so you'll never
41
 * need to create and manage instances of this class.
41
 *       need to create and manage instances of this class.
42
 */
42
 */
43
class LteAmc : public Object
43
class LteAmc : public Object
44
{
44
{
 Lines 49-61    Link Here 
49
  LteAmc ();
49
  LteAmc ();
50
  virtual ~LteAmc();
50
  virtual ~LteAmc();
51
  
51
  
52
  /// Types of AMC model.
52
  enum AmcModel
53
  enum AmcModel
53
    {
54
    {
55
      /**
56
       * \details
57
       * An AMC model based on Piro, G.; Grieco, L.A; Boggia, G.; Camarda, P.,
58
       * "A two-level scheduling algorithm for QoS support in the downlink of
59
       * LTE cellular networks," _Wireless Conference (EW), 2010 European_,
60
       * pp.246,253, 12-15 April 2010.
61
       */
54
      PiroEW2010,
62
      PiroEW2010,
55
      // model based on Piro, G.; Grieco, L.A.; Boggia, G.; Camarda, P.;
63
      /**
56
      //A two-level scheduling algorithm for QoS support in the downlink of 
64
       * An AMC model based on 10% of BER according to LteMiErrorModel.
57
      //LTE cellular networks European Wireless Conference (EW), 2010
65
       */
58
      MiErrorModel // model based on 10% of BER according to LteMiErrorModel
66
      MiErrorModel
59
    };
67
    };
60
  
68
  
61
  /**
69
  /**
 Lines 102-113    Link Here 
102
  
110
  
103
private:
111
private:
104
  
112
  
113
  /**
114
   * The `Ber` attribute.
115
   *
116
   * The requested BER in assigning MCS (default is 0.00005).
117
   */
105
  double m_ber;
118
  double m_ber;
119
120
  /**
121
   * The `AmcModel` attribute.
122
   *
123
   * AMC model used to assign CQI.
124
   */
106
  AmcModel m_amcModel;
125
  AmcModel m_amcModel;
107
126
108
127
}; // end of `class LteAmc`
109
110
};
111
128
112
129
113
}
130
}
(-)a/src/lte/model/lte-enb-phy.cc (-6 / +18 lines)
 Lines 51-69    Link Here 
51
51
52
NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy);
52
NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy);
53
53
54
// duration of the data part of a subframe in DL
54
/**
55
// = 0.001 / 14 * 11 (fixed to 11 symbols) -1ns as margin to avoid overlapping simulator events
55
 * Duration of the data portion of a DL subframe.
56
 * Equals to "TTI length * (11/14) - margin".
57
 * Data portion is fixed to 11 symbols out of the available 14 symbols.
58
 * 1 nanosecond margin is added to avoid overlapping simulator events.
59
 */
56
static const Time DL_DATA_DURATION = NanoSeconds (785714 -1);
60
static const Time DL_DATA_DURATION = NanoSeconds (785714 -1);
57
61
58
//  delay from subframe start to transmission of the data in DL 
62
/**
59
// = 0.001 / 14 * 3 (ctrl fixed to 3 symbols)
63
 * Delay from the start of a DL subframe to transmission of the data portion.
64
 * Equals to "TTI length * (3/14)".
65
 * Control portion is fixed to 3 symbols out of the available 14 symbols.
66
 */
60
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START = NanoSeconds (214286);
67
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START = NanoSeconds (214286);
61
68
62
////////////////////////////////////////
69
////////////////////////////////////////
63
// member SAP forwarders
70
// member SAP forwarders
64
////////////////////////////////////////
71
////////////////////////////////////////
65
72
66
73
/// \todo SetBandwidth() and SetCellId() can be removed.
67
class EnbMemberLteEnbPhySapProvider : public LteEnbPhySapProvider
74
class EnbMemberLteEnbPhySapProvider : public LteEnbPhySapProvider
68
{
75
{
69
public:
76
public:
 Lines 173-179    Link Here 
173
                                       &LteEnbPhy::GetNoiseFigure),
180
                                       &LteEnbPhy::GetNoiseFigure),
174
                   MakeDoubleChecker<double> ())
181
                   MakeDoubleChecker<double> ())
175
    .AddAttribute ("MacToChannelDelay",
182
    .AddAttribute ("MacToChannelDelay",
176
                   "The delay in TTI units that occurs between a scheduling decision in the MAC and the actual start of the transmission by the PHY. This is intended to be used to model the latency of real PHY and MAC implementations.",
183
                   "The delay in TTI units that occurs between a scheduling "
184
                   "decision in the MAC and the actual start of the "
185
                   "transmission by the PHY. This is intended to be used to "
186
                   "model the latency of real PHY and MAC implementations.",
177
                   UintegerValue (2),
187
                   UintegerValue (2),
178
                   MakeUintegerAccessor (&LteEnbPhy::SetMacChDelay, 
188
                   MakeUintegerAccessor (&LteEnbPhy::SetMacChDelay, 
179
                                         &LteEnbPhy::GetMacChDelay),
189
                                         &LteEnbPhy::GetMacChDelay),
 Lines 183-188    Link Here 
183
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportUeSinr))
193
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportUeSinr))
184
    .AddAttribute ("UeSinrSamplePeriod",
194
    .AddAttribute ("UeSinrSamplePeriod",
185
                   "The sampling period for reporting UEs' SINR stats (default value 1)",
195
                   "The sampling period for reporting UEs' SINR stats (default value 1)",
196
                   /// \todo In what unit is this?
186
                   UintegerValue (1),
197
                   UintegerValue (1),
187
                   MakeUintegerAccessor (&LteEnbPhy::m_srsSamplePeriod),
198
                   MakeUintegerAccessor (&LteEnbPhy::m_srsSamplePeriod),
188
                   MakeUintegerChecker<uint16_t> ())
199
                   MakeUintegerChecker<uint16_t> ())
 Lines 191-196    Link Here 
191
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportInterferenceTrace))
202
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportInterferenceTrace))
192
    .AddAttribute ("InterferenceSamplePeriod",
203
    .AddAttribute ("InterferenceSamplePeriod",
193
                   "The sampling period for reporting interference stats (default value 1)",
204
                   "The sampling period for reporting interference stats (default value 1)",
205
                   /// \todo In what unit is this?
194
                   UintegerValue (1),
206
                   UintegerValue (1),
195
                   MakeUintegerAccessor (&LteEnbPhy::m_interferenceSamplePeriod),
207
                   MakeUintegerAccessor (&LteEnbPhy::m_interferenceSamplePeriod),
196
                   MakeUintegerChecker<uint16_t> ())
208
                   MakeUintegerChecker<uint16_t> ())
(-)a/src/lte/model/lte-enb-phy.h (-13 / +60 lines)
 Lines 302-328    Link Here 
302
  void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
302
  void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
303
  uint8_t DoGetMacChTtiDelay ();
303
  uint8_t DoGetMacChTtiDelay ();
304
304
305
  /**
306
   * Add the given RNTI to the list of attached UE #m_ueAttached.
307
   * \param rnti RNTI of a UE
308
   * \return true if the RNTI has _not_ existed before, or false otherwise.
309
   */
305
  bool AddUePhy (uint16_t rnti);
310
  bool AddUePhy (uint16_t rnti);
306
311
  /**
312
   * Remove the given RNTI from the list of attached UE #m_ueAttached.
313
   * \param rnti RNTI of a UE
314
   * \return true if the RNTI has existed before, or false otherwise.
315
   */
307
  bool DeleteUePhy (uint16_t rnti);
316
  bool DeleteUePhy (uint16_t rnti);
308
317
309
  void CreateSrsReport (uint16_t rnti, double srs);
318
  void CreateSrsReport (uint16_t rnti, double srs);
310
319
311
320
  /**
321
   * List of RNTI of attached UEs. Used for quickly determining whether a UE is
322
   * attached to this eNodeB or not.
323
   */
312
  std::set <uint16_t> m_ueAttached;
324
  std::set <uint16_t> m_ueAttached;
313
325
314
326
315
  // P_A per UE RNTI
327
  /// P_A per UE RNTI.
316
  std::map <uint16_t,double> m_paMap;
328
  std::map <uint16_t,double> m_paMap;
317
329
318
  // DL power allocation map
330
  /// DL power allocation map.
319
  std::map <int, double> m_dlPowerAllocationMap;
331
  std::map <int, double> m_dlPowerAllocationMap;
320
332
333
  /**
334
   * A vector of integers, if the i-th value is j it means that the j-th
335
   * resource block is used for transmission in the downlink. If there is
336
   * no i such that the value of the i-th element is j, it means that RB j
337
   * is not used.
338
   */
321
  std::vector <int> m_listOfDownlinkSubchannel;
339
  std::vector <int> m_listOfDownlinkSubchannel;
322
340
323
  std::vector <int> m_dlDataRbMap;
341
  std::vector <int> m_dlDataRbMap;
324
342
325
  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; // for storing info on future receptions
343
  /// For storing info on future receptions.
344
  std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue;
326
345
327
  LteEnbPhySapProvider* m_enbPhySapProvider;
346
  LteEnbPhySapProvider* m_enbPhySapProvider;
328
  LteEnbPhySapUser* m_enbPhySapUser;
347
  LteEnbPhySapUser* m_enbPhySapUser;
 Lines 330-336    Link Here 
330
  LteEnbCphySapProvider* m_enbCphySapProvider;
349
  LteEnbCphySapProvider* m_enbCphySapProvider;
331
  LteEnbCphySapUser* m_enbCphySapUser;
350
  LteEnbCphySapUser* m_enbCphySapUser;
332
351
352
  /**
353
   * The frame number currently served. In ns-3, frame number starts from 1.
354
   * In contrast, the 3GPP standard's frame number starts from 0.
355
   */
333
  uint32_t m_nrFrames;
356
  uint32_t m_nrFrames;
357
  /**
358
   * The subframe number currently served. In ns-3, subframe number starts
359
   * from 1. In contrast, the 3GPP standard's subframe number starts from 0.
360
   * The number resets to the beginning again after 10 subframes.
361
   */
334
  uint32_t m_nrSubFrames;
362
  uint32_t m_nrSubFrames;
335
363
336
  uint16_t m_srsPeriodicity;
364
  uint16_t m_srsPeriodicity;
 Lines 339-373    Link Here 
339
  std::vector <uint16_t> m_srsUeOffset;
367
  std::vector <uint16_t> m_srsUeOffset;
340
  uint16_t m_currentSrsOffset;
368
  uint16_t m_currentSrsOffset;
341
369
370
  /**
371
   * The Master Information Block message to be broadcasted every frame.
372
   * The message content is specified by the upper layer through the RRC SAP.
373
   */
342
  LteRrcSap::MasterInformationBlock m_mib;
374
  LteRrcSap::MasterInformationBlock m_mib;
375
  /**
376
   * The System Information Block Type 1 message to be broadcasted. SIB1 is
377
   * broadcasted every 6th subframe of every odd-numbered radio frame.
378
   * The message content is specified by the upper layer through the RRC SAP.
379
   */
343
  LteRrcSap::SystemInformationBlockType1 m_sib1;
380
  LteRrcSap::SystemInformationBlockType1 m_sib1;
344
381
345
  Ptr<LteHarqPhy> m_harqPhyModule;
382
  Ptr<LteHarqPhy> m_harqPhyModule;
346
383
347
  /**
384
  /**
348
   * Trace reporting the linear average of SRS SINRs 
385
   * The `ReportUeSinr` trace source. Reporting the linear average of SRS SINR.
349
   * uint16_t cellId, uint16_t rnti,  double sinrLinear
386
   * Exporting cell ID, RNTI, and SINR in linear unit.
350
   */
387
   */
351
  TracedCallback<uint16_t, uint16_t, double> m_reportUeSinr;
388
  TracedCallback<uint16_t, uint16_t, double> m_reportUeSinr;
389
  /**
390
   * The `UeSinrSamplePeriod` trace source. The sampling period for reporting
391
   * UEs' SINR stats.
392
   */
352
  uint16_t m_srsSamplePeriod;
393
  uint16_t m_srsSamplePeriod;
353
  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
394
  std::map <uint16_t,uint16_t> m_srsSampleCounterMap;
354
395
355
  /**
396
  /**
356
   * Trace reporting the interference per PHY RB (TS 36.214 section 5.2.2,
397
   * The `ReportInterference` trace source. Reporting the interference per PHY
357
   *  measured on DATA) 
398
   * RB (TS 36.214 section 5.2.2, measured on DATA). Exporting cell ID and
358
   * uint16_t cellId, Ptr<SpectrumValue> interference linear power per RB basis
399
   * interference linear power per RB basis.
359
   */
400
   */
360
  TracedCallback<uint16_t, Ptr<SpectrumValue> > m_reportInterferenceTrace;
401
  TracedCallback<uint16_t, Ptr<SpectrumValue> > m_reportInterferenceTrace;
402
  /**
403
   * The `InterferenceSamplePeriod` attribute. The sampling period for
404
   * reporting interference stats.
405
   * \todo In what unit is this?
406
   */
361
  uint16_t m_interferenceSamplePeriod;
407
  uint16_t m_interferenceSamplePeriod;
362
  uint16_t m_interferenceSampleCounter;
408
  uint16_t m_interferenceSampleCounter;
363
409
364
  /**
410
  /**
365
   * Trace information regarding PHY stats from UL Tx perspective
411
   * The `DlPhyTransmission` trace source. Contains trace information regarding
366
   * PhyTrasmissionStatParameters see lte-common.h
412
   * PHY stats from DL Tx perspective. Exporting a structure with type
413
   * PhyTransmissionStatParameters.
367
   */
414
   */
368
  TracedCallback<PhyTransmissionStatParameters> m_dlPhyTransmission;
415
  TracedCallback<PhyTransmissionStatParameters> m_dlPhyTransmission;
369
416
370
};
417
}; // end of `class LteEnbPhy`
371
418
372
419
373
}
420
}
(-)a/src/lte/model/lte-enb-rrc.cc (-8 / +28 lines)
 Lines 98-103    Link Here 
98
///////////////////////////////////////////
98
///////////////////////////////////////////
99
99
100
100
101
/// Map each of UE Manager states to its string representation.
101
static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
102
static const std::string g_ueManagerStateName[UeManager::NUM_STATES] =
102
{
103
{
103
  "INITIAL_RANDOM_ACCESS",
104
  "INITIAL_RANDOM_ACCESS",
 Lines 112-117    Link Here 
112
  "HANDOVER_LEAVING",
113
  "HANDOVER_LEAVING",
113
};
114
};
114
115
116
/**
117
 * \param s The UE manager state.
118
 * \return The string representation of the given state.
119
 */
115
static const std::string & ToString (UeManager::State s)
120
static const std::string & ToString (UeManager::State s)
116
{
121
{
117
  return g_ueManagerStateName[s];
122
  return g_ueManagerStateName[s];
 Lines 301-307    Link Here 
301
                   MakeUintegerAccessor (&UeManager::m_rnti),
306
                   MakeUintegerAccessor (&UeManager::m_rnti),
302
                   MakeUintegerChecker<uint16_t> ())
307
                   MakeUintegerChecker<uint16_t> ())
303
    .AddTraceSource ("StateTransition",
308
    .AddTraceSource ("StateTransition",
304
                     "fired upon every UE state transition seen by the UeManager at the eNB RRC",
309
                     "Fired upon every UE state transition seen by the "
310
                     "UeManager at the eNB RRC.",
305
                     MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace))
311
                     MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace))
306
  ;
312
  ;
307
  return tid;
313
  return tid;
 Lines 1428-1449    Link Here 
1428
1434
1429
    // Trace sources
1435
    // Trace sources
1430
    .AddTraceSource ("NewUeContext",
1436
    .AddTraceSource ("NewUeContext",
1431
                     "trace fired upon creation of a new UE context",
1437
                     "Fired upon creation of a new UE context.",
1432
                     MakeTraceSourceAccessor (&LteEnbRrc::m_newUeContextTrace))
1438
                     MakeTraceSourceAccessor (&LteEnbRrc::m_newUeContextTrace))
1433
    .AddTraceSource ("ConnectionEstablished",
1439
    .AddTraceSource ("ConnectionEstablished",
1434
                     "trace fired upon successful RRC connection establishment",
1440
                     "Fired upon successful RRC connection establishment.",
1435
                     MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace))
1441
                     MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace))
1436
    .AddTraceSource ("ConnectionReconfiguration",
1442
    .AddTraceSource ("ConnectionReconfiguration",
1437
                     "trace fired upon RRC connection reconfiguration",
1443
                     "Fired upon RRC connection reconfiguration.",
1438
                     MakeTraceSourceAccessor (&LteEnbRrc::m_connectionReconfigurationTrace))
1444
                     MakeTraceSourceAccessor (&LteEnbRrc::m_connectionReconfigurationTrace))
1439
    .AddTraceSource ("HandoverStart",
1445
    .AddTraceSource ("HandoverStart",
1440
                     "trace fired upon start of a handover procedure",
1446
                     "Fired upon start of a handover procedure.",
1441
                     MakeTraceSourceAccessor (&LteEnbRrc::m_handoverStartTrace))
1447
                     MakeTraceSourceAccessor (&LteEnbRrc::m_handoverStartTrace))
1442
    .AddTraceSource ("HandoverEndOk",
1448
    .AddTraceSource ("HandoverEndOk",
1443
                     "trace fired upon successful termination of a handover procedure",
1449
                     "Fired upon successful termination of a handover procedure.",
1444
                     MakeTraceSourceAccessor (&LteEnbRrc::m_handoverEndOkTrace))
1450
                     MakeTraceSourceAccessor (&LteEnbRrc::m_handoverEndOkTrace))
1445
    .AddTraceSource ("RecvMeasurementReport",
1451
    .AddTraceSource ("RecvMeasurementReport",
1446
                     "trace fired when measurement report is received",
1452
                     "Fired when measurement report is received.",
1447
                     MakeTraceSourceAccessor (&LteEnbRrc::m_recvMeasurementReportTrace))
1453
                     MakeTraceSourceAccessor (&LteEnbRrc::m_recvMeasurementReportTrace))
1448
  ;
1454
  ;
1449
  return tid;
1455
  return tid;
 Lines 2305-2314    Link Here 
2305
}
2311
}
2306
2312
2307
2313
2308
// from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity
2314
/// Number of distinct SRS periodicity plus one.
2309
static const uint8_t SRS_ENTRIES = 9;
2315
static const uint8_t SRS_ENTRIES = 9;
2316
/**
2317
 * Sounding Reference Symbol (SRS) periodicity (TSRS) in milliseconds. Taken
2318
 * from 3GPP TS 36.213 Table 8.2-1. Index starts from 1.
2319
 */
2310
static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40,  80, 160, 320};
2320
static const uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40,  80, 160, 320};
2321
/**
2322
 * The lower bound (inclusive) of the SRS configuration indices (ISRS) which
2323
 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
2324
 * Table 8.2-1. Index starts from 1.
2325
 */
2311
static const uint16_t g_srsCiLow[SRS_ENTRIES] =       {0, 0, 2,  7, 17, 37,  77, 157, 317};
2326
static const uint16_t g_srsCiLow[SRS_ENTRIES] =       {0, 0, 2,  7, 17, 37,  77, 157, 317};
2327
/**
2328
 * The upper bound (inclusive) of the SRS configuration indices (ISRS) which
2329
 * use the corresponding SRS periodicity (TSRS). Taken from 3GPP TS 36.213
2330
 * Table 8.2-1. Index starts from 1.
2331
 */
2312
static const uint16_t g_srsCiHigh[SRS_ENTRIES] =      {0, 1, 6, 16, 36, 76, 156, 316, 636};
2332
static const uint16_t g_srsCiHigh[SRS_ENTRIES] =      {0, 1, 6, 16, 36, 76, 156, 316, 636};
2313
2333
2314
void 
2334
void 
(-)a/src/lte/model/lte-enb-rrc.h (-37 / +202 lines)
 Lines 55-62    Link Here 
55
55
56
56
57
/**
57
/**
58
 * Manages all the radio bearer information possessed by the ENB RRC for a single UE
58
 * \ingroup lte
59
 *
59
 * Manages all the radio bearer information possessed by the ENB RRC for a
60
 * single UE.
60
 */
61
 */
61
class UeManager : public Object
62
class UeManager : public Object
62
{
63
{
 Lines 397-430    Link Here 
397
   */
398
   */
398
  void SwitchToState (State s);
399
  void SwitchToState (State s);
399
400
401
  uint8_t m_lastAllocatedDrbid;
400
402
403
  /**
404
   * The `DataRadioBearerMap` attribute. List of UE DataRadioBearerInfo by
405
   * DRBID.
406
   */
401
  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
407
  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
408
409
  /**
410
   * The `Srb0` attribute. SignalingRadioBearerInfo for SRB0.
411
   */
402
  Ptr<LteSignalingRadioBearerInfo> m_srb0;
412
  Ptr<LteSignalingRadioBearerInfo> m_srb0;
413
  /**
414
   * The `Srb1` attribute. SignalingRadioBearerInfo for SRB1.
415
   */
403
  Ptr<LteSignalingRadioBearerInfo> m_srb1;
416
  Ptr<LteSignalingRadioBearerInfo> m_srb1;
404
  uint8_t m_lastAllocatedDrbid;
417
418
  /**
419
   * The `C-RNTI` attribute. Cell Radio Network Temporary Identifier.
420
   */
405
  uint16_t m_rnti;
421
  uint16_t m_rnti;
422
  /**
423
   * International Mobile Subscriber Identity assigned to this UE. A globally
424
   * unique UE identifier.
425
   */
406
  uint64_t m_imsi;
426
  uint64_t m_imsi;
427
  ///
407
  uint8_t m_lastRrcTransactionIdentifier;
428
  uint8_t m_lastRrcTransactionIdentifier;
429
  ///
408
  LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated;
430
  LteRrcSap::PhysicalConfigDedicated m_physicalConfigDedicated;
431
  /// Pointer to the parent eNodeB RRC.
409
  Ptr<LteEnbRrc> m_rrc;
432
  Ptr<LteEnbRrc> m_rrc;
433
  /// The current UeManager state.
410
  State m_state;
434
  State m_state;
435
  ///
411
  LtePdcpSapUser* m_drbPdcpSapUser;
436
  LtePdcpSapUser* m_drbPdcpSapUser;
437
  ///
412
  bool m_pendingRrcConnectionReconfiguration;
438
  bool m_pendingRrcConnectionReconfiguration;
413
  //             imsi      cellid    rnti      old    new
439
440
  /**
441
   * The `StateTransition` trace source. Fired upon every UE state transition
442
   * seen by the UeManager at the eNB RRC. Exporting IMSI, cell ID, RNTI, old
443
   * state, and new state.
444
   */
414
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
445
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
446
415
  uint16_t m_sourceX2apId;
447
  uint16_t m_sourceX2apId;
416
  uint16_t m_sourceCellId;
448
  uint16_t m_sourceCellId;
417
  uint16_t m_targetCellId;
449
  uint16_t m_targetCellId;
418
  std::list<uint8_t> m_drbsToBeStarted;
450
  std::list<uint8_t> m_drbsToBeStarted;
419
  bool m_needPhyMacConfiguration;
451
  bool m_needPhyMacConfiguration;
420
452
453
  /**
454
   * Time limit before a _connection request timeout_ occurs. Set after a new
455
   * UE context is added after a successful Random Access. Calling
456
   * LteEnbRrc::ConnectionRequestTimeout() when it expires. Cancelled when RRC
457
   * CONNECTION REQUEST is received.
458
   */
421
  EventId m_connectionRequestTimeout;
459
  EventId m_connectionRequestTimeout;
460
  /**
461
   * Time limit before a _connection setup timeout_ occurs. Set after an RRC
462
   * CONNECTION SETUP is sent. Calling LteEnbRrc::ConnectionSetupTimeout() when
463
   * it expires. Cancelled when RRC CONNECTION SETUP COMPLETE is received.
464
   */
422
  EventId m_connectionSetupTimeout;
465
  EventId m_connectionSetupTimeout;
466
  /**
467
   * The delay before a _connection rejected timeout_ occurs. Set after an RRC
468
   * CONNECTION REJECT is sent. Calling LteEnbRrc::ConnectionRejectedTimeout()
469
   * when it expires.
470
   */
423
  EventId m_connectionRejectedTimeout;
471
  EventId m_connectionRejectedTimeout;
472
  /**
473
   * Time limit before a _handover joining timeout_ occurs. Set after a new UE
474
   * context is added after receiving a handover request. Calling
475
   * LteEnbRrc::HandoverJoiningTimeout() when it expires. Cancelled when
476
   * RRC CONNECTION RECONFIGURATION COMPLETE is received.
477
   */
424
  EventId m_handoverJoiningTimeout;
478
  EventId m_handoverJoiningTimeout;
479
  /**
480
   * Time limit before a _handover leaving timeout_ occurs. Set after a
481
   * handover command is sent. Calling LteEnbRrc::HandoverLeavingTimeout()
482
   * when it expires. Cancelled when RRC CONNECTION RE-ESTABLISHMENT or X2
483
   * UE CONTEXT RELEASE is received.
484
   */
425
  EventId m_handoverLeavingTimeout;
485
  EventId m_handoverLeavingTimeout;
426
486
427
};
487
}; // end of `class UeManager`
428
488
429
489
430
490
 Lines 679-685    Link Here 
679
739
680
  /** 
740
  /** 
681
   * Method triggered when a UE is expected to request for connection but does
741
   * Method triggered when a UE is expected to request for connection but does
682
   * not do so in a reasonable time
742
   * not do so in a reasonable time. The method will remove the UE context.
683
   * 
743
   * 
684
   * \param rnti the T-C-RNTI whose timeout expired
744
   * \param rnti the T-C-RNTI whose timeout expired
685
   */
745
   */
 Lines 687-700    Link Here 
687
747
688
  /** 
748
  /** 
689
   * Method triggered when a UE is expected to complete a connection setup
749
   * Method triggered when a UE is expected to complete a connection setup
690
   * procedure but does not do so in a reasonable time
750
   * procedure but does not do so in a reasonable time. The method will remove
751
   * the UE context.
691
   *
752
   *
692
   * \param rnti the T-C-RNTI whose timeout expired
753
   * \param rnti the T-C-RNTI whose timeout expired
693
   */
754
   */
694
  void ConnectionSetupTimeout (uint16_t rnti);
755
  void ConnectionSetupTimeout (uint16_t rnti);
695
756
696
  /**
757
  /**
697
   * Method triggered a while after sending RRC Connection Rejected
758
   * Method triggered a while after sending RRC Connection Rejected. The method
759
   * will remove the UE context.
698
   * 
760
   * 
699
   * \param rnti the T-C-RNTI whose timeout expired
761
   * \param rnti the T-C-RNTI whose timeout expired
700
   */
762
   */
 Lines 702-708    Link Here 
702
764
703
  /** 
765
  /** 
704
   * Method triggered when a UE is expected to join the cell for a handover 
766
   * Method triggered when a UE is expected to join the cell for a handover 
705
   * but does not do so in a reasonable time
767
   * but does not do so in a reasonable time. The method will remove the UE
768
   * context.
706
   * 
769
   * 
707
   * \param rnti the C-RNTI whose timeout expired
770
   * \param rnti the C-RNTI whose timeout expired
708
   */
771
   */
 Lines 710-727    Link Here 
710
773
711
  /** 
774
  /** 
712
   * Method triggered when a UE is expected to leave a cell for a handover
775
   * Method triggered when a UE is expected to leave a cell for a handover
713
   * but no feedback is received in a reasonable time
776
   * but no feedback is received in a reasonable time. The method will remove
777
   * the UE context.
714
   * 
778
   * 
715
   * \param rnti the C-RNTI whose timeout expired
779
   * \param rnti the C-RNTI whose timeout expired
716
   */
780
   */
717
  void HandoverLeavingTimeout (uint16_t rnti);
781
  void HandoverLeavingTimeout (uint16_t rnti);
718
782
719
  /** 
783
  /** 
720
   * Send a HandoverRequest through the X2 SAP interface
784
   * Send a HandoverRequest through the X2 SAP interface. This method will
721
   * 
785
   * trigger a handover which is started by the RRC by sending a handover
722
   * This method will trigger a handover which is started by the RRC
786
   * request to the target eNB over the X2 interface
723
   * by sending a handover request to the target eNB over the X2
724
   * interface 
725
   *
787
   *
726
   * \param rnti the ID of the UE to be handed over
788
   * \param rnti the ID of the UE to be handed over
727
   * \param cellId the ID of the target eNB
789
   * \param cellId the ID of the target eNB
 Lines 918-970    Link Here 
918
980
919
  Callback <void, Ptr<Packet> > m_forwardUpCallback;
981
  Callback <void, Ptr<Packet> > m_forwardUpCallback;
920
982
983
  /// Interface to receive messages from neighbour eNodeB over the X2 interface.
921
  EpcX2SapUser* m_x2SapUser;
984
  EpcX2SapUser* m_x2SapUser;
985
  /// Interface to send messages to neighbour eNodeB over the X2 interface.
922
  EpcX2SapProvider* m_x2SapProvider;
986
  EpcX2SapProvider* m_x2SapProvider;
923
987
988
  /// Receive API calls from the eNodeB MAC instance.
924
  LteEnbCmacSapUser* m_cmacSapUser;
989
  LteEnbCmacSapUser* m_cmacSapUser;
990
  /// Interface to the eNodeB MAC instance.
925
  LteEnbCmacSapProvider* m_cmacSapProvider;
991
  LteEnbCmacSapProvider* m_cmacSapProvider;
926
992
993
  /// Receive API calls from the handover algorithm instance.
927
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
994
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
995
  /// Interface to the handover algorithm instance.
928
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
996
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
929
997
998
  /// Receive API calls from the ANR instance.
930
  LteAnrSapUser* m_anrSapUser;
999
  LteAnrSapUser* m_anrSapUser;
1000
  /// Interface to the ANR instance.
931
  LteAnrSapProvider* m_anrSapProvider;
1001
  LteAnrSapProvider* m_anrSapProvider;
932
1002
1003
  /// Receive API calls from the FFR algorithm instance.
933
  LteFfrRrcSapUser* m_ffrRrcSapUser;
1004
  LteFfrRrcSapUser* m_ffrRrcSapUser;
1005
  /// Interface to the FFR algorithm instance.
934
  LteFfrRrcSapProvider* m_ffrRrcSapProvider;
1006
  LteFfrRrcSapProvider* m_ffrRrcSapProvider;
935
1007
1008
  /// Interface to send messages to UE over the RRC protocol.
936
  LteEnbRrcSapUser* m_rrcSapUser;
1009
  LteEnbRrcSapUser* m_rrcSapUser;
1010
  /// Interface to receive messages from UE over the RRC protocol.
937
  LteEnbRrcSapProvider* m_rrcSapProvider;
1011
  LteEnbRrcSapProvider* m_rrcSapProvider;
938
1012
1013
  /// Interface to the eNodeB MAC instance, to be used by RLC instances.
939
  LteMacSapProvider* m_macSapProvider;
1014
  LteMacSapProvider* m_macSapProvider;
940
1015
1016
  /// Interface to send messages to core network over the S1 protocol.
941
  EpcEnbS1SapProvider* m_s1SapProvider;
1017
  EpcEnbS1SapProvider* m_s1SapProvider;
1018
  /// Interface to receive messages from core network over the S1 protocol.
942
  EpcEnbS1SapUser* m_s1SapUser;
1019
  EpcEnbS1SapUser* m_s1SapUser;
943
1020
1021
  /// Receive API calls from the eNodeB PHY instance.
944
  LteEnbCphySapUser* m_cphySapUser;
1022
  LteEnbCphySapUser* m_cphySapUser;
1023
  /// Interface to the eNodeB PHY instance.
945
  LteEnbCphySapProvider* m_cphySapProvider;
1024
  LteEnbCphySapProvider* m_cphySapProvider;
946
1025
1026
  /// True if ConfigureCell() has been completed.
947
  bool m_configured;
1027
  bool m_configured;
1028
  /// Cell identifier. Must be unique across the simulation.
948
  uint16_t m_cellId;
1029
  uint16_t m_cellId;
1030
  /// Downlink E-UTRA Absolute Radio Frequency Channel Number.
949
  uint16_t m_dlEarfcn;
1031
  uint16_t m_dlEarfcn;
1032
  /// Uplink E-UTRA Absolute Radio Frequency Channel Number.
950
  uint16_t m_ulEarfcn;
1033
  uint16_t m_ulEarfcn;
1034
  /// Downlink transmission bandwidth configuration in number of Resource Blocks.
951
  uint16_t m_dlBandwidth;
1035
  uint16_t m_dlBandwidth;
1036
  /// Uplink transmission bandwidth configuration in number of Resource Blocks.
952
  uint16_t m_ulBandwidth;
1037
  uint16_t m_ulBandwidth;
1038
  ///
953
  uint16_t m_lastAllocatedRnti;
1039
  uint16_t m_lastAllocatedRnti;
954
1040
955
  /// the System Information Block Type 1 that is currently broadcasted over BCH
1041
  /// The System Information Block Type 1 that is currently broadcasted over BCH.
956
  LteRrcSap::SystemInformationBlockType1 m_sib1;
1042
  LteRrcSap::SystemInformationBlockType1 m_sib1;
957
1043
1044
  /**
1045
   * The `UeMap` attribute. List of UeManager by C-RNTI.
1046
   */
958
  std::map<uint16_t, Ptr<UeManager> > m_ueMap;
1047
  std::map<uint16_t, Ptr<UeManager> > m_ueMap;
959
1048
960
  /**
1049
  /**
961
   * \brief List of measurement configuration which are active in every UE
1050
   * List of measurement configuration which are active in every UE attached to
962
   *        attached to this eNodeB instance.
1051
   * this eNodeB instance.
963
   */
1052
   */
964
  LteRrcSap::MeasConfig m_ueMeasConfig;
1053
  LteRrcSap::MeasConfig m_ueMeasConfig;
965
1054
1055
  /// List of measurement identities which are intended for handover purpose.
966
  std::set<uint8_t> m_handoverMeasIds;
1056
  std::set<uint8_t> m_handoverMeasIds;
1057
  /// List of measurement identities which are intended for ANR purpose.
967
  std::set<uint8_t> m_anrMeasIds;
1058
  std::set<uint8_t> m_anrMeasIds;
1059
  /// List of measurement identities which are intended for FFR purpose.
968
  std::set<uint8_t> m_ffrMeasIds;
1060
  std::set<uint8_t> m_ffrMeasIds;
969
1061
970
  struct X2uTeidInfo
1062
  struct X2uTeidInfo
 Lines 976-1026    Link Here 
976
  //       TEID      RNTI, DRBID
1068
  //       TEID      RNTI, DRBID
977
  std::map<uint32_t, X2uTeidInfo> m_x2uTeidInfoMap;
1069
  std::map<uint32_t, X2uTeidInfo> m_x2uTeidInfoMap;
978
1070
1071
  /**
1072
   * The `DefaultTransmissionMode` attribute. The default UEs' transmission
1073
   * mode (0: SISO).
1074
   */
979
  uint8_t m_defaultTransmissionMode;
1075
  uint8_t m_defaultTransmissionMode;
980
1076
  /**
1077
   * The `EpsBearerToRlcMapping` attribute. Specify which type of RLC will be
1078
   * used for each type of EPS bearer.
1079
   */
981
  enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping;
1080
  enum LteEpsBearerToRlcMapping_t m_epsBearerToRlcMapping;
982
1081
  /**
1082
   * The `SystemInformationPeriodicity` attribute. The interval for sending
1083
   * system information.
1084
   */
983
  Time m_systemInformationPeriodicity;
1085
  Time m_systemInformationPeriodicity;
984
1086
  /**
985
  // SRS related attributes
1087
   * The `SrsPeriodicity` attribute. The SRS periodicity in milliseconds.
1088
   */
986
  uint16_t m_srsCurrentPeriodicityId;
1089
  uint16_t m_srsCurrentPeriodicityId;
987
  std::set<uint16_t> m_ueSrsConfigurationIndexSet;
1090
  std::set<uint16_t> m_ueSrsConfigurationIndexSet;
988
  uint16_t m_lastAllocatedConfigurationIndex;
1091
  uint16_t m_lastAllocatedConfigurationIndex;
989
  bool m_reconfigureUes;
1092
  bool m_reconfigureUes;
990
1093
991
  // Cell selection related attribute
1094
  /**
1095
   * The `QRxLevMin` attribute. One of information transmitted within the SIB1
1096
   * message, indicating the required minimum RSRP level that any UE must
1097
   * receive from this cell before it is allowed to camp to this cell.
1098
   */
992
  int8_t m_qRxLevMin;
1099
  int8_t m_qRxLevMin;
993
1100
  /**
994
  // Handover related attributes
1101
   * The `AdmitHandoverRequest` attribute. Whether to admit an X2 handover
1102
   * request from another eNB.
1103
   */
995
  bool m_admitHandoverRequest;
1104
  bool m_admitHandoverRequest;
1105
  /**
1106
   * The `AdmitRrcConnectionRequest` attribute. Whether to admit a connection
1107
   * request from a UE.
1108
   */
996
  bool m_admitRrcConnectionRequest;
1109
  bool m_admitRrcConnectionRequest;
997
1110
  /**
998
  // UE measurements related attributes
1111
   * The `RsrpFilterCoefficient` attribute. Determines the strength of
1112
   * smoothing effect induced by layer 3 filtering of RSRP in all attached UE.
1113
   * If equals to 0, no layer 3 filtering is applicable.
1114
   */
999
  uint8_t m_rsrpFilterCoefficient;
1115
  uint8_t m_rsrpFilterCoefficient;
1116
  /**
1117
   * The `RsrqFilterCoefficient` attribute. Determines the strength of
1118
   * smoothing effect induced by layer 3 filtering of RSRQ in all attached UE.
1119
   * If equals to 0, no layer 3 filtering is applicable.
1120
   */
1000
  uint8_t m_rsrqFilterCoefficient;
1121
  uint8_t m_rsrqFilterCoefficient;
1001
1122
  /**
1002
  // timeouts
1123
   * The `ConnectionRequestTimeoutDuration` attribute. After a RA attempt, if
1124
   * no RRC CONNECTION REQUEST is received before this time, the UE context is
1125
   * destroyed. Must account for reception of RAR and transmission of RRC
1126
   * CONNECTION REQUEST over UL GRANT.
1127
   */
1003
  Time m_connectionRequestTimeoutDuration;
1128
  Time m_connectionRequestTimeoutDuration;
1129
  /**
1130
   * The `ConnectionSetupTimeoutDuration` attribute. After accepting connection
1131
   * request, if no RRC CONNECTION SETUP COMPLETE is received before this time,
1132
   * the UE context is destroyed. Must account for the UE's reception of RRC
1133
   * CONNECTION SETUP and transmission of RRC CONNECTION SETUP COMPLETE.
1134
   */
1004
  Time m_connectionSetupTimeoutDuration;
1135
  Time m_connectionSetupTimeoutDuration;
1136
  /**
1137
   * The `ConnectionRejectedTimeoutDuration` attribute. Time to wait between
1138
   * sending a RRC CONNECTION REJECT and destroying the UE context.
1139
   */
1005
  Time m_connectionRejectedTimeoutDuration;
1140
  Time m_connectionRejectedTimeoutDuration;
1141
  /**
1142
   * The `HandoverJoiningTimeoutDuration` attribute. After accepting a handover
1143
   * request, if no RRC CONNECTION RECONFIGURATION COMPLETE is received before
1144
   * this time, the UE context is destroyed. Must account for reception of X2
1145
   * HO REQ ACK by source eNB, transmission of the Handover Command,
1146
   * non-contention-based random access and reception of the RRC CONNECTION
1147
   * RECONFIGURATION COMPLETE message.
1148
   */
1006
  Time m_handoverJoiningTimeoutDuration;
1149
  Time m_handoverJoiningTimeoutDuration;
1150
  /**
1151
   * The `HandoverLeavingTimeoutDuration` attribute. After issuing a Handover
1152
   * Command, if neither RRC CONNECTION RE-ESTABLISHMENT nor X2 UE Context
1153
   * Release has been previously received, the UE context is destroyed.
1154
   */
1007
  Time m_handoverLeavingTimeoutDuration;
1155
  Time m_handoverLeavingTimeoutDuration;
1008
1156
1009
  //             cellid    rnti
1157
  /**
1158
   * The `NewUeContext` trace source. Fired upon creation of a new UE context.
1159
   * Exporting cell ID and RNTI.
1160
   */
1010
  TracedCallback<uint16_t, uint16_t> m_newUeContextTrace;
1161
  TracedCallback<uint16_t, uint16_t> m_newUeContextTrace;
1011
  //             imsi      cellid    rnti
1162
  /**
1163
   * The `ConnectionEstablished` trace source. Fired upon successful RRC
1164
   * connection establishment. Exporting IMSI, cell ID, and RNTI.
1165
   */
1012
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
1166
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
1013
  //             imsi      cellid    rnti
1167
  /**
1168
   * The `ConnectionReconfiguration` trace source. Fired upon RRC connection
1169
   * reconfiguration. Exporting IMSI, cell ID, and RNTI.
1170
   */
1014
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
1171
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
1015
  //             imsi      cellid    rnti     targetCellId
1172
  /**
1173
   * The `HandoverStart` trace source. Fired upon start of a handover
1174
   * procedure. Exporting IMSI, cell ID, RNTI, and target cell ID.
1175
   */
1016
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
1176
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
1017
  //             imsi      cellid    rnti
1177
  /**
1178
   * The `HandoverEndOk` trace source. Fired upon successful termination of a
1179
   * handover procedure. Exporting IMSI, cell ID, and RNTI.
1180
   */
1018
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndOkTrace;
1181
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndOkTrace;
1019
1182
  /**
1020
  //             imsi      cellid    rnti
1183
   * The `RecvMeasurementReport` trace source. Fired when measurement report is
1184
   * received. Exporting IMSI, cell ID, and RNTI.
1185
   */
1021
  TracedCallback<uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport> m_recvMeasurementReportTrace;
1186
  TracedCallback<uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport> m_recvMeasurementReportTrace;
1022
1187
1023
};
1188
}; // end of `class LteEnbRrc`
1024
1189
1025
1190
1026
} // namespace ns3
1191
} // namespace ns3
(-)a/src/lte/model/lte-phy.h (-3 / +60 lines)
 Lines 212-240    Link Here 
212
212
213
213
214
protected:
214
protected:
215
  /// Pointer to the NetDevice where this PHY layer is attached.
215
  Ptr<LteNetDevice> m_netDevice;
216
  Ptr<LteNetDevice> m_netDevice;
216
217
218
  /**
219
   * The downlink LteSpectrumPhy associated to this LtePhy. Also available as
220
   * attribute `DlSpectrumPhy` in the child classes LteEnbPhy and LteUePhy.
221
   */
217
  Ptr<LteSpectrumPhy> m_downlinkSpectrumPhy;
222
  Ptr<LteSpectrumPhy> m_downlinkSpectrumPhy;
223
  /**
224
   * The uplink LteSpectrumPhy associated to this LtePhy. Also available as
225
   * attribute `UlSpectrumPhy` in the child classes LteEnbPhy and LteUePhy.
226
   */
218
  Ptr<LteSpectrumPhy> m_uplinkSpectrumPhy;
227
  Ptr<LteSpectrumPhy> m_uplinkSpectrumPhy;
219
228
229
  /**
230
   * Transmission power in dBm. Also available as attribute `TxPower` in the
231
   * child classes LteEnbPhy and LteUePhy.
232
   */
220
  double m_txPower;
233
  double m_txPower;
234
  /**
235
   * Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the
236
   * receiver. Also available as attribute `NoiseFigure` in the child classes
237
   * LteEnbPhy and LteUePhy.
238
   *
239
   * According to [Wikipedia](http://en.wikipedia.org/wiki/Noise_figure), this
240
   * is "the difference in decibels (dB) between the noise output of the actual
241
   * receiver to the noise output of an ideal receiver with the same overall
242
   * gain and bandwidth when the receivers are connected to sources at the
243
   * standard noise temperature T0." In this model, we consider T0 = 290K.
244
   */
221
  double m_noiseFigure;
245
  double m_noiseFigure;
222
246
247
  /// Transmission time interval.
223
  double m_tti;
248
  double m_tti;
249
  /**
250
   * The UL bandwidth in number of PRBs.
251
   * Specified by the upper layer through CPHY SAP.
252
   */
224
  uint8_t m_ulBandwidth;
253
  uint8_t m_ulBandwidth;
254
  /**
255
   * The DL bandwidth in number of PRBs.
256
   * Specified by the upper layer through CPHY SAP.
257
   */
225
  uint8_t m_dlBandwidth;
258
  uint8_t m_dlBandwidth;
259
  /// The RB gruop size according to the bandwidth.
226
  uint8_t m_rbgSize;
260
  uint8_t m_rbgSize;
227
261
  /**
262
   * The downlink carrier frequency.
263
   * Specified by the upper layer through CPHY SAP.
264
   */
228
  uint16_t m_dlEarfcn;
265
  uint16_t m_dlEarfcn;
266
  /**
267
   * The uplink carrier frequency.
268
   * Specified by the upper layer through CPHY SAP.
269
   */
229
  uint16_t m_ulEarfcn;
270
  uint16_t m_ulEarfcn;
230
271
272
  /// A queue of packet bursts to be sent.
231
  std::vector< Ptr<PacketBurst> > m_packetBurstQueue;
273
  std::vector< Ptr<PacketBurst> > m_packetBurstQueue;
274
  /// A queue of control messages to be sent.
232
  std::vector< std::list<Ptr<LteControlMessage> > > m_controlMessagesQueue;
275
  std::vector< std::list<Ptr<LteControlMessage> > > m_controlMessagesQueue;
233
  uint8_t m_macChTtiDelay; // delay between MAC and channel layer in terms of TTIs
276
  /**
277
   * Delay between MAC and channel layer in terms of TTIs. It is the delay that
278
   * occurs between a scheduling decision in the MAC and the actual start of
279
   * the transmission by the PHY. This is intended to be used to model the
280
   * latency of real PHY and MAC implementations.
281
   *
282
   * In LteEnbPhy, it is 2 TTIs by default and can be configured through the
283
   * `MacToChannelDelay` attribute. In LteUePhy, it is 4 TTIs.
284
   */
285
  uint8_t m_macChTtiDelay;
234
286
287
  /**
288
   * Cell identifier. In LteEnbPhy, this corresponds to the ID of the cell
289
   * which hosts this PHY layer. In LteUePhy, this corresponds to the ID of the
290
   * eNodeB which this PHY layer is synchronized with.
291
   */
235
  uint16_t m_cellId;
292
  uint16_t m_cellId;
236
293
237
};
294
}; // end of `class LtePhy`
238
295
239
296
240
}
297
}
(-)a/src/lte/model/lte-ue-phy.cc (-10 / +21 lines)
 Lines 47-60    Link Here 
47
47
48
48
49
49
50
// duration of data portion of UL subframe
50
/**
51
// = TTI - 1 symbol for SRS - 1ns as margin to avoid overlapping simulator events
51
 * Duration of the data portion of a UL subframe.
52
// (symbol duration in nanoseconds = TTI / 14 (rounded))
52
 * Equals to "TTI length - 1 symbol length for SRS - margin".
53
// in other words, duration of data portion of UL subframe = TTI*(13/14) -1ns
53
 * The margin is 1 nanosecond and is intended to avoid overlapping simulator
54
 * events. The duration of one symbol is TTI/14 (rounded). In other words,
55
 * duration of data portion of UL subframe = 1 ms * (13/14) - 1 ns.
56
 */
54
static const Time UL_DATA_DURATION = NanoSeconds (1e6 - 71429 - 1); 
57
static const Time UL_DATA_DURATION = NanoSeconds (1e6 - 71429 - 1); 
55
58
56
// delay from subframe start to transmission of SRS 
59
/**
57
// = TTI - 1 symbol for SRS 
60
 * Delay from subframe start to transmission of SRS.
61
 * Equals to "TTI length - 1 symbol for SRS".
62
 */
58
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START = NanoSeconds (1e6 - 71429); 
63
static const Time UL_SRS_DELAY_FROM_SUBFRAME_START = NanoSeconds (1e6 - 71429); 
59
64
60
65
 Lines 107-118    Link Here 
107
// LteUePhy methods
112
// LteUePhy methods
108
////////////////////////////////////////
113
////////////////////////////////////////
109
114
115
/// Map each of UE PHY states to its string representation.
110
static const std::string g_uePhyStateName[LteUePhy::NUM_STATES] =
116
static const std::string g_uePhyStateName[LteUePhy::NUM_STATES] =
111
{
117
{
112
  "CELL_SEARCH",
118
  "CELL_SEARCH",
113
  "SYNCHRONIZED"
119
  "SYNCHRONIZED"
114
};
120
};
115
121
122
/**
123
 * \param s The UE PHY state.
124
 * \return The string representation of the given state.
125
 */
116
static inline const std::string & ToString (LteUePhy::State s)
126
static inline const std::string & ToString (LteUePhy::State s)
117
{
127
{
118
  return g_uePhyStateName[s];
128
  return g_uePhyStateName[s];
 Lines 243-249    Link Here 
243
                   MakeUintegerAccessor (&LteUePhy::m_rsrpSinrSamplePeriod),
253
                   MakeUintegerAccessor (&LteUePhy::m_rsrpSinrSamplePeriod),
244
                   MakeUintegerChecker<uint16_t> ())
254
                   MakeUintegerChecker<uint16_t> ())
245
    .AddTraceSource ("UlPhyTransmission",
255
    .AddTraceSource ("UlPhyTransmission",
246
                     "DL transmission PHY layer statistics.",
256
                     "UL transmission PHY layer statistics.",
247
                     MakeTraceSourceAccessor (&LteUePhy::m_ulPhyTransmission))
257
                     MakeTraceSourceAccessor (&LteUePhy::m_ulPhyTransmission))
248
    .AddAttribute ("DlSpectrumPhy",
258
    .AddAttribute ("DlSpectrumPhy",
249
                   "The downlink LteSpectrumPhy associated to this LtePhy",
259
                   "The downlink LteSpectrumPhy associated to this LtePhy",
 Lines 263-269    Link Here 
263
                   MakeDoubleAccessor (&LteUePhy::m_pssReceptionThreshold),
273
                   MakeDoubleAccessor (&LteUePhy::m_pssReceptionThreshold),
264
                   MakeDoubleChecker<double> ())
274
                   MakeDoubleChecker<double> ())
265
    .AddAttribute ("UeMeasurementsFilterPeriod",
275
    .AddAttribute ("UeMeasurementsFilterPeriod",
266
                   "Time period for reporting UE measurements (default 200 ms.) ",
276
                   "Time period for reporting UE measurements, i.e., the"
277
                   "length of layer-1 filtering (default 200 ms).",
267
                   TimeValue (MilliSeconds (200)),
278
                   TimeValue (MilliSeconds (200)),
268
                   MakeTimeAccessor (&LteUePhy::m_ueMeasurementsFilterPeriod),
279
                   MakeTimeAccessor (&LteUePhy::m_ueMeasurementsFilterPeriod),
269
                   MakeTimeChecker ())
280
                   MakeTimeChecker ())
 Lines 271-280    Link Here 
271
                     "Report UE measurements RSRP (dBm) and RSRQ (dB).",
282
                     "Report UE measurements RSRP (dBm) and RSRQ (dB).",
272
                     MakeTraceSourceAccessor (&LteUePhy::m_reportUeMeasurements))
283
                     MakeTraceSourceAccessor (&LteUePhy::m_reportUeMeasurements))
273
    .AddTraceSource ("StateTransition",
284
    .AddTraceSource ("StateTransition",
274
                     "Trace fired upon every UE PHY state transition",
285
                     "Trace fired upon every UE PHY state transition.",
275
                     MakeTraceSourceAccessor (&LteUePhy::m_stateTransitionTrace))
286
                     MakeTraceSourceAccessor (&LteUePhy::m_stateTransitionTrace))
276
    .AddAttribute ("EnableUplinkPowerControl",
287
    .AddAttribute ("EnableUplinkPowerControl",
277
                   "If true Uplink Power Control will be enabled",
288
                   "If true, Uplink Power Control will be enabled.",
278
                   BooleanValue (true),
289
                   BooleanValue (true),
279
                   MakeBooleanAccessor (&LteUePhy::m_enableUplinkPowerControl),
290
                   MakeBooleanAccessor (&LteUePhy::m_enableUplinkPowerControl),
280
                   MakeBooleanChecker ())
291
                   MakeBooleanChecker ())
(-)a/src/lte/model/lte-ue-phy.h (-16 / +58 lines)
 Lines 260-265    Link Here 
260
   */
260
   */
261
  void ReportUeMeasurements ();
261
  void ReportUeMeasurements ();
262
262
263
  /**
264
   * Switch the UE PHY to the given state.
265
   * \param s the destination state
266
   */
263
  void SwitchToState (State s);
267
  void SwitchToState (State s);
264
268
265
  // UE CPHY SAP methods
269
  // UE CPHY SAP methods
 Lines 279-285    Link Here 
279
  virtual void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
283
  virtual void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
280
  virtual void DoSendRachPreamble (uint32_t prachId, uint32_t raRnti);
284
  virtual void DoSendRachPreamble (uint32_t prachId, uint32_t raRnti);
281
285
286
  /// A list of sub channels to use in TX.
282
  std::vector <int> m_subChannelsForTransmission;
287
  std::vector <int> m_subChannelsForTransmission;
288
  /// A list of sub channels to use in RX.
283
  std::vector <int> m_subChannelsForReception;
289
  std::vector <int> m_subChannelsForReception;
284
290
285
  std::vector< std::vector <int> > m_subChannelsForTransmissionQueue;
291
  std::vector< std::vector <int> > m_subChannelsForTransmissionQueue;
 Lines 287-300    Link Here 
287
293
288
  Ptr<LteAmc> m_amc;
294
  Ptr<LteAmc> m_amc;
289
295
296
  /**
297
   * The `EnableUplinkPowerControl` attribute. If true, Uplink Power Control
298
   * will be enabled.
299
   */
290
  bool m_enableUplinkPowerControl;
300
  bool m_enableUplinkPowerControl;
301
  /// Pointer to UE Uplink Power Control entity.
291
  Ptr<LteUePowerControl> m_powerControl;
302
  Ptr<LteUePowerControl> m_powerControl;
292
303
293
  Time m_p10CqiPeriocity; /**< Wideband Periodic CQI: 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms */
304
  /// Wideband Periodic CQI. 2, 5, 10, 16, 20, 32, 40, 64, 80 or 160 ms.
305
  Time m_p10CqiPeriocity;
294
  Time m_p10CqiLast;
306
  Time m_p10CqiLast;
295
307
296
  /**< SubBand Aperiodic CQI: activated by  DCI format 0 or Random Access Response Grant */
308
  /**
297
  // NOTE defines a periodicity for academic studies
309
   * SubBand Aperiodic CQI. Activated by DCI format 0 or Random Access Response
310
   * Grant.
311
   * \note Defines a periodicity for academic studies.
312
   */
298
  Time m_a30CqiPeriocity;
313
  Time m_a30CqiPeriocity;
299
  Time m_a30CqiLast;
314
  Time m_a30CqiLast;
300
315
 Lines 317-326    Link Here 
317
  bool m_dlConfigured;
332
  bool m_dlConfigured;
318
  bool m_ulConfigured;
333
  bool m_ulConfigured;
319
334
335
  /// The current UE PHY state.
320
  State m_state;
336
  State m_state;
321
  //             cellid    rnti
337
  /**
338
   * The `StateTransition` trace source. Fired upon every UE PHY state
339
   * transition. Exporting the serving cell ID, RNTI, old state, and new state.
340
   */
322
  TracedCallback<uint16_t, uint16_t, State, State> m_stateTransitionTrace;
341
  TracedCallback<uint16_t, uint16_t, State, State> m_stateTransitionTrace;
323
342
343
  /// \todo Can be removed.
324
  uint8_t m_subframeNo;
344
  uint8_t m_subframeNo;
325
345
326
  bool m_rsReceivedPowerUpdated;
346
  bool m_rsReceivedPowerUpdated;
 Lines 341-358    Link Here 
341
  };
361
  };
342
  std::list <PssElement> m_pssList;
362
  std::list <PssElement> m_pssList;
343
363
344
  double m_pssReceptionThreshold; // on RSRQ [W]
364
  /**
365
   * The `RsrqUeMeasThreshold` attribute. Receive threshold for PSS on RSRQ
366
   * in dB.
367
   */
368
  double m_pssReceptionThreshold;
345
369
370
  /// Summary results of measuring a specific cell. Used for layer-1 filtering.
346
  struct UeMeasurementsElement
371
  struct UeMeasurementsElement
347
  {
372
  {
348
    double rsrpSum;
373
    double rsrpSum;   ///< Sum of RSRP sample values in linear unit.
349
    uint8_t rsrpNum;
374
    uint8_t rsrpNum;  ///< Number of RSRP samples.
350
    double rsrqSum;
375
    double rsrqSum;   ///< Sum of RSRQ sample values in linear unit.
351
    uint8_t rsrqNum;
376
    uint8_t rsrqNum;  ///< Number of RSRQ samples.
352
  };
377
  };
353
378
379
  /**
380
   * Store measurement results during the last layer-1 filtering period.
381
   * Indexed by the cell ID where the measurements come from.
382
   */
354
  std::map <uint16_t, UeMeasurementsElement> m_ueMeasurementsMap;
383
  std::map <uint16_t, UeMeasurementsElement> m_ueMeasurementsMap;
384
  /**
385
   * The `UeMeasurementsFilterPeriod` attribute. Time period for reporting UE
386
   * measurements, i.e., the length of layer-1 filtering (default 200 ms).
387
   */
355
  Time m_ueMeasurementsFilterPeriod;
388
  Time m_ueMeasurementsFilterPeriod;
389
  /// \todo Can be removed.
356
  Time m_ueMeasurementsFilterLast;
390
  Time m_ueMeasurementsFilterLast;
357
391
358
  Ptr<LteHarqPhy> m_harqPhyModule;
392
  Ptr<LteHarqPhy> m_harqPhyModule;
 Lines 361-388    Link Here 
361
  uint32_t m_raRnti;
395
  uint32_t m_raRnti;
362
396
363
  /**
397
  /**
364
   * Trace information regarding RSRP and average SINR (see TS 36.214)
398
   * The `ReportCurrentCellRsrpSinr` trace source. Trace information regarding
365
   * uint16_t cellId, uint16_t rnti, double rsrp, double sinr
399
   * RSRP and average SINR (see TS 36.214). Exporting cell ID, RNTI, RSRP, and
400
   * SINR.
366
   */
401
   */
367
  TracedCallback<uint16_t, uint16_t, double, double> m_reportCurrentCellRsrpSinrTrace;
402
  TracedCallback<uint16_t, uint16_t, double, double> m_reportCurrentCellRsrpSinrTrace;
403
  /**
404
   * The `RsrpSinrSamplePeriod` attribute. The sampling period for reporting
405
   * RSRP-SINR stats.
406
   */
368
  uint16_t m_rsrpSinrSamplePeriod;
407
  uint16_t m_rsrpSinrSamplePeriod;
369
  uint16_t m_rsrpSinrSampleCounter;
408
  uint16_t m_rsrpSinrSampleCounter;
370
409
371
  /**
410
  /**
372
   * Trace information regarding RSRP and RSRQ (see TS 36.214)
411
   * The `ReportUeMeasurements` trace source. Contains trace information
373
   * uint16_t rnti, uint16_t cellId, double rsrpDbm, double rsrqDb, bool isServingCell
412
   * regarding RSRP and RSRQ measured from a specific cell (see TS 36.214).
413
   * Exporting RNTI, the ID of the measured cell, RSRP (in dBm), RSRQ (in dB),
414
   * and whether the cell is the serving cell.
374
   */
415
   */
375
  TracedCallback<uint16_t, uint16_t, double, double, bool> m_reportUeMeasurements;
416
  TracedCallback<uint16_t, uint16_t, double, double, bool> m_reportUeMeasurements;
376
417
377
  EventId m_sendSrsEvent;
418
  EventId m_sendSrsEvent;
378
419
379
  /**
420
  /**
380
   * Trace information regarding PHY stats from DL Tx perspective
421
   * The `UlPhyTransmission` trace source. Contains trace information regarding
381
   * PhyTrasmissionStatParameters  see lte-common.h
422
   * PHY stats from UL Tx perspective. Exporting a structure with type
423
   * PhyTransmissionStatParameters.
382
   */
424
   */
383
  TracedCallback<PhyTransmissionStatParameters> m_ulPhyTransmission;
425
  TracedCallback<PhyTransmissionStatParameters> m_ulPhyTransmission;
384
426
385
};
427
}; // end of `class LteUePhy`
386
428
387
429
388
}
430
}
(-)a/src/lte/model/lte-ue-rrc.cc (-15 / +19 lines)
 Lines 86-92    Link Here 
86
86
87
87
88
88
89
89
/// Map each of UE RRC states to its string representation.
90
static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES] =
90
static const std::string g_ueRrcStateName[LteUeRrc::NUM_STATES] =
91
{
91
{
92
  "IDLE_START",
92
  "IDLE_START",
 Lines 104-109    Link Here 
104
  "CONNECTED_REESTABLISHING"
104
  "CONNECTED_REESTABLISHING"
105
};
105
};
106
106
107
/**
108
 * \param s The UE RRC state.
109
 * \return The string representation of the given state.
110
 */
107
static const std::string & ToString (LteUeRrc::State s)
111
static const std::string & ToString (LteUeRrc::State s)
108
{
112
{
109
  return g_ueRrcStateName[s];
113
  return g_ueRrcStateName[s];
 Lines 195-240    Link Here 
195
                   MakeTimeAccessor (&LteUeRrc::m_t300),
199
                   MakeTimeAccessor (&LteUeRrc::m_t300),
196
                   MakeTimeChecker ())
200
                   MakeTimeChecker ())
197
    .AddTraceSource ("MibReceived",
201
    .AddTraceSource ("MibReceived",
198
                     "trace fired upon reception of Master Information Block",
202
                     "Fired upon reception of Master Information Block.",
199
                     MakeTraceSourceAccessor (&LteUeRrc::m_mibReceivedTrace))
203
                     MakeTraceSourceAccessor (&LteUeRrc::m_mibReceivedTrace))
200
    .AddTraceSource ("Sib1Received",
204
    .AddTraceSource ("Sib1Received",
201
                     "trace fired upon reception of System Information Block Type 1",
205
                     "Fired upon reception of System Information Block Type 1.",
202
                     MakeTraceSourceAccessor (&LteUeRrc::m_sib1ReceivedTrace))
206
                     MakeTraceSourceAccessor (&LteUeRrc::m_sib1ReceivedTrace))
203
    .AddTraceSource ("Sib2Received",
207
    .AddTraceSource ("Sib2Received",
204
                     "trace fired upon reception of System Information Block Type 2",
208
                     "Fired upon reception of System Information Block Type 2.",
205
                     MakeTraceSourceAccessor (&LteUeRrc::m_sib2ReceivedTrace))
209
                     MakeTraceSourceAccessor (&LteUeRrc::m_sib2ReceivedTrace))
206
    .AddTraceSource ("StateTransition",
210
    .AddTraceSource ("StateTransition",
207
                     "trace fired upon every UE RRC state transition",
211
                     "Fired upon every UE RRC state transition.",
208
                     MakeTraceSourceAccessor (&LteUeRrc::m_stateTransitionTrace))
212
                     MakeTraceSourceAccessor (&LteUeRrc::m_stateTransitionTrace))
209
    .AddTraceSource ("InitialCellSelectionEndOk",
213
    .AddTraceSource ("InitialCellSelectionEndOk",
210
                     "trace fired upon successful initial cell selection procedure",
214
                     "Fired upon successful initial cell selection procedure.",
211
                     MakeTraceSourceAccessor (&LteUeRrc::m_initialCellSelectionEndOkTrace))
215
                     MakeTraceSourceAccessor (&LteUeRrc::m_initialCellSelectionEndOkTrace))
212
    .AddTraceSource ("InitialCellSelectionEndError",
216
    .AddTraceSource ("InitialCellSelectionEndError",
213
                     "trace fired upon failed initial cell selection procedure",
217
                     "Fired upon failed initial cell selection procedure.",
214
                     MakeTraceSourceAccessor (&LteUeRrc::m_initialCellSelectionEndErrorTrace))
218
                     MakeTraceSourceAccessor (&LteUeRrc::m_initialCellSelectionEndErrorTrace))
215
    .AddTraceSource ("RandomAccessSuccessful",
219
    .AddTraceSource ("RandomAccessSuccessful",
216
                     "trace fired upon successful completion of the random access procedure",
220
                     "Fired upon successful completion of the random access procedure.",
217
                     MakeTraceSourceAccessor (&LteUeRrc::m_randomAccessSuccessfulTrace))
221
                     MakeTraceSourceAccessor (&LteUeRrc::m_randomAccessSuccessfulTrace))
218
    .AddTraceSource ("RandomAccessError",
222
    .AddTraceSource ("RandomAccessError",
219
                     "trace fired upon failure of the random access procedure",
223
                     "Fired upon failure of the random access procedure.",
220
                     MakeTraceSourceAccessor (&LteUeRrc::m_randomAccessErrorTrace))
224
                     MakeTraceSourceAccessor (&LteUeRrc::m_randomAccessErrorTrace))
221
    .AddTraceSource ("ConnectionEstablished",
225
    .AddTraceSource ("ConnectionEstablished",
222
                     "trace fired upon successful RRC connection establishment",
226
                     "Fired upon successful RRC connection establishment.",
223
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionEstablishedTrace))
227
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionEstablishedTrace))
224
    .AddTraceSource ("ConnectionTimeout",
228
    .AddTraceSource ("ConnectionTimeout",
225
                     "trace fired upon timeout RRC connection establishment because of T300",
229
                     "Fired upon timeout RRC connection establishment because of T300.",
226
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionTimeoutTrace))
230
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionTimeoutTrace))
227
    .AddTraceSource ("ConnectionReconfiguration",
231
    .AddTraceSource ("ConnectionReconfiguration",
228
                     "trace fired upon RRC connection reconfiguration",
232
                     "Fired upon RRC connection reconfiguration.",
229
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionReconfigurationTrace))
233
                     MakeTraceSourceAccessor (&LteUeRrc::m_connectionReconfigurationTrace))
230
    .AddTraceSource ("HandoverStart",
234
    .AddTraceSource ("HandoverStart",
231
                     "trace fired upon start of a handover procedure",
235
                     "Fired upon start of a handover procedure.",
232
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverStartTrace))
236
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverStartTrace))
233
    .AddTraceSource ("HandoverEndOk",
237
    .AddTraceSource ("HandoverEndOk",
234
                     "trace fired upon successful termination of a handover procedure",
238
                     "Fired upon successful termination of a handover procedure.",
235
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverEndOkTrace))
239
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverEndOkTrace))
236
    .AddTraceSource ("HandoverEndError",
240
    .AddTraceSource ("HandoverEndError",
237
                     "trace fired upon failure of a handover procedure",
241
                     "Fired upon failure of a handover procedure.",
238
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverEndErrorTrace))
242
                     MakeTraceSourceAccessor (&LteUeRrc::m_handoverEndErrorTrace))
239
  ;
243
  ;
240
  return tid;
244
  return tid;
(-)a/src/lte/model/lte-ue-rrc.h (-25 / +104 lines)
 Lines 467-472    Link Here 
467
  void LeaveConnectedMode ();
467
  void LeaveConnectedMode ();
468
  void DisposeOldSrb1 ();
468
  void DisposeOldSrb1 ();
469
  uint8_t Bid2Drbid (uint8_t bid);
469
  uint8_t Bid2Drbid (uint8_t bid);
470
  /**
471
   * Switch the UE RRC to the given state.
472
   * \param s the destination state
473
   */
470
  void SwitchToState (State s);
474
  void SwitchToState (State s);
471
475
472
  std::map<uint8_t, uint8_t> m_bid2DrbidMap;
476
  std::map<uint8_t, uint8_t> m_bid2DrbidMap;
 Lines 486-547    Link Here 
486
  LteAsSapProvider* m_asSapProvider;
490
  LteAsSapProvider* m_asSapProvider;
487
  LteAsSapUser* m_asSapUser;
491
  LteAsSapUser* m_asSapUser;
488
492
493
  /// The current UE RRC state.
489
  State m_state;
494
  State m_state;
490
495
496
  /// The unique UE identifier.
491
  uint64_t m_imsi;
497
  uint64_t m_imsi;
498
  /**
499
   * The `C-RNTI` attribute. Cell Radio Network Temporary Identifier.
500
   */
492
  uint16_t m_rnti;
501
  uint16_t m_rnti;
502
  /**
503
   * The `CellId` attribute. Serving cell identifier.
504
   */
493
  uint16_t m_cellId;
505
  uint16_t m_cellId;
494
506
507
  /**
508
   * The `Srb0` attribute. SignalingRadioBearerInfo for SRB0.
509
   */
495
  Ptr<LteSignalingRadioBearerInfo> m_srb0;
510
  Ptr<LteSignalingRadioBearerInfo> m_srb0;
511
  /**
512
   * The `Srb1` attribute. SignalingRadioBearerInfo for SRB1.
513
   */
496
  Ptr<LteSignalingRadioBearerInfo> m_srb1;
514
  Ptr<LteSignalingRadioBearerInfo> m_srb1;
515
  /**
516
   * SRB1 configuration before RRC connection reconfiguration. To be deleted
517
   * soon by DisposeOldSrb1().
518
   */
497
  Ptr<LteSignalingRadioBearerInfo> m_srb1Old;
519
  Ptr<LteSignalingRadioBearerInfo> m_srb1Old;
520
  /**
521
   * The `DataRadioBearerMap` attribute. List of UE RadioBearerInfo for Data
522
   * Radio Bearers by LCID.
523
   */
498
  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
524
  std::map <uint8_t, Ptr<LteDataRadioBearerInfo> > m_drbMap;
499
525
526
  /**
527
   * True if RLC SM is to be used, false if RLC UM/AM are to be used.
528
   * Can be modified using SetUseRlcSm().
529
   */
500
  bool m_useRlcSm;
530
  bool m_useRlcSm;
501
531
502
  uint8_t m_lastRrcTransactionIdentifier;
532
  uint8_t m_lastRrcTransactionIdentifier;
503
533
504
  LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated;
534
  LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated;
505
535
506
  uint8_t m_dlBandwidth; /**< downlink bandwidth in RBs */
536
  uint8_t m_dlBandwidth; /**< Downlink bandwidth in RBs. */
507
  uint8_t m_ulBandwidth; /**< uplink bandwidth in RBs */
537
  uint8_t m_ulBandwidth; /**< Uplink bandwidth in RBs. */
508
538
509
  uint16_t m_dlEarfcn;  /**< downlink carrier frequency */
539
  uint16_t m_dlEarfcn;  /**< Downlink carrier frequency. */
510
  uint16_t m_ulEarfcn;  /**< uplink carrier frequency */
540
  uint16_t m_ulEarfcn;  /**< Uplink carrier frequency. */
511
541
512
  //             imsi      cellId    rnti,     sourceCellId
542
  /**
543
   * The `MibReceived` trace source. Fired upon reception of Master Information
544
   * Block. Exporting IMSI, the serving cell ID, RNTI, and the source cell ID.
545
   */
513
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_mibReceivedTrace;
546
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_mibReceivedTrace;
514
  //             imsi      cellId    rnti,     sourceCellId
547
  /**
548
   * The `Sib1Received` trace source. Fired upon reception of System
549
   * Information Block Type 1. Exporting IMSI, the serving cell ID, RNTI, and
550
   * the source cell ID.
551
   */
515
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_sib1ReceivedTrace;
552
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_sib1ReceivedTrace;
516
  //             imsi      cellId    rnti
553
  /**
554
   * The `Sib2Received` trace source. Fired upon reception of System
555
   * Information Block Type 2. Exporting IMSI, the serving cell ID, RNTI.
556
   */
517
  TracedCallback<uint64_t, uint16_t, uint16_t> m_sib2ReceivedTrace;
557
  TracedCallback<uint64_t, uint16_t, uint16_t> m_sib2ReceivedTrace;
518
  //             imsi      cellId    rnti
558
  /**
559
   * The `StateTransition` trace source. Fired upon every UE RRC state
560
   * transition. Exporting IMSI, the serving cell ID, RNTI, old state, and new
561
   * state.
562
   */
519
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
563
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
520
  //             imsi      cellId
564
  /**
565
   * The `InitialCellSelectionEndOk` trace source. Fired upon successful
566
   * initial cell selection procedure. Exporting IMSI and the selected cell ID.
567
   */
521
  TracedCallback<uint64_t, uint16_t> m_initialCellSelectionEndOkTrace;
568
  TracedCallback<uint64_t, uint16_t> m_initialCellSelectionEndOkTrace;
522
  //             imsi      cellId
569
  /**
570
   * The `InitialCellSelectionEndError` trace source. Fired upon failed initial
571
   * cell selection procedure. Exporting IMSI and the cell ID under evaluation.
572
   */
523
  TracedCallback<uint64_t, uint16_t> m_initialCellSelectionEndErrorTrace;
573
  TracedCallback<uint64_t, uint16_t> m_initialCellSelectionEndErrorTrace;
524
  //             imsi      cellId    rnti
574
  /**
575
   * The `RandomAccessSuccessful` trace source. Fired upon successful
576
   * completion of the random access procedure. Exporting IMSI, cell ID, and
577
   * RNTI.
578
   */
525
  TracedCallback<uint64_t, uint16_t, uint16_t> m_randomAccessSuccessfulTrace;
579
  TracedCallback<uint64_t, uint16_t, uint16_t> m_randomAccessSuccessfulTrace;
526
  //             imsi      cellId    rnti
580
  /**
581
   * The `RandomAccessError` trace source. Fired upon failure of the random
582
   * access procedure. Exporting IMSI, cell ID, and RNTI.
583
   */
527
  TracedCallback<uint64_t, uint16_t, uint16_t> m_randomAccessErrorTrace;
584
  TracedCallback<uint64_t, uint16_t, uint16_t> m_randomAccessErrorTrace;
528
  //             imsi      cellId    rnti
585
  /**
586
   * The `ConnectionEstablished` trace source. Fired upon successful RRC
587
   * connection establishment. Exporting IMSI, cell ID, and RNTI.
588
   */
529
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
589
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionEstablishedTrace;
530
  //             imsi      cellId    rnti
590
  /**
591
   * The `ConnectionTimeout` trace source. Fired upon timeout RRC connection
592
   * establishment because of T300. Exporting IMSI, cell ID, and RNTI.
593
   */
531
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionTimeoutTrace;
594
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionTimeoutTrace;
532
  //             imsi      cellId    rnti
595
  /**
596
   * The `ConnectionReconfiguration` trace source. Fired upon RRC connection
597
   * reconfiguration. Exporting IMSI, cell ID, and RNTI.
598
   */
533
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
599
  TracedCallback<uint64_t, uint16_t, uint16_t> m_connectionReconfigurationTrace;
534
  //             imsi      cellId    rnti      targetCellId
600
  /**
601
   * The `HandoverStart` trace source. Fired upon start of a handover
602
   * procedure. Exporting IMSI, source cell ID, RNTI, and target cell ID.
603
   */
535
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
604
  TracedCallback<uint64_t, uint16_t, uint16_t, uint16_t> m_handoverStartTrace;
536
  //             imsi      cellId    rnti
605
  /**
606
   * The `HandoverEndOk` trace source. Fired upon successful termination of a
607
   * handover procedure. Exporting IMSI, cell ID, and RNTI.
608
   */
537
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndOkTrace;
609
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndOkTrace;
538
  //             imsi      cellId    rnti
610
  /**
611
   * The `HandoverEndError` trace source. Fired upon failure of a handover
612
   * procedure. Exporting IMSI, cell ID, and RNTI.
613
   */
539
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndErrorTrace;
614
  TracedCallback<uint64_t, uint16_t, uint16_t> m_handoverEndErrorTrace;
540
615
541
  bool m_connectionPending; /**< true if a connection request by upper layers is pending */
616
  /// True if a connection request by upper layers is pending.
542
  bool m_hasReceivedMib; /**< true if MIB was received for the current cell  */
617
  bool m_connectionPending;
543
  bool m_hasReceivedSib1; /**< true if SIB1 was received for the current cell  */
618
  /// True if MIB was received for the current cell.
544
  bool m_hasReceivedSib2; /**< true if SIB2 was received for the current cell  */
619
  bool m_hasReceivedMib;
620
  /// True if SIB1 was received for the current cell.
621
  bool m_hasReceivedSib1;
622
  /// True if SIB2 was received for the current cell.
623
  bool m_hasReceivedSib2;
545
624
546
  /// Stored content of the last SIB1 received.
625
  /// Stored content of the last SIB1 received.
547
  LteRrcSap::SystemInformationBlockType1 m_lastSib1;
626
  LteRrcSap::SystemInformationBlockType1 m_lastSib1;
 Lines 801-809    Link Here 
801
  void CancelLeavingTrigger (uint8_t measId, uint16_t cellId);
880
  void CancelLeavingTrigger (uint8_t measId, uint16_t cellId);
802
881
803
  /**
882
  /**
804
   * \brief Timer for RRC connection establishment procedure.
883
   * The `T300` attribute. Timer for RRC connection establishment procedure
805
   *
884
   * (i.e., the procedure is deemed as failed if it takes longer than this).
806
   * Section 7.3 of 3GPP TS 36.331.
885
   * See Section 7.3 of 3GPP TS 36.331.
807
   */
886
   */
808
  Time m_t300;
887
  Time m_t300;
809
888
(-)a/src/lte/model/no-op-handover-algorithm.h (-4 / +3 lines)
 Lines 41-49    Link Here 
41
class NoOpHandoverAlgorithm : public LteHandoverAlgorithm
41
class NoOpHandoverAlgorithm : public LteHandoverAlgorithm
42
{
42
{
43
public:
43
public:
44
  /**
44
  /// Creates a No-op handover algorithm instance.
45
   * \brief Creates a No-op handover algorithm instance.
46
   */
47
  NoOpHandoverAlgorithm ();
45
  NoOpHandoverAlgorithm ();
48
46
49
  virtual ~NoOpHandoverAlgorithm ();
47
  virtual ~NoOpHandoverAlgorithm ();
 Lines 67-74    Link Here 
67
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
65
  void DoReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults);
68
66
69
private:
67
private:
70
  // Handover Management SAPs
68
  /// Interface to the eNodeB RRC instance.
71
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
69
  LteHandoverManagementSapUser* m_handoverManagementSapUser;
70
  /// Receive API calls from the eNodeB RRC instance.
72
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
71
  LteHandoverManagementSapProvider* m_handoverManagementSapProvider;
73
72
74
}; // end of class NoOpHandoverAlgorithm
73
}; // end of class NoOpHandoverAlgorithm

Return to bug 938