【转】MTK方案GPON ONU注册流程和OMCI分析

进入串口登录:输入以下指令 开启GPON ONU OMCI报文调试指令:
echo msg init 1 > /proc/gpon/debug
echo msg oam 1 > /proc/gpon/debug
echo msg err 1 > /proc/gpon/debug
echo msg omci 1 > /proc/gpon/debug
ONU 激活概述
ONU的激活过程由OLT控制,其激活过程大致如下:
1.ONU 通过 Upstream_Overhead 消息接收工作参数
2.ONU 根据接收到的工作参数调整自己的参数(如:发送光功率)
3.OLT 通过 Serial_Number Acquisition 流程发现新 ONU 的序列号
4.OLT 给所有新 ONU 分配 ONU-ID
5.OLT 测量新 ONU 的均衡时延
6.OLT 将测量的均衡时延传送给 ONU
7.ONU 根据均衡时延调整其上行帧的发送起始点
以上激活过程是通过交互上下行标记(flag)以及PLOAM消息来完成的

tcphy[2]: Link-down!!!str = 0tcphy[2]: Link-up at 100F. tx_amp_save=0.tcphy[10]: boosten=1 agccode=5 zfgain=5 ch_idx=23 snr=3 set olt type: 0
echo used greatest stack depth: 9644 bytes left
sendOmciCmdMsg open message queue fail![4415850ms]PLOAM: State change O5 —> O1
a) 初始状态 Initial-state(O1)
该状态的ONU刚刚上电,仍处于LOS/LOF。一旦接收到下行流,LOS和LOF消除,ONU
就转移到待机状态(O2)
[4415860ms]PLOAM: State change O1 —> O2

b) 待机状态 Standby-state(O2)
该 状 态 的 ONU 已 经 接 收 到 下 行 流 , 在 等 待 接 收 网 络 参 数 。 当 ONU 接 收 到Upstream_Overhead消息后根据这些网络参数进行相关配置(如:定界符、功率模式、预置的均衡时延)并转移到序列号状态(O3)
[4419560ms]PLOAM: Rx Upstream_Overhead.(FF012000 00AAAB59 83200000),state O2
[4419570ms]PLOAM: State change O2 —> O3

c) 序列号状态 Serial-Number-state(O3)
OLT给所有处于该状态的ONU发送Serial-Number Request消息,以发现新的ONU以及
他们的序列号。当OLT发现了新的ONU后,ONU就等待OLT给它指配ONU-ID。OLT通过
Assign_ONU-ID消息来指配ONU-ID。ONU获得ONU-ID后就转移到测距状态(O4)

[4419570ms]Receive the PLOAM message same:FF012000
[4419570ms]Receive the PLOAM message same:FF012000
[4419570ms]PLOAM: Receive Extended_Burst_Length message.(FF14770F 00000000 00000000)
[4419570ms]PLOAM: Setting the O3/O4 type 3 preamble. Overflow: 0, Rec. Value: 119, Set Value: 119
[4419570ms]Receive the PLOAM message same:FF14770F
[4419570ms]Receive the PLOAM message same:FF14770F
[4420350ms]PLOAM: Rx Upstream_Overhead.(FF012000 00AAAB59 83200000),state O3
[4420360ms]Receive the PLOAM message same:FF012000
[4420360ms]Receive the PLOAM message same:FF012000
[4420360ms]PLOAM: Receive Extended_Burst_Length message.(FF14770F 00000000 00000000)
[4420360ms]PLOAM: Setting the O3/O4 type 3 preamble. Overflow: 0, Rec. Value: 119, Set Value: 119
[4420360ms]Receive the PLOAM message same:FF14770F
[4420360ms]Receive the PLOAM message same:FF14770F
[4420360ms]PLOAM: Receive Assign_ONU_ID message.(FF030448 48474E80 031F6800)
[4420360ms]PLOAM: State change O3 —> O4
Serial_Number Acquisition流程:
首先OLT暂停对上行带宽的授权,从而产生一个安静期。等待一段测距延时之后,OLT发送Serial_Number Request。处于Serial_Number 状 态 ( O3 ) 的 ONU 接 收 到 Serial_Number Request 后 等 待 一 段SN-Response-Time时间(见8.7.1 节)再发送响应消息。OLT收到响应消息后发送Assign_ONU-ID消息,ONU进入测距状态(O4)。}

