龙空技术网

环路检测技术

onme0 935

前言:

现在小伙伴们对“gigabitethernet0”大体比较关怀,同学们都需要剖析一些“gigabitethernet0”的相关知识。那么小编在网上收集了一些有关“gigabitethernet0””的相关文章,希望朋友们能喜欢,看官们快快来学习一下吧!

概述

网络中的环路会导致设备对广播、组播以及未知单播等报文进行重复发送,造成网络资源浪费甚至网络瘫痪。为了能够及时发现二层网络中的环路,避免对整个网络造成严重影响,需要提供一种检测技术,使网络中出现环路时能及时通知用户检查网络连接和配置情况,并能够将出问题的接口置于某种受控状态,这种检测技术就是环路检测技术。

技术实现原理

环路检测(Loop Detection)工作于以太网的链路层协议,用来检测物理接口所在的VLAN是否存在环路。设备周期性地发送环路检测报文并检测其是否返回本设备(不要求收、发端口为同一端口)以确认是否存在环路,若某端口收到了由设备发出的环路检测报文,则认定该端口所在链路存在环路。同时,设备将向用户告警以及记录日志,并根据该端口所处的工作模式设置端口的状态(默认设置端口为Shutdown),从而使端口置于受控状态,尽量减小接入环路对整网的影响。

序号

常用环路检测处理模式

定义

1

Block

当系统检测到端口出现环路时,除了生成日志信息外,还会禁止端口学习MAC地址并将端口的入方向阻塞。

2

No-learning

当系统检测到端口出现环路时,除了生成日志信息外,还会禁止端口学习MAC地址。

3

Shutdown

当系统检测到端口出现环路时,除了生成日志信息外,还会自动关闭该端口,使其不能收发任何报文。

注意事项:

1、针对Block和No-learning处理的恢复模式,华三和华为网络设备定义:当设备检测到某端口出现环路后,若在三倍的环路检测时间间隔内仍未收到环路检测报文,则该端口上的环路已消除,自动将该端口恢复为正常转发状态,并通知给用户 默认情况,华三网络设备的环路检测时间间隔是30秒,华为网络设备的环路检测时间间隔是5秒

2、针对Shutdown处理的恢复模式,华三网络设备的定义是:出现环路的端口先被自动关闭,然后在shutdown-interval命令所配置的时间之后自动恢复。如果此时环路尚未消除,该端口将被再次关闭,然后恢复,如此往复直至环路消除。华为网络设备的定义是:出现环路的端口被自动关闭,无法自动恢复,需进入接口模式执行命令shutdown和undo shutdown手动恢复或重启设备。默认情况下,华三和华为网络设备都采用shutdown的处理模式。

适用场景设备物理接口环路,即单端口环路,如设备下联家用路由器或HUB,路由器或HUB接口环路。设备物理接口之间环路,即端口间环路检测。华三网络设备环路检测配置及分析华三网络设备软件版本

version 7.1.070, Release 1119P20

华三网络设备环路检测配置命令

####以shutdown处理模式配置

[H3C]interface GigabitEthernet 1/0/1

[H3C-GigabitEthernet1/0/1] loopback-detection action shutdown

[H3C-GigabitEthernet1/0/1] loopback-detection enable vlan 184

[H3C-GigabitEthernet1/0/1] loopback-detection action shutdown

[H3C-GigabitEthernet1/0/1]

####配置设备shutdown-interval的值

[H3C]shutdown-interval ?

INTEGER<0-300> Detection interval, in seconds

华三网络设备环路检测查询命令

####仅列举存在环路的物理接口

[H3C]dis loopback-detection

Loop detection is enabled.

Loop detection interval is 30 second(s).

No loop is detected.

华三网络设备环路检测日志分析华三网络设备物理端口之间的环路场景

####用一根网线先连接华三交换机的G1/0/9口,再连接G1/0/11口

<H3C>Jan 3 04:43:16:346 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/9 changed to up.

Jan 3 04:43:16:377 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/9 changed to up.

Jan 3 04:43:16:406 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/11 changed to up.

Jan 3 04:43:16:415 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/11 changed to up.

####G1/0/9和G1/0/11接口物理和协议状态转变成UP状态

Jan 3 04:43:17:781 2013 H3C LPDT/4/LPDT_LOOPED: Loopback exists on GigabitEthernet1/0/11.

Jan 3 04:43:17:803 2013 H3C LPDT/4/LPDT_VLAN_LOOPED: Loopback exists on GigabitEthernet1/0/11 in VLAN 190.

####G1/0/11接口收到环路检测报文,设备判定G1/0/11接口存在环路。环路检测日志关键词:LPDT

Jan 3 04:43:17:850 2013 H3C LPDT/5/LPDT_VLAN_RECOVERED: Loopback on GigabitEthernet1/0/11 in VLAN 190 recovered.

Jan 3 04:43:17:851 2013 H3C LPDT/5/LPDT_RECOVERED: Loopback on GigabitEthernet1/0/11 recovered.

####G1/0/11接口尝试恢复接口UP状态

Jan 3 04:43:17:857 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/11 changed to down.

Jan 3 04:43:17:859 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/11 changed to down.

Jan 3 04:43:17:892 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/9 changed to down.

Jan 3 04:43:17:893 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/9 changed to down.

####鉴于交换机环路链路一直存在,最终G1/0/11和G1/0/9先后转变成DOWN状态

华三网络设备单端口环路场景

####交换机G1/0/9连接一台普通家用路由器LAN接口,路由器的另外两LAN接口使用一根网线连接,非WAN口

<H3C>Jan 3 04:44:35:483 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/9 changed to up.

Jan 3 04:44:35:488 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/9 changed to up.

