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) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya
(CTTC) | 3 * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya
(CTTC) |
4 * Copyright (c) 2015, Danilo Abrignani | 4 * Copyright (c) 2015, Danilo Abrignani |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include <ns3/epc-enb-s1-sap.h> | 39 #include <ns3/epc-enb-s1-sap.h> |
40 #include <ns3/lte-handover-management-sap.h> | 40 #include <ns3/lte-handover-management-sap.h> |
41 #include <ns3/lte-componentcarrier-management-sap.h> | 41 #include <ns3/lte-componentcarrier-management-sap.h> |
42 #include <ns3/lte-enb-cphy-sap.h> | 42 #include <ns3/lte-enb-cphy-sap.h> |
43 #include <ns3/lte-rrc-sap.h> | 43 #include <ns3/lte-rrc-sap.h> |
44 #include <ns3/lte-anr-sap.h> | 44 #include <ns3/lte-anr-sap.h> |
45 #include <ns3/lte-ffr-rrc-sap.h> | 45 #include <ns3/lte-ffr-rrc-sap.h> |
46 | 46 |
47 #include <map> | 47 #include <map> |
48 #include <set> | 48 #include <set> |
| 49 #include <ns3/component-carrier.h> |
| 50 #include <vector> |
49 | 51 |
50 namespace ns3 { | 52 namespace ns3 { |
51 | 53 |
52 class LteRadioBearerInfo; | 54 class LteRadioBearerInfo; |
53 class LteSignalingRadioBearerInfo; | 55 class LteSignalingRadioBearerInfo; |
54 class LteDataRadioBearerInfo; | 56 class LteDataRadioBearerInfo; |
55 class LteEnbRrc; | 57 class LteEnbRrc; |
56 class Packet; | 58 class Packet; |
57 | 59 |
58 | 60 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 311 |
310 /** | 312 /** |
311 * TracedCallback signature for state transition events. | 313 * TracedCallback signature for state transition events. |
312 * | 314 * |
313 * \param [in] imsi | 315 * \param [in] imsi |
314 * \param [in] cellId | 316 * \param [in] cellId |
315 * \param [in] rnti | 317 * \param [in] rnti |
316 * \param [in] oldState | 318 * \param [in] oldState |
317 * \param [in] newState | 319 * \param [in] newState |
318 */ | 320 */ |
319 typedef void (* StateTracedCallback) | 321 typedef void (*StateTracedCallback) |
320 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, | 322 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, |
321 const State oldState, const State newState); | 323 const State oldState, const State newState); |
322 | 324 |
323 private: | 325 private: |
324 | 326 |
325 /**· | 327 /**· |
326 * Add a new LteDataRadioBearerInfo structure to the UeManager | 328 * Add a new LteDataRadioBearerInfo structure to the UeManager |
327 *· | 329 *· |
328 * \param radioBearerInfo· | 330 * \param radioBearerInfo· |
329 *· | 331 *· |
330 * \return the id of the newly added data radio bearer structure | 332 * \return the id of the newly added data radio bearer structure |
331 */ | 333 */ |
(...skipping 12 matching lines...) Expand all Loading... |
344 * \param drbid the Data Radio Bearer id | 346 * \param drbid the Data Radio Bearer id |
345 */ | 347 */ |
346 void RemoveDataRadioBearerInfo (uint8_t drbid); | 348 void RemoveDataRadioBearerInfo (uint8_t drbid); |
347 | 349 |
348 /**· | 350 /**· |
349 *· | 351 *· |
350 * \return an RrcConnectionReconfiguration struct built based on the | 352 * \return an RrcConnectionReconfiguration struct built based on the |
351 * current configuration | 353 * current configuration |
352 */ | 354 */ |
353 LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration (); | 355 LteRrcSap::RrcConnectionReconfiguration BuildRrcConnectionReconfiguration (); |
354 | 356 |
355 /**· | 357 /**· |
356 *· | 358 *· |
357 * \return an NonCriticalExtensionConfiguration struct built based on the | 359 * \return an NonCriticalExtensionConfiguration struct built based on the |
358 * current configuration | 360 * current configuration |
359 */ | 361 */ |
360 LteRrcSap::NonCriticalExtensionConfiguration BuildNonCriticalExtentionConfigur
ationCa (); | 362 LteRrcSap::NonCriticalExtensionConfiguration BuildNonCriticalExtentionConfigur
ationCa (); |
361 | 363 |
362 /**· | 364 /**· |
363 *· | 365 *· |
364 * \return a RadioResourceConfigDedicated struct built based on the | 366 * \return a RadioResourceConfigDedicated struct built based on the |
365 * current configuration | 367 * current configuration |
366 */ | 368 */ |
367 LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated (); | 369 LteRrcSap::RadioResourceConfigDedicated BuildRadioResourceConfigDedicated (); |
368 | 370 |
369 /**· | 371 /**· |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 */ | 546 */ |
545 virtual ~LteEnbRrc (); | 547 virtual ~LteEnbRrc (); |
546 | 548 |
547 | 549 |
548 // inherited from Object | 550 // inherited from Object |
549 protected: | 551 protected: |
550 virtual void DoDispose (void); | 552 virtual void DoDispose (void); |
551 public: | 553 public: |
552 static TypeId GetTypeId (void); | 554 static TypeId GetTypeId (void); |
553 | 555 |
| 556 uint16_t m_noOfCcs; |
554 | 557 |
| 558 void InitializeSap (void); |
555 /** | 559 /** |
556 * Set the X2 SAP this RRC should interact with | 560 * Set the X2 SAP this RRC should interact with |
557 * \param s the X2 SAP Provider to be used by this RRC entity | 561 * \param s the X2 SAP Provider to be used by this RRC entity |
558 */ | 562 */ |
559 void SetEpcX2SapProvider (EpcX2SapProvider* s); | 563 void SetEpcX2SapProvider (EpcX2SapProvider* s); |
560 | 564 |
561 /**· | 565 /**· |
562 * Get the X2 SAP offered by this RRC | 566 * Get the X2 SAP offered by this RRC |
563 * \return s the X2 SAP User interface offered to the X2 entity by this RRC en
tity | 567 * \return s the X2 SAP User interface offered to the X2 entity by this RRC en
tity |
564 */ | 568 */ |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 EpcEnbS1SapUser* GetS1SapUser (); | 681 EpcEnbS1SapUser* GetS1SapUser (); |
678 | 682 |
679 | 683 |
680 /** | 684 /** |
681 * set the CPHY SAP this RRC should use to interact with the PHY | 685 * set the CPHY SAP this RRC should use to interact with the PHY |
682 * | 686 * |
683 * \param s the CPHY SAP Provider | 687 * \param s the CPHY SAP Provider |
684 */ | 688 */ |
685 void SetLteEnbCphySapProvider (LteEnbCphySapProvider * s); | 689 void SetLteEnbCphySapProvider (LteEnbCphySapProvider * s); |
686 | 690 |
| 691 void SetLteEnbCphySapProvider (LteEnbCphySapProvider * s, uint16_t pos); |
| 692 |
687 /** | 693 /** |
688 * | 694 * |
689 * | 695 * |
690 * \return s the CPHY SAP User interface offered to the PHY by this RRC | 696 * \return s the CPHY SAP User interface offered to the PHY by this RRC |
691 */ | 697 */ |
692 LteEnbCphySapUser* GetLteEnbCphySapUser (); | 698 LteEnbCphySapUser* GetLteEnbCphySapUser (); |
693 | 699 |
| 700 LteEnbCphySapUser* GetLteEnbCphySapUser (uint16_t pos); |
| 701 |
694 /**· | 702 /**· |
695 *· | 703 *· |
696 *· | 704 *· |
697 * \param rnti the identifier of an UE | 705 * \param rnti the identifier of an UE |
698 *· | 706 *· |
699 * \return true if the corresponding UeManager instance exists | 707 * \return true if the corresponding UeManager instance exists |
700 */ | 708 */ |
701 bool HasUeManager (uint16_t rnti) const; | 709 bool HasUeManager (uint16_t rnti) const; |
702 | 710 |
703 /** | 711 /** |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 * configuration), which is expected to be further configured through | 749 * configuration), which is expected to be further configured through |
742 * `LteEnbRrc::AddUeMeasReportConfig`; | 750 * `LteEnbRrc::AddUeMeasReportConfig`; |
743 * - Enabling MIB (Master Information Block) broadcast transmission | 751 * - Enabling MIB (Master Information Block) broadcast transmission |
744 * - Enabling SIB (System Information Block) broadcast transmission | 752 * - Enabling SIB (System Information Block) broadcast transmission |
745 * | 753 * |
746 * Typically runs when the eNodeB NetDevice is installed, for instance by | 754 * Typically runs when the eNodeB NetDevice is installed, for instance by |
747 * `LteHelper::InstallEnbDevice` (i.e. before the simulation starts). | 755 * `LteHelper::InstallEnbDevice` (i.e. before the simulation starts). |
748 * | 756 * |
749 * \warning Raises an error when executed more than once. | 757 * \warning Raises an error when executed more than once. |
750 */ | 758 */ |
751 void ConfigureCell (uint8_t ulBandwidth, | 759 void ConfigureCell (std::map<uint8_t, Ptr<ComponentCarrier> > ccm, |
752 uint8_t dlBandwidth, | |
753 uint16_t ulEarfcn,· | |
754 uint16_t dlEarfcn, | |
755 uint16_t cellId); | 760 uint16_t cellId); |
756 | 761 |
757 /**· | 762 /**· |
758 * set the cell id of this eNB | 763 * set the cell id of this eNB |
759 *· | 764 *· |
760 * \param m_cellId· | 765 * \param m_cellId· |
761 */ | 766 */ |
762 void SetCellId (uint16_t m_cellId); | 767 void SetCellId (uint16_t m_cellId); |
763 | 768 |
| 769 void SetCellId (uint16_t m_cellId, uint16_t ccIndex); |
| 770 |
764 /**· | 771 /**· |
765 * Enqueue an IP data packet on the proper bearer for downlink | 772 * Enqueue an IP data packet on the proper bearer for downlink |
766 * transmission. Normally expected to be called by the NetDevice | 773 * transmission. Normally expected to be called by the NetDevice |
767 * forwarding a packet coming from the EpcEnbApplication· | 774 * forwarding a packet coming from the EpcEnbApplication· |
768 *· | 775 *· |
769 * \param p the packet | 776 * \param p the packet |
770 *· | 777 *· |
771 * \return true if successful, false if an error occurred | 778 * \return true if successful, false if an error occurred |
772 */ | 779 */ |
773 bool SendData (Ptr<Packet> p); | 780 bool SendData (Ptr<Packet> p); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 RLC_UM_ALWAYS = 2, | 855 RLC_UM_ALWAYS = 2, |
849 RLC_AM_ALWAYS = 3, | 856 RLC_AM_ALWAYS = 3, |
850 PER_BASED = 4}; | 857 PER_BASED = 4}; |
851 | 858 |
852 /** | 859 /** |
853 * TracedCallback signature for new Ue Context events. | 860 * TracedCallback signature for new Ue Context events. |
854 * | 861 * |
855 * \param [in] cellId | 862 * \param [in] cellId |
856 * \param [in] rnti | 863 * \param [in] rnti |
857 */ | 864 */ |
858 typedef void (* NewUeContextTracedCallback) | 865 typedef void (*NewUeContextTracedCallback) |
859 (const uint16_t cellId, const uint16_t rnti); | 866 (const uint16_t cellId, const uint16_t rnti); |
860 | 867 |
861 /** | 868 /** |
862 * TracedCallback signature for connection and handover end events. | 869 * TracedCallback signature for connection and handover end events. |
863 * | 870 * |
864 * \param [in] imsi | 871 * \param [in] imsi |
865 * \param [in] cellId | 872 * \param [in] cellId |
866 * \param [in] rnti | 873 * \param [in] rnti |
867 */ | 874 */ |
868 typedef void (* ConnectionHandoverTracedCallback) | 875 typedef void (*ConnectionHandoverTracedCallback) |
869 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti); | 876 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti); |
870 | 877 |
871 /** | 878 /** |
872 * TracedCallback signature for handover start events. | 879 * TracedCallback signature for handover start events. |
873 * | 880 * |
874 * \param [in] imsi | 881 * \param [in] imsi |
875 * \param [in] cellId | 882 * \param [in] cellId |
876 * \param [in] rnti | 883 * \param [in] rnti |
877 * \param [in] targetCid | 884 * \param [in] targetCid |
878 */ | 885 */ |
879 typedef void (* HandoverStartTracedCallback) | 886 typedef void (*HandoverStartTracedCallback) |
880 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, | 887 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, |
881 const uint16_t targetCid); | 888 const uint16_t targetCid); |
882 | 889 |
883 /** | 890 /** |
884 * TracedCallback signature for receive measurement report events. | 891 * TracedCallback signature for receive measurement report events. |
885 * | 892 * |
886 * \param [in] imsi | 893 * \param [in] imsi |
887 * \param [in] cellId | 894 * \param [in] cellId |
888 * \param [in] rnti | 895 * \param [in] rnti |
889 * \param [in] report | 896 * \param [in] report |
890 */ | 897 */ |
891 typedef void (* ReceiveReportTracedCallback) | 898 typedef void (*ReceiveReportTracedCallback) |
892 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, | 899 (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti, |
893 const LteRrcSap::MeasurementReport report); | 900 const LteRrcSap::MeasurementReport report); |
894 | 901 |
895 private: | 902 private: |
896 | 903 |
897 | 904 |
898 // RRC SAP methods | 905 // RRC SAP methods |
899 | 906 |
900 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::CompleteSetupUe
interface to UeManager::CompleteSetupUe | 907 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::CompleteSetupUe
interface to UeManager::CompleteSetupUe |
901 void DoCompleteSetupUe (uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUePa
rameters params); | 908 void DoCompleteSetupUe (uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUePa
rameters params); |
902 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnecti
onRequest interface to UeManager::RecvRrcConnectionRequest | 909 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnecti
onRequest interface to UeManager::RecvRrcConnectionRequest |
903 void DoRecvRrcConnectionRequest (uint16_t rnti, LteRrcSap::RrcConnectionReques
t msg); | 910 void DoRecvRrcConnectionRequest (uint16_t rnti, LteRrcSap::RrcConnectionReques
t msg); |
904 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnecti
onSetupCompleted interface to UeManager::RecvRrcConnectionSetupCompleted | 911 /// Part of the RRC protocol. Forwarding LteEnbRrcSapProvider::RecvRrcConnecti
onSetupCompleted interface to UeManager::RecvRrcConnectionSetupCompleted |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 LteEnbRrcSapProvider* m_rrcSapProvider; | 1116 LteEnbRrcSapProvider* m_rrcSapProvider; |
1110 | 1117 |
1111 /// Interface to the eNodeB MAC instance, to be used by RLC instances. | 1118 /// Interface to the eNodeB MAC instance, to be used by RLC instances. |
1112 LteMacSapProvider* m_macSapProvider; | 1119 LteMacSapProvider* m_macSapProvider; |
1113 | 1120 |
1114 /// Interface to send messages to core network over the S1 protocol. | 1121 /// Interface to send messages to core network over the S1 protocol. |
1115 EpcEnbS1SapProvider* m_s1SapProvider; | 1122 EpcEnbS1SapProvider* m_s1SapProvider; |
1116 /// Interface to receive messages from core network over the S1 protocol. | 1123 /// Interface to receive messages from core network over the S1 protocol. |
1117 EpcEnbS1SapUser* m_s1SapUser; | 1124 EpcEnbS1SapUser* m_s1SapUser; |
1118 | 1125 |
1119 /// Receive API calls from the eNodeB PHY instance. | 1126 /// Receive API calls from the eNodeB PHY instances. |
1120 LteEnbCphySapUser* m_cphySapUser; | 1127 std::vector<LteEnbCphySapUser*> m_cphySapUser; |
1121 /// Interface to the eNodeB PHY instance. | 1128 /// Interface to the eNodeB PHY instances. |
1122 LteEnbCphySapProvider* m_cphySapProvider; | 1129 std::vector<LteEnbCphySapProvider*> m_cphySapProvider; |
1123 | 1130 |
1124 /// True if ConfigureCell() has been completed. | 1131 /// True if ConfigureCell() has been completed. |
1125 bool m_configured; | 1132 bool m_configured; |
1126 /// Cell identifier. Must be unique across the simulation. | 1133 /// Cell identifier. Must be unique across the simulation. |
1127 uint16_t m_cellId; | 1134 uint16_t m_cellId; |
1128 /// Downlink E-UTRA Absolute Radio Frequency Channel Number. | 1135 /// Downlink E-UTRA Absolute Radio Frequency Channel Number. |
1129 uint16_t m_dlEarfcn; | 1136 uint16_t m_dlEarfcn; |
1130 /// Uplink E-UTRA Absolute Radio Frequency Channel Number. | 1137 /// Uplink E-UTRA Absolute Radio Frequency Channel Number. |
1131 uint16_t m_ulEarfcn; | 1138 uint16_t m_ulEarfcn; |
1132 /// Downlink transmission bandwidth configuration in number of Resource Blocks
. | 1139 /// Downlink transmission bandwidth configuration in number of Resource Blocks
. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 * received. Exporting IMSI, cell ID, and RNTI. | 1289 * received. Exporting IMSI, cell ID, and RNTI. |
1283 */ | 1290 */ |
1284 TracedCallback<uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport> m_r
ecvMeasurementReportTrace; | 1291 TracedCallback<uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport> m_r
ecvMeasurementReportTrace; |
1285 | 1292 |
1286 }; // end of `class LteEnbRrc` | 1293 }; // end of `class LteEnbRrc` |
1287 | 1294 |
1288 | 1295 |
1289 } // namespace ns3 | 1296 } // namespace ns3 |
1290 | 1297 |
1291 #endif // LTE_ENB_RRC_H | 1298 #endif // LTE_ENB_RRC_H |
OLD | NEW |