在LTE網絡產生切換時首先需要激活UE端丈量進程,UE端用戶可采取以下方法實現:
1 直接通過eNB的RRC實體實現(也是本文介紹)
2 通過已有切換算法配置丈量
3 開發新的切換算法并對其配置
首先需要研究丈量的內容是甚么,NS3通過LteRrcSap::ReportConfigEutra說明:
struct ThresholdEutra { enum { THRESHOLD_RSRP, ///< RSRP is used for the threshold. THRESHOLD_RSRQ ///< RSRQ is used for the threshold. } choice; uint8_t range; ///< Value range used in RSRP/RSRQ threshold. }; struct ReportConfigEutra { enum { EVENT, PERIODICAL } triggerType; enum { EVENT_A1, ///< Event A1: Serving becomes better than absolute threshold. EVENT_A2, ///< Event A2: Serving becomes worse than absolute threshold. EVENT_A3, ///< Event A3: Neighbour becomes amount of offset better than PCell. EVENT_A4, ///< Event A4: Neighbour becomes better than absolute threshold. EVENT_A5 ///< Event A5: PCell becomes worse than absolute `threshold1` AND Neighbour becomes better than another absolute `threshold2`. } eventId; ///< Choice of E-UTRA event triggered reporting criteria. ThresholdEutra threshold1; ///< Threshold for event A1, A2, A4, and A5. ThresholdEutra threshold2; ///< Threshold for event A5. /// Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving condition is met for a cell in `cellsTriggeredList`, as specified in 5.5.4.1 of 3GPP TS 36.331. bool reportOnLeave; /// Offset value for Event A3. An integer between ⑶0 and 30. The actual value is (value * 0.5) dB. int8_t a3Offset; /// Parameter used within the entry and leave condition of an event triggered reporting condition. The actual value is (value * 0.5) dB. uint8_t hysteresis; /// Time during which specific criteria for the event needs to be met in order to trigger a measurement report. uint16_t timeToTrigger; enum { REPORT_STRONGEST_CELLS, REPORT_CGI } purpose; enum { RSRP, ///< Reference Signal Received Power RSRQ ///< Reference Signal Received Quality } triggerQuantity; ///< The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36.214. enum { SAME_AS_TRIGGER_QUANTITY, BOTH ///< Both the RSRP and RSRQ quantities are to be included in the measurement report. } reportQuantity; ///< The quantities to be included in the measurement report, always assumed to be BOTH. /// Maximum number of cells, excluding the serving cell, to be included in the measurement report. uint8_t maxReportCells; enum { MS120, MS240, MS480, MS640, MS1024, MS2048, MS5120, MS10240, MIN1, MIN6, MIN12, MIN30, MIN60, SPARE3, SPARE2, SPARE1 } reportInterval; ///< Indicates the interval between periodical reports. /// Number of measurement reports applicable, always assumed to be infinite. uint8_t reportAmount; ReportConfigEutra (); }; // end of struct ReportConfigEutra其中結構體ThresholdEutra根據3GPP標準文件定義了基于RSRP和RSRQ下的閾值及對應閾值的范圍。
ReportConfigEutra結構體定義了:
1 觸發丈量報告的類型 2 事件等級 3 不同等級事件下閾值 4是不是初始化丈量報告進程 5 A3事件偏移值 6 進入或離開事件觸發狀態時所用參數
7 觸發時間 8 目的 9 用于評價觸發狀態的觸發量 10 報告量 11 最大報告的小區數目 12 周期報告的報告間隔 13 丈量報告數目
將ReportConfigEutra結構體作為函數LteEnbRrc::AddUeMeasReportConfig的參數,見src/lte/model/lte-enb-rrc.cc便可。
舉例:
LteRrcSap::ReportConfigEutra config; config.eventid=LteRrcSap::ReportConfigEutra::EVENT_A1; config.threshold1.choice=LteRrcSap::ReportConfigEutra::THRESHOLD_RARP; config.threshold1.range=41; config.triggerQuantity=LteRrcSap::ReportConfigEutra::RSRP; config.reportInterval=LteRrcSap::ReportConfigEutra::MS480; //配置對象初始化 std::vector<uint8_t> measIdList; NetDeviceContainer::Iterator it; for(it=devs.Begin();it!=devs.End();it++) {Ptr<NetDevice> dev=*it; Ptr<LteEnbNetDevice>endDev=dev->GetObject<LteEnbNetDevice>(); Ptr<LteEnbRrc>enbRrc=enbDev->GetRrc(); uint8_t measId=enbRrc->AddUeMeasReportConfig(config);//調用 measIdList.push_back(measId);//存儲已有的measId rnbRrc->TraceConnect("RecvMeasurementReport", "context", MakeCallback("&RecvMeasurementReportCallback"));// }