####G1/0/9接口物理和协议状态转变成UP状态

<H3C>Jan 3 04:45:06:884 2013 H3C LPDT/4/LPDT_LOOPED: Loopback exists on GigabitEthernet1/0/9.

Jan 3 04:45:06:937 2013 H3C LPDT/4/LPDT_VLAN_LOOPED: Loopback exists on GigabitEthernet1/0/9 in VLAN 190.

####G1/0/9接口收到环路检测报文,设备判定G1/0/9接口存在环路。环路检测日志关键词:LPDT

Jan 3 04:45:06:966 2013 H3C LPDT/5/LPDT_VLAN_RECOVERED: Loopback on GigabitEthernet1/0/9 in VLAN 190 recovered.

Jan 3 04:45:06:967 2013 H3C LPDT/5/LPDT_RECOVERED: Loopback on GigabitEthernet1/0/9 recovered.

####G1/0/9接口尝试恢复接口UP状态

Jan 3 04:45:07:012 2013 H3C IFNET/3/PHY_UPDOWN: Physical state on the interface GigabitEthernet1/0/9 changed to down.

Jan 3 04:45:07:015 2013 H3C IFNET/5/LINK_UPDOWN: Line protocol state on the interface GigabitEthernet1/0/9 changed to down.

####鉴于家用路由器的环路链路一直存在,最终G1/0/11和G1/0/9先后转变成DOWN状态

华三网络设备环路检测报文分析华为网络设备环路检测配置及分析华为网络设备软件版本

V200R019C10SPC500

华为网络设备环路检测配置命令

[HUAWEI]interface GigabitEthernet 0/0/1

[HUAWEI-GigabitEthernet0/0/1] loopback-detect packet vlan 1

[HUAWEI-GigabitEthernet0/0/1] loopback-detect enable

[HUAWEI-GigabitEthernet0/0/1]loopback-detect action shutdown

华为网络设备环路检测查询命令

####列举所有物理接口的环路检测状态

[HUAWEI]dis loopback-detect

Loopback-detect sending-packet interval: 5

(A): Auto Loopback-detect

-----------------------------------------------------------------

Interface RecoverTime Action Status

-----------------------------------------------------------------

GigabitEthernet0/0/1 15 shutdown NORMAL

……

GigabitEthernet0/0/28 15 shutdown NORMAL

华为网络设备环路检测日志分析华为网络设备物理端口之间的环路场景

####用一根网线先连接华为交换机的G0/0/9口,再连接G0/0/11口

<HUAWEI>

Sep 9 2021 10:45:27 HUAWEI 01IFPDT/4/IF_STATE(l)[31]:Interface GigabitEthernet0/0/9 has turned into UP state.

Sep 9 2021 10:45:27 HUAWEI 01IFPDT/4/IF_STATE(l)[32]:Interface GigabitEthernet0/0/11 has turned into UP state.

####G0/0/9和G0/0/11接口转变成UP状态

<HUAWEI>

Sep 9 2021 10:45:29 HUAWEI LBDT/4/PORTTRAP:OID 1.3.6.1.4.1.2011.5.25.174.3.3 Loopback exists on interface(17)GigabitEthernet0/0/11 (VLAN 1), loopback detection status: 3, auto loop detection for trap only on VLAN none. (Status 1:normal; 2:block; 3:shutdown; 4:trap; 5:nolearn; 6:quitvlan)

####G0/0/11接口收到环路检测报文,设备判定G0/0/11接口存在环路。环路检测日志关键词:LBDT

Sep 9 2021 10:45:30 HUAWEI 01IFPDT/4/IF_STATE(l)[33]:Interface GigabitEthernet0/0/11 has turned into DOWN state.

Sep 9 2021 10:45:30 HUAWEI 01IFPDT/4/IF_STATE(l)[34]:Interface GigabitEthernet0/0/9 has turned into DOWN state.

<HUAWEI>

####鉴于交换机环路链路的存在,G0/0/11和G0/0/9转变成DOWN状态

华为网络设备单端口环路场景

####交换机G0/0/9连接一台普通家用路由器LAN接口,路由器的另外两LAN接口使用一根网线连接,非WAN口

<HUAWEI>

Sep 9 2021 10:49:31 HUAWEI 01IFPDT/4/IF_STATE(l)[40]:Interface GigabitEthernet0/0/9 has turned into UP state.

####G0/0/9接口转变成UP状态

Sep 9 2021 10:50:20 HUAWEI LBDT/4/PORTTRAP:OID 1.3.6.1.4.1.2011.5.25.174.3.3 Loopback exists on interface(15)GigabitEthernet0/0/9 (Untagged), loopback detection status: 3, auto loop detection for trap only on VLAN none. (Status 1:normal; 2:block; 3:shutdown; 4:trap; 5:nolearn; 6:quitvlan)

####G0/0/9接口收到环路检测报文,设备判定G0/0/9接口存在环路。环路检测日志关键词:LBDT

Sep 9 2021 10:50:20 HUAWEI 01IFPDT/4/IF_STATE(l)[41]:Interface GigabitEthernet0/0/9 has turned into DOWN state.

Sep 9 2021 10:50:20 HUAWEI 01IFADP/4/PORTDOWNINFO(l)[42]:Interface GigabitEthernet0/0/9 has turned into DOWN state.

<HUAWEI>

####鉴于家用路由器的环路链路的存在,G0/0/9转变成DOWN状态

华为网络设备环路检测报文分析总结

本文介绍环路检测技术原理、适用场景以及华三和华为网络设备环路检测配置分析,希望各位小伙伴有所收获,不足之处,欢迎各位小伙伴留言指正。

标签: #gigabitethernet0