ONU Physical Distance
The host application can calculate the physical distance of an ONU. To do this , it must retrieve the following the information.
- The Maximum PON logical distance (MLD) in km units configured as part of the PON Distance attribute in the PON NI object. This parameter is read via the bcmolt_cfg_get(pon_ni) API.
- The Ranging Time (EqDi) in bit units of the ONUi. The parameter can be read using the bcmolt_cfg_get(pon_onu) API.
- The Ranging Time (EqD0) in bit units of an ONU in 0 km distance. This parameter is used to calibrate for various delays, including the minimum ONU response time which is typically 35 μs.
The constants used for the calculation are:
- Round-trip time of 102 meters is 1 μs
- 1 bit transmission delay (TD) is :
— 0.8038585 ns for GPON
— 0.4019292 ns for XGPON
The Logical Distance (LD) in meters is : LD = MLD – (EqD × TD) × 102
The Physical Distance (PD) is calculated by subtracting the LD of the ONU at distance 0 from the LD of the ONU in question: PD = LDi – LD0
Example: Calculate the GPON ONUi PD:
MLD = 25 km
EqDi = 23,540
EqD0 = 267,490
LDi = 25000 – ((23540 × 0.000803) × 102) = 23071
LD0 = 25000 – ((267490 × 0.000803) × 102) = 3,090 (This ONU appears at ~3.6 km distance , due to an internal delay caused by imposing a 35 μs minimum response time.)
PD = 23,071 – 3,090 = 19,981(i.e. ~20km).
以上为BCM68620的芯片资料原文。
首先,理解几个参数,MLD是最大PON逻辑距离(km为单位),此参数可以配置OLT中进行配置。而这个值在将会参与EqDi的计算。逻辑如下:
1.配置MLD的命令如下(MLB默认为20):
PTF3704(config)#ont auto-find distance min 0 max 25 interface gpon 0/1
2. 根据公式LD = MLD – (EqD × TD) × 102,可知LD(逻辑距离)是用来计算实际的物理距离的,此时ONU的实际物理距离(PD = LDi – LD0)不变,那么LDi也不变,此时,MLD变大,由公式可以看出,EqDi的值也会变大。
3. 根据公式LD = MLD – (EqD × TD) × 102。可知:
- 当MLB为20km时,LD = 20 000 - (198371 × 0.000803)×102 = 20 000 – 16 248 = 3752
- 当MLB为25km时,LD = 25 000 - (259330 × 0.000803)×102 = 25 000 – 21 241 = 3759
这两个值实测十分的接近。从原理上来看这两个值应该是相同的。理由是同一台ONU的LD0应该相同。
4. 为什么会有LD0(0km时的逻辑距离)。根据测距的原理,一发一收,当ONU跟OLT的物理距离无限接近的时候, 光到达ONU只会,从法兰盘到bosa之间也有一小段光纤距离再加上ONU处理测距信号后响应测距之间所用的时间。对于光来说,每个ONU的响应时间以及内部的光传输,就相当于光多跑了大概3.5 ~ 4公里左右。而这个值每个ONU都是不固定的 。
而针对这件事情,OLT不可能知道所有的ONU的EqD0,从而算出准确的LD0。所以厂商们通常测试了常见的一些个ONU的EqD0,从而记录下来,当其Vendor ID 与之匹配后,便使用对于的EqD0来进行测距。当没有在预配置好的Vendor ID列表中匹配,便使用一个默认的EqD0值。代码如下:
/*基于vendor id的记录表*/
MLOCAL L_ONT_ZERO_EQD_RECORD_BY_VERDOR_ID 1_ont_zero_eqd_record_by_verdor_id[ ] ={
{“GCOM”, 198137},
{“GPON” , 199333},
{“XPON” , 199306},
{“ZTEG” , 198097},
{“HWTC” , 198824}
}
/*默认的ZERO EQD值*/
#define L_ONT_ZERO_EQD_DEFAULT (198137)