1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 2 /* 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation; 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * 18 * Author: Nicola Baldo <nbaldo@cttc.es> 19 * Modified by: Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015) 20 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation) 21 */ 22 23 #ifndef LTE_HELPER_H 24 #define LTE_HELPER_H 25 26 #include <ns3/config.h> 27 #include <ns3/simulator.h> 28 #include <ns3/names.h> 29 #include <ns3/net-device.h> 30 #include <ns3/net-device-container.h> 31 #include <ns3/node.h> 32 #include <ns3/node-container.h> 33 #include <ns3/eps-bearer.h> 34 #include <ns3/phy-stats-calculator.h> 35 #include <ns3/phy-tx-stats-calculator.h> 36 #include <ns3/phy-rx-stats-calculator.h> 37 #include <ns3/mac-stats-calculator.h> 38 #include <ns3/radio-bearer-stats-calculator.h> 39 #include <ns3/radio-bearer-stats-connector.h> 40 #include <ns3/epc-tft.h> 41 #include <ns3/mobility-model.h> 42 #include <ns3/component-carrier-enb.h> 43 #include <ns3/cc-helper.h> 44 #include <map> 45 46 namespace ns3 { 47 48 49 class LteUePhy; 50 class LteEnbPhy; 51 class SpectrumChannel; 52 class EpcHelper; 53 class PropagationLossModel; 54 class SpectrumPropagationLossModel; 55 56 /** 57 * \ingroup lte 58 * 59 * Creation and configuration of LTE entities. One LteHelper instance is 60 * typically enough for an LTE simulation. To create it: 61 * 62 * Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); 63 * 64 * The general responsibility of the helper is to create various LTE objects 65 * and arrange them together to make the whole LTE system. The overall 66 * arrangement would look like the following: 67 * - Downlink spectrum channel 68 * + Path loss model 69 * + Fading model 70 * - Uplink spectrum channel 71 * + Path loss model 72 * + Fading model 73 * - eNodeB node(s) 74 * + Mobility model 75 * + eNodeB device(s) 76 * * Antenna model 77 * * eNodeB PHY (includes spectrum PHY, interference model, HARQ model) 78 * * eNodeB MAC 79 * * eNodeB RRC (includes RRC protocol) 80 * * Scheduler 81 * * Handover algorithm 82 * * FFR (frequency reuse) algorithm 83 * * ANR (automatic neighbour relation) 84 * * CCM (Carrier Component Manager) 85 * + EPC related models (EPC application, Internet stack, X2 interface) 86 * - UE node(s) 87 * + Mobility model 88 * + UE device(s) 89 * * Antenna model 90 * * UE PHY (includes spectrum PHY, interference model, HARQ model) 91 * * UE MAC 92 * * UE RRC (includes RRC protocol) 93 * * NAS 94 * - EPC helper 95 * - Various statistics calculator objects 96 * 97 * Spetrum channels are created automatically: one for DL, and one for UL. 98 * eNodeB devices are created by calling InstallEnbDevice(), while UE devices 99 * are created by calling InstallUeDevice(). EPC helper can be set by using 100 * SetEpcHelper(). 101 */ 102 class LteHelper : public Object 103 { 104 public: 105 LteHelper (void); 106 virtual ~LteHelper (void); 107 108 /** 109 * Register this type. 110 * \return The object TypeId. 111 */ 112 static TypeId GetTypeId (void); 113 virtual void DoDispose (void); 114 115 /** 116 * Set the EpcHelper to be used to setup the EPC network in 117 * conjunction with the setup of the LTE radio access network. 118 * 119 * \note if no EpcHelper is ever set, then LteHelper will default 120 * to creating an LTE-only simulation with no EPC, using LteRlcSm as 121 * the RLC model, and without supporting any IP networking. In other 122 * words, it will be a radio-level simulation involving only LTE PHY 123 * and MAC and the FF Scheduler, with a saturation traffic model for 124 * the RLC. 125 * 126 * \param h a pointer to the EpcHelper to be used 127 */ 128 void SetEpcHelper (Ptr<EpcHelper> h); 129 130 /** 131 * Set the type of path loss model to be used for both DL and UL channels. 132 * 133 * \param type type of path loss model, must be a type name of any class 134 * inheriting from ns3::PropagationLossModel, for example: 135 * "ns3::FriisPropagationLossModel" 136 */ 137 void SetPathlossModelType (TypeId type); 138 139 /** 140 * Set an attribute for the path loss models to be created. 141 * 142 * \param n the name of the attribute 143 * \param v the value of the attribute 144 */ 145 void SetPathlossModelAttribute (std::string n, const AttributeValue &v); 146 147 /** 148 * Set the type of scheduler to be used by eNodeB devices. 149 * 150 * \param type type of scheduler, must be a type name of any class 151 * inheriting from ns3::FfMacScheduler, for example: 152 * "ns3::PfFfMacScheduler" 153 * 154 * Equivalent with setting the `Scheduler` attribute. 155 */ 156 void SetSchedulerType (std::string type); 157 158 /** 159 * 160 * \return the scheduler type 161 */ 162 std::string GetSchedulerType () const; 163 164 /** 165 * Set an attribute for the scheduler to be created. 166 * 167 * \param n the name of the attribute 168 * \param v the value of the attribute 169 */ 170 void SetSchedulerAttribute (std::string n, const AttributeValue &v); 171 172 /** 173 * Set the type of FFR algorithm to be used by eNodeB devices. 174 * 175 * \param type type of FFR algorithm, must be a type name of any class 176 * inheriting from ns3::LteFfrAlgorithm, for example: 177 * "ns3::LteFrNoOpAlgorithm" 178 * 179 * Equivalent with setting the `FfrAlgorithm` attribute. 180 */ 181 void SetFfrAlgorithmType (std::string type); 182 183 /** 184 * 185 * \return the FFR algorithm type 186 */ 187 std::string GetFfrAlgorithmType () const; 188 189 /** 190 * Set an attribute for the FFR algorithm to be created. 191 * 192 * \param n the name of the attribute 193 * \param v the value of the attribute 194 */ 195 void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v); 196 197 /** 198 * Set the type of handover algorithm to be used by eNodeB devices. 199 * 200 * \param type type of handover algorithm, must be a type name of any class 201 * inheriting from ns3::LteHandoverAlgorithm, for example: 202 * "ns3::NoOpHandoverAlgorithm" 203 * 204 * Equivalent with setting the `HandoverAlgorithm` attribute. 205 */ 206 void SetHandoverAlgorithmType (std::string type); 207 208 /** 209 * 210 * \return the handover algorithm type 211 */ 212 std::string GetHandoverAlgorithmType () const; 213 214 /** 215 * Set an attribute for the handover algorithm to be created. 216 * 217 * \param n the name of the attribute 218 * \param v the value of the attribute 219 */ 220 void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v); 221 222 /** 223 * Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created. 224 * 225 * \param n the name of the attribute. 226 * \param v the value of the attribute 227 */ 228 void SetEnbDeviceAttribute (std::string n, const AttributeValue &v); 229 230 /** 231 * Set the type of antenna model to be used by eNodeB devices. 232 * 233 * \param type type of antenna model, must be a type name of any class 234 * inheriting from ns3::AntennaModel, for example: 235 * "ns3::IsotropicAntennaModel" 236 */ 237 void SetEnbAntennaModelType (std::string type); 238 239 /** 240 * Set an attribute for the eNodeB antenna model to be created. 241 * 242 * \param n the name of the attribute. 243 * \param v the value of the attribute 244 */ 245 void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v); 246 247 /** 248 * Set an attribute for the UE devices (LteUeNetDevice) to be created. 249 * 250 * \param n the name of the attribute. 251 * \param v the value of the attribute 252 */ 253 void SetUeDeviceAttribute (std::string n, const AttributeValue &v); 254 255 /** 256 * Set the type of antenna model to be used by UE devices. 257 * 258 * \param type type of antenna model, must be a type name of any class 259 * inheriting from ns3::AntennaModel, for example: 260 * "ns3::IsotropicAntennaModel" 261 */ 262 void SetUeAntennaModelType (std::string type); 263 264 /** 265 * Set an attribute for the UE antenna model to be created. 266 * 267 * \param n the name of the attribute 268 * \param v the value of the attribute 269 */ 270 void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v); 271 272 /** 273 * Set the type of spectrum channel to be used in both DL and UL. 274 * 275 * \param type type of spectrum channel model, must be a type name of any 276 * class inheriting from ns3::SpectrumChannel, for example: 277 * "ns3::MultiModelSpectrumChannel" 278 */ 279 void SetSpectrumChannelType (std::string type); 280 281 /** 282 * Set an attribute for the spectrum channel to be created (both DL and UL). 283 * 284 * \param n the name of the attribute 285 * \param v the value of the attribute 286 */ 287 void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v); 288 289 /** 290 * Set the type of carrier component algorithm to be used by eNodeB devices. 291 * 292 * \param type type of carrier component manager 293 * 294 */ 295 void SetEnbComponentCarrierManagerType (std::string type); 296 297 /** 298 * 299 * \return the carrier enb component carrier manager type 300 */ 301 std::string GetEnbComponentCarrierManagerType () const; 302 303 /** 304 * Set an attribute for the enb component carrier manager to be created. 305 * 306 * \param n the name of the attribute 307 * \param v the value of the attribute 308 */ 309 void SetEnbComponentCarrierManagerAttribute (std::string n, const AttributeValue &v); 310 311 /** 312 * Set the type of Component Carrier Manager to be used by Ue devices. 313 * 314 * \param type type of UE Component Carrier Manager 315 * 316 */ 317 void SetUeComponentCarrierManagerType (std::string type); 318 319 320 /** 321 * 322 * \return the carrier ue component carrier manager type 323 */ 324 std::string GetUeComponentCarrierManagerType () const; 325 326 /** 327 * Set an attribute for the ue component carrier manager to be created. 328 * 329 * \param n the name of the attribute 330 * \param v the value of the attribute 331 */ 332 void SetUeComponentCarrierManagerAttribute (std::string n, const AttributeValue &v); 333 334 /** 335 * Create a set of eNodeB devices. 336 * 337 * \param c the node container where the devices are to be installed 338 * \return the NetDeviceContainer with the newly created devices 339 */ 340 NetDeviceContainer InstallEnbDevice (NodeContainer c); 341 342 /** 343 * Create a set of UE devices. 344 * 345 * \param c the node container where the devices are to be installed 346 * \return the NetDeviceContainer with the newly created devices 347 */ 348 NetDeviceContainer InstallUeDevice (NodeContainer c); 349 350 /** 351 * \brief Enables automatic attachment of a set of UE devices to a suitable 352 * cell using Idle mode initial cell selection procedure. 353 * \param ueDevices the set of UE devices to be attached 354 * 355 * By calling this, the UE will start the initial cell selection procedure at 356 * the beginning of simulation. In addition, the function also instructs each 357 * UE to immediately enter CONNECTED mode and activates the default EPS 358 * bearer. 359 * 360 * If this function is called when the UE is in a situation where entering 361 * CONNECTED mode is not possible (e.g. before the simulation begin), then the 362 * UE will attempt to connect at the earliest possible time (e.g. after it 363 * camps to a suitable cell). 364 * 365 * Note that this function can only be used in EPC-enabled simulation. 366 */ 367 void Attach (NetDeviceContainer ueDevices); 368 369 /** 370 * \brief Enables automatic attachment of a UE device to a suitable cell 371 * using Idle mode initial cell selection procedure. 372 * \param ueDevice the UE device to be attached 373 * 374 * By calling this, the UE will start the initial cell selection procedure at 375 * the beginning of simulation. In addition, the function also instructs the 376 * UE to immediately enter CONNECTED mode and activates the default EPS 377 * bearer. 378 * 379 * If this function is called when the UE is in a situation where entering 380 * CONNECTED mode is not possible (e.g. before the simulation begin), then the 381 * UE will attempt to connect at the earliest possible time (e.g. after it 382 * camps to a suitable cell). 383 * 384 * Note that this function can only be used in EPC-enabled simulation. 385 */ 386 void Attach (Ptr<NetDevice> ueDevice); 387 388 /** 389 * \brief Manual attachment of a set of UE devices to the network via a given 390 * eNodeB. 391 * \param ueDevices the set of UE devices to be attached 392 * \param enbDevice the destination eNodeB device 393 * 394 * In addition, the function also instructs each UE to immediately enter 395 * CONNECTED mode and activates the default EPS bearer. 396 * 397 * The function can be used in both LTE-only and EPC-enabled simulations. 398 * Note that this function will disable Idle mode initial cell selection 399 * procedure. 400 */ 401 void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice); 402 403 /** 404 * \brief Manual attachment of a UE device to the network via a given eNodeB. 405 * \param ueDevice the UE device to be attached 406 * \param enbDevice the destination eNodeB device 407 * 408 * In addition, the function also instructs the UE to immediately enter 409 * CONNECTED mode and activates the default EPS bearer. 410 * 411 * The function can be used in both LTE-only and EPC-enabled simulations. 412 * Note that this function will disable Idle mode initial cell selection 413 * procedure. 414 */ 415 void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); 416 417 /** 418 * \brief Manual attachment of a set of UE devices to the network via the 419 * closest eNodeB (with respect to distance) among those in the set. 420 * \param ueDevices the set of UE devices to be attached 421 * \param enbDevices the set of eNodeB devices to be considered 422 * 423 * This function finds among the eNodeB set the closest eNodeB for each UE, 424 * and then invokes manual attachment between the pair. 425 * 426 * Users are encouraged to use automatic attachment (Idle mode cell selection) 427 * instead of this function. 428 * 429 * \sa LteHelper::Attach(NetDeviceContainer ueDevices); 430 */ 431 void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices); 432 433 /** 434 * \brief Manual attachment of a UE device to the network via the closest 435 * eNodeB (with respect to distance) among those in the set. 436 * \param ueDevice the UE device to be attached 437 * \param enbDevices the set of eNodeB devices to be considered 438 * 439 * This function finds among the eNodeB set the closest eNodeB for the UE, 440 * and then invokes manual attachment between the pair. 441 * 442 * Users are encouraged to use automatic attachment (Idle mode cell selection) 443 * instead of this function. 444 * 445 * \sa LteHelper::Attach(Ptr<NetDevice> ueDevice); 446 */ 447 void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices); 448 449 /** 450 * Activate a dedicated EPS bearer on a given set of UE devices. 451 * 452 * \param ueDevices the set of UE devices 453 * \param bearer the characteristics of the bearer to be activated 454 * \param tft the Traffic Flow Template that identifies the traffic to go on this bearer 455 * \returns bearer ID 456 */ 457 uint8_t ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft> tft); 458 459 /** 460 * Activate a dedicated EPS bearer on a given UE device. 461 * 462 * \param ueDevice the UE device 463 * \param bearer the characteristics of the bearer to be activated 464 * \param tft the Traffic Flow Template that identifies the traffic to go on this bearer. 465 * \returns bearer ID 466 */ 467 uint8_t ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft); 468 469 /** 470 * \brief Manually trigger dedicated bearer de-activation at specific simulation time 471 * \param ueDevice the UE on which dedicated bearer to be de-activated must be of the type LteUeNetDevice 472 * \param enbDevice eNB, must be of the type LteEnbNetDevice 473 * \param bearerId Bearer Identity which is to be de-activated 474 * 475 * \warning Requires the use of EPC mode. See SetEpcHelper() method. 476 */ 477 478 void DeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId); 479 /** 480 * Create an X2 interface between all the eNBs in a given set. 481 * 482 * \param enbNodes the set of eNB nodes 483 */ 484 void AddX2Interface (NodeContainer enbNodes); 485 486 /** 487 * Create an X2 interface between two eNBs. 488 * 489 * \param enbNode1 one eNB of the X2 interface 490 * \param enbNode2 the other eNB of the X2 interface 491 */ 492 void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2); 493 494 /** 495 * Manually trigger an X2-based handover. 496 * 497 * \param hoTime when the handover shall be initiated 498 * \param ueDev the UE that hands off, must be of the type LteUeNetDevice 499 * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice 500 * (originally the UE is attached to this eNB) 501 * \param targetEnbDev target eNB, must be of the type LteEnbNetDevice 502 * (the UE would be connected to this eNB after the 503 * handover) 504 * 505 * \warning Requires the use of EPC mode. See SetEpcHelper() method 506 */ 507 void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev, 508 Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev); 509 510 511 /** 512 * Manually trigger an X2-based handover. 513 * 514 * \param hoTime when the handover shall be initiated 515 * \param ueDev the UE that hands off, must be of the type LteUeNetDevice 516 * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice 517 * (originally the UE is attached to this eNB) 518 * \param targetCellId target CellId (the UE primary component carrier will 519 * be connected to this cell after the handover) 520 * 521 * \warning Requires the use of EPC mode. See SetEpcHelper() method 522 */ 523 void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev, 524 Ptr<NetDevice> sourceEnbDev, uint16_t targetCellId); 525 526 /** 527 * Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation). 528 * 529 * \param ueDevices the set of UE devices 530 * \param bearer the characteristics of the bearer to be activated 531 */ 532 void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer); 533 534 /** 535 * Activate a Data Radio Bearer on a UE device (for LTE-only simulation). 536 * This method will schedule the actual activation 537 * the bearer so that it happens after the UE got connected. 538 * 539 * \param ueDevice the UE device 540 * \param bearer the characteristics of the bearer to be activated 541 */ 542 void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer); 543 544 /** 545 * Set the type of fading model to be used in both DL and UL. 546 * 547 * \param type type of fading model, must be a type name of any class 548 * inheriting from ns3::SpectrumPropagationLossModel, for 549 * example: "ns3::TraceFadingLossModel" 550 */ 551 void SetFadingModel (std::string type); 552 553 /** 554 * Set an attribute for the fading model to be created (both DL and UL). 555 * 556 * \param n the name of the attribute 557 * \param v the value of the attribute 558 */ 559 void SetFadingModelAttribute (std::string n, const AttributeValue &v); 560 561 /** 562 * Enables full-blown logging for major components of the LENA architecture. 563 */ 564 void EnableLogComponents (void); 565 566 /** 567 * Enables trace sinks for PHY, MAC, RLC and PDCP. To make sure all nodes are 568 * traced, traces should be enabled once all UEs and eNodeBs are in place and 569 * connected, just before starting the simulation. 570 */ 571 void EnableTraces (void); 572 573 /** 574 * Enable trace sinks for PHY layer. 575 */ 576 void EnablePhyTraces (void); 577 578 /** 579 * Enable trace sinks for DL PHY layer. 580 */ 581 void EnableDlPhyTraces (void); 582 583 /** 584 * Enable trace sinks for UL PHY layer. 585 */ 586 void EnableUlPhyTraces (void); 587 588 /** 589 * Enable trace sinks for DL transmission PHY layer. 590 */ 591 void EnableDlTxPhyTraces (void); 592 593 /** 594 * Enable trace sinks for UL transmission PHY layer. 595 */ 596 void EnableUlTxPhyTraces (void); 597 598 /** 599 * Enable trace sinks for DL reception PHY layer. 600 */ 601 void EnableDlRxPhyTraces (void); 602 603 /** 604 * Enable trace sinks for UL reception PHY layer. 605 */ 606 void EnableUlRxPhyTraces (void); 607 608 /** 609 * Enable trace sinks for MAC layer. 610 */ 611 void EnableMacTraces (void); 612 613 /** 614 * Enable trace sinks for DL MAC layer. 615 */ 616 void EnableDlMacTraces (void); 617 618 /** 619 * Enable trace sinks for UL MAC layer. 620 */ 621 void EnableUlMacTraces (void); 622 623 /** 624 * Enable trace sinks for RLC layer. 625 */ 626 void EnableRlcTraces (void); 627 628 /** 629 * 630 * \return the RLC stats calculator object 631 */ 632 Ptr<RadioBearerStatsCalculator> GetRlcStats (void); 633 634 /** 635 * Enable trace sinks for PDCP layer 636 */ 637 void EnablePdcpTraces (void); 638 639 /** 640 * 641 * \return the PDCP stats calculator object 642 */ 643 Ptr<RadioBearerStatsCalculator> GetPdcpStats (void); 644 645 /** 646 * Assign a fixed random variable stream number to the random variables used. 647 * 648 * The InstallEnbDevice() or InstallUeDevice method should have previously 649 * been called by the user on the given devices. 650 * 651 * If TraceFadingLossModel has been set as the fading model type, this method 652 * will also assign a stream number to it, if none has been assigned before. 653 * 654 * \param c NetDeviceContainer of the set of net devices for which the 655 * LteNetDevice should be modified to use a fixed stream 656 * \param stream first stream index to use 657 * \return the number of stream indices (possibly zero) that have been assigned 658 */ 659 int64_t AssignStreams (NetDeviceContainer c, int64_t stream); 660 661 /** 662 * \return a pointer to the SpectrumChannel instance used for the uplink 663 */ 664 Ptr<SpectrumChannel> GetUplinkSpectrumChannel (void) const; 665 666 667 /** 668 * \return a pointer to the SpectrumChannel instance used for the downlink 669 */ 670 Ptr<SpectrumChannel> GetDownlinkSpectrumChannel (void) const; 671 672 673 protected: 674 // inherited from Object 675 virtual void DoInitialize (void); 676 677 private: 678 679 /** 680 * Configure the component carriers 681 * 682 * \param ulEarfcn uplink EARFCN 683 * \param dlEarfcn downlink EARFCN 684 * \param ulbw uplink bandwidth for each CC 685 * \param dlbw downlink bandwidth for each CC 686 */ 687 void DoComponentCarrierConfigure (uint32_t ulEarfcn, uint32_t dlEarfcn, uint16_t ulbw, uint16_t dlbw); 688 /** 689 * Create an eNodeB device (LteEnbNetDevice) on the given node. 690 * \param n the node where the device is to be installed 691 * \return pointer to the created device 692 */ 693 Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n); 694 695 /** 696 * Create a UE device (LteUeNetDevice) on the given node 697 * \param n the node where the device is to be installed 698 * \return pointer to the created device 699 */ 700 Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n); 701 702 /** 703 * The actual function to trigger a manual handover. 704 * \param ueDev the UE that hands off, must be of the type LteUeNetDevice 705 * \param sourceEnbDev source eNB, must be of the type LteEnbNetDevice 706 * (originally the UE is attached to this eNB) 707 * \param targetCellId target CellId (the UE primary component carrier will 708 * be connected to this cell after the handover) 709 * 710 * This method is normally scheduled by HandoverRequest() to run at a specific 711 * time where a manual handover is desired by the simulation user. 712 */ 713 void DoHandoverRequest (Ptr<NetDevice> ueDev, 714 Ptr<NetDevice> sourceEnbDev, 715 uint16_t targetCellId); 716 717 718 /** 719 * \brief The actual function to trigger a manual bearer de-activation 720 * \param ueDevice the UE on which bearer to be de-activated must be of the type LteUeNetDevice 721 * \param enbDevice eNB, must be of the type LteEnbNetDevice 722 * \param bearerId Bearer Identity which is to be de-activated 723 * 724 * This method is normally scheduled by DeActivateDedicatedEpsBearer() to run at a specific 725 * time when a manual bearer de-activation is desired by the simulation user. 726 */ 727 void DoDeActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice, uint8_t bearerId); 728 729 /// Function that performs a channel model initialization of all component carriers 730 void ChannelModelInitialization (void); 731 732 /** 733 * \brief This function create the component carrier based on provided configuration parameters 734 */ 735 736 /// The downlink LTE channel used in the simulation. 737 Ptr<SpectrumChannel> m_downlinkChannel; 738 /// The uplink LTE channel used in the simulation. 739 Ptr<SpectrumChannel> m_uplinkChannel; 740 /// The path loss model used in the downlink channel. 741 Ptr<Object> m_downlinkPathlossModel; 742 /// The path loss model used in the uplink channel. 743 Ptr<Object> m_uplinkPathlossModel; 744 745 /// Factory of MAC scheduler object. 746 ObjectFactory m_schedulerFactory; 747 /// Factory of FFR (frequency reuse) algorithm object. 748 ObjectFactory m_ffrAlgorithmFactory; 749 /// Factory of handover algorithm object. 750 ObjectFactory m_handoverAlgorithmFactory; 751 /// Factory of enb component carrier manager object. 752 ObjectFactory m_enbComponentCarrierManagerFactory; 753 /// Factory of ue component carrier manager object. 754 ObjectFactory m_ueComponentCarrierManagerFactory; 755 /// Factory of LteEnbNetDevice objects. 756 ObjectFactory m_enbNetDeviceFactory; 757 /// Factory of antenna object for eNodeB. 758 ObjectFactory m_enbAntennaModelFactory; 759 /// Factory for LteUeNetDevice objects. 760 ObjectFactory m_ueNetDeviceFactory; 761 /// Factory of antenna object for UE. 762 ObjectFactory m_ueAntennaModelFactory; 763 /// Factory of path loss model object. 764 ObjectFactory m_pathlossModelFactory; 765 /// Factory of both the downlink and uplink LTE channels. 766 ObjectFactory m_channelFactory; 767 768 /// Name of fading model type, e.g., "ns3::TraceFadingLossModel". 769 std::string m_fadingModelType; 770 /// Factory of fading model object for both the downlink and uplink channels. 771 ObjectFactory m_fadingModelFactory; 772 /// The fading model used in both the downlink and uplink channels. 773 Ptr<SpectrumPropagationLossModel> m_fadingModel; 774 /** 775 * True if a random variable stream number has been assigned for the fading 776 * model. Used to prevent such assignment to be done more than once. 777 */ 778 bool m_fadingStreamsAssigned; 779 780 /// Container of PHY layer statistics. 781 Ptr<PhyStatsCalculator> m_phyStats; 782 /// Container of PHY layer statistics related to transmission. 783 Ptr<PhyTxStatsCalculator> m_phyTxStats; 784 /// Container of PHY layer statistics related to reception. 785 Ptr<PhyRxStatsCalculator> m_phyRxStats; 786 /// Container of MAC layer statistics. 787 Ptr<MacStatsCalculator> m_macStats; 788 /// Container of RLC layer statistics. 789 Ptr<RadioBearerStatsCalculator> m_rlcStats; 790 /// Container of PDCP layer statistics. 791 Ptr<RadioBearerStatsCalculator> m_pdcpStats; 792 /// Connects RLC and PDCP statistics containers to appropriate trace sources 793 RadioBearerStatsConnector m_radioBearerStatsConnector; 794 795 /** 796 * Helper which provides implementation of core network. Initially empty 797 * (i.e., LTE-only simulation without any core network) and then might be 798 * set using SetEpcHelper(). 799 */ 800 Ptr<EpcHelper> m_epcHelper; 801 802 /** 803 * Keep track of the number of IMSI allocated. Increases by one every time a 804 * new UE is installed (by InstallSingleUeDevice()). The first UE will have 805 * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9). 806 */ 807 uint64_t m_imsiCounter; 808 /** 809 * Keep track of the number of cell ID allocated. Increases by one every time 810 * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB 811 * will have a cell ID of 1. The maximum number of eNodeB is 65535. 812 */ 813 uint16_t m_cellIdCounter; 814 815 /** 816 * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for 817 * RRC signaling. If false, LteRrcProtocolReal will be used. 818 */ 819 bool m_useIdealRrc; 820 /** 821 * The `AnrEnabled` attribute. Activate or deactivate Automatic Neighbour 822 * Relation function. 823 */ 824 bool m_isAnrEnabled; 825 /** 826 * The `UsePdschForCqiGeneration` attribute. If true, DL-CQI will be 827 * calculated from PDCCH as signal and PDSCH as interference. If false, 828 * DL-CQI will be calculated from PDCCH as signal and PDCCH as interference. 829 */ 830 bool m_usePdschForCqiGeneration; 831 832 /** 833 * The `UseCa` attribute. If true, Carrier Aggregation is enabled. 834 * Hence, the helper will expect a valid component carrier map 835 * If it is false, the component carrier will be created within the LteHelper 836 * this is to maintain the backwards compatibility with user script 837 */ 838 bool m_useCa; 839 840 /** 841 * This contains all the information about each component carrier 842 */ 843 std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams; 844 845 /** 846 * Number of component carriers that will be installed by default at eNodeB and UE devices. 847 */ 848 uint16_t m_noOfCcs; 849 850 }; // end of `class LteHelper` 851 852 853 } // namespace ns3 854 855 856 857 #endif // LTE_HELPER_H 858