配置EFM功能示例
组网需求
随着网络的快速发展,IP网络越来越多的承载语音、视频等多种业务,这些业务对网络的高可靠性提出了更高的要求,从而网络要求更快的故障感知能力和故障处理速度。
在启用新的网络前对该网络进行链路连通性和链路的质量进行检测。
在链路正常启用后,动态监测链路的质量。
当主用链路故障时,能够切换到备用链路上进行业务转发。
配置思路
在CE1和CE4设备配置EFM基本功能,实现链路连通性的自动检测。
在CE1设备上配置EFM远端环回,以实现正式启用链路前对CE1到CE4链路进行连通性和性能测试。
在CE1设备上配置EFM链路监控功能,监测CE1到CE4之间链路的性能和质量。
在CE4上配置EFM与接口联动功能,使得当EFM检测到CE1到CE4链路故障时,将CE4另一侧的接口置为逻辑Down。
操作步骤
- 配置EFM基本功能
# 全局使能CE1的EFM功能。
<HUAWEI> system-view [HUAWEI] sysname CE1 [CE1] efm enable
# 使能CE1上接口GE0/0/2的EFM功能。
[CE1] interface gigabitethernet 0/0/2 [CE1-GigabitEthernet0/0/2] efm enable [CE1-GigabitEthernet0/0/2] quit
# 全局使能CE4的EFM功能。
<HUAWEI> system-view [HUAWEI] sysname CE4 [CE4] efm enable
# 配置CE4的GE0/0/1接口的EFM工作模式为被动模式。
[CE4] interface gigabitethernet 0/0/1 [CE4-GigabitEthernet0/0/1] efm mode passive
# 使能CE4上接口GE0/0/1的EFM功能。
[CE4-GigabitEthernet0/0/1] efm enable [CE4-GigabitEthernet0/0/1] quit
# 检查配置结果
如果CE1和CE4的EFM配置正确,接口GE0/0/2和接口GE0/0/1成功协商后进入握手阶段,此时在CE1或者CE4上执行display efm session { all | interface interface-type interface-num }命令,可看到接口GE0/0/2或者接口GE0/0/1的EFM协议状态为detect。
[CE1] display efm session all Interface EFM State Loopback Timeout ---------------------------------------------------------------------- GigabitEthernet0/0/2 detect --
- 配置EFM远端环回功能
# 在CE1上配置EFM远端环回。
[CE1] interface gigabitethernet 0/0/2 [CE1-GigabitEthernet0/0/2] efm loopback start [CE1-GigabitEthernet0/0/2] quit
# 检查配置结果
配置EFM远端环回成功后,在CE1上执行display efm session { all | interface interface-type interface-num }命令,可以看到接口GE0/0/2的EFM协议状态为loopback (control),即远端环回状态(且为远端环回的发起方)。
[CE1] display efm session interface gigabitethernet 0/0/2 Interface EFM State Loopback Timeout ---------------------------------------------------------------------- GigabitEthernet0/0/2 loopback (control) 20
配置EFM远端环回成功后,在CE4上执行display efm session { all | interface interface-type interface-num }命令,可以看到接口GE0/0/1的EFM协议状态为loopback (be controlled),即远端环回状态(且为远端环回的响应方)。
[CE4] display efm session interface gigabitethernet 0/0/1 Interface EFM State Loopback Timeout ---------------------------------------------------------------------- GigabitEthernet0/0/1 loopback (be controlled) --
- 从CE1向CE4发送测试报文
[CE1] test-packet start interface gigabitethernet 0/0/2 Please wait.............. Info: The test is completed.
- 在CE1上查看测试报文的返回情况。
[CE1] display test-packet result TestResult Value -------------------------------------------------------- PacketsSend : 5 PacketsReceive : 5 PacketsLost : 0 BytesSend : 320 BytesReceive : 320 BytesLost : 0 StartTime : 03-05-2012 14:28:16 UTC+03:00 EndTime : 03-05-2012 14:29:22 UTC+03:00
根据以上数据可计算链路的丢包率等,以查看链路质量。
- 取消EFM远端环回。
[CE1] interface gigabitethernet 0/0/2 [CE1-GigabitEthernet0/0/2] efm loopback stop [CE1-GigabitEthernet0/0/2] quit
缺省情况下,远端环回的超时时间是20分钟,到达此时间,远端环回自动停止。如果需要提前取消远端环回,可执行以上步骤。
- 检查配置结果。
远端环回功能取消后,在CE1或者CE4上执行display efm session { all | interface interface-type interface-num }命令,可以看到链路两端接口的EFM协议状态为detect,即握手状态。例如:
[CE1] display efm session all Interface EFM State Loopback Timeout ---------------------------------------------------------------------- GigabitEthernet0/0/2 detect --
远端环回功能检测到链路为正常情况下,可以进行下面的配置,以实时监控链路的连通性及其故障。
- 在CE1上配置接口GE0/0/2的误帧、误码、误帧秒检测功能
# 在CE1上配置接口GE0/0/2的误帧检测功能
[CE1] interface gigabitethernet 0/0/2 [CE1-GigabitEthernet0/0/2] efm error-frame period 5 [CE1-GigabitEthernet0/0/2] efm error-frame threshold 5 [CE1-GigabitEthernet0/0/2] efm error-frame notification enable
# 在CE1上配置接口GE0/0/2的误码检测功能
[CE1-GigabitEthernet0/0/2] efm error-code period 5 [CE1-GigabitEthernet0/0/2] efm error-code threshold 5 [CE1-GigabitEthernet0/0/2] efm error-code notification enable
# 在CE1上配置接口GE0/0/2的误帧秒检测功能
[CE1-GigabitEthernet0/0/2] efm error-frame-second period 120 [CE1-GigabitEthernet0/0/2] efm error-frame-second threshold 5 [CE1-GigabitEthernet0/0/2] efm error-frame-second notification enable [CE1-GigabitEthernet0/0/2] quit
- 检查配置结果
上述配置完成后,CE1的接口GE0/0/2和CE4的接口GE0/0/1成功协商后进入握手阶段,此时在CE1或者CE4上执行display efm session { all | interface interface-type interface-num }命令,可看到接口GE0/0/2或者接口GE0/0/1的EFM协议状态为detect。
[CE1] display efm session interface gigabitethernet 0/0/2 Interface EFM State Loopback Timeout ---------------------------------------------------------------------- GigabitEthernet0/0/2 detect --
上述配置完成后,执行命令display efm { all | interface interface-type interface-number },接口的EFM配置信息如下:
[CE1] display efm interface gigabitethernet 0/0/2 Item Value ---------------------------------------------------- Interface: GigabitEthernet0/0/2 EFM Enable Flag: enable Mode: active Loopback IgnoreRequest: no OAMPDU MaxSize: 128 OAMPDU Timeout: 5000 OAMPDU Interval: 1000 Parser: forward Multiplexer: forward ErrCodeNotification: enable ErrCodePeriod: 5 ErrCodeThreshold: 5 ErrFrameNotification: enable ErrFramePeriod: 5 ErrFrameThreshold: 5 ErrFrameSecondNotification: enable ErrFrameSecondPeriod: 120 ErrFrameSecondThreshold: 5 Hold Up Time: 0 ThresholdEvtTriggerErrDown: disable TriggerIfDown: disable TriggerMacRenew: disable Remote MAC: 0010-0010-0010 Remote EFM Enable Flag: enable Remote Mode: passive Remote MaxSize: 128 Remote Loopback IgnoreRequest: no Remote State: -- Remote Parser: forward Remote Multiplexer: forward ErrFramePeriodNotification: disable ErrFramePeriodPeriod: 200000 ErrFramePeriodThreshold: 1 Loopback Remain Time: --
- 在CE4上配置EFM与接口GE0/0/2联动
[CE4] oam-mgr [CE4-oam-mgr] oam-bind efm interface gigabitethernet 0/0/1 trigger if-down interface gigabitethernet 0/0/2 [CE4-oam-mgr] quit
- 检查配置结果
配置完成后,在CE1接口GE0/0/2下执行shutdown命令,在CE4设备上可以查看到接口GE0/0/2下“current state”的值为“TRIGGER DOWN (3AH)”。
[CE1] interface gigabitethernet 0/0/2 [CE1-GigabitEthernet0/0/2] shutdown [CE1-GigabitEthernet0/0/2] quit
[CE4] display interface gigabitethernet 0/0/2 GigabitEthernet0/0/2 current state : TRIGGER DOWN (3AH) Line protocol current state : DOWN ...
此处只列了display interface gigabitethernet 0/0/2命令需要关注的显式信息,“...”表示省略。
配置文件
CE1的配置文件
# sysname CE1 # efm enable # interface GigabitEthernet0/0/2 efm enable efm error-frame period 5 efm error-frame threshold 5 efm error-frame notification enable efm error-frame-second period 120 efm error-frame-second threshold 5 efm error-frame-second notification enable efm error-code period 5 efm error-code threshold 5 efm error-code notification enable # return
CE4的配置文件
# sysname CE4 # efm enable # interface GigabitEthernet0/0/1 efm mode passive efm enable # oam-mgr oam-bind ingress efm interface GigabitEthernet0/0/1 trigger if-down egress interface GigabitEthernet0/0/2 oam-bind ingress interface GigabitEthernet0/0/2 egress efm interface GigabitEthernet0/0/1 trigger if-down # return