测距过程:
首先OLT产生一个安静时段,之后OLT给所有ONU发送Ranging Request消息。ONU接收到Ranging Request消息后等待Ranging-Response-Time(见8.7.2节)再发送Serial-Number消息。OLT接收到Serial-Number消息后发送Assign Ranging Time
消息,ONU接收到Ranging Time消息后进入运行状态(O5)
[4420360ms]Receive the PLOAM message same:FF030448
[4420360ms]Receive the PLOAM message same:FF030448
[4420370ms]Receive PLOAM message filed.
[4420700ms]PLOAM: Receive Ranging_Time message.(04040000 040E2100 00000000)
[4420700ms]PLOAM: Receive the main path EqD, 40e21.
[4420700ms]PLOAM: Setting the main path EqD in O4, ByteDelay:40e20, BitDelay:1.
d) 测距状态 Ranging-state(O4)
Assign Ranging Time不同的ONU发送信号到达OLT时应保持同步,为此每个ONU需要一个均衡时延,该参数是在测距状态中测得的。ONU接收到Ranging_Time消息后转移到运行状态(O5)。
[4420700ms]PLOAM: State change O4 —> O5
[4420710ms]Receive the PLOAM message same: 4040000
[4420730ms]Receive the PLOAM message same: 4040000
str = 1[4420820ms]PLOAM: Receive Request_Password message.(04090000 00000000 00000000)
[4420820ms]PLOAM: Send password message.(04020000 00000000 00000000)
[4420870ms]PLOAM: Receive Request_Key message.(040D0000 00000000 00000000)
[4420870ms]PLOAM: Send encryption key message.(04050100 AD107C74 45F6AC03)
[4420870ms]PLOAM: Send encryption key message.(04050101 5BE2C75D 40A86664)
[4420940ms]PLOAM: Receive Key_Switching_Time message.(041323AE 558A0000 00000000)
[4420950ms]PLOAM: Send acknowledge PLOAM message.
[4420960ms]PLOAM: Send acknowledge message.(04091304 1323AE55 8A000000)
[4420960ms]Receive the PLOAM message same: 41323AE
[4420970ms]Receive the PLOAM message same: 41323AE
[4423330ms]PLOAM: Receive Configure_PortID message.(040E0100 40000000 00000000)
[4423340ms]PLOAM: Send acknowledge PLOAM message.
[4423350ms]PLOAM: Send acknowledge message.(04090E04 0E010040 00000000)
[4423350ms]Receive the PLOAM message same: 40E0100
[4423350ms]Receive the PLOAM message same: 40E0100
[4423360ms]PLOAM: Receive Encrypted_PortID message.(04080200 40000000 00000000)
[4423360ms]PLOAM: Send acknowledge PLOAM message.
[4423360ms]PLOAM: Send acknowledge message.(04090804 08020040 00000000)
[4423370ms]Receive the PLOAM message same: 4080200
[4423390ms]Receive the PLOAM message same: 4080200
[4423390ms]PLOAM: Receive BER_Interval message.(04120000 00000000 00000000)
[4423400ms]PLOAM: Send acknowledge PLOAM message.
[4423410ms]PLOAM: Send acknowledge message.(04091204 12000000 00000000)
[4423410ms]Receive the PLOAM message same: 4120000
[4423420ms]Receive the PLOAM message same: 4120000
[4423420ms]PLOAM: Receive Assign_AllocID message.(040A0040 01000000 00000000)
[4423430ms]PLOAM: OLT Assign ALLOC_ID 4
[4423430ms]PLOAM: Send acknowledge PLOAM message.
[4423440ms]PLOAM: Send acknowledge message.(04090A04 0A004001 00000000)
[4423450ms]Receive the PLOAM message same: 40A0040
[4423450ms]Receive the PLOAM message same: 40A0040

