WO2012034412A1 - 选择性虚拟局域网中的环路检测方法和装置 - Google Patents

选择性虚拟局域网中的环路检测方法和装置 Download PDF

Info

Publication number
WO2012034412A1
WO2012034412A1 PCT/CN2011/074579 CN2011074579W WO2012034412A1 WO 2012034412 A1 WO2012034412 A1 WO 2012034412A1 CN 2011074579 W CN2011074579 W CN 2011074579W WO 2012034412 A1 WO2012034412 A1 WO 2012034412A1
Authority
WO
WIPO (PCT)
Prior art keywords
svlan
vlan tag
tag value
receiving port
loop
Prior art date
Application number
PCT/CN2011/074579
Other languages
English (en)
French (fr)
Inventor
周吉
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012034412A1 publication Critical patent/WO2012034412A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Definitions

  • the present invention relates to communication or, in particular, to a loop detection method and apparatus in an SVLAN (Selective VLAN). Background technique
  • SVLAN Selective VLAN, Selective Virtual Office i or Network
  • QinQ-based VLAN Virtual Local Area Network
  • the packets can be exchanged through the outer label or through the inner and outer double-layer labels as needed.
  • the SVLAN technology has a strong flexibility to effectively isolate VLANs and reuse VLAN resources. It also provides the necessary basis for core networking with MPLS (Multi-Protocol Label Switching) switching.
  • Ordinary QinQ only adds a layer of the same VLAN outer label to all data streams received by the customer (custom) port, and the SVLAN function can selectively select the stream received by the same client (custom) port.
  • the user needs to apply different outer labels to different inner labels of the same custom port, and also realize transparent transmission of the stream.
  • the same inner label of different custom ports can be labeled with the same outer layer.
  • the switch sends a specific format of Ethernet broadcast packets from a port, which can be called "detecting packets," if the message After being sent out, if the 4 ⁇ text is reclaimed from the other port intact within the specified time, or only a TAG header is added, there is a loop under the port. If there is a loop, the MAC address will be caused. Learning errors, and even causing "broadcast storms", can seriously lead to network and switch failures. Enable port loop detection and close looped ports, which can effectively eliminate the impact of port loops. However, for SVLANs In the technical network environment, the traditional loop detection mode is likely to cause loop detection errors. Even if there is no loop, the loop will be considered in the network.
  • the main object of the present invention is to provide an SVLAN (Selective VLAN).
  • the loop detection method and apparatus are to solve at least one of the above problems.
  • a loop detection method in an SVLAN including: extracting a VLAN tag value and a receiving port number in a detection packet received by a receiving port in an SVLAN;
  • the index table corresponding to the foregoing detection packet is found in the index table of the receiving port configuration, where the inner VLAN tag value in the index record is equal to the VLAN tag value, and the port number in the index record is equal to the receiving port number.
  • the loop detection method in the SVLAN further includes: if there is no index record corresponding to the foregoing detection message, if the index record corresponding to the detection of the message is found in the index table configured by the receiving port, There is a loop in the above SVLAN.
  • the loop detection method in the SVLAN further includes: if the outer VLAN tag value is the same as the inner VLAN tag value, There is a loop in the above SVLAN. After the loop is detected in the SVLAN, the loop detection method in the SVLAN further includes: closing the receiving port, or sending an alarm.
  • the loop detection method in the SVLAN further includes: configuring the index table on the receiving port according to the configuration of the SVLAN, before extracting the VLAN tag value and the receiving port number in the detection packet received by the receiving port in the SVLAN, where the foregoing index table is configured according to the configuration of the SVLAN, where Each index record in the index table includes: a mapping relationship between an inner VLAN tag value, an outer VLAN tag value, and a port number.
  • the loop detection method in the SVLAN further includes: updating the index table on the receiving port according to the configuration of the updated SVLAN.
  • the loop detection method in the SVLAN further includes: determining whether the received detection packet is legal; and if the received detection packet is received, before the SVLAN receives the VLAN tag value and the receiving port number in the detection packet received by the receiving port. If the packet is invalid, the detection packet is discarded, and the step of extracting the VLAN tag value and the receiving port number in the detection port received by the receiving port in the SVLAN is not performed, and it is determined that there is no loop in the SVLAN.
  • a loop detection apparatus in an SVLAN including: an extracting unit configured to extract a VLAN tag in a detection received by a receiving port in an SVLAN a value and a receiving port number; the searching unit is configured to search for an index record corresponding to the foregoing detection packet in the index table configured by the receiving port, where an inner VLAN tag value in the index record is equal to the foregoing VLAN tag value.
  • the port number in the index record is equal to the receiving port number; the determining unit is configured to determine an outer VLAN tag value and the inner VLAN tag in the index record when the index record corresponding to the detecting message is present
  • the detection unit is configured to detect that there is no loop in the SVLAN when the outer VLAN tag value is different from the inner VLAN tag value.
  • the detecting unit is further configured to: when the search unit is configured to search for the index record corresponding to the detection message in the index table configured by the receiving port, or the determining unit determines the outer VLAN in the index record.
  • the tag value is the same as the inner VLAN tag value, it is detected that there is a loop in the SVLAN.
  • the loop detection device further includes: a configuration unit configured to: before the extracting unit extracts a VLAN tag value and a receiving port number in the detection packet received by the receiving port in the SVLAN, configure the foregoing on the receiving port according to the configuration of the SVLAN
  • An index table where each index record in the index table includes: a mapping relationship between an inner VLAN tag value, an outer VLAN tag value, and a port number.
  • FIG. 1 is a schematic diagram of a network of an SVLAN according to the related art
  • FIG. 2 is a preferred flowchart of a loop detection method in an SVLAN according to an embodiment of the present invention
  • FIG. 3 is a flowchart according to the present invention.
  • FIG. 4 is another preferred flowchart of a loop detection method in an SVLAN according to an embodiment of the present invention;
  • FIG. 5 is a loop detection in an SVLAN according to an embodiment of the present invention.
  • the loop detection method in the S VLAN is applied to the switch in the S VLAN.
  • the loop detection method in the S VLAN according to the embodiment of the present invention includes the following steps:
  • the SVLAN index table is used to determine whether a loop occurs in the SVLAN.
  • the inner VLAN tag and the outer VLAN tag are further compared, so that the inner VLAN tag is the same. In this case, it can be accurately determined whether a loop occurs in the SVLAN, which solves the problem that the loop detection method in the prior art causes an error in data transmission in the network, thereby ensuring the correctness of the loop detection.
  • the method further includes: if the index record corresponding to the detection packet does not exist, the loop exists in the SVLAN. . With the preferred embodiment, it is possible to further accurately determine that there is a loop in the SVLAN.
  • the method further includes: if the outer VLAN tag value is the same as the inner VLAN tag value, the SVLAN There is a loop in it. With the preferred embodiment, it is possible to further accurately determine that there is a loop in the SVLAN.
  • the method further includes: closing the receiving port, or sending an alarm message.
  • the method before extracting the VLAN tag value and the receiving port number in the detection packet received by the receiving port in the SVLAN, the method further includes: configuring the index table on the receiving port according to the configuration of the SVLAN, where Each index record includes: a mapping relationship between the inner VLAN tag value, the outer VLAN tag value, and the port number.
  • the index table extracts only three required SVLAN information, that is, the inner VLAN tag value, the outer VLAN tag value, and the port number.
  • the inner VLAN tag value is limited to the loop detection configuration. VLAN), which effectively saves a lot of storage space, and is easy to index, and retrieves quickly and easily.
  • FIG. 3 shows the structure of the index table, where the inner VLAN tag value (In_vlan), the outer VLAN tag value (Out vlan), and the port number (Port) are corresponding.
  • the method further includes: updating the index table on the receiving port according to the configuration of the updated SVLAN.
  • dynamic updating of the index table can be implemented to adapt to changes in the network in real time.
  • the method before extracting the VLAN tag value and the receiving port number in the detection packet received by the receiving port in the SVLAN, the method further includes: determining whether the received detection packet is legal; if the received detection packet is invalid, discarding The foregoing detection packet does not perform the step of extracting the VLAN tag value and the receiving port number in the detection packet received by the receiving port in the SVLAN, and determines that there is no loop in the SVLAN.
  • the validity of the detection of the 4 ⁇ text is first determined, and only the loop detection processing is performed on the legal detection packet, thereby saving system resources and optimizing the processing flow.
  • the loop detection method of the present invention is compatible with existing loop detection protocols.
  • the loop detection method according to the embodiment of the present invention will be described in detail below based on the network structure shown in FIG.
  • the configuration 1/1 port belongs to VLAN 100, and the 1/2 port belongs to VLAN 100.
  • Switch A is configured with the following SVLAN:
  • Port 1/2 In vlan 100 Out vlan 200 The VLAN tag with 4 VLANs coming in from the 1/2 port will be added with the VLAN tag of VLAN 200 and then forwarded in VLAN 200.
  • the ports of Switch B and Switch C belong to VLAN 100.
  • Loop detection is configured on port 1/1 of switch A.
  • the loop detection VLAN is 100.
  • the detection with VLAN 100 tag is sent from port 1/1 and from port 1/2.
  • the loop detection packet is directly processed to have a loop in the VLAN 100, so that DOWN 1/1 is dropped, or corresponding alarm information is sent.
  • the SVLAN is matched after the detection of the message, so that the error detection can be prevented and the normal operation of the network can be ensured.
  • FIG. 4 is another preferred flowchart of a loop detection method in an SVLAN according to an embodiment of the present invention, which includes the following steps: Step S402: The loop detection module constructs a detection packet, and creates an SVLAN fast index table. (as shown
  • Step S404 the loop detection module receives the detection message, and proceeds to step S406; Step S406 If the loop detection message is legal, go to step S408; if the loop detection message is illegal, go to step S414; Step S408: The loop detection extension module retrieves the SVLAN fast index table (corresponding to the embodiment 1) If the matching is successful, that is, the index record corresponding to the detection packet exists in the SVLAN fast index table, where the inner VLAN tag value in the index record is equal to the detection.
  • the value of the VLAN tag in the packet, the port number in the index record is equal to the receiving port number in the detection packet, and the inner and outer labels are different. That is, the inner VLAN tag value in the SVLAN fast index table is different from the outer VLAN. If the matching fails or the matching is successful but the inner and outer labels are the same, then go to step 4 to gather S416; step S412: there is no network loop in the VLAN at this time, therefore Waiting for the next loop detection process; Step S414: The illegal loop detection message will be immediately discarded, and then go to step 4 to gather S412; Step S416: At this time, there is a network loop in the VLAN, and the DOW is needed. Detect the port or send corresponding alarm information.
  • FIG. 5 is a schematic structural diagram of a loop detecting apparatus in an SVLAN according to an embodiment of the present invention, which includes: an extracting unit 502, configured to extract a detection packet received by a receiving port in an SVLAN.
  • the searching unit 504 is configured to be connected to the extracting unit 502, and configured to: in the index table configured by the receiving port, search for an index record corresponding to the detection packet, where the index record The inner VLAN tag value is equal to the VLAN tag value, and the port number in the index record is equal to the receiving port number.
  • the determining unit 506 is connected to the searching unit 504, and is configured to exist in the presence of the detection packet.
  • the detecting unit 508 is connected to the determining unit 506, and is set to the outer VLAN tag value and the When the inner VLAN tag value is different, it is detected that there is no loop in the SVLAN.
  • the SVLAN index table is used to determine whether a loop occurs in the SVLAN. When the inner VLAN tag is the same, the inner VLAN tag and the outer VLAN tag are further compared, so that the inner VLAN tag is the same.
  • the search unit 504 finds that there is no index record corresponding to the detection 4 in the index table configured by the receiving port, or the determining unit 506 determines the index record.
  • the detecting unit 508 detects that there is a loop in the SVLAN. With the preferred embodiment, it is possible to further accurately determine that there is a loop in the SVLAN.
  • the detecting device turns off the receiving port, or sends an alarm message.
  • the foregoing apparatus further includes: a configuration unit 510, connected to the searching unit 504, configured to extract, in the extracting unit 502, a VLAN tag in the detection message received by the receiving port in the SVLAN Before the value is received and the port number is received, the index table is configured on the receiving port according to the configuration of the SVLAN, where each index record in the index table includes: an inner VLAN tag value, an outer VLAN tag value, and The mapping between port numbers.
  • the configuration unit 510 updates the index table on the receiving port by updating the configuration of the SVLAN.
  • dynamic updating of the index table can be implemented to adapt to changes in the network in real time.
  • the loop detecting device before the extraction of the VLAN tag value and the receiving port number in the detection packet received by the receiving port in the SVLAN, the loop detecting device further determines whether the received detection packet is legal; if the received detection message is invalid Then, the foregoing detection packet is discarded, and the step of extracting the VLAN tag value and the receiving port number in the detection port received by the receiving port in the SVLAN is not performed, and it is determined that there is no loop in the SVLAN.
  • the validity of the detection packet before the loop detection is performed, the validity of the detection packet is first determined, and only the loop detection processing is performed on the legal detection packet, thereby saving system resources and optimizing the processing flow. The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种SVLAN中的环路检测方法和装置,其中,该SVLAN中的环路检测方法包括:提取SVLAN中接收端口所接收的检测报文中的VLAN标签值和接收端口号;在上述接收端口配置的索引表中查找是否存在与上述检测报文对应的索引记录,其中,上述索引记录中的内层VLAN标签值等于上述VLAN标签值、上述索引记录中的端口号等于上述接收端口号;若存在上述与上述检测报文对应的索引记录,则判断上述索引记录中的外层VLAN标签值与上述内层VLAN标签值是否相同;若上述外层VLAN标签值与上述内层VLAN标签值不同,则上述SVLAN中不存在环路。本发明解决了环路检测方法导致网络中的数据传输出现错误的问题。

Description

选择性虚拟局域网中的环路检测方法和装置 技术领域 本发明涉及通信领 i或, 具体而言, 涉及一种 SVLAN ( Selective VLAN, 选 择性虚拟局域网) 中的环路检测方法和装置。 背景技术
SVLAN ( Selective VLAN, 选择性虚拟局 i或网) 技术是一种基于 QinQ的 VLAN ( Virtual Local Area Network, 虚拟局域网) 的扩展技术。 它通过在以太 网帧中堆叠两个 802.1Q包头, 有效地扩展了 VLAN数目, 使 VLAN的数目最 多可达 4096*4096个。 同时, 多个内层 VLAN能够被复用到一个核心 VLAN 中。 报文既可以通过外层标签进行交换, 也可以根据需要通过内外双层标签进 行交换。 该 SVLAN技术具有很强的灵活性, 有效地对 VLAN进行了隔离和 VLAN资源的重用, 同时为具有 MPLS ( Multi-Protocol Label Switching, 多协 议标签交换 ) 交换的核心组网提供了必要的依据。 普通的 QinQ只是对客户 (custom ) 端口收到的所有的数据流都增加一层 相同的 VLAN外层标签, 而 SVLAN功能可以对同一个客户 ( custom )端口收 到的流选择性地才艮据用户需求对同一个 custom 端口的不同的内层标签打上不 同的外层标签, 同时也可以实现流的透传。 而不同的 custom端口的相同的内层 标签可以打上相同的外层标签。 随着网络技术的不断更新换代,用户需求的不断增加,尤其是现在 SVLAN 技术的应用越来越广泛, 需要对网络中的环路进行检测。 现有技术中, 一般釆 用的是传统双端口环路检测方法, 其原理为: 交换机从一个端口发送一个特定 格式的以太网广播报文, 可以称作"检测报文,,。 倘若报文发出后, 在规定时间 内如果这个 4艮文原封不动的从另一个个端口收回来了, 或者仅仅是增加了一个 TAG头,说明这个端口下面存在环路。存在环路就会导致 MAC地址学习错误, 甚至造成"广播风暴", 严重的会导致网络及交换机瘫痪。 启用端口环路检测, 关闭有环路的端口, 可以有效的消除端口环路造成的影响。 然而, 对于釆用了 SVLAN技术的网络环境, 传统的环路检测方式很可能 出现环路检测错误的情况, 即使实际不存在环路也会认为网络中出现了环路。 如图 1所示, 如果三台交换机只是在普通环境下, 1/1-2、 2/1-2、 3/1-2六个端 口啫属于 vlanlO, 那么 1/1 口则会检测出环路; 口果 1/2 口不属于 vlanlO, 而 属于 vlan20, 那么 1/1 口则检测出没有环路。 但如果在 S VLAN的环境下, 情况就不一样了。 比如在图 1中, 1/2口配置 内层标签为 vlanlO, 外层标签为 vlan20的 SVLAN, 此时, 当从 1/1 口出来的 带 vlanlO标签的报文经过交换机^ 交换机 C之后, 依然带 vlanlO的标签, 此时从 1/2 口进来, 根据传统的环路检测方式将检测出有环路。 而实际上这种 情况是不存在环路的, 不会发生广播风暴, 这是因为 1/2口进来的带 vlanlO标 签的报文会被加上外层标签 vlan20, 从而在 vlan20中转发。 如果这个时候由于 误认为有环路而将 1/1 口关闭, 则会导致网络中 vlanlO的流量不通, 相关业务 中断。 可见, 现有技术中的环路检测方法在 SVLAN的环境下可能出现环路检测 错误的情况, 从而导致网络中的数据传输出现错误。 发明内容 针对现有技术中的环路检测方法导致网络中的数据传输出现错误的问题 而提出本发明, 为此, 本发明的主要目的在于提供一种 SVLAN ( Selective VLAN, 选择性虚拟局域网) 中的环路检测方法和装置, 以解决上述问题至少 之一。 为了实现上述目的, 根据本发明的一个方面, 提供了一种 SVLAN中的环 路检测方法, 其包括: 提取 SVLAN中接收端口所接收的检测 4艮文中的 VLAN 标签值和接收端口号; 在上述接收端口配置的索引表中查找是否存在与上述检 测报文对应的索引记录, 其中, 上述索引记录中的内层 VLAN标签值等于上述 VLAN标签值、 上述索引记录中的端口号等于上述接收端口号; 若存在上述与 上述检测报文对应的索引记录,则判断上述索引记录中的外层 VLAN标签值与 上述内层 VLAN标签值是否相同;若上述外层 VLAN标签值与上述内层 VLAN 标签值不同, 则上述 SVLAN中不存在环路。 在上述接收端口配置的索引表中查找是否存在与上述检测 4艮文对应的索 引记录之后, SVLAN 中的环路检测方法还包括: 若不存在上述与上述检测 4艮 文对应的索引记录, 则上述 SVLAN中存在环路。 在判断上述索引记录中的外层 VLAN标签值与上述内层 VLAN标签值是 否相同之后, SVLAN中的环路检测方法还包括: 若上述外层 VLAN标签值与 上述内层 VLAN标签值相同, 则上述 SVLAN中存在环路。 在判断出上述 SVLAN 中存在环路之后, SVLAN 中的环路检测方法还包 括: 关闭上述接收端口, 或者, 发出告警信息。 在提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值和接收端 口号之前, SVLAN 中的环路检测方法还包括: 根据 SVLAN的配置在上述接 收端口上配置上述索引表, 其中, 上述索引表中的每一条索引记录包括: 内层 VLAN标签值、 外层 VLAN标签值和端口号之间的映射关系。 在上述 SVLAN的配置发生更新时, SVLAN 中的环路检测方法还包括: 根据更新后的 SVLAN的配置在上述接收端口上更新上述索引表。 在提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值和接收端 口号之前, SVLAN 中的环路检测方法还包括: 判断上述接收的检测报文是否 合法; 若上述接收的检测报文不合法, 则丢弃上述检测报文, 不执行上述提取 SVLAN 中接收端口所接收的检测 4艮文中的 VLAN 标签值和接收端口号的步 骤, 并判断出上述 SVLAN中不存在环路。 为了实现上述目的, 才艮据本发明的另一方面, 提供了一种 SVLAN中的环 路检测装置, 其包括: 提取单元, 设置为提取 SVLAN中接收端口所接收的检 测 4艮文中的 VLAN标签值和接收端口号; 查找单元, 设置为在上述接收端口配 置的索引表中查找是否存在与上述检测报文对应的索引记录, 其中, 上述索引 记录中的内层 VLAN标签值等于上述 VLAN标签值、 上述索引记录中的端口 号等于上述接收端口号; 判断单元, 设置为在存在上述与上述检测报文对应的 索引记录时, 判断上述索引记录中的外层 VLAN标签值与上述内层 VLAN标 签值是否相同; 检测单元,设置为在上述外层 VLAN标签值与上述内层 VLAN 标签值不同时, 检测出上述 SVLAN中不存在环路。 上述检测单元还设置为在上述查找单元在上述接收端口配置的索引表中 查找出不存在上述与上述检测报文对应的索引记录时, 或者, 上述判断单元判 断出上述索引记录中的外层 VLAN标签值与上述内层 VLAN标签值相同时, 检测出上述 SVLAN中存在环路。 上述环路检测装置还包括: 配置单元,设置为在上述提取单元提取 SVLAN 中接收端口所接收的检测报文中的 VLAN 标签值和接收端口号之前, 根据 SVLAN 的配置在上述接收端口上配置上述索引表, 其中, 上述索引表中的每 一条索引记录包括: 内层 VLAN标签值、 外层 VLAN标签值和端口号之间的 映射关系。 通过本发明, 釆用 SVLAN索引表来判断是否在 SVLAN中出现环路, 解 决了现有技术中的环路检测方法导致网络中的数据传输出现错误的问题, 进而 保证了环路检测的正确 >f生。 本发明的其它特征和优点将在随后的说明书中阐述, 并且, 部分地从说明 书中变得显而易见, 或者通过实施本发明而了解。 本发明的目的和其他优点可 通过在所写的说明书、 权利要求书、 以及附图中所特别指出的结构来实现和获 得。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1是才艮据相关技术的 SVLAN的网络示意图; 图 2是根据本发明实施例的 SVLAN中的环路检测方法的一种优选的流程 图; 图 3是根据本发明实施例的 SVLAN索引表的示意图; 图 4是根据本发明实施例的 SVLAN中的环路检测方法的另一种优选的流 程图; 图 5是才艮据本发明实施例的 SVLAN中的环路检测装置的一种优选的结构 示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 实施例 1 本实施例中的环路检测方法应用于 S VLAN中的交换机中, 如图 2所示, 根据本发明实施例的 S VLAN中的环路检测方法包括如下步骤:
S202,提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值和接 收端口号;
S204, 在所述接收端口配置的索引表中查找是否存在与上述检测 4艮文对应 的索引记录, 其中, 所述索引记录中的内层 VLAN标签值等于所述 VLAN标 签值、 所述索引记录中的端口号等于所述接收端口号;
S206, 若存在与上述检测报文对应的索引记录, 则判断上述索引记录中的 外层 VLAN标签值与上述内层 VLAN标签值是否相同;
S208, 若所述外层 VLAN标签值与所述内层 VLAN标签值不同, 则上述 SVLAN中不存在环路。 通过本实施例, 釆用 SVLAN索引表来判断是否在 SVLAN中出现环路, 在内层 VLAN标签相同的情况下, 进一步比较内层 VLAN标签与外层 VLAN 标签,从而在内层 VLAN标签相同的情况下可以准确地判断出 SVLAN中是否 出现环路, 解决了现有技术中的环路检测方法导致网络中的数据传输出现错误 的问题, 进而保证了环路检测的正确性。 优选的, 在所述接收端口配置的索引表中查找是否存在与检测 4艮文对应的 索引记录之后, 还包括: 若不存在上述与检测报文对应的索引记录, 则上述 SVLAN中存在环路。 通过该优选的实施例, 可以进一步准确地判断出 SVLAN 中存在环路。 优选的, 在判断上述索引记录中的外层 VLAN标签值与上述内层 VLAN 标签值是否相同之后, 还包括: 若所述外层 VLAN标签值与所述内层 VLAN 标签值相同, 则上述 SVLAN中存在环路。 通过该优选的实施例, 可以进一步 准确地判断出 SVLAN中存在环路。 优选的, 在判断出上述 SVLAN中存在环路之后, 还包括: 关闭上述接收 端口, 或者, 发出告警信息。 通过该优选的实施例, 可以在判断出存在环路之 后, 有效地避免环路所带来的影响。 优选的,在提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值 和接收端口号之前, 还包括: 根据 SVLAN的配置在上述接收端口上配置上述 索引表, 其中, 上述索引表中的每一条索引记录包括: 内层 VLAN标签值、 外 层 VLAN标签值和端口号之间的映射关系。 通过本实施例, 索引表只提取了三 个所需要的 SVLAN信息, 即, 内层 VLAN标签值、 外层 VLAN标签值和端 口号 (优选的, 内层 VLAN标签值仅限于环路检测的配置 VLAN ), 从而有效 的节省了大量存储空间, 并且便于建立索引, 以及快速方便地实现检索。 优选的, 图 3示出了索引表的结构, 其中, 内层 VLAN标签值( In_vlan )、 外层 VLAN标签值 ( Out vlan ) 和端口号 (Port ) 三者——对应。 优选的,在上述 SVLAN的配置发生更新时,还包括:根据更新后的 SVLAN 的配置在上述接收端口上更新上述索引表。 通过本实施例, 可以实现索引表的 动态更新, 以便实时地适应网络的变化。 优选的,提取 SVLAN中接收端口所接收的检测 4艮文中的 VLAN标签值和 接收端口号之前, 还包括: 判断上述接收的检测报文是否合法; 若上述接收的 检测报文不合法, 则丢弃上述检测报文, 不执行上述提取 SVLAN中接收端口 所接收的检测报文中的 VLAN 标签值和接收端口号的步骤, 并判断出上述 SVLAN 中不存在环路。 通过本实施例, 在进行环路检测之前, 首先对检测 4艮 文的合法性进行判断, 并只对合法的检测报文进行环路检测处理, 从而节省了 系统资源, 以及优化了处理流程。 优选的, 如果设备上没有配 SVLAN, 那么在配置环路检测时就创建一个 空表项, 因此不影响后续检索和匹配动作; 如果之后再配置 SVLAN, 则根据 已有的环回检测 VLAN来创建相应的 SVLAN快速索引表项。 从而, 本发明中 的环路检测方法对于现有的环路检测协议是兼容的。 以下基于图 1所示的网络结构来详细描述才艮据本发明实施例的环路检测方 法。 £设配置 1/1 口属于 VLAN100, 1/2 口也属于 VLAN100, 交换机 A上配 置如下 SVLAN:
Port 1/2 In vlan 100 Out vlan 200 即从 1/2口进来的带 VLAN100标签的 4艮文会加上 VLAN200的夕卜层标签, 然后在 VLAN200中转发。 交换机 B和交换机 C的端口都属于 VLAN100, 在 交换机 A的 1/1 口配置环路检测, 环路检测 VLAN是 100, 带 VLAN100标签 的检测 4艮文从 1/1 口发出, 从 1/2口进来。 在应用本发明的解决方案之前, 环路检测报文接收后会直接处理为在 VLAN100中存在环路, 从而会 DOWN掉 1/1 口, 或者发出相应的告警信息。 而在应用了本发明之后, 检测 4艮文接收后会进行 SVLAN的匹配, 从而可以防 止错误检测, 保证网络的正常运作。 实施例 2 图 4是根据本发明实施例的 SVLAN中的环路检测方法的另一种优选的流 程图, 其包括如下步骤: 步骤 S402: 环路检测模块构建检测报文, 创建 SVLAN快速索引表(如图
3所示), 并且根据配置的环路检测 VLAN和 SVLAN信息下相应的表项, 并转 至步 4聚 S404; 步骤 S404: 环路检测模块接收检测报文, 并转至步骤 S406; 步骤 S406: 如果环路检测报文是合法的, 则转至步骤 S408; 如果环路检 测报文非法, 则转至步骤 S414; 步骤 S408: 环路检测扩展模块检索 SVLAN快速索引表(相当于实施例 1 中的索引表), 并转至步骤 S410; 步骤 S410: 若匹配成功(即上述 SVLAN快速索引表中存在与检测报文对 应的索引记录, 其中, 该索引记录中的内层 VLAN 标签值等于检测报文中的 VLAN标签值、 索引记录中的端口号等于上述检测报文中的接收端口号)且内 外层标签不同 (即, 上述 SVLAN快速索引表中的内层 VLAN标签值不同于外 层 VLAN标签值), 则转至步骤 S412; 若匹配失败或者匹配成功但内外层标签 相同, 则转至步 4聚 S416; 步骤 S412: 此时在该 VLAN中不存在网络环路, 因此等待进入下一次环 路检测流程; 步骤 S414: 非法的环路检测 4艮文会被立即丢弃, 然后转至步 4聚 S412; 步骤 S416: 此时在该 VLAN中存在网络环路, 需要 DOW 掉检测端口或 者发出相应的告警信息。 通过本实施例, 釆用 SVLAN索引表来判断是否在 SVLAN中出现环路, 在内层 VLAN标签相同的情况下, 进一步比较内层 VLAN标签与外层 VLAN 标签,从而在内层 VLAN标签相同的情况下可以准确地判断出 SVLAN中是否 出现环路, 解决了现有技术中的环路检测方法导致网络中的数据传输出现错误 的问题, 进而保证了环路检测的正确性。 实施例 3 图 5是才艮据本发明实施例的 SVLAN中的环路检测装置的一种优选的结构 示意图, 其包括: 提取单元 502 , 设置为提取 SVLAN中接收端口所接收的检 测报文中的 VLAN标签值和接收端口号;查找单元 504 ,与提取单元 502连接, 设置为在所述接收端口配置的索引表中查找是否存在与上述检测报文对应的 索引记录, 其中, 所述索引记录中的内层 VLAN标签值等于所述 VLAN标签 值、 所述索引记录中的端口号等于所述接收端口号; 判断单元 506 , 与查找单 元 504连接, 设置为在存在与上述检测报文对应的索引记录时, 判断所述索引 记录中的外层 VLAN标签值与所述内层 VLAN标签值是否相同;检测单元 508 , 与判断单元 506连接, 设置为在所述外层 VLAN标签值与所述内层 VLAN标 签值不同时, 检测出所述 SVLAN中不存在环路。 通过本实施例, 釆用 SVLAN索引表来判断是否在 SVLAN中出现环路, 在内层 VLAN标签相同的情况下, 进一步比较内层 VLAN标签与外层 VLAN 标签,从而在内层 VLAN标签相同的情况下可以准确地判断出 SVLAN中是否 出现环路, 解决了现有技术中的环路检测方法导致网络中的数据传输出现错误 的问题, 进而保证了环路检测的正确性。 优选的, 在所述查找单元 504在所述接收端口配置的索引表中查找出不存 在与上述检测 4艮文对应的索引记录时, 或者, 所述判断单元 506判断出所述索 引记录中的外层 VLAN标签值与所述内层 VLAN标签值相同时, 所述检测单 元 508检测出所述 SVLAN中存在环路。 通过该优选的实施例, 可以进一步准 确地判断出 SVLAN中存在环路。 优选的, 在检测单元 508检测出上述 SVLAN中存在环路之后, 上述检测 装置关闭上述接收端口, 或者, 发出告警信息。 通过该优选的实施例, 可以在 判断出存在环路之后, 有效地避免环路所带来的影响。 优选的, 上述装置还包括: 配置单元 510 , 与查找单元 504连接, 设置为 在所述提取单元 502提取 SVLAN中接收端口所接收的检测 4艮文中的 VLAN标 签值和接收端口号之前, 根据 SVLAN的配置在所述接收端口上配置所述索引 表, 其中, 所述索引表中的每一条索引记录包括: 内层 VLAN 标签值、 外层 VLAN标签值和端口号之间的映射关系。 优选的, 图 3示出了索引表的结构, 其中, 内层 VLAN标签值( In_vlan )、 外层 VLAN标签值 ( Out vlan ) 和端口号 (Port ) 三者——对应。 优选的, 在上述 SVLAN的配置发生更新时, 配置单元 510 居更新后的 SVLAN 的配置在上述接收端口上更新上述索引表。 通过本实施例, 可以实现 索引表的动态更新, 以便实时地适应网络的变化。 优选的,提取 SVLAN中接收端口所接收的检测 4艮文中的 VLAN标签值和 接收端口号之前, 上述环路检测装置进一步判断上述接收的检测报文是否合 法; 若上述接收的检测 艮文不合法, 则丢弃上述检测 艮文, 不执行上述提取 SVLAN 中接收端口所接收的检测 4艮文中的 VLAN 标签值和接收端口号的步 骤, 并判断出上述 SVLAN中不存在环路。 通过本实施例, 在进行环路检测之 前, 首先对检测报文的合法性进行判断, 并只对合法的检测报文进行环路检测 处理, 从而节省了系统资源, 以及优化了处理流程。 以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保护范 围。 需要说明的是, 在附图的流程图示出的步骤可以在诸如一组计算机可执行 指令的计算机系统中执行, 并且, 虽然在流程图中示出了逻辑顺序, 但是在某 些情况下, 可以以不同于此处的顺序执行所示出或描述的步 4聚。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 或者将它们 分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集 成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。

Claims

权 利 要 求 书
1. 一种选择性虚拟局域网 SVLAN中的环路检测方法, 其中, 包括:
提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值和接 收端口号;
在所述接收端口配置的索引表中查找是否存在与所述检测报文对应 的索引记录,其中,所述索引记录中的内层 VLAN标签值等于所述 VLAN 标签值、 所述索引记录中的端口号等于所述接收端口号;
若存在所述与所述检测 4艮文对应的索引记录, 则判断所述索引记录 中的外层 VLAN标签值与所述内层 VLAN标签值是否相同;
若所述外层 VLAN标签值与所述内层 VLAN标签值不同, 则所述 SVLAN中不存在环路。
2. 根据权利要求 1所述的方法, 其中, 在所述接收端口配置的索引表中查 找是否存在与所述检测 4艮文对应的索引记录之后, 还包括:
若不存在所述与所述检测 4艮文对应的索引记录, 则所述 SVLAN 中 存在环路。
3. 根据权利要求 1所述的方法,其中,在判断所述索引记录中的外层 VLAN 标签值与所述内层 VLAN标签值是否相同之后, 还包括:
若所述外层 VLAN标签值与所述内层 VLAN标签值相同, 则所述 SVLAN中存在环路。
4. 根据权利要求 2或 3所述的方法, 其中, 在判断出所述 SVLAN中存在 环路之后, 还包括:
关闭所述接收端口, 或者, 发出告警信息。
5. 根据权利要求 1所述的方法, 其中, 在提取 SVLAN中接收端口所接收 的检测 4艮文中的 VLAN标签值和接收端口号之前, 还包括:
根据 SVLAN的配置在所述接收端口上配置所述索引表, 其中, 所 述索引表中的每一条索引记录包括: 内层 VLAN标签值、外层 VLAN标 签值和端口号之间的映射关系。
6. 根据权利要求 5所述的方法, 其中, 在所述 SVLAN的配置发生更新时, 还包括:
根据更新后的 SVLAN的配置在所述接收端口上更新所述索引表。
7. 根据权利要求 1所述的方法, 其中, 在提取 SVLAN中接收端口所接收 的检测 4艮文中的 VLAN标签值和接收端口号之前, 还包括:
判断所述接收的检测报文是否合法;
若所述接收的检测 艮文不合法, 则丢弃所述检测 艮文, 不执行所述 提取 SVLAN中接收端口所接收的检测报文中的 VLAN标签值和接收端 口号的步骤, 并判断出所述 SVLAN中不存在环路。
8. —种选择性虚拟局域网 SVLAN中的环路检测装置, 其中, 包括:
提取单元, 设置为提取 SVLAN 中接收端口所接收的检测报文中的 VLAN标签值和接收端口号;
查找单元, 设置为在所述接收端口配置的索引表中查找是否存在与 所述检测 4艮文对应的索引记录, 其中, 所述索引记录中的内层 VLAN标 签值等于所述 VLAN标签值、 所述索引记录中的端口号等于所述接收端 口号;
判断单元, 设置为在存在所述与所述检测 4艮文对应的索引记录时, 判断所述索引记录中的外层 VLAN标签值与所述内层 VLAN标签值是否 相同;
检测单元,设置为在所述外层 VLAN标签值与所述内层 VLAN标签 值不同时, 检测出所述 SVLAN中不存在环路。
9. 才艮据权利要求 8所述的装置, 其中, 所述检测单元还设置为在所述查找 单元在所述接收端口配置的索引表中查找出不存在所述与所述检测 4艮文 对应的索引记录时, 或者, 所述判断单元判断出所述索引记录中的外层 VLAN标签值与所述内层 VLAN标签值相同时, 检测出所述 SVLAN中 存在环路。
10. 根据权利要求 8所述的装置, 其中, 还包括:
配置单元, 设置为在所述提取单元提取 SVLAN 中接收端口所接收 的检测 4艮文中的 VLAN标签值和接收端口号之前, 才艮据 SVLAN的配置 在所述接收端口上配置所述索引表, 其中, 所述索引表中的每一条索引 记录包括: 内层 VLAN标签值、外层 VLAN标签值和端口号之间的映射 关系。
PCT/CN2011/074579 2010-09-13 2011-05-24 选择性虚拟局域网中的环路检测方法和装置 WO2012034412A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010286908.5A CN101938388B (zh) 2010-09-13 2010-09-13 选择性虚拟局域网中的环路检测方法和装置
CN201010286908.5 2010-09-13

Publications (1)

Publication Number Publication Date
WO2012034412A1 true WO2012034412A1 (zh) 2012-03-22

Family

ID=43391533

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/074579 WO2012034412A1 (zh) 2010-09-13 2011-05-24 选择性虚拟局域网中的环路检测方法和装置

Country Status (2)

Country Link
CN (1) CN101938388B (zh)
WO (1) WO2012034412A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938388B (zh) * 2010-09-13 2014-12-10 中兴通讯股份有限公司 选择性虚拟局域网中的环路检测方法和装置
CN102143414B (zh) * 2011-05-20 2013-09-11 太仓市同维电子有限公司 Epon中局端设备与终端设备间实现网络连接测试的方法
CN103023779B (zh) * 2012-08-13 2018-04-10 中兴通讯股份有限公司 一种数据报文处理方法及装置
CN107566294B (zh) * 2017-07-06 2021-11-05 中国南方电网有限责任公司 一种适用于iec62439标准的网络风暴抑制方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1988476A (zh) * 2006-12-19 2007-06-27 武汉烽火网络有限责任公司 一种自适应快速环路检测和环路阻断的方法及装置
CN101110764A (zh) * 2007-08-13 2008-01-23 中兴通讯股份有限公司 一种以太网交换机数据帧划分虚拟局域网并转发的方法
CN101409639A (zh) * 2008-11-25 2009-04-15 杭州华三通信技术有限公司 QinQ配置方法和配置装置
CN101567854A (zh) * 2009-05-26 2009-10-28 武汉烽火网络有限责任公司 基于流分类的以太网数据帧vlan双层标签处理装置和方法
CN101938388A (zh) * 2010-09-13 2011-01-05 中兴通讯股份有限公司 选择性虚拟局域网中的环路检测方法和装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534226A (zh) * 2009-04-14 2009-09-16 杭州华三通信技术有限公司 一种基于vlan的全网环路检测方法和环路检测设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1988476A (zh) * 2006-12-19 2007-06-27 武汉烽火网络有限责任公司 一种自适应快速环路检测和环路阻断的方法及装置
CN101110764A (zh) * 2007-08-13 2008-01-23 中兴通讯股份有限公司 一种以太网交换机数据帧划分虚拟局域网并转发的方法
CN101409639A (zh) * 2008-11-25 2009-04-15 杭州华三通信技术有限公司 QinQ配置方法和配置装置
CN101567854A (zh) * 2009-05-26 2009-10-28 武汉烽火网络有限责任公司 基于流分类的以太网数据帧vlan双层标签处理装置和方法
CN101938388A (zh) * 2010-09-13 2011-01-05 中兴通讯股份有限公司 选择性虚拟局域网中的环路检测方法和装置

Also Published As

Publication number Publication date
CN101938388A (zh) 2011-01-05
CN101938388B (zh) 2014-12-10

Similar Documents

Publication Publication Date Title
US7729276B2 (en) Method and system for tunneling MACSec packets through non-MACSec nodes
JP5345942B2 (ja) Pbtネットワークの中間ノードにおけるイーサネットoam
US9185035B2 (en) Apparatus and method for processing packet in MPLS-TP network
US8619788B1 (en) Performing scalable L2 wholesale services in computer networks
US9276769B2 (en) Circuit bundle for resiliency/protection of circuits
US9001644B2 (en) Ethernet virtual private network system for providing fast protection for access rings
WO2015165212A1 (zh) 一种报文处理方法、装置及计算机存储介质
US20120163165A1 (en) Apparatus and method for packet transport service based on multi protocol label switching-transport profile (mpls-tp) network
WO2005048540A1 (ja) 通信システム及び通信方法
EP2852108B1 (en) Method and device for clearing media access control forwarding table items
WO2010086750A1 (en) Scaled ethernet oam for mesh and hub-and-spoke networks
WO2009021371A1 (fr) Procédé et dispositif permettant de réaliser une émulation pseudo-filaire de bout en bout
EP1766876A2 (en) Technique for transferring data over a packet switched network
WO2007071153A1 (fr) Procede, systeme de reseau de donnees et noeud de reseau pour transmission de paquets de donnees
WO2012122844A1 (zh) 一种多链接互连网络分域互连的方法和系统
WO2011101756A1 (en) Fast lsp alert mechanism
WO2012034412A1 (zh) 选择性虚拟局域网中的环路检测方法和装置
WO2012159461A1 (zh) 一种二层路径最大传输单元发现方法和节点
US10009272B2 (en) Packet transmission apparatus for processing operations, administration, and maintenance (OAM) packet and protection switching message
US7423980B2 (en) Full mesh status monitor
WO2014040422A1 (zh) 介质访问控制地址学习控制方法、装置和路由桥
WO2013051004A2 (en) A low latency carrier class switch-router
TWI536773B (zh) 利用一偏移提供內頻帶控制通道的擬線
JP5115771B2 (ja) ネットワークシステム、ルータ装置及びそれらに用いる冗長化方法
WO2012127490A1 (en) Interworkinq network element

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11824482

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11824482

Country of ref document: EP

Kind code of ref document: A1