在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"));// }