e) 运行状态 Operation-state(O5)
处于该状态的ONU可以在OLT的控制下发送上行数据以及PLOAM消息,该状态中的
ONU也可根据需求建立其他连接。当测距成功后,所有的ONU都依据各自的均衡时延发送信号,以保持上行帧的同步。不同ONU发送的信号将分别到达OLT,但每个信号会正好出现在上行帧中它应该出现的位置上。
暂停运行中的ONU:在正常运行时,OLT可能使ONU暂停发送信号以获得其它ONU的
序列号或对其它ONU进行测距。OLT持续一段时间停止对所有上行带宽的授权,ONU按照正常的方式工作,由于没有接收到授权就不会发送信号,从而产生一个安静时段,这样OLT就使得所有ONU暂停发送信号。
f) POPUP 状态 POPUP-state(O6)
当处于运行状态(O5)的ONU检测到LOS或LOF时就进入到该状态。在该状态中ONU
立即停止发送信号,这样OLT将检测到该ONU的LOS告警。
当ODN光纤中断时,许多ONU都会进入到该状态,从网络可靠性考虑,此时应采用以
下方式之一:
如果启用了保护倒换,所有的ONU将倒换到备用光纤上。这时所有ONU将重新进行测
距,为此OLT发送Broadcast POPUP消息通知所有ONU进入到测距状态(O4)。
如果没有保护倒换但ONU具有内部保护能力,OLT发送Directed POPUP消息通知ONU
进入运行状态(O5)。当ONU进入到O5状态时,OLT需要先对该ONU进行检测,之后再
恢复该ONU的业务。
如果ONU没有从LOS或LOF中恢复过来,ONU就不会收到Broadcast POPUP消息或
Directed POPUP消息,经过TO2时间后ONU进入初始状态(O1)。
g) 紧急停止状态 Emergency-Stop-state(O7)
当ONU接收到的Disable_Serial_Number消息带有“Disable”选项时,ONU就进入到紧急停止状态(O7)并关闭激光器。在O7状态下,ONU被禁止发送信号。如果ONU没有成功进入到O7状态,并且OLT仍能继续接收到ONU发送的信号,OLT将产生Dfi告警。
当ONU的故障排除后,OLT发送带有“Enable”选项的Disable_Serial_Number消息,从而激活该ONU。ONU接收到消息后进入待机状态(O2),所有的参数(包括序列号和ONU-ID)将被重新检查

接下来进行OMCI init 和 mib sync 信息 分析
OMCI报文分析:
**20 0b:**TCI(teansaction correlation identity 2byte)
49:(0100 1001)拆分4:是AR=1(0100),9:ME_type( get )(1 byte) (AR=1是指OLT下发请求)
0a :device indefier type(1byte)(固定)
01 01:ME_Class=257 ==ONT2-G
00 00:ME_ID

https://blog.csdn.net/weixin_42353331/article/details/86133552

