OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari | 3 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 /** | 58 /** |
59 * | 59 * |
60 * \param dlPhy the downlink LteSpectrumPhy instance | 60 * \param dlPhy the downlink LteSpectrumPhy instance |
61 * \param ulPhy the uplink LteSpectrumPhy instance | 61 * \param ulPhy the uplink LteSpectrumPhy instance |
62 */ | 62 */ |
63 LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); | 63 LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy); |
64 | 64 |
65 virtual ~LteEnbPhy (); | 65 virtual ~LteEnbPhy (); |
66 | 66 |
| 67 /** |
| 68 * \brief Get the type ID. |
| 69 * \return the object TypeId |
| 70 */ |
| 71 static TypeId GetTypeId (void); |
67 // inherited from Object | 72 // inherited from Object |
68 static TypeId GetTypeId (void); | |
69 virtual void DoInitialize (void); | 73 virtual void DoInitialize (void); |
70 virtual void DoDispose (void); | 74 virtual void DoDispose (void); |
71 | 75 |
72 | 76 |
73 /** | 77 /** |
74 * \brief Get the PHY SAP provider | 78 * \brief Get the PHY SAP provider |
75 * \return a pointer to the SAP Provider of the PHY | 79 * \return a pointer to the SAP Provider of the PHY |
76 */ | 80 */ |
77 LteEnbPhySapProvider* GetLteEnbPhySapProvider (); | 81 LteEnbPhySapProvider* GetLteEnbPhySapProvider (); |
78 | 82 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 * \brief End a LTE frame | 261 * \brief End a LTE frame |
258 */ | 262 */ |
259 void EndFrame (void); | 263 void EndFrame (void); |
260 | 264 |
261 /** | 265 /** |
262 * \brief PhySpectrum received a new PHY-PDU | 266 * \brief PhySpectrum received a new PHY-PDU |
263 */ | 267 */ |
264 void PhyPduReceived (Ptr<Packet> p); | 268 void PhyPduReceived (Ptr<Packet> p); |
265 | 269 |
266 /** | 270 /** |
267 * \brief PhySpectrum received a new list of LteControlMessage | 271 * \brief PhySpectrum received a new list of LteControlMessage |
268 */ | 272 */ |
269 virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >)
; | 273 virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >)
; |
270 | 274 |
271 // inherited from LtePhy | 275 // inherited from LtePhy |
272 virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr); | 276 virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr); |
273 virtual void GenerateDataCqiReport (const SpectrumValue& sinr); | 277 virtual void GenerateDataCqiReport (const SpectrumValue& sinr); |
274 virtual void ReportInterference (const SpectrumValue& interf); | 278 virtual void ReportInterference (const SpectrumValue& interf); |
275 virtual void ReportRsReceivedPower (const SpectrumValue& power); | 279 virtual void ReportRsReceivedPower (const SpectrumValue& power); |
276 | 280 |
277 | 281 |
278 | 282 |
279 /** | 283 /** |
280 * \brief PhySpectrum generated a new UL HARQ feedback | 284 * \brief PhySpectrum generated a new UL HARQ feedback |
281 */ | 285 */ |
282 virtual void ReceiveLteUlHarqFeedback (UlInfoListElement_s mes); | 286 virtual void ReceiveLteUlHarqFeedback (UlInfoListElement_s mes); |
283 | 287 |
| 288 /** |
| 289 * \brief PhySpectrum generated a new UL HARQ feedback |
| 290 * |
| 291 * \param harq the HARQ Phy |
| 292 */ |
284 void SetHarqPhyModule (Ptr<LteHarqPhy> harq); | 293 void SetHarqPhyModule (Ptr<LteHarqPhy> harq); |
285 | 294 |
286 /** | 295 /** |
287 * TracedCallback signature for the linear average of SRS SINRs. | 296 * TracedCallback signature for the linear average of SRS SINRs. |
288 * | 297 * |
289 * \param [in] cellId | 298 * \param [in] cellId |
290 * \param [in] rnti | 299 * \param [in] rnti |
291 * \param [in] sinrLinear | 300 * \param [in] sinrLinear |
292 */ | 301 */ |
293 typedef void (* ReportUeSinrTracedCallback) | 302 typedef void (* ReportUeSinrTracedCallback) |
294 (uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrier
Id); | 303 (uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrier
Id); |
295 | 304 |
296 /** | 305 /** |
297 * TracedCallback signature for the linear average of SRS SINRs. | 306 * TracedCallback signature for the linear average of SRS SINRs. |
298 * | 307 * |
299 * \param [in] cellId | 308 * \param [in] cellId |
300 * \param [in] spectrumValue | 309 * \param [in] spectrumValue |
301 * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated | 310 * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated |
302 * and will be changed to \c Ptr<const SpectrumValue> in a future release. | 311 * and will be changed to \c Ptr<const SpectrumValue> in a future release. |
303 */ | 312 */ |
304 typedef void (* ReportInterferenceTracedCallback) | 313 typedef void (* ReportInterferenceTracedCallback) |
305 (uint16_t cellId, Ptr<SpectrumValue> spectrumValue); | 314 (uint16_t cellId, Ptr<SpectrumValue> spectrumValue); |
306 | 315 |
307 private: | 316 private: |
308 | 317 |
309 // LteEnbCphySapProvider forwarded methods | 318 // LteEnbCphySapProvider forwarded methods |
| 319 /** |
| 320 * Set bandwidth function |
| 321 * |
| 322 * \param ulBandwidth UL bandwidth |
| 323 * \param dlBandwidth DL bandwidth |
| 324 */ |
310 void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth); | 325 void DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth); |
| 326 /** |
| 327 * Set EARFCN |
| 328 * |
| 329 * \param dlEarfcn DL EARFCN |
| 330 * \param ulEarfcn UL EARFCN |
| 331 */ |
311 void DoSetEarfcn (uint32_t dlEarfcn, uint32_t ulEarfcn); | 332 void DoSetEarfcn (uint32_t dlEarfcn, uint32_t ulEarfcn); |
| 333 /** |
| 334 * Add UE |
| 335 * |
| 336 * \param rnti RNTI |
| 337 */ |
312 void DoAddUe (uint16_t rnti); | 338 void DoAddUe (uint16_t rnti); |
| 339 /** |
| 340 * Remove UE |
| 341 * |
| 342 * \param rnti RNTI |
| 343 */ |
313 void DoRemoveUe (uint16_t rnti); | 344 void DoRemoveUe (uint16_t rnti); |
| 345 /** |
| 346 * Set PA |
| 347 * |
| 348 * \param rnti RNTI |
| 349 * \param pa PA |
| 350 */ |
314 void DoSetPa (uint16_t rnti, double pa); | 351 void DoSetPa (uint16_t rnti, double pa); |
| 352 /** |
| 353 * Set transmission mode |
| 354 * |
| 355 * \param rnti RNTI |
| 356 * \param txMode transmit mode |
| 357 */ |
315 void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode); | 358 void DoSetTransmissionMode (uint16_t rnti, uint8_t txMode); |
| 359 /** |
| 360 * Set source configuration index |
| 361 * |
| 362 * \param rnti RNTI |
| 363 * \param srcCi source configuration index |
| 364 */ |
316 void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi); | 365 void DoSetSrsConfigurationIndex (uint16_t rnti, uint16_t srcCi); |
| 366 /** |
| 367 * Set master information block |
| 368 * |
| 369 * \param mib LteRrcSap::MasterInformationBlock |
| 370 */ |
317 void DoSetMasterInformationBlock (LteRrcSap::MasterInformationBlock mib); | 371 void DoSetMasterInformationBlock (LteRrcSap::MasterInformationBlock mib); |
| 372 /** |
| 373 * Set system information block |
| 374 * |
| 375 * \param sib1 LteRrcSap::SystemInformationBlockType1 |
| 376 */ |
318 void DoSetSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1
sib1); | 377 void DoSetSystemInformationBlockType1 (LteRrcSap::SystemInformationBlockType1
sib1); |
319 | 378 |
320 // LteEnbPhySapProvider forwarded methods | 379 // LteEnbPhySapProvider forwarded methods |
321 void DoSendMacPdu (Ptr<Packet> p); | 380 void DoSendMacPdu (Ptr<Packet> p); |
| 381 /** |
| 382 * Send LTE Control Message function |
| 383 * |
| 384 * \param msg LTE control message |
| 385 */ |
322 void DoSendLteControlMessage (Ptr<LteControlMessage> msg); | 386 void DoSendLteControlMessage (Ptr<LteControlMessage> msg); |
| 387 /** |
| 388 * Get MAC ch TTI delay function |
| 389 * |
| 390 * \returns delay value |
| 391 */ |
323 uint8_t DoGetMacChTtiDelay (); | 392 uint8_t DoGetMacChTtiDelay (); |
324 | 393 |
325 /** | 394 /** |
326 * Add the given RNTI to the list of attached UE #m_ueAttached. | 395 * Add the given RNTI to the list of attached UE #m_ueAttached. |
327 * \param rnti RNTI of a UE | 396 * \param rnti RNTI of a UE |
328 * \return true if the RNTI has _not_ existed before, or false otherwise. | 397 * \return true if the RNTI has _not_ existed before, or false otherwise. |
329 */ | 398 */ |
330 bool AddUePhy (uint16_t rnti); | 399 bool AddUePhy (uint16_t rnti); |
331 /** | 400 /** |
332 * Remove the given RNTI from the list of attached UE #m_ueAttached. | 401 * Remove the given RNTI from the list of attached UE #m_ueAttached. |
333 * \param rnti RNTI of a UE | 402 * \param rnti RNTI of a UE |
334 * \return true if the RNTI has existed before, or false otherwise. | 403 * \return true if the RNTI has existed before, or false otherwise. |
335 */ | 404 */ |
336 bool DeleteUePhy (uint16_t rnti); | 405 bool DeleteUePhy (uint16_t rnti); |
337 | 406 |
| 407 /** |
| 408 * Create SRS report function |
| 409 * |
| 410 * \param rnti the RNTI |
| 411 * \param srs the SRS |
| 412 */ |
338 void CreateSrsReport (uint16_t rnti, double srs); | 413 void CreateSrsReport (uint16_t rnti, double srs); |
339 | 414 |
340 /** | 415 /** |
341 * List of RNTI of attached UEs. Used for quickly determining whether a UE is | 416 * List of RNTI of attached UEs. Used for quickly determining whether a UE is |
342 * attached to this eNodeB or not. | 417 * attached to this eNodeB or not. |
343 */ | 418 */ |
344 std::set <uint16_t> m_ueAttached; | 419 std::set <uint16_t> m_ueAttached; |
345 | 420 |
346 | 421 |
347 /// P_A per UE RNTI. | 422 /// P_A per UE RNTI. |
348 std::map <uint16_t,double> m_paMap; | 423 std::map <uint16_t,double> m_paMap; |
349 | 424 |
350 /// DL power allocation map. | 425 /// DL power allocation map. |
351 std::map <int, double> m_dlPowerAllocationMap; | 426 std::map <int, double> m_dlPowerAllocationMap; |
352 | 427 |
353 /** | 428 /** |
354 * A vector of integers, if the i-th value is j it means that the j-th | 429 * A vector of integers, if the i-th value is j it means that the j-th |
355 * resource block is used for transmission in the downlink. If there is | 430 * resource block is used for transmission in the downlink. If there is |
356 * no i such that the value of the i-th element is j, it means that RB j | 431 * no i such that the value of the i-th element is j, it means that RB j |
357 * is not used. | 432 * is not used. |
358 */ | 433 */ |
359 std::vector <int> m_listOfDownlinkSubchannel; | 434 std::vector <int> m_listOfDownlinkSubchannel; |
360 | 435 |
361 std::vector <int> m_dlDataRbMap; | 436 std::vector <int> m_dlDataRbMap; ///< DL data RB map |
362 | 437 |
363 /// For storing info on future receptions. | 438 /// For storing info on future receptions. |
364 std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; | 439 std::vector< std::list<UlDciLteControlMessage> > m_ulDciQueue; |
365 | 440 |
366 LteEnbPhySapProvider* m_enbPhySapProvider; | 441 LteEnbPhySapProvider* m_enbPhySapProvider; ///< ENB Phy SAP provider |
367 LteEnbPhySapUser* m_enbPhySapUser; | 442 LteEnbPhySapUser* m_enbPhySapUser; ///< ENB Phy SAP user |
368 | 443 |
369 LteEnbCphySapProvider* m_enbCphySapProvider; | 444 LteEnbCphySapProvider* m_enbCphySapProvider; ///< ENB CPhy SAP provider |
370 LteEnbCphySapUser* m_enbCphySapUser; | 445 LteEnbCphySapUser* m_enbCphySapUser; ///< ENB CPhy SAP user |
371 | 446 |
372 /** | 447 /** |
373 * The frame number currently served. In ns-3, frame number starts from 1. | 448 * The frame number currently served. In ns-3, frame number starts from 1. |
374 * In contrast, the 3GPP standard's frame number starts from 0. | 449 * In contrast, the 3GPP standard's frame number starts from 0. |
375 */ | 450 */ |
376 uint32_t m_nrFrames; | 451 uint32_t m_nrFrames; |
377 /** | 452 /** |
378 * The subframe number currently served. In ns-3, subframe number starts | 453 * The subframe number currently served. In ns-3, subframe number starts |
379 * from 1. In contrast, the 3GPP standard's subframe number starts from 0. | 454 * from 1. In contrast, the 3GPP standard's subframe number starts from 0. |
380 * The number resets to the beginning again after 10 subframes. | 455 * The number resets to the beginning again after 10 subframes. |
381 */ | 456 */ |
382 uint32_t m_nrSubFrames; | 457 uint32_t m_nrSubFrames; |
383 | 458 |
384 uint16_t m_srsPeriodicity; | 459 uint16_t m_srsPeriodicity; ///< SRS periodicity |
385 Time m_srsStartTime; | 460 Time m_srsStartTime; ///< SRS start time |
386 std::map <uint16_t,uint16_t> m_srsCounter; | 461 std::map <uint16_t,uint16_t> m_srsCounter; ///< SRS counter |
387 std::vector <uint16_t> m_srsUeOffset; | 462 std::vector <uint16_t> m_srsUeOffset; ///< SRS UE offset |
388 uint16_t m_currentSrsOffset; | 463 uint16_t m_currentSrsOffset; ///< current SRS offset |
389 | 464 |
390 /** | 465 /** |
391 * The Master Information Block message to be broadcasted every frame. | 466 * The Master Information Block message to be broadcasted every frame. |
392 * The message content is specified by the upper layer through the RRC SAP. | 467 * The message content is specified by the upper layer through the RRC SAP. |
393 */ | 468 */ |
394 LteRrcSap::MasterInformationBlock m_mib; | 469 LteRrcSap::MasterInformationBlock m_mib; |
395 /** | 470 /** |
396 * The System Information Block Type 1 message to be broadcasted. SIB1 is | 471 * The System Information Block Type 1 message to be broadcasted. SIB1 is |
397 * broadcasted every 6th subframe of every odd-numbered radio frame. | 472 * broadcasted every 6th subframe of every odd-numbered radio frame. |
398 * The message content is specified by the upper layer through the RRC SAP. | 473 * The message content is specified by the upper layer through the RRC SAP. |
399 */ | 474 */ |
400 LteRrcSap::SystemInformationBlockType1 m_sib1; | 475 LteRrcSap::SystemInformationBlockType1 m_sib1; |
401 | 476 |
402 Ptr<LteHarqPhy> m_harqPhyModule; | 477 Ptr<LteHarqPhy> m_harqPhyModule; ///< HARQ Phy module |
403 | 478 |
404 /** | 479 /** |
405 * The `ReportUeSinr` trace source. Reporting the linear average of SRS SINR. | 480 * The `ReportUeSinr` trace source. Reporting the linear average of SRS SINR. |
406 * Exporting cell ID, RNTI, SINR in linear unit and ComponentCarrierId | 481 * Exporting cell ID, RNTI, SINR in linear unit and ComponentCarrierId |
407 */ | 482 */ |
408 TracedCallback<uint16_t, uint16_t, double, uint8_t> m_reportUeSinr; | 483 TracedCallback<uint16_t, uint16_t, double, uint8_t> m_reportUeSinr; |
409 /** | 484 /** |
410 * The `UeSinrSamplePeriod` trace source. The sampling period for reporting | 485 * The `UeSinrSamplePeriod` trace source. The sampling period for reporting |
411 * UEs' SINR stats. | 486 * UEs' SINR stats. |
412 */ | 487 */ |
413 uint16_t m_srsSamplePeriod; | 488 uint16_t m_srsSamplePeriod; |
414 std::map <uint16_t,uint16_t> m_srsSampleCounterMap; | 489 std::map <uint16_t,uint16_t> m_srsSampleCounterMap; ///< SRS sample counter ma
p |
415 | 490 |
416 /** | 491 /** |
417 * The `ReportInterference` trace source. Reporting the interference per PHY | 492 * The `ReportInterference` trace source. Reporting the interference per PHY |
418 * RB (TS 36.214 section 5.2.2, measured on DATA). Exporting cell ID and | 493 * RB (TS 36.214 section 5.2.2, measured on DATA). Exporting cell ID and |
419 * interference linear power per RB basis. | 494 * interference linear power per RB basis. |
420 * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated | 495 * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated |
421 * and will be changed to \c Ptr<const SpectrumValue> in a future release. | 496 * and will be changed to \c Ptr<const SpectrumValue> in a future release. |
422 */ | 497 */ |
423 TracedCallback<uint16_t, Ptr<SpectrumValue> > m_reportInterferenceTrace; | 498 TracedCallback<uint16_t, Ptr<SpectrumValue> > m_reportInterferenceTrace; |
424 /** | 499 /** |
425 * The `InterferenceSamplePeriod` attribute. The sampling period for | 500 * The `InterferenceSamplePeriod` attribute. The sampling period for |
426 * reporting interference stats. | 501 * reporting interference stats. |
427 * \todo In what unit is this? | 502 * \todo In what unit is this? |
428 */ | 503 */ |
429 uint16_t m_interferenceSamplePeriod; | 504 uint16_t m_interferenceSamplePeriod; |
430 uint16_t m_interferenceSampleCounter; | 505 uint16_t m_interferenceSampleCounter; ///< interference sample counter |
431 | 506 |
432 /** | 507 /** |
433 * The `DlPhyTransmission` trace source. Contains trace information regarding | 508 * The `DlPhyTransmission` trace source. Contains trace information regarding |
434 * PHY stats from DL Tx perspective. Exporting a structure with type | 509 * PHY stats from DL Tx perspective. Exporting a structure with type |
435 * PhyTransmissionStatParameters. | 510 * PhyTransmissionStatParameters. |
436 */ | 511 */ |
437 TracedCallback<PhyTransmissionStatParameters> m_dlPhyTransmission; | 512 TracedCallback<PhyTransmissionStatParameters> m_dlPhyTransmission; |
438 | 513 |
439 }; // end of `class LteEnbPhy` | 514 }; // end of `class LteEnbPhy` |
440 | 515 |
441 | 516 |
442 } | 517 } |
443 | 518 |
444 #endif /* LTE_ENB_PHY_H */ | 519 #endif /* LTE_ENB_PHY_H */ |
OLD | NEW |