OLD | NEW |
(Empty) | |
| 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: NIST |
| 20 */ |
| 21 |
| 22 #ifndef NIST_LTE_HELPER_H |
| 23 #define NIST_LTE_HELPER_H |
| 24 |
| 25 #include <ns3/config.h> |
| 26 #include <ns3/simulator.h> |
| 27 #include <ns3/names.h> |
| 28 #include <ns3/net-device.h> |
| 29 #include <ns3/net-device-container.h> |
| 30 #include <ns3/node.h> |
| 31 #include <ns3/node-container.h> |
| 32 #include <ns3/nist-eps-bearer.h> |
| 33 #include <ns3/nist-phy-stats-calculator.h> |
| 34 #include <ns3/nist-phy-tx-stats-calculator.h> |
| 35 #include <ns3/nist-phy-rx-stats-calculator.h> |
| 36 #include <ns3/nist-mac-stats-calculator.h> |
| 37 #include <ns3/nist-radio-bearer-stats-calculator.h> |
| 38 #include <ns3/nist-radio-bearer-stats-connector.h> |
| 39 #include <ns3/nist-epc-tft.h> |
| 40 #include <ns3/nist-lte-enb-rrc.h> |
| 41 #include <ns3/nist-lte-ue-rrc.h> |
| 42 #include <ns3/nist-lte-spectrum-phy.h> |
| 43 #include <ns3/mobility-model.h> |
| 44 #include <ns3/nist-sl-tft.h> |
| 45 |
| 46 namespace ns3 { |
| 47 |
| 48 |
| 49 class NistLteUePhy; |
| 50 class NistLteEnbPhy; |
| 51 class SpectrumChannel; |
| 52 class NistEpcHelper; |
| 53 class PropagationLossModel; |
| 54 class SpectrumPropagationLossModel; |
| 55 |
| 56 /** |
| 57 * \ingroup lte |
| 58 * |
| 59 * Creation and configuration of LTE entities. One NistLteHelper instance is |
| 60 * typically enough for an LTE simulation. To create it: |
| 61 * |
| 62 * Ptr<NistLteHelper> lteHelper = CreateObject<NistLteHelper> (); |
| 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 * + EPC related models (EPC application, Internet stack, X2 interface) |
| 85 * - UE node(s) |
| 86 * + Mobility model |
| 87 * + UE device(s) |
| 88 * * Antenna model |
| 89 * * UE PHY (includes spectrum PHY, interference model, HARQ model) |
| 90 * * UE MAC |
| 91 * * UE RRC (includes RRC protocol) |
| 92 * * NAS |
| 93 * - EPC helper |
| 94 * - Various statistics calculator objects |
| 95 * |
| 96 * Spetrum channels are created automatically: one for DL, and one for UL. |
| 97 * eNodeB devices are created by calling InstallEnbDevice(), while UE devices |
| 98 * are created by calling InstallUeDevice(). EPC helper can be set by using |
| 99 * SetEpcHelper(). |
| 100 */ |
| 101 class NistLteHelper : public Object |
| 102 { |
| 103 public: |
| 104 NistLteHelper (void); |
| 105 virtual ~NistLteHelper (void); |
| 106 |
| 107 /** |
| 108 * Register this type. |
| 109 * \return The object TypeId. |
| 110 */ |
| 111 static TypeId GetTypeId (void); |
| 112 virtual void DoDispose (void); |
| 113 |
| 114 /**· |
| 115 * Set the NistEpcHelper to be used to setup the EPC network in |
| 116 * conjunction with the setup of the LTE radio access network. |
| 117 * |
| 118 * \note if no NistEpcHelper is ever set, then NistLteHelper will default |
| 119 * to creating an LTE-only simulation with no EPC, using NistLteRlcSm as |
| 120 * the RLC model, and without supporting any IP networking. In other |
| 121 * words, it will be a radio-level simulation involving only LTE PHY |
| 122 * and MAC and the FF Scheduler, with a saturation traffic model for |
| 123 * the RLC. |
| 124 *· |
| 125 * \param h a pointer to the NistEpcHelper to be used |
| 126 */ |
| 127 void SetEpcHelper (Ptr<NistEpcHelper> h); |
| 128 |
| 129 /** |
| 130 * Set eNBs created after this call to enable. |
| 131 * |
| 132 */ |
| 133 void EnableNewEnbPhy (); |
| 134 |
| 135 /** |
| 136 * Set eNBs created after this call to disable. |
| 137 * |
| 138 */ |
| 139 void DisableNewEnbPhy (); |
| 140 |
| 141 |
| 142 /**· |
| 143 * Set the type of path loss model to be used for both DL and UL channels. |
| 144 *· |
| 145 * \param type type of path loss model, must be a type name of any class |
| 146 * inheriting from ns3::PropagationLossModel, for example: |
| 147 * "ns3::FriisPropagationLossModel" |
| 148 */ |
| 149 void SetPathlossModelType (std::string type); |
| 150 |
| 151 /** |
| 152 * Set an attribute for the path loss models to be created. |
| 153 *· |
| 154 * \param n the name of the attribute |
| 155 * \param v the value of the attribute |
| 156 */ |
| 157 void SetPathlossModelAttribute (std::string n, const AttributeValue &v); |
| 158 |
| 159 /**· |
| 160 * Set the type of scheduler to be used by eNodeB devices. |
| 161 *· |
| 162 * \param type type of scheduler, must be a type name of any class |
| 163 * inheriting from ns3::NistFfMacScheduler, for example: |
| 164 * "ns3::PfNistFfMacScheduler" |
| 165 * |
| 166 * Equivalent with setting the `Scheduler` attribute. |
| 167 */ |
| 168 void SetSchedulerType (std::string type); |
| 169 |
| 170 /** |
| 171 * |
| 172 * \return the scheduler type |
| 173 */ |
| 174 std::string GetSchedulerType () const;· |
| 175 |
| 176 /**· |
| 177 * Set the type of UL scheduler to be used by UEs devices. |
| 178 * |
| 179 * \param type the UE scheduler to set· |
| 180 */ |
| 181 void SetUlSchedulerType (std::string type); |
| 182 |
| 183 /** |
| 184 * |
| 185 * \return the UL scheduler type |
| 186 */ |
| 187 std::string GetUlSchedulerType () const;· |
| 188 |
| 189 /** |
| 190 * Set an attribute for the scheduler to be created. |
| 191 *· |
| 192 * \param n the name of the attribute |
| 193 * \param v the value of the attribute |
| 194 */ |
| 195 void SetSchedulerAttribute (std::string n, const AttributeValue &v); |
| 196 |
| 197 /** |
| 198 * Set the type of FFR algorithm to be used by eNodeB devices. |
| 199 * |
| 200 * \param type type of FFR algorithm, must be a type name of any class |
| 201 * inheriting from ns3::NistLteFfrAlgorithm, for example: |
| 202 * "ns3::NistLteFrNoOpAlgorithm" |
| 203 * |
| 204 * Equivalent with setting the `FfrAlgorithm` attribute. |
| 205 */ |
| 206 void SetFfrAlgorithmType (std::string type); |
| 207 |
| 208 /** |
| 209 * |
| 210 * \return the FFR algorithm type |
| 211 */ |
| 212 std::string GetFfrAlgorithmType () const; |
| 213 |
| 214 /** |
| 215 * Set an attribute for the FFR algorithm to be created. |
| 216 * |
| 217 * \param n the name of the attribute |
| 218 * \param v the value of the attribute |
| 219 */ |
| 220 void SetFfrAlgorithmAttribute (std::string n, const AttributeValue &v); |
| 221 |
| 222 /** |
| 223 * Set the type of handover algorithm to be used by eNodeB devices. |
| 224 * |
| 225 * \param type type of handover algorithm, must be a type name of any class |
| 226 * inheriting from ns3::NistLteHandoverAlgorithm, for example: |
| 227 * "ns3::NistNoOpHandoverAlgorithm" |
| 228 * |
| 229 * Equivalent with setting the `HandoverAlgorithm` attribute. |
| 230 */ |
| 231 void SetHandoverAlgorithmType (std::string type); |
| 232 |
| 233 /** |
| 234 * |
| 235 * \return the handover algorithm type |
| 236 */ |
| 237 std::string GetHandoverAlgorithmType () const; |
| 238 |
| 239 /** |
| 240 * Set an attribute for the handover algorithm to be created. |
| 241 * |
| 242 * \param n the name of the attribute |
| 243 * \param v the value of the attribute |
| 244 */ |
| 245 void SetHandoverAlgorithmAttribute (std::string n, const AttributeValue &v); |
| 246 |
| 247 /** |
| 248 * Set an attribute for the eNodeB devices (NistLteEnbNetDevice) to be created
. |
| 249 *· |
| 250 * \param n the name of the attribute. |
| 251 * \param v the value of the attribute |
| 252 */ |
| 253 void SetEnbDeviceAttribute (std::string n, const AttributeValue &v); |
| 254 |
| 255 /**· |
| 256 * Set the type of antenna model to be used by eNodeB 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 SetEnbAntennaModelType (std::string type); |
| 263 |
| 264 /** |
| 265 * Set an attribute for the eNodeB 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 SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v); |
| 271 |
| 272 /** |
| 273 * Set an attribute for the UE devices (NistLteUeNetDevice) to be created. |
| 274 * |
| 275 * \param n the name of the attribute. |
| 276 * \param v the value of the attribute |
| 277 */ |
| 278 void SetUeDeviceAttribute (std::string n, const AttributeValue &v); |
| 279 |
| 280 /**· |
| 281 * Set the type of antenna model to be used by UE devices. |
| 282 *· |
| 283 * \param type type of antenna model, must be a type name of any class |
| 284 * inheriting from ns3::AntennaModel, for example: |
| 285 * "ns3::IsotropicAntennaModel" |
| 286 */ |
| 287 void SetUeAntennaModelType (std::string type); |
| 288 |
| 289 /** |
| 290 * Set an attribute for the UE antenna model to be created. |
| 291 *· |
| 292 * \param n the name of the attribute |
| 293 * \param v the value of the attribute |
| 294 */ |
| 295 void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v); |
| 296 |
| 297 /**· |
| 298 * Set the type of spectrum channel to be used in both DL and UL. |
| 299 * |
| 300 * \param type type of spectrum channel model, must be a type name of any |
| 301 * class inheriting from ns3::SpectrumChannel, for example: |
| 302 * "ns3::MultiModelSpectrumChannel" |
| 303 */ |
| 304 void SetSpectrumChannelType (std::string type); |
| 305 |
| 306 /** |
| 307 * Set an attribute for the spectrum channel to be created (both DL and UL). |
| 308 *· |
| 309 * \param n the name of the attribute |
| 310 * \param v the value of the attribute |
| 311 */ |
| 312 void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v); |
| 313 |
| 314 /** |
| 315 * Create a set of eNodeB devices. |
| 316 * |
| 317 * \param c the node container where the devices are to be installed |
| 318 * \return the NetDeviceContainer with the newly created devices |
| 319 */ |
| 320 NetDeviceContainer InstallEnbDevice (NodeContainer c); |
| 321 |
| 322 /** |
| 323 * Create a set of UE devices. |
| 324 * |
| 325 * \param c the node container where the devices are to be installed |
| 326 * \return the NetDeviceContainer with the newly created devices |
| 327 */ |
| 328 NetDeviceContainer InstallUeDevice (NodeContainer c); |
| 329 |
| 330 /** |
| 331 * \brief Enables automatic attachment of a set of UE devices to a suitable |
| 332 * cell using Idle mode initial cell selection procedure. |
| 333 * \param ueDevices the set of UE devices to be attached |
| 334 * |
| 335 * By calling this, the UE will start the initial cell selection procedure at |
| 336 * the beginning of simulation. In addition, the function also instructs each |
| 337 * UE to immediately enter CONNECTED mode and activates the default EPS |
| 338 * bearer. |
| 339 * |
| 340 * If this function is called when the UE is in a situation where entering |
| 341 * CONNECTED mode is not possible (e.g. before the simulation begin), then the |
| 342 * UE will attempt to connect at the earliest possible time (e.g. after it |
| 343 * camps to a suitable cell). |
| 344 * |
| 345 * Note that this function can only be used in EPC-enabled simulation. |
| 346 */ |
| 347 void Attach (NetDeviceContainer ueDevices); |
| 348 |
| 349 /** |
| 350 * \brief Enables automatic attachment of a UE device to a suitable cell |
| 351 * using Idle mode initial cell selection procedure. |
| 352 * \param ueDevice the UE device to be attached |
| 353 * |
| 354 * By calling this, the UE will start the initial cell selection procedure at |
| 355 * the beginning of simulation. In addition, the function also instructs the |
| 356 * UE to immediately enter CONNECTED mode and activates the default EPS |
| 357 * bearer. |
| 358 * |
| 359 * If this function is called when the UE is in a situation where entering |
| 360 * CONNECTED mode is not possible (e.g. before the simulation begin), then the |
| 361 * UE will attempt to connect at the earliest possible time (e.g. after it |
| 362 * camps to a suitable cell). |
| 363 * |
| 364 * Note that this function can only be used in EPC-enabled simulation. |
| 365 */ |
| 366 void Attach (Ptr<NetDevice> ueDevice); |
| 367 |
| 368 /** |
| 369 * \brief Manual attachment of a set of UE devices to the network via a given |
| 370 * eNodeB. |
| 371 * \param ueDevices the set of UE devices to be attached |
| 372 * \param enbDevice the destination eNodeB device |
| 373 * |
| 374 * In addition, the function also instructs each UE to immediately enter |
| 375 * CONNECTED mode and activates the default EPS bearer. |
| 376 * |
| 377 * The function can be used in both LTE-only and EPC-enabled simulations. |
| 378 * Note that this function will disable Idle mode initial cell selection |
| 379 * procedure. |
| 380 */ |
| 381 void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice); |
| 382 |
| 383 /** |
| 384 * \brief Manual attachment of a UE device to the network via a given eNodeB. |
| 385 * \param ueDevice the UE device to be attached |
| 386 * \param enbDevice the destination eNodeB device |
| 387 * |
| 388 * In addition, the function also instructs the UE to immediately enter |
| 389 * CONNECTED mode and activates the default EPS bearer. |
| 390 * |
| 391 * The function can be used in both LTE-only and EPC-enabled simulations. |
| 392 * Note that this function will disable Idle mode initial cell selection |
| 393 * procedure. |
| 394 */ |
| 395 void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice); |
| 396 |
| 397 /**· |
| 398 * \brief Manual attachment of a set of UE devices to the network via the |
| 399 * closest eNodeB (with respect to distance) among those in the set. |
| 400 * \param ueDevices the set of UE devices to be attached |
| 401 * \param enbDevices the set of eNodeB devices to be considered |
| 402 *· |
| 403 * This function finds among the eNodeB set the closest eNodeB for each UE, |
| 404 * and then invokes manual attachment between the pair. |
| 405 *· |
| 406 * Users are encouraged to use automatic attachment (Idle mode cell selection) |
| 407 * instead of this function. |
| 408 *· |
| 409 * \sa NistLteHelper::Attach(NetDeviceContainer ueDevices); |
| 410 */ |
| 411 void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbD
evices); |
| 412 |
| 413 /**· |
| 414 * \brief Manual attachment of a UE device to the network via the closest |
| 415 * eNodeB (with respect to distance) among those in the set. |
| 416 * \param ueDevice the UE device to be attached |
| 417 * \param enbDevices the set of eNodeB devices to be considered |
| 418 * |
| 419 * This function finds among the eNodeB set the closest eNodeB for the UE, |
| 420 * and then invokes manual attachment between the pair. |
| 421 *· |
| 422 * Users are encouraged to use automatic attachment (Idle mode cell selection) |
| 423 * instead of this function. |
| 424 * |
| 425 * \sa NistLteHelper::Attach(Ptr<NetDevice> ueDevice); |
| 426 */ |
| 427 void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevice
s); |
| 428 |
| 429 /** |
| 430 * Activate a dedicated EPS bearer on a given set of UE devices. |
| 431 * |
| 432 * \param ueDevices the set of UE devices |
| 433 * \param bearer the characteristics of the bearer to be activated |
| 434 * \param tft the Traffic Flow Template that identifies the traffic to go on t
his bearer |
| 435 */ |
| 436 uint8_t ActivateDedicatedNistEpsBearer (NetDeviceContainer ueDevices, NistEpsB
earer bearer, Ptr<NistEpcTft> tft); |
| 437 |
| 438 /** |
| 439 * Activate a dedicated EPS bearer on a given UE device. |
| 440 * |
| 441 * \param ueDevice the UE device |
| 442 * \param bearer the characteristics of the bearer to be activated |
| 443 * \param tft the Traffic Flow Template that identifies the traffic to go on t
his bearer. |
| 444 */ |
| 445 uint8_t ActivateDedicatedNistEpsBearer (Ptr<NetDevice> ueDevice, NistEpsBearer
bearer, Ptr<NistEpcTft> tft); |
| 446 |
| 447 /** |
| 448 * \brief Manually trigger dedicated bearer de-activation at specific simulat
ion time |
| 449 * \param ueDevice the UE on which dedicated bearer to be de-activated must b
e of the type NistLteUeNetDevice |
| 450 * \param enbDevice eNB, must be of the type NistLteEnbNetDevice |
| 451 * \param bearerId Bearer Identity which is to be de-activated |
| 452 * |
| 453 * \warning Requires the use of EPC mode. See SetNistEpcHelper() method. |
| 454 */ |
| 455 |
| 456 void DeActivateDedicatedNistEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevice>
enbDevice, uint8_t bearerId); |
| 457 |
| 458 /** |
| 459 * Activate a dedicated EPS bearer on a given set of UE devices. |
| 460 * |
| 461 * \param ueDevices the set of UE devices |
| 462 * \param tft the Traffic Flow Template that identifies the traffic to go on t
his bearer |
| 463 */ |
| 464 void ActivateSidelinkBearer (NetDeviceContainer ueDevices, Ptr<NistSlTft> tft)
; |
| 465 |
| 466 /** |
| 467 * Deactivate a sidelink bearer on a given set of UE devices. |
| 468 * |
| 469 * \param ueDevices the set of UE devices |
| 470 * \param tft Sidelink bearer information which is to be de-activated |
| 471 */ |
| 472 void DeactivateSidelinkBearer (NetDeviceContainer ueDevices, Ptr<NistSlTft> tf
t); |
| 473 |
| 474 /** |
| 475 * Activate a sidelink bearer on a given UE device. |
| 476 * |
| 477 * \param ueDevice the UE device |
| 478 * \param tft the Traffic Flow Template that identifies the traffic to go on t
his bearer. |
| 479 */ |
| 480 void ActivateSidelinkBearer (Ptr<NetDevice> ueDevice, Ptr<NistSlTft> tft); |
| 481 |
| 482 /** |
| 483 * \brief Manually trigger sidelink bearer de-activation at specific simulati
on time |
| 484 * \param ueDevice the UE on which sidelink bearer to be de-activated must be
of the type NistLteUeNetDevice |
| 485 * \param tft Sidelink bearer information which is to be de-activated |
| 486 * |
| 487 * \warning Requires the use of EPC mode. See SetNistEpcHelper() method. |
| 488 */ |
| 489 |
| 490 void DeactivateSidelinkBearer (Ptr<NetDevice> ueDevice, Ptr<NistSlTft> tft); |
| 491 ·· |
| 492 /** |
| 493 * Activate discovery for given UEs for certain applications |
| 494 *· |
| 495 * \param ueDevices the set of UE devices |
| 496 * \param apps the applications to start |
| 497 * \param rxtx the interest in monitoring or announcing (0 for rx and 1 for tx
) |
| 498 */ |
| 499 void StartDiscovery (NetDeviceContainer ueDevices, std::list<uint32_t> apps, b
ool rxtx); |
| 500 |
| 501 /** |
| 502 * Deactivate discovery for given UEs for certain applications |
| 503 * |
| 504 * \param ueDevices the set of UE devices |
| 505 * \param apps the applicaions to stop |
| 506 * \param rxtx the interest in monitoring or announcing (0 for rx and 1 for tx
) |
| 507 */ |
| 508 void StopDiscovery (NetDeviceContainer ueDevices, std::list<uint32_t> apps, bo
ol rxtx); |
| 509 |
| 510 /** |
| 511 * Activate discovery for one UE for given applications |
| 512 * |
| 513 * \param ueDevice the UE device |
| 514 * \param apps the applications to start |
| 515 * \param rxtx the interest in monitoring or announcing (0 for rx and 1 for tx
) |
| 516 */ |
| 517 void StartDiscovery (Ptr<NetDevice> ueDevice, std::list<uint32_t> apps, bool r
xtx); |
| 518 |
| 519 /** |
| 520 * Deactivate discovery for one UE for given applications |
| 521 * \param ueDevice the UE device |
| 522 * \param apps the applications to stop |
| 523 * \param rxtx the interest in monitoring or announcing (0 for rx and 1 for t
x) |
| 524 */ |
| 525 void StopDiscovery (Ptr<NetDevice> ueDevice, std::list<uint32_t> apps, bool rx
tx); |
| 526 |
| 527 /** |
| 528 * Create an X2 interface between all the eNBs in a given set. |
| 529 * |
| 530 * \param enbNodes the set of eNB nodes |
| 531 */ |
| 532 void AddX2Interface (NodeContainer enbNodes); |
| 533 |
| 534 /** |
| 535 * Create an X2 interface between two eNBs. |
| 536 * |
| 537 * \param enbNode1 one eNB of the X2 interface |
| 538 * \param enbNode2 the other eNB of the X2 interface |
| 539 */ |
| 540 void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2); |
| 541 |
| 542 /** |
| 543 * Manually trigger an X2-based handover. |
| 544 * |
| 545 * \param hoTime when the handover shall be initiated |
| 546 * \param ueDev the UE that hands off, must be of the type NistLteUeNetDevice |
| 547 * \param sourceEnbDev source eNB, must be of the type NistLteEnbNetDevice |
| 548 * (originally the UE is attached to this eNB) |
| 549 * \param targetEnbDev target eNB, must be of the type NistLteEnbNetDevice |
| 550 * (the UE would be connected to this eNB after the |
| 551 * handover) |
| 552 * |
| 553 * \warning Requires the use of EPC mode. See SetNistEpcHelper() method |
| 554 */ |
| 555 void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev, |
| 556 Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev
); |
| 557 |
| 558 |
| 559 /**· |
| 560 * Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation
). |
| 561 *· |
| 562 * \param ueDevices the set of UE devices |
| 563 * \param bearer the characteristics of the bearer to be activated |
| 564 */ |
| 565 void ActivateDataRadioBearer (NetDeviceContainer ueDevices, NistEpsBearer bea
rer); |
| 566 |
| 567 /**· |
| 568 * Activate a Data Radio Bearer on a UE device (for LTE-only simulation). |
| 569 * This method will schedule the actual activation |
| 570 * the bearer so that it happens after the UE got connected. |
| 571 *· |
| 572 * \param ueDevice the UE device |
| 573 * \param bearer the characteristics of the bearer to be activated |
| 574 */ |
| 575 void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, NistEpsBearer bearer); |
| 576 |
| 577 /**· |
| 578 * Set the type of fading model to be used in both DL and UL. |
| 579 *· |
| 580 * \param type type of fading model, must be a type name of any class |
| 581 * inheriting from ns3::SpectrumPropagationLossModel, for |
| 582 * example: "ns3::NistTraceFadingLossModel" |
| 583 */ |
| 584 void SetFadingModel (std::string type); |
| 585 |
| 586 /** |
| 587 * Set an attribute for the fading model to be created (both DL and UL). |
| 588 * |
| 589 * \param n the name of the attribute |
| 590 * \param v the value of the attribute |
| 591 */ |
| 592 void SetFadingModelAttribute (std::string n, const AttributeValue &v); |
| 593 |
| 594 /** |
| 595 * Enables full-blown logging for major components of the LENA architecture. |
| 596 */ |
| 597 void EnableLogComponents (void); |
| 598 |
| 599 /** |
| 600 * Enables trace sinks for PHY, MAC, RLC and PDCP. To make sure all nodes are |
| 601 * traced, traces should be enabled once all UEs and eNodeBs are in place and |
| 602 * connected, just before starting the simulation. |
| 603 */ |
| 604 void EnableTraces (void); |
| 605 |
| 606 /** |
| 607 * Enable trace sinks for PHY layer. |
| 608 */ |
| 609 void EnablePhyTraces (void); |
| 610 |
| 611 /** |
| 612 * Enable trace sinks for DL PHY layer. |
| 613 */ |
| 614 void EnableDlPhyTraces (void); |
| 615 |
| 616 /** |
| 617 * Enable trace sinks for UL PHY layer. |
| 618 */ |
| 619 void EnableUlPhyTraces (void); |
| 620 |
| 621 /** |
| 622 * Enable trace sinks for SL PHY layer. |
| 623 */ |
| 624 void EnableSlPhyTraces (void); |
| 625 |
| 626 /** |
| 627 * Enable trace sinks for DL transmission PHY layer. |
| 628 */ |
| 629 void EnableDlTxPhyTraces (void); |
| 630 |
| 631 /** |
| 632 * Enable trace sinks for UL transmission PHY layer. |
| 633 */ |
| 634 void EnableUlTxPhyTraces (void); |
| 635 |
| 636 /** |
| 637 * Enable trace sinks for SL transmission PHY layer. |
| 638 */ |
| 639 void EnableSlTxPhyTraces (void); |
| 640 |
| 641 /** |
| 642 * Enable trace sinks for DL reception PHY layer. |
| 643 */ |
| 644 void EnableDlRxPhyTraces (void); |
| 645 |
| 646 /** |
| 647 * Enable trace sinks for UL reception PHY layer. |
| 648 */ |
| 649 void EnableUlRxPhyTraces (void); |
| 650 |
| 651 /** |
| 652 * Enable trace sinks for SL reception PHY layer. |
| 653 */ |
| 654 void EnableSlRxPhyTraces (void); |
| 655 |
| 656 /** |
| 657 * Enable trace sinks for SL reception PHY layer. |
| 658 */ |
| 659 void EnableSlPscchRxPhyTraces (void); |
| 660 |
| 661 /** |
| 662 * Enable trace sinks for MAC layer. |
| 663 */ |
| 664 void EnableMacTraces (void); |
| 665 |
| 666 /** |
| 667 * Enable trace sinks for DL MAC layer. |
| 668 */ |
| 669 void EnableDlMacTraces (void); |
| 670 |
| 671 /** |
| 672 * Enable trace sinks for UL MAC layer. |
| 673 */ |
| 674 void EnableUlMacTraces (void); |
| 675 |
| 676 /** |
| 677 * Enable trace sinks for SL UE MAC layer. |
| 678 */ |
| 679 void EnableSlUeMacTraces (void); |
| 680 |
| 681 /** |
| 682 * Enable trace sinks for SL UE MAC layer. |
| 683 */ |
| 684 void EnableSlSchUeMacTraces (void); |
| 685 |
| 686 /** |
| 687 * Enable trace sinks for RLC layer. |
| 688 */ |
| 689 void EnableRlcTraces (void); |
| 690 |
| 691 /**· |
| 692 *· |
| 693 * \return the RLC stats calculator object |
| 694 */ |
| 695 Ptr<NistRadioBearerStatsCalculator> GetRlcStats (void); |
| 696 |
| 697 /** |
| 698 * Enable trace sinks for PDCP layer |
| 699 */ |
| 700 void EnablePdcpTraces (void); |
| 701 |
| 702 /**· |
| 703 *· |
| 704 * \return the PDCP stats calculator object |
| 705 */ |
| 706 Ptr<NistRadioBearerStatsCalculator> GetPdcpStats (void); |
| 707 |
| 708 /** |
| 709 * Assign a fixed random variable stream number to the random variables used. |
| 710 * |
| 711 * The InstallEnbDevice() or InstallUeDevice method should have previously |
| 712 * been called by the user on the given devices. |
| 713 * |
| 714 * If NistTraceFadingLossModel has been set as the fading model type, this met
hod |
| 715 * will also assign a stream number to it, if none has been assigned before. |
| 716 * |
| 717 * \param c NetDeviceContainer of the set of net devices for which the |
| 718 * NistLteNetDevice should be modified to use a fixed stream |
| 719 * \param stream first stream index to use |
| 720 * \return the number of stream indices (possibly zero) that have been assigne
d |
| 721 */ |
| 722 int64_t AssignStreams (NetDeviceContainer c, int64_t stream); |
| 723 |
| 724 /** |
| 725 * Deploys the Sidelink configuration to the eNodeBs |
| 726 * \param enbDevices List of devices where to configure sidelink |
| 727 * \param slConfiguration Sidelink configuration |
| 728 */ |
| 729 void InstallSidelinkConfiguration (NetDeviceContainer enbDevices, Ptr<LteEnbRr
cSl> slConfiguration); |
| 730 |
| 731 /** |
| 732 * Deploys the Sidelink configuration to the eNodeB |
| 733 * \param enbDevice The eNodeB where to configure sidelink |
| 734 * \param slConfiguration Sidelink configuration |
| 735 */ |
| 736 void InstallSidelinkConfiguration (Ptr<NetDevice> enbDevice, Ptr<LteEnbRrcSl>
slConfiguration); |
| 737 |
| 738 /** |
| 739 * Deploys the Sidelink configuration to the UEs |
| 740 * \param ueDevices List of devices where to configure sidelink |
| 741 * \param slConfiguration Sidelink configuration |
| 742 */ |
| 743 void InstallSidelinkConfiguration (NetDeviceContainer ueDevices, Ptr<LteUeRrcS
l> slConfiguration); |
| 744 |
| 745 /** |
| 746 * Deploys the Sidelink configuration to the Ue |
| 747 * \param ueDevice The UE where to configure sidelink |
| 748 * \param slConfiguration Sidelink configuration |
| 749 */ |
| 750 void InstallSidelinkConfiguration (Ptr<NetDevice> ueDevice, Ptr<LteUeRrcSl> sl
Configuration); |
| 751 |
| 752 /** |
| 753 * Compute the RSRP between the given nodes for the given propagation loss mod
el |
| 754 * This code is derived from the multi-model-spectrum-channel class. It can be
used for both uplink and downlink |
| 755 * \param propagationLoss The loss model |
| 756 * \param psd The power spectral density of the transmitter |
| 757 * \param txPhy The transmitter |
| 758 * \param rxPhy The receiver |
| 759 * \return The RSRP· |
| 760 */ |
| 761 double DoCalcRsrp (Ptr<PropagationLossModel> propagationLoss, Ptr<SpectrumValu
e> psd, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy); |
| 762 |
| 763 /** |
| 764 * Compute the RSRP between the given nodes for the given propagation loss mod
el |
| 765 * This code is derived from the multi-model-spectrum-channel class. It can be
used for both uplink and downlink |
| 766 * \param propagationLoss The loss model |
| 767 * \param txPower The transmit power |
| 768 * \param txPhy The transmitter |
| 769 * \param rxPhy The receiver |
| 770 * \return The RSRP· |
| 771 */ |
| 772 double DoCalcRsrp (Ptr<PropagationLossModel> propagationLoss, double txPower,
Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy); |
| 773 |
| 774 /** |
| 775 * Computes the S-RSRP between 2 UEs. Information about the uplink frequency a
nd band is necessary to be able to call the function before the simulation star
ts. |
| 776 * \param txPower Transmit power for the reference signal |
| 777 * \param ulEarfcn Uplink frequency |
| 778 * \param ulBandwidth Uplink bandwidth |
| 779 * \param txDevice Transmitter UE |
| 780 * \param rxDevice Receiver UE |
| 781 * \return RSRP value |
| 782 */ |
| 783 double CalcSidelinkRsrp (double txPower, double ulEarfcn, double ulBandwidth,
Ptr<NetDevice> txDevice, Ptr<NetDevice> rxDevice); |
| 784 |
| 785 /** |
| 786 * Computes the RSRP between a transmitter UE and a receiver UE as defined in
TR 36.843. Information about the uplink frequency and band is necessary to be a
ble to call the function before the simulation starts.· |
| 787 * \param txPower Transmit power for the reference signal |
| 788 * \param ulEarfcn Uplink frequency |
| 789 * \param txDevice Transmitter UE |
| 790 * \param rxDevice Receiver UE |
| 791 * \return RSRP value |
| 792 */ |
| 793 double CalcSidelinkRsrpEval (double txPower, double ulEarfcn, Ptr<NetDevice> t
xDevice, Ptr<NetDevice> rxDevice); |
| 794 |
| 795 protected: |
| 796 // inherited from Object |
| 797 virtual void DoInitialize (void); |
| 798 |
| 799 private: |
| 800 /** |
| 801 * Create an eNodeB device (NistLteEnbNetDevice) on the given node. |
| 802 * \param n the node where the device is to be installed |
| 803 * \return pointer to the created device |
| 804 */ |
| 805 Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n); |
| 806 |
| 807 /** |
| 808 * Create a UE device (NistLteUeNetDevice) on the given node |
| 809 * \param n the node where the device is to be installed |
| 810 * \return pointer to the created device |
| 811 */ |
| 812 Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n); |
| 813 |
| 814 /** |
| 815 * The actual function to trigger a manual handover. |
| 816 * \param ueDev the UE that hands off, must be of the type NistLteUeNetDevice |
| 817 * \param sourceEnbDev source eNB, must be of the type NistLteEnbNetDevice |
| 818 * (originally the UE is attached to this eNB) |
| 819 * \param targetEnbDev target eNB, must be of the type NistLteEnbNetDevice |
| 820 * (the UE would be connected to this eNB after the |
| 821 * handover) |
| 822 * |
| 823 * This method is normally scheduled by HandoverRequest() to run at a specific |
| 824 * time where a manual handover is desired by the simulation user. |
| 825 */ |
| 826 void DoHandoverRequest (Ptr<NetDevice> ueDev, |
| 827 Ptr<NetDevice> sourceEnbDev, |
| 828 Ptr<NetDevice> targetEnbDev); |
| 829 |
| 830 |
| 831 /** |
| 832 * \brief The actual function to trigger a manual bearer de-activation |
| 833 * \param ueDevice the UE on which bearer to be de-activated must be of the t
ype NistLteUeNetDevice |
| 834 * \param enbDevice eNB, must be of the type NistLteEnbNetDevice |
| 835 * \param bearerId Bearer Identity which is to be de-activated |
| 836 * |
| 837 * This method is normally scheduled by DeActivateDedicatedNistEpsBearer() to
run at a specific |
| 838 * time when a manual bearer de-activation is desired by the simulation user. |
| 839 */ |
| 840 void DoDeActivateDedicatedNistEpsBearer (Ptr<NetDevice> ueDevice, Ptr<NetDevic
e> enbDevice, uint8_t bearerId); |
| 841 |
| 842 |
| 843 /// The downlink LTE channel used in the simulation. |
| 844 Ptr<SpectrumChannel> m_downlinkChannel; |
| 845 /// The uplink LTE channel used in the simulation. |
| 846 Ptr<SpectrumChannel> m_uplinkChannel; |
| 847 /// The path loss model used in the downlink channel. |
| 848 Ptr<Object> m_downlinkPathlossModel; |
| 849 /// The path loss model used in the uplink channel. |
| 850 Ptr<Object> m_uplinkPathlossModel; |
| 851 |
| 852 /// Factory of MAC scheduler object. |
| 853 ObjectFactory m_schedulerFactory; |
| 854 |
| 855 /// Factory of MAC UE scheduler object. |
| 856 ObjectFactory m_UlschedulerFactory; |
| 857 |
| 858 /// Factory of FFR (frequency reuse) algorithm object. |
| 859 ObjectFactory m_ffrAlgorithmFactory; |
| 860 /// Factory of handover algorithm object. |
| 861 ObjectFactory m_handoverAlgorithmFactory; |
| 862 /// Factory of NistLteEnbNetDevice objects. |
| 863 ObjectFactory m_enbNetDeviceFactory; |
| 864 /// Factory of antenna object for eNodeB. |
| 865 ObjectFactory m_enbAntennaModelFactory; |
| 866 /// Factory for NistLteUeNetDevice objects. |
| 867 ObjectFactory m_ueNetDeviceFactory; |
| 868 /// Factory of antenna object for UE. |
| 869 ObjectFactory m_ueAntennaModelFactory; |
| 870 /// Factory of path loss model object for the downlink channel. |
| 871 ObjectFactory m_dlPathlossModelFactory; |
| 872 /// Factory of path loss model object for the uplink channel. |
| 873 ObjectFactory m_ulPathlossModelFactory; |
| 874 /// Factory of both the downlink and uplink LTE channels. |
| 875 ObjectFactory m_channelFactory; |
| 876 |
| 877 /// Name of fading model type, e.g., "ns3::NistTraceFadingLossModel". |
| 878 std::string m_fadingModelType; |
| 879 /// Factory of fading model object for both the downlink and uplink channels. |
| 880 ObjectFactory m_fadingModelFactory; |
| 881 /// The fading model used in both the downlink and uplink channels. |
| 882 Ptr<SpectrumPropagationLossModel> m_fadingModule; |
| 883 /** |
| 884 * True if a random variable stream number has been assigned for the fading |
| 885 * model. Used to prevent such assignment to be done more than once. |
| 886 */ |
| 887 bool m_fadingStreamsAssigned; |
| 888 |
| 889 /// Container of PHY layer statistics. |
| 890 Ptr<NistPhyStatsCalculator> m_phyStats; |
| 891 /// Container of PHY layer statistics related to transmission. |
| 892 Ptr<NistPhyTxStatsCalculator> m_phyTxStats; |
| 893 /// Container of PHY layer statistics related to reception. |
| 894 Ptr<NistPhyRxStatsCalculator> m_phyRxStats; |
| 895 /// Container of MAC layer statistics. |
| 896 Ptr<NistMacStatsCalculator> m_macStats; |
| 897 /// Container of RLC layer statistics. |
| 898 Ptr<NistRadioBearerStatsCalculator> m_rlcStats; |
| 899 /// Container of PDCP layer statistics. |
| 900 Ptr<NistRadioBearerStatsCalculator> m_pdcpStats; |
| 901 /// Connects RLC and PDCP statistics containers to appropriate trace sources |
| 902 NistRadioBearerStatsConnector m_radioBearerStatsConnector; |
| 903 |
| 904 /** |
| 905 * Helper which provides implementation of core network. Initially empty |
| 906 * (i.e., LTE-only simulation without any core network) and then might be |
| 907 * set using SetNistEpcHelper(). |
| 908 */ |
| 909 Ptr<NistEpcHelper> m_epcHelper; |
| 910 |
| 911 /** |
| 912 * Keep track of the number of IMSI allocated. Increases by one every time a |
| 913 * new UE is installed (by InstallSingleUeDevice()). The first UE will have |
| 914 * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9). |
| 915 */ |
| 916 uint64_t m_imsiCounter; |
| 917 /** |
| 918 * Keep track of the number of cell ID allocated. Increases by one every time |
| 919 * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB |
| 920 * will have a cell ID of 1. The maximum number of eNodeB is 65535. |
| 921 */ |
| 922 uint16_t m_cellIdCounter; |
| 923 |
| 924 /** |
| 925 * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for |
| 926 * RRC signaling. If false, LteRrcProtocolReal will be used. |
| 927 */ |
| 928 bool m_useIdealRrc; |
| 929 /** |
| 930 * The `AnrEnabled` attribute. Activate or deactivate Automatic Neighbour |
| 931 * Relation function. |
| 932 */ |
| 933 bool m_isAnrEnabled; |
| 934 /** |
| 935 * The `UsePdschForCqiGeneration` attribute. If true, DL-CQI will be |
| 936 * calculated from PDCCH as signal and PDSCH as interference. If false, |
| 937 * DL-CQI will be calculated from PDCCH as signal and PDCCH as interference. |
| 938 */ |
| 939 bool m_usePdschForCqiGeneration; |
| 940 |
| 941 /** |
| 942 * The `UseSidelink` attribute. If true, the UEs will contain additional· |
| 943 * spectrum phy model to receive sidelink communication |
| 944 */ |
| 945 bool m_useSidelink; |
| 946 |
| 947 /**· |
| 948 * This attribute check if the UEs are allowed to perform ProSe direct discove
ry |
| 949 * Annoncements and Monitoring requests are not implemented,· |
| 950 * only direct discovery messages are exchanged |
| 951 */ |
| 952 bool m_useDiscovery; |
| 953 |
| 954 /** |
| 955 * The `UseSameUlDlPropagationCondition` attribute. If true, the UEs will have······· |
| 956 * the same shadowing and LOS condition for both UL and DL |
| 957 * False per default |
| 958 */ |
| 959 bool m_sameUlDlPropagationCondition; |
| 960 |
| 961 /** Enables/Disables eNB physical layer upon creation |
| 962 * True per defaul |
| 963 */ |
| 964 bool m_EnbEnablePhyLayer; |
| 965 |
| 966 }; // end of `class NistLteHelper` |
| 967 |
| 968 |
| 969 } // namespace ns3 |
| 970 |
| 971 |
| 972 |
| 973 #endif // NIST_LTE_HELPER_H |
OLD | NEW |