:ME_Contents;40 00:ME_Entity_MASK(即0100 0000:OLT下发请求257 实体的第2个属性值:OMCC Version)
剩余绿色部分是 Attribute of value(除了ME_Entity_ID外第一个算起) ;
[4423830ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 0b 49 0a 01 01 00 00  40 00 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

AR =1: MIB reset
4f :AR=1 ME_type=f(MIB reset)(AR=1是指OLT下发请求)
00 02:ME_Class==ONT data
00 00:ME_ID 在ONT-data里默认都为00

[4423850ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 0c 4f 0a 00 02 00 00  00 00 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

29(0010 1001):AK=1(ONU响应OLT的请求);9是ME_type(get)
01 01:ME_class=257=ONT2-G
00:result or reaon(0:表示执行成功)
40 00:ME_Entity_MASK(即0100 0000:OLT下发请求257 实体的第2个属性值:OMCC Version)
a0 00 00 00 00
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:Equipment ID(20byte)

[4423870ms]TX SKB LEN:44, TX MSG: 00000907, 00100000 
0000: 20 0b 29 0a 01 01 00 00  【00 40 00 a0 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28】 

AK=1: MIB reset response
[4424070ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 0c 2f 0a 00 02 00 00  00 00 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4d:AR=1 ME-type=d=13(MIB upload)
00 02:ME_class==2 ==ONT data

[4424090ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 0d 4d 0a 00 02 00 00  00 00 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

2d:Ak=1 ME-type=d=13(MIB upload response)
00 02:ME_class==2 ==ONT data
01 b1:ME_numbers of subsequent

[4424110ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 0d 2d 0a 00 02 00 00  01 b1 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4e:AR=1 ME-type=d=14(MIB upload nest)
00 02:ME_class==2 ==ONT data

[4424130ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 0e 4e 0a 00 02 00 00  00 00 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

2e:AK=1 ME-type=d=14(MIB upload nest response)
00 02:ME_class==2 ==ONT data
00 02(byte14-15):ME_Entity of object ==ME_Class
00 00:sub_ME_ID=00 00
80 00:Sub_ME_Entity_Mask(1000 0000:响应第一个属性值:MIB data Sync)

[4424150ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 0e 2e 0a 00 02 00 00  00 02 00 00 80 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4e:AR=1 ME-type=d=14(MIB upload nest)
00 02:ME_class==2 ==ONT data
00 01:ME_numbers of subsequent

[4424170ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 0f 4e 0a 00 02 00 00  00 01 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28

2e:AK=1 ME-type=d=14(MIB upload nest response)
00 02:ME_class=2 =ONT data
00 05:Sub_ME_Class = CardHolder
01 80 :Sub_ME_ID=484
f0 00:Sub_ME_Mask==1111 0000 0000 0000:第1,2,3,4个属性值
48 31 38 47 4e 2d 34 31 31:H18GN-411(第4个属性值)
[4424190ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 0f 2e 0a 00 02 00 00  00 05 01 80 f0 00 f8 f8  
0010: 01 48 31 38 47 4e 2d 34  31 31 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4e:AR=1 ME-type=d=14(MIB upload nest)
00 02:ME_class==2 ==ONT data
00 02:ME_numbers of subsequent

[4424210ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 10 4e 0a 00 02 00 00  00 02 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

2e:AK=1 ME-type=d=14(MIB upload nest response)
00 02:ME_class2 ONT data
00 05:Sub_ME_Class = CardHolder
01 80 :Sub_ME_ID484
f0 80:Sub_ME_Mask1111 1000 0000 0000:第1,2,3,4,5个属性值
48 31 38 47 4e 2d 34 31 31:H18GN-411(第4个属性值)

[4424230ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 10 2e 0a 00 02 00 00  00 05 01 80 0f 80 48 31  
0010: 38 47 4e 2d 34 31 31 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4e:AR=1 ME-type=d=14(MIB upload nest)
00 02:ME_class==2 ==ONT data
00 03:ME_numbers of subsequent
[4424250ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 11 4e 0a 00 02 00 00  00 03 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

2e:AK=1 ME-type=d=14(MIB upload nest response)
00 02:ME_class2 ONT data
00 05:Sub_ME_Class = CardHolder
01 02 :Sub_ME_ID258
f0 00:Sub_ME_Mask1111 0000 0000 0000:第1,2,3,4个属性值
48 31 38 47 4e 2d 34 31 31:H18GN-411(第4个属性值)

[4424270ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 11 2e 0a 00 02 00 00  00 05 01 02 f0 00 18 18  
0010: 03 48 31 38 47 4e 2d 34  31 31 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

[4424290ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 12 4e 0a 00 02 00 00  00 04 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4424310ms]TX SKB LEN:44, TX MSG: 00000907, 00100000

0000: 20 12 2e 0a 00 02 00 00  00 05 01 02 0f 80 48 31  
0010: 38 47 4e 2d 34 31 31 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 00 28 

4424330ms]RX PKT LEN: 44, Rx Msg: 00000410, 00178000

0000: 20 13 4e 0a 00 02 00 00  00 05 00 00 00 00 00 00  
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
0020: 00 00 00 00 00 00 00 00  00 00 0

猜你喜欢

转载自blog.csdn.net/f2157120/article/details/107729132