WO2017050199A1 - Network loop detection method and controller - Google Patents

Network loop detection method and controller Download PDF

Info

Publication number
WO2017050199A1
WO2017050199A1 PCT/CN2016/099348 CN2016099348W WO2017050199A1 WO 2017050199 A1 WO2017050199 A1 WO 2017050199A1 CN 2016099348 W CN2016099348 W CN 2016099348W WO 2017050199 A1 WO2017050199 A1 WO 2017050199A1
Authority
WO
WIPO (PCT)
Prior art keywords
mac address
address mapping
network
forwarding device
controller
Prior art date
Application number
PCT/CN2016/099348
Other languages
French (fr)
Chinese (zh)
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 WO2017050199A1 publication Critical patent/WO2017050199A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a network loop detection method and controller.
  • FIG. 1 In the network shown in Figure 1, it includes all levels of switches, as well as various types of servers. Loops occur in the network due to server configuration errors, network failures, or switch configuration errors or operational failures. For example, Figure 1 shows four scenarios in which loops may occur.
  • Curve 1 indicates the loop caused by the NIC fault or the network cable self-loop of the common physical server.
  • the loopback of the network cable is caused by the connection between the receiving end and the sending end of the network cable.
  • the server is installed with the virtual machine.
  • curve 2 represents the loop caused by the configuration error of the virtual switch in the server where the virtual machine is installed;
  • curve 4 represents the virtual scalable local area network (English: Virtual eXtensible Local Area Network, abbreviated: VXLAN)
  • VXLAN Virtual eXtensible Local Area Network
  • a switch in the network actively sends a broadcast packet or a multicast packet to perform loop detection through a spanning tree protocol (Spanning Tree Protocol, STP) or a private protocol. If the switch detects any of the following In this case, you need to break the loop, that is, perform the operation of blocking the port, closing the port, or withdrawing the port from the virtual local area network (English: Virtual Local Area Network, abbreviation: VLAN).
  • STP Spanning Tree Protocol
  • VLAN Virtual Local Area Network
  • the network is large and the networking is complex. Therefore, a single switch in the network cannot accurately and quickly determine the network loop, which may result in the network loop being unable to be processed. Forwarding of the message.
  • the invention provides a network loop detection method and a controller, which are used to solve the problem that the prior art cannot accurately and quickly determine the network loop.
  • a network loop detection method includes:
  • each MAC address mapping includes a MAC address and a port of the forwarding device
  • the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least A comparison MAC address mapping includes the same MAC address;
  • the obtaining the multiple MAC address mappings includes acquiring the reference MAC address mapping and the address mapping of the at least one comparison MAC respectively.
  • the obtaining the reference MAC address mapping includes:
  • the controller Determining, by the controller, the reference MAC address mapping according to a MAC address of a host that accesses the forwarding device that is obtained from the cloud platform and a port that the forwarding device communicates with the host;
  • a MAC address mapping including a MAC address sent by the forwarding device for the first time as a reference MAC address mapping of the MAC address
  • the obtaining the comparison MAC address mapping includes:
  • the controller periodically acquires a MAC address mapping of the forwarding device, and obtains a comparison MAC address mapping of each reference MAC address mapping;
  • the controller receives a drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between ports of the forwarding device, where the port in the drift MAC address mapping is a drift port; the controller The drift MAC address mapping is mapped as a comparison MAC address of the MAC address.
  • the at least two MAC address mappings include a reference MAC address mapping and at least one ratio Mapping to MAC addresses;
  • the determining that the network exists a loop includes:
  • the controller continues to acquire the comparison MAC address mapping of the reference address mapping during the set time period, and determines that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time; or
  • the fourth In an implementation manner, after the controller determines that the network has a loop, the method further includes: the controller determining, according to the at least one comparison MAC address mapping, a loop fault in the network port;
  • the controller is configured according to attributes of each forwarding device in the network and each forwarding The bandwidth occupied by the device determines a ring network blocking port from the at least two loop failure ports.
  • a controller includes:
  • An acquiring unit configured to acquire multiple media access control MAC address mappings of the forwarding device managed by the controller; wherein each MAC address mapping includes a MAC address and a port of the forwarding device;
  • a processing unit configured to determine, when determining that the MAC addresses of the at least two MAC address mappings in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different There is a loop on the network where the device is located.
  • the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least A comparison MAC address mapping includes the same MAC address;
  • the acquiring unit when acquiring the reference MAC address mapping, is used to:
  • the acquiring unit when acquiring the comparison MAC address mapping, is used to:
  • the acquiring unit maps the drift MAC address as a comparison MAC address of the MAC address.
  • the at least two MAC address mappings include a reference MAC address mapping and at least one ratio Mapping to MAC addresses;
  • the processing unit is configured to: when determining that the network has a loop:
  • the acquiring unit continuously acquires the comparison MAC address mapping of the reference address mapping during a set period of time And determining that the network has a loop; wherein the set time period is greater than a time required to complete a specific service; or
  • the processing unit is further configured to:
  • the controller determines that the network has a loop, determining, according to the at least one comparison MAC address mapping, a loop fault port in the network;
  • the at least two loop failure ports belong to different forwarding devices, according to attributes of each forwarding device in the network and occupied by each forwarding device Bandwidth, determining a ring network blocking port from the at least two loop failure ports.
  • the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a port of the forwarding device; Determining, by the controller, that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining the forwarding device There is a loop in the network where it is located. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
  • FIG. 1 is a schematic diagram of a network loop in the prior art
  • FIG. 2 is a network architecture diagram of a method for implementing a network loop detection according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a network loop detection method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an example of a network loop detection method according to an embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of a controller according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of another controller according to an embodiment of the present invention.
  • the embodiment of the invention provides a network loop detection method, which is used to solve the problem that the prior art cannot accurately and quickly determine The problem of the network loop.
  • the method and the controller of the present invention are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
  • the controller acquires multiple media access control (English: Medium Access Control, MAC address) address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a Determining a port of the forwarding device; the controller determining that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the port of the forwarding device included in the at least two MAC address mappings When not, it is determined that there is a loop in the network where the forwarding device is located. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
  • media access control English: Medium Access Control, MAC address
  • the network loop detection method provided by the embodiment of the present invention is applicable to the data link layer (ie, the second layer) network architecture shown in FIG. 2, and includes the cloud platform 210, the controller 220, and at least one forwarding as shown in the figure.
  • Devices forwarding device 231, forwarding device 232, and forwarding device 233 and terminal device 240. among them,
  • the cloud platform 210 manages all the devices in the entire network by using the controller 220. After the network establishes a connection, the cloud platform 210 can determine the terminal devices in the network that access each forwarding device (as shown in the figure). a MAC address of the access device 232 and the terminal device 240 of the forwarding device 233 and an interface for the forwarding device to communicate with the terminal device, that is, a MAC address mapping, wherein each MAC address mapping includes a MAC address and a forwarding device Port
  • the controller 220 may be disposed on a separate device, such as a server, and the server may be a physical server or a virtual server, and the controller 220 may also be disposed on the forwarding device, where the forwarding device may be a switch or router.
  • the controller 220 may map the MAC address obtained from the forwarding device 231, the forwarding device 232, and the forwarding device 233 in the network by acquiring the MAC address mapping from the cloud platform 210, and collecting the MAC address. Multiple MAC address mappings determine whether a loop exists in the network, further determine the location of the network loop, and perform network loop cancellation operations or alarms;
  • any one of the forwarding device 231, the forwarding device 232, and the forwarding device 233 (in this embodiment, only the forwarding device 231 is used as an example), which may be a switch, or other compatible switch function.
  • the network device such as a router, is not limited by the present invention.
  • the forwarding device 231 is configured to forward a message based on an OpenFlow protocol or other protocol.
  • the forwarding device 231 has a MAC learning capability in the packet sending and receiving process. For example, the forwarding device 231 receives the port PORT1.
  • the forwarding device 231 can learn a MAC address mapping - (the first MAC address, PORT1 of the forwarding device 231); the forwarding device 231 will also The learned MAC address mapping is reported to the controller 220;
  • the terminal device 240 may be a general server or a switch, or another terminal, or a network device compatible with the server and the switch, which is not limited by the present invention.
  • the forwarding device 231, the forwarding device 232, and the forwarding device 233 may be directly determined by using a link layer discovery protocol (LLDP).
  • LLDP link layer discovery protocol
  • a network loop detection method provided by an embodiment of the present invention is applied to a controller in a network of a data link layer, such as the controller 220 in the network architecture shown in FIG. 2.
  • the processing flow of the method includes:
  • Step 301 The controller acquires multiple MAC address mappings of the forwarding device managed by the controller.
  • Each MAC address mapping includes a MAC address and a port of the forwarding device.
  • any one of the MAC address mappings is used to indicate that the destination address or the source address included in the transport packet is a MAC address included in the MAC address mapping, and the transport packet is forwarded through the MAC address mapping.
  • the port of the device is forwarded.
  • any MAC address mapping (the first MAC address, PORT1 of the first forwarding device) indicates that when the source address in the transport packet is the first MAC address, the transport packet passes through the PORT1 of the first forwarding device.
  • the source port is forwarded.
  • the transport packet is forwarded through the PORT1 of the first forwarding device as the destination port.
  • a port of a forwarding device included in any MAC address mapping may be a port of any of the following tunnels: Transparent Interconnection of Lots of Links (TRILL) tunnel, virtual private LAN service (English) : Virtual Private LAN Service, abbreviation: VPLS) Tunnel, VXLAN, Stateless Transport Tunneling (STT) and Network Virtualization Generic Routing Encapsulation (NVGRE) tunnel Wait.
  • TRILL Transparent Interconnection of Lots of Links
  • the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address mapping include the same MAC address; the reference The MAC address is mapped to a MAC address mapping as a basis for comparison; the comparison MAC address is mapped to a MAC address mapping that is compared with a reference MAC address mapping.
  • the acquiring, by the controller, the multiple MAC address mappings includes: acquiring the reference MAC address mapping and the address mapping of the at least one comparison MAC respectively.
  • the controller obtains the reference MAC address mapping, which may include the following two methods:
  • the first mode the controller obtains the reference MAC address mapping according to the MAC address of the host that accesses the forwarding device and the port that the forwarding device communicates with the host.
  • the second mode the controller receives a MAC address mapping including a MAC address sent by the forwarding device for the first time as a reference MAC address mapping of the MAC address.
  • the cloud platform can determine the MAC address of the host that accesses each forwarding device in the network and the port that each forwarding device communicates with the host. Therefore, the controller can The MAC address of the host of the access forwarding device in the cloud platform and the port that the forwarding device communicates with the host are obtained by the active request or the cloud platform, and the reference MAC address mapping is obtained.
  • each forwarding device in the network managed by the controller since each forwarding device in the network managed by the controller has the capability of MAC learning, each forwarding device in the network can learn the MAC during the network operation. Address mapping. For example, the PORT2 of the second forwarding device first receives a transmission message whose source address is the second MAC address, and the MAC address learned by the second forwarding device is mapped to (the second MAC address, PORT2 of the second forwarding device). . Each forwarding device reports the MAC address mapping to the controller after learning the MAC address mapping including the MAC address for the first time.
  • the reference MAC address including the first MAC address is mapped to the MAC address mapping of the first MAC address that is obtained by the controller for the first time, and the MAC address mapping including the first MAC address is subsequently obtained, and then The obtained MAC address mapping is the comparison MAC address mapping of the reference mapping.
  • the controller obtains the comparison MAC address mapping, and includes the following two methods:
  • the first mode the controller periodically acquires a MAC address mapping of the forwarding device, and obtains a comparison MAC address mapping of each reference MAC address mapping.
  • the second mode the controller receives the drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between the ports of the forwarding device, and the port in the drift MAC address mapping is a post-drift port;
  • the controller maps the drift MAC address as a comparison MAC address of the MAC address.
  • the drift MAC address is mapped to a MAC address mapping learned by the forwarding device after the MAC address is drifted.
  • the controller In the first mode, in order to ensure the security of the transmitted message, since the forwarding device in the network is always in the MAC learning state, the controller needs to poll each forwarding device in the network according to the set period. Obtain the MAC address mapping learned by each forwarding device.
  • the forwarding device in the network continuously updates the MAC address mapping saved by itself through MAC learning, so any forwarding device can determine that the MAC address mapping in the local storage corresponds to a MAC address.
  • the port of the forwarding device is flapped.
  • the forwarding device may map the port including the MAC address and the drifting device to the controller as a drift MAC address.
  • Step 302 The controller determines that the MAC addresses mapped by the at least two MAC addresses in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different. There is a loop on the network where the forwarding device is located.
  • the at least two MAC address mappings include a reference MAC address mapping and at least one comparison.
  • MAC address mapping in this case, in step 302, the controller determines that the network has a loop, including the following trigger conditions:
  • the first type the controller continuously obtains the comparison MAC address mapping of the reference address mapping during the set time period, and determines that the network has a loop; wherein the set time period is greater than the completion specific
  • the time required for the service, the set time period can be specifically set according to the actual scenario, for example, the value is 10 seconds, 20 seconds.
  • the second type when the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, determining that the network has a loop.
  • the terminal device In the first trigger condition, when a certain service is processed by the network, it is normal for a MAC address to drift between the ports of the forwarding device. For example, under the active/standby link transmission mechanism, the terminal device is in the active/standby chain. If the path is changed, the network topology changes, or the terminal device is a server that installs a virtual machine or a server of a VXLAN, and the virtual machine drifts. In this case, a small amount of MAC address drift occurs normally in a short period of time. Therefore, the controller is normal.
  • the controller Determining that the network has a loop when determining that the MAC address is long (in a set period of time greater than the time required to complete a particular service) and the MAC address is drifting or oscillating, the controller
  • the set time period can be used to prevent the network from having a loop due to a small number of MAC address flapping when the network processes some specific services, thereby reducing the probability of network loop misjudgment.
  • the number of comparison MAC address mappings of a reference MAC address mapping may reflect the number of times the MAC address in the reference MAC address mapping is drifted. Therefore, after a MAC address is transmitted multiple times, it may be determined. There is a loop in the network.
  • the setting threshold may be set according to an actual scenario, which is not limited by the present invention.
  • the controller After determining that the network has a loop, the controller performs a network loop elimination operation, an alarm, or records a log and periodically sends an alert message according to a preset delivery policy, where the network loop elimination operation includes: The network closes the port, exits the VLAN, etc., and sends an alert message, including sending a text message or an email.
  • the method further includes:
  • the controller is configured according to attributes of each forwarding device in the network and each forwarding The bandwidth occupied by the device determines a ring network blocking port from the at least two loop failure ports.
  • the controller may determine a loop fault port in the network according to a port of the forwarding device included in the comparison MAC address mapping, and adopt a conventional technology when the multiple loop fault ports are included.
  • the loop network blocked port is determined, thereby achieving network loop elimination.
  • the network loop detection method provided by the embodiment of the present invention can use multiple types of networks, such as a single network, a set. Group networks, as well as networks of various sizes and complex networks.
  • the network connection in the network may be connected through a physical entity or through a wireless connection, which is not limited by the present invention.
  • the type of the network may be existing networks, such as VLAN, QinQ, VPLS, TRILL, VXLAN, NVGRE, STT, and the like.
  • the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and one of the forwarding devices. a port; the controller determines that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining The network in which the forwarding device is located has a loop. In this manner, the controller can accurately and quickly determine a loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally eliminating the network loop.
  • the controller may determine whether the network has a loop through the network loop detection method provided in the foregoing embodiment.
  • each forwarding device/terminal device is interconnected with one port of another forwarding device/terminal device through one port of its own, for example, PORT1 of forwarding device A is interconnected with PORT 12 of terminal device E; forwarding device B PORT5 is interconnected with PORT15 of terminal device F...
  • Example 1 the PORT 12 of the terminal device E sends an Ethernet data packet, and the PORT 14 of the terminal device F transmits an Ethernet data packet, and the forwarding device A can learn the source MAC address of the Ethernet data packet on PORT1 and PORT2, respectively, and can Determine the forwarding device C or the forwarding device D according to the destination MAC address of the Ethernet data packet according to the equal-cost multipath routing (English: Equal-Cost Multipath Routing, ECMP), and determine the forwarding device C or the forwarding device D to the Ethernet. Data packets are forwarded.
  • the following network loops may appear in the network:
  • the PORT 12 of the terminal device E has a self-loop, that is, after the terminal device E forwards an Ethernet data packet through the PORT 12, it also receives the Ethernet data packet through the PORT 12.
  • the multi-path link between the terminal device E and the forwarding device A fails to be negotiated or the port aggregation control protocol (English: Link Aggregation Control Protocol, abbreviated as LACP) fails.
  • LACP Link Aggregation Control Protocol
  • terminal device E There is an interconnected link between the terminal device E and the terminal device F, and a network loop is formed with the forwarding device A, as shown in the network loop shown in FIG.
  • the controller may determine that any one of the foregoing three types of network loops occurs when the plurality of MAC address mappings learned and reported by the forwarding device A are determined to meet the following conditions:
  • the first type the MAC address learned by the forwarding device A on the PORT1 changes multiple times, that is, the MAC address included in the multiple MAC address mappings of the PORT1 reported by the forwarding device A changes multiple times;
  • the second type the port of the forwarding device A included in the multiple MAC address mappings that include a MAC address reported by the forwarding device A frequently drifts between PORT1 and PORT2.
  • Example 2 PORT14 and PORT15 of the terminal device F send Ethernet data packets, and PORT2 of the forwarding device A And the PORT5 of the forwarding device B can learn the source MAC address of the Ethernet data packet, and determine the forwarding device C or the forwarding device D by using the destination MAC address of the Ethernet data packet, according to the determined forwarding device C or forwarding.
  • Device D forwards the Ethernet data packet.
  • the following network loops may appear in the network:
  • the PORT 14 and PORT 15 of the terminal device F form a network loop with the forwarding device A, the forwarding device B, and the forwarding device C, as shown in the network loop shown in FIG. 2, similarly, the PORT 14 and PORT 15 of the terminal device F and the forwarding device A
  • the forwarding device B and the forwarding device D form a network loop.
  • the controller may determine that the network loop occurs when the following conditions are met in the multiple MAC address mappings reported by the forwarding devices:
  • the ports of the forwarding device included are repeatedly moved between ports of different forwarding devices.
  • the forwarding device A sends the Ethernet data packet to the forwarding device C and the forwarding device D through the PORT3 and the PORT4.
  • the forwarding device A can receive the forwarding information sent by the forwarding device A because the forwarding device C or the forwarding device D is faulty. Ethernet datagram. Therefore, the following network loops may appear in the network:
  • the forwarding device C or the forwarding device D is faulty, causing the PORT3 and PORT4 of the forwarding device A to form a network loop with the forwarding device C and the forwarding device D, as shown in the network loop shown in curve 3.
  • the controller may determine that the network loop occurs when the following conditions are met in the multiple MAC address mappings reported by the forwarding devices:
  • the port of the forwarding device included in the multiple MAC address mappings including one MAC address frequently drifts between PORT3 and PORT1 (or PORT2).
  • PORT1 and PORT2 are the access side ports of the forwarding device A
  • PORT3 and PORT4 are the network side ports of the forwarding device A.
  • the above condition can also be expressed as a MAC address mapping of a MAC address reported by the forwarding device A, and the ports of the forwarding device included frequently drift on the network side port and the access side port.
  • the network loop in the example 2 is related to the forwarding device A and the forwarding device B. Therefore, the traditional single forwarding device cannot determine the network loop, and the location of the loop in the network cannot be determined. Therefore, the implementation of the present invention is adopted. For example, the network loop detection method is provided, and the MAC address mapping of each forwarding device can be used to determine that the network has a loop, thereby determining the location of the network loop.
  • the forwarding device A can determine that the learned MAC address is drifting on the network side port and the access side port, that is, the forwarding device A can determine that a network loop occurs by a conventional method, and The forwarding device A performs the network loop elimination itself.
  • the network loop is not caused by the forwarding device A, the unilateral execution of the network loop elimination by the forwarding device A may cause further network failure. Therefore, the embodiment of the present invention is adopted. Providing a network loop detection method, which can determine a loop of the network through MAC address mapping of each forwarding device, and further Determine the location of the network loop.
  • the present invention further provides a controller.
  • the controller 500 includes: an obtaining unit 501 and a processing unit 502, where
  • the obtaining unit 501 is configured to acquire multiple MAC address mappings of the forwarding device managed by the controller, where each MAC address mapping includes one MAC address and one port of the forwarding device;
  • the processing unit 502 is configured to determine, when determining that the MAC addresses of the at least two MAC address mappings in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different There is a loop on the network where the forwarding device is located.
  • the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address mapping include the same MAC address;
  • the acquiring unit 501 is configured to acquire the address mapping of the reference MAC address mapping and the at least one comparison MAC respectively when acquiring the multiple MAC address mappings.
  • the acquiring unit 501 is configured to: when acquiring the reference MAC address mapping:
  • the obtaining unit 501 is configured to: when acquiring the comparison MAC address mapping:
  • the at least two MAC address mappings include a reference MAC address mapping and at least one comparison MAC address mapping.
  • the processing unit 502 is configured to: when determining that the network has a loop;
  • the acquiring unit 501 When the acquiring unit 501 continues to acquire the comparison MAC address mapping of the reference address mapping, it is determined that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time; or
  • processing unit 502 is further configured to:
  • the controller determines that the network has a loop, determining, according to the at least one comparison MAC address mapping, a loop failure port in the network;
  • the at least two loop failure ports belong to different forwarding devices, according to attributes of each forwarding device in the network and occupied by each forwarding device Bandwidth, determining a ring network blocking port from the at least two loop failure ports.
  • the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a port of the forwarding device; the controller Determining, when the MAC addresses of the at least two MAC address mappings in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining the network where the forwarding device is located There is a loop. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
  • the division of the unit in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (English: read-only memory, abbreviated as: ROM), a random access memory (English: random access memory, abbreviated as: RAM), a magnetic disk or an optical disk, and the like.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or an optical disk and the like.
  • the present invention further provides a controller.
  • the controller 600 includes a transceiver 601, a processor 602, a bus 603, and a memory 604, where:
  • the transceiver 601, the processor 602, and the memory 604 are connected to each other through a bus 603.
  • the bus 603 may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard architecture (English: Extended Industry Standard Architecture, for short) EISA) bus and so on.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 6, but it does not mean that there is only one bus or one type of bus.
  • the transceiver 601 is configured to communicate with the forwarding device managed by the controller 600, and the cloud platform, such as acquiring multiple MAC address mappings from the forwarding device and the cloud platform.
  • the controller 600 also includes a memory 604 for storing programs and the like.
  • the program can include program code, the program code including computer operating instructions.
  • Memory 604 may include RAM and may also include non-volatile memory, such as at least one disk storage.
  • the processor 602 executes an application stored in the memory 604 to implement the above network loop detection method.
  • the network loop detection method and controller provided by the embodiment of the present invention, the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and the forwarding device a port; the controller determines that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different,
  • the network in which the forwarding device is located has a loop.
  • the controller can accurately and quickly determine the loop existing on the network according to the collected multiple MAC address mappings, and then determine the location of the network loop, and finally implement network loop elimination.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

Disclosed are a network loop detection method and a controller, which are used for resolving the problem of impossibility in accurately and rapidly determining a network loop in the prior art. A controller acquires a plurality of MAC address mappings sent by a forwarding device managed by the controller, wherein each MAC address mapping comprises one MAC address and one port of the forwarding device; and the controller determines that a loop exists in a network where the forwarding device is located when MAC addresses of at least two MAC address mappings in the plurality of MAC address mappings are determined to be the same and ports of forwarding devices in the at least two MAC address mappings are different. In such a way, the controller can accurately and rapidly determine that a loop exists in a network according to a plurality of collected MAC address mappings, thereby determining the position of a network loop, and finally realizing network loop elimination.

Description

一种网络环路检测方法及控制器Network loop detection method and controller
本申请要求于2015年9月23日提交中国专利局、申请号为201510613030.4、发明名称为“一种网络环路检测方法及控制器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201510613030.4, entitled "A Network Loop Detection Method and Controller", filed on September 23, 2015, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种网络环路检测方法及控制器。The present invention relates to the field of communications technologies, and in particular, to a network loop detection method and controller.
背景技术Background technique
在如图1所示的网络中,包含各级交换机,以及各类服务器。由于服务器配置错误、网络故障或交换机配置错误或运行故障等原因,会导致网络出现环路(英文:loop)。例如,图1示出了四种可能出现环路的场景。In the network shown in Figure 1, it includes all levels of switches, as well as various types of servers. Loops occur in the network due to server configuration errors, network failures, or switch configuration errors or operational failures. For example, Figure 1 shows four scenarios in which loops may occur.
其中,曲线1表示普通物理服务器由于网卡故障或该普通物理服务器的网线自环导致的环路,其中,网线自环是由于网线的接收端和发送端连接导致的;在安装了虚拟机的服务器中,包含虚拟机,以及对虚拟机的报文进行转发的虚拟交换机,曲线2表示由于安装了虚拟机的服务器中虚拟交换机的配置错误导致的环路;曲线4表示虚拟可扩展局域网(英文:Virtual eXtensible Local Area Network,缩写:VXLAN)的服务器中包含的虚拟交换机的配置错误导致的环路;曲线3和曲线5均表示由于交换机的连接或配置错误导致的环路。 Curve 1 indicates the loop caused by the NIC fault or the network cable self-loop of the common physical server. The loopback of the network cable is caused by the connection between the receiving end and the sending end of the network cable. The server is installed with the virtual machine. In the virtual switch that contains the virtual machine and forwards the packets of the virtual machine, curve 2 represents the loop caused by the configuration error of the virtual switch in the server where the virtual machine is installed; curve 4 represents the virtual scalable local area network (English: Virtual eXtensible Local Area Network, abbreviated: VXLAN) The loop caused by the configuration error of the virtual switch included in the server; both curves 3 and 5 indicate the loop caused by the connection or configuration error of the switch.
传统的,网络中的一个交换机通过生成树协议(英文:Spanning Tree Protocol,缩写:STP)或私有协议主动发送广播报文或组播报文进行环路探测,该交换机若探测出以下任一种情况时,则需要破除(break)环路,即执行阻塞端口、关闭端口或使端口退出业务虚拟局域网(英文:Virtual Local Area Network,缩写:VLAN)等操作。Traditionally, a switch in the network actively sends a broadcast packet or a multicast packet to perform loop detection through a spanning tree protocol (Spanning Tree Protocol, STP) or a private protocol. If the switch detects any of the following In this case, you need to break the loop, that is, perform the operation of blocking the port, closing the port, or withdrawing the port from the virtual local area network (English: Virtual Local Area Network, abbreviation: VLAN).
然而,在实际场景中,网络规模巨大,组网复杂,因此,网络中的单个交换机不能准确迅速地判断出网络环路,进而导致网络环路无法处理,造成网络长时间处于广播风暴,影响正常报文的转发。However, in the actual scenario, the network is large and the networking is complex. Therefore, a single switch in the network cannot accurately and quickly determine the network loop, which may result in the network loop being unable to be processed. Forwarding of the message.
发明内容Summary of the invention
本发明提供一种网络环路检测方法及控制器,用以解决现有技术无法准确迅速地判断出网络环路的问题。The invention provides a network loop detection method and a controller, which are used to solve the problem that the prior art cannot accurately and quickly determine the network loop.
本发明提供的具体技术方案如下:The specific technical solutions provided by the present invention are as follows:
第一方面,一种网络环路检测方法,包括: In a first aspect, a network loop detection method includes:
控制器获取所述控制器管理的转发设备的多个媒体访问控制MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;Obtaining, by the controller, a plurality of media access control MAC address mappings of the forwarding device managed by the controller; wherein each MAC address mapping includes a MAC address and a port of the forwarding device;
所述控制器在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。Determining, by the controller, that the MAC addresses of the at least two MAC address mappings are the same, and the ports of the forwarding device that are included in the at least two MAC address mappings are different, determining the forwarding device There is a loop in the network where it is located.
结合第一方面,在第一方面的第一种可能的实现方式中,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;With reference to the first aspect, in a first possible implementation manner of the first aspect, the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least A comparison MAC address mapping includes the same MAC address;
所述获取所述多个MAC地址映射,包括分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。And the obtaining the multiple MAC address mappings includes acquiring the reference MAC address mapping and the address mapping of the at least one comparison MAC respectively.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述获取所述参考MAC地址映射包括:With reference to the first possible implementation of the first aspect, in the second possible implementation manner of the first aspect, the obtaining the reference MAC address mapping includes:
所述控制器根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;或Determining, by the controller, the reference MAC address mapping according to a MAC address of a host that accesses the forwarding device that is obtained from the cloud platform and a port that the forwarding device communicates with the host; or
所述控制器接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射;Receiving, by the controller, a MAC address mapping including a MAC address sent by the forwarding device for the first time as a reference MAC address mapping of the MAC address;
所述获取所述对比MAC地址映射包括:The obtaining the comparison MAC address mapping includes:
所述控制器周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;或者The controller periodically acquires a MAC address mapping of the forwarding device, and obtains a comparison MAC address mapping of each reference MAC address mapping; or
所述控制器接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述控制器将所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。The controller receives a drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between ports of the forwarding device, where the port in the drift MAC address mapping is a drift port; the controller The drift MAC address mapping is mapped as a comparison MAC address of the MAC address.
结合第一方面的第一种或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对MAC地址映射;In conjunction with the first or second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, the at least two MAC address mappings include a reference MAC address mapping and at least one ratio Mapping to MAC addresses;
所述确定所述网络存在环路包括:The determining that the network exists a loop includes:
当在设定时间段内,所述控制器持续获取到所述参考地址映射的比对MAC地址映射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间;或The controller continues to acquire the comparison MAC address mapping of the reference address mapping during the set time period, and determines that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time; or
所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。When the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, it is determined that the network has a loop.
结合第一方面的第一种至第三种可能的实现方式中的任一项,在第一方面的第四种可 能的实现方式中,在所述控制器确定所述网络存在环路后,所述方法还包括:所述控制器根据所述至少一个比对MAC地址映射,确定所述网络中的环路故障端口;In combination with any one of the first to third possible implementations of the first aspect, the fourth In an implementation manner, after the controller determines that the network has a loop, the method further includes: the controller determining, according to the at least one comparison MAC address mapping, a loop fault in the network port;
当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,所述控制器根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, the controller is configured according to attributes of each forwarding device in the network and each forwarding The bandwidth occupied by the device determines a ring network blocking port from the at least two loop failure ports.
第二方面,一种控制器,包括:In a second aspect, a controller includes:
获取单元,用于获取所述控制器管理的转发设备的多个媒体访问控制MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;An acquiring unit, configured to acquire multiple media access control MAC address mappings of the forwarding device managed by the controller; wherein each MAC address mapping includes a MAC address and a port of the forwarding device;
处理单元,用于在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。a processing unit, configured to determine, when determining that the MAC addresses of the at least two MAC address mappings in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different There is a loop on the network where the device is located.
结合第二方面,在第二方面的第一种可能的实现方式中,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;With reference to the second aspect, in a first possible implementation manner of the second aspect, the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least A comparison MAC address mapping includes the same MAC address;
所述获取单元,在获取所述多个MAC地址映射时,用于分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。And acquiring, by the acquiring unit, the address mapping of the reference MAC address mapping and the at least one comparison MAC respectively when acquiring the multiple MAC address mappings.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述获取单元,在获取所述参考MAC地址映射时,用于:With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the acquiring unit, when acquiring the reference MAC address mapping, is used to:
根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;或接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射;Obtaining the reference MAC address mapping according to the MAC address of the host that accesses the forwarding device obtained from the cloud platform and the port that the forwarding device communicates with the host; or receiving the first sending of the forwarding device includes one MAC address mapping of the MAC address as a reference MAC address mapping of the MAC address;
所述获取单元,在获取所述对比MAC地址映射时,用于:The acquiring unit, when acquiring the comparison MAC address mapping, is used to:
周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;或者接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述获取单元将所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。Obtaining a MAC address mapping of the forwarding device periodically, obtaining a comparison MAC address mapping of each reference MAC address mapping, or receiving a drift sent by the forwarding device when determining that a MAC address is drifting between ports of the forwarding device MAC address mapping, the port in the drift MAC address mapping is a post-drift port; the acquiring unit maps the drift MAC address as a comparison MAC address of the MAC address.
结合第二方面的第一种或第二种可能的实现方式,在第二方面的第三种可能的实现方式中,所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对MAC地址映射;With reference to the first or second possible implementation of the second aspect, in a third possible implementation manner of the second aspect, the at least two MAC address mappings include a reference MAC address mapping and at least one ratio Mapping to MAC addresses;
所述处理单元,在确定所述网络存在环路时,用于:The processing unit is configured to: when determining that the network has a loop:
当在设定时间段内,所述获取单元持续获取到所述参考地址映射的比对MAC地址映 射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间;或The acquiring unit continuously acquires the comparison MAC address mapping of the reference address mapping during a set period of time And determining that the network has a loop; wherein the set time period is greater than a time required to complete a specific service; or
所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。When the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, it is determined that the network has a loop.
结合第二方面的第一种至第三种可能的实现方式中的任一项,在第二方面的第四种可能的实现方式中,所述处理单元,还用于:With reference to any one of the first to third possible implementations of the second aspect, in a fourth possible implementation of the second aspect, the processing unit is further configured to:
在所述控制器确定所述网络存在环路后,根据所述至少一个比对MAC地址映射,确定所述网络中的环路故障端口;After the controller determines that the network has a loop, determining, according to the at least one comparison MAC address mapping, a loop fault port in the network;
当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, according to attributes of each forwarding device in the network and occupied by each forwarding device Bandwidth, determining a ring network blocking port from the at least two loop failure ports.
采用本发明提供的网络环路检测方法,控制器获取所述控制器管理的转发设备发送的多个MAC地址映射,其中每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;所述控制器在确定在所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。这样,所述控制器可以根据收集的多个MAC地址映射,准确迅速地确定网络存在环路,进而确定网络环路的位置,最终实现网络环路消除。Using the network loop detection method provided by the present invention, the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a port of the forwarding device; Determining, by the controller, that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining the forwarding device There is a loop in the network where it is located. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
附图说明DRAWINGS
图1为现有技术中网络环路示意图;1 is a schematic diagram of a network loop in the prior art;
图2为本发明实施例提供的一种实现网络环路检测方法的网络架构图;2 is a network architecture diagram of a method for implementing a network loop detection according to an embodiment of the present invention;
图3为本发明实施例提供的一种网络环路检测方法的流程图;FIG. 3 is a flowchart of a network loop detection method according to an embodiment of the present invention;
图4为本发明实施例提供的一种网络环路检测方法的实例示意图;FIG. 4 is a schematic diagram of an example of a network loop detection method according to an embodiment of the present disclosure;
图5为本发明实施例提供的一种控制器结构示意图;FIG. 5 is a schematic structural diagram of a controller according to an embodiment of the present disclosure;
图6为本发明实施例提供的另一种控制器的结构示意图。FIG. 6 is a schematic structural diagram of another controller according to an embodiment of the present invention.
具体实施方式detailed description
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail with reference to the accompanying drawings, in which FIG. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种网络环路检测方法,用以解决现有技术无法准确迅速地判断出 网络环路的问题。其中,本发明所述方法和控制器基于同一发明构思,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The embodiment of the invention provides a network loop detection method, which is used to solve the problem that the prior art cannot accurately and quickly determine The problem of the network loop. The method and the controller of the present invention are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
本发明实施例中,控制器获取所述控制器管理的转发设备发送的多个媒体访问控制(英文:Medium Access Control,缩写:MAC)地址映射,其中每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;所述控制器在确定在所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。这样,所述控制器可以根据收集的多个MAC地址映射,准确迅速地确定网络存在环路,进而确定网络环路的位置,最终实现网络环路消除。In the embodiment of the present invention, the controller acquires multiple media access control (English: Medium Access Control, MAC address) address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a Determining a port of the forwarding device; the controller determining that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the port of the forwarding device included in the at least two MAC address mappings When not, it is determined that there is a loop in the network where the forwarding device is located. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
本发明实施例提供的网络环路检测方法,适用于图2所示的数据链路层(即二层)的网络架构中,如图所示,包含云平台210、控制器220,至少一个转发设备(转发设备231、转发设备232和转发设备233)和终端设备240。其中,The network loop detection method provided by the embodiment of the present invention is applicable to the data link layer (ie, the second layer) network architecture shown in FIG. 2, and includes the cloud platform 210, the controller 220, and at least one forwarding as shown in the figure. Devices (forwarding device 231, forwarding device 232, and forwarding device 233) and terminal device 240. among them,
所述云平台210通过所述控制器220管理整个网络中的所有设备,所述云平台210在网络建立连接后,即可确定网络中的接入每个转发设备的终端设备(如图所示,接入转发设备232和转发设备233的终端设备240)的MAC地址以及该转发设备与该终端设备通信的接口,即MAC地址映射,其中,每个MAC地址映射包括一个MAC地址和一个转发设备的端口;The cloud platform 210 manages all the devices in the entire network by using the controller 220. After the network establishes a connection, the cloud platform 210 can determine the terminal devices in the network that access each forwarding device (as shown in the figure). a MAC address of the access device 232 and the terminal device 240 of the forwarding device 233 and an interface for the forwarding device to communicate with the terminal device, that is, a MAC address mapping, wherein each MAC address mapping includes a MAC address and a forwarding device Port
所述控制器220可以设置在独立的设备,例如服务器上,所述服务器可以是物理服务器或者虚拟服务器,所述控制器220也可以设置在转发设备上,其中,所述转发设备可以是交换机或路由器。所述控制器220可以通过从云平台210获取MAC地址映射,还可以从网络中的所述转发设备231、所述转发设备232和所述转发设备233中获取的MAC地址映射,并通过收集的多个MAC地址映射确定网络中是否存在环路,并进一步确定网络环路的位置,以及执行网络环路消除操作或告警;The controller 220 may be disposed on a separate device, such as a server, and the server may be a physical server or a virtual server, and the controller 220 may also be disposed on the forwarding device, where the forwarding device may be a switch or router. The controller 220 may map the MAC address obtained from the forwarding device 231, the forwarding device 232, and the forwarding device 233 in the network by acquiring the MAC address mapping from the cloud platform 210, and collecting the MAC address. Multiple MAC address mappings determine whether a loop exists in the network, further determine the location of the network loop, and perform network loop cancellation operations or alarms;
所述转发设备231、所述转发设备232和所述转发设备233中任一个转发设备(本实施例中,仅以转发设备231为例进行说明),可以为交换机,或为兼容交换机功能的其它网络设备,如路由器等,本发明对此不做限定。所述转发设备231用于基于开放式流(英文:OpenFlow)协议或者其它协议转发报文;所述转发设备231在报文收发过程中,具有MAC学习能力,例如,转发设备231在端口PORT1收到一个源MAC地址为第一MAC地址的报文,则所述转发设备231可以学习到一个MAC地址映射——(第一MAC地址,转发设备231的PORT1);所述转发设备231还会将学习到的MAC地址映射,上报至所述控制器220; Any one of the forwarding device 231, the forwarding device 232, and the forwarding device 233 (in this embodiment, only the forwarding device 231 is used as an example), which may be a switch, or other compatible switch function. The network device, such as a router, is not limited by the present invention. The forwarding device 231 is configured to forward a message based on an OpenFlow protocol or other protocol. The forwarding device 231 has a MAC learning capability in the packet sending and receiving process. For example, the forwarding device 231 receives the port PORT1. To a packet whose source MAC address is the first MAC address, the forwarding device 231 can learn a MAC address mapping - (the first MAC address, PORT1 of the forwarding device 231); the forwarding device 231 will also The learned MAC address mapping is reported to the controller 220;
所述终端设备240可以是普通的服务器或交换机,或者其他终端,或者兼容服务器和交换机的网络设备,本发明对此不做限定。The terminal device 240 may be a general server or a switch, or another terminal, or a network device compatible with the server and the switch, which is not limited by the present invention.
其中,在上述网络架构中,所述转发设备231、所述转发设备232,以及所述转发设备233还可以直接通过链路层发现协议(英文:Link Layer Discovery Protocol,缩写:LLDP)等方式确定网络设备的端口连接,进而根据确定的端口连接获得MAC地址映射。The forwarding device 231, the forwarding device 232, and the forwarding device 233 may be directly determined by using a link layer discovery protocol (LLDP). The port of the network device is connected, and then the MAC address mapping is obtained according to the determined port connection.
参阅图3所示,本发明实施例提供的一种网络环路检测方法,应用于数据链路层的网络中的控制器中,例如图2所示的网络架构中的控制器220。该方法的处理流程包括:Referring to FIG. 3, a network loop detection method provided by an embodiment of the present invention is applied to a controller in a network of a data link layer, such as the controller 220 in the network architecture shown in FIG. 2. The processing flow of the method includes:
步骤301:控制器获取所述控制器管理的转发设备的多个MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口。Step 301: The controller acquires multiple MAC address mappings of the forwarding device managed by the controller. Each MAC address mapping includes a MAC address and a port of the forwarding device.
其中,任一个MAC地址映射用于表示在传输报文中包含的目的地址或源地址为所述MAC地址映射中包括的MAC地址时,所述传输报文通过所述MAC地址映射中包括的转发设备的端口进行转发。例如,任一个MAC地址映射(第一MAC地址,第一转发设备的PORT1)表示,在传输报文中的源地址为第一MAC地址时,则所述传输报文通过第一转发设备的PORT1作为源端口进行转发;在传输报文中的目的地址为第一MAC地址时,则所述传输报文通过第一转发设备的PORT1作为目的端口进行转发。Any one of the MAC address mappings is used to indicate that the destination address or the source address included in the transport packet is a MAC address included in the MAC address mapping, and the transport packet is forwarded through the MAC address mapping. The port of the device is forwarded. For example, any MAC address mapping (the first MAC address, PORT1 of the first forwarding device) indicates that when the source address in the transport packet is the first MAC address, the transport packet passes through the PORT1 of the first forwarding device. The source port is forwarded. When the destination address in the transport packet is the first MAC address, the transport packet is forwarded through the PORT1 of the first forwarding device as the destination port.
在任一个MAC地址映射中包括的转发设备的一个端口,可以为以下任意一种隧道的端口:多链接透明互联(英文:Transparent Interconnection of Lots of Links,缩写:TRILL)隧道、虚拟专用局域网服务(英文:Virtual Private LAN Service,缩写:VPLS)隧道、VXLAN、无状态传输隧道(英文:Stateless Transport Tunneling,缩写:STT)和网络虚拟化通用路由封装(英文:Network Virtualization Generic Routing Encapsulation,缩写:NVGRE)隧道等。A port of a forwarding device included in any MAC address mapping may be a port of any of the following tunnels: Transparent Interconnection of Lots of Links (TRILL) tunnel, virtual private LAN service (English) : Virtual Private LAN Service, abbreviation: VPLS) Tunnel, VXLAN, Stateless Transport Tunneling (STT) and Network Virtualization Generic Routing Encapsulation (NVGRE) tunnel Wait.
可选的,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;所述参考MAC地址映射为作为比较基础的MAC地址映射;所述比对MAC地址映射为与参考MAC地址映射做比较的MAC地址映射。Optionally, the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address mapping include the same MAC address; the reference The MAC address is mapped to a MAC address mapping as a basis for comparison; the comparison MAC address is mapped to a MAC address mapping that is compared with a reference MAC address mapping.
所述控制器获取所述多个MAC地址映射,包括:分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。The acquiring, by the controller, the multiple MAC address mappings includes: acquiring the reference MAC address mapping and the address mapping of the at least one comparison MAC respectively.
其中,所述控制器获取所述参考MAC地址映射,可以包括以下两种方式:The controller obtains the reference MAC address mapping, which may include the following two methods:
第一种方式:所述控制器根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;The first mode: the controller obtains the reference MAC address mapping according to the MAC address of the host that accesses the forwarding device and the port that the forwarding device communicates with the host.
第二种方式:所述控制器接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射。 The second mode: the controller receives a MAC address mapping including a MAC address sent by the forwarding device for the first time as a reference MAC address mapping of the MAC address.
在第一种方式中,由于在网络建立连接后,所述云平台就可以确定网络中接入各个转发设备的主机的MAC地址以及各个转发设备与主机通信的端口,因此,所述控制器可以通过主动请求或者所述云平台主动下发,获取云平台中的接入转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射。In the first mode, after the network is established, the cloud platform can determine the MAC address of the host that accesses each forwarding device in the network and the port that each forwarding device communicates with the host. Therefore, the controller can The MAC address of the host of the access forwarding device in the cloud platform and the port that the forwarding device communicates with the host are obtained by the active request or the cloud platform, and the reference MAC address mapping is obtained.
在第二种方式中,由于在所述控制器管理的网络中的每个转发设备具有MAC学习的能力,因此,在网络运行过程中,所述网络中的每个转发设备均可以学习到MAC地址映射。例如,第二转发设备的PORT2首次接收到一个源地址为第二MAC地址的传输报文,则所述第二转发设备学习的MAC地址映射为(第二MAC地址,第二转发设备的PORT2)。每个转发设备在首次学习到包含一个MAC地址的MAC地址映射后,向所述控制器上报该MAC地址映射。In the second mode, since each forwarding device in the network managed by the controller has the capability of MAC learning, each forwarding device in the network can learn the MAC during the network operation. Address mapping. For example, the PORT2 of the second forwarding device first receives a transmission message whose source address is the second MAC address, and the MAC address learned by the second forwarding device is mapped to (the second MAC address, PORT2 of the second forwarding device). . Each forwarding device reports the MAC address mapping to the controller after learning the MAC address mapping including the MAC address for the first time.
其中,包含第一MAC地址的参考MAC地址映射为所述控制器首次获取到的包含该第一MAC地址的MAC地址映射,而后续还获取到包含该第一MAC地址的MAC地址映射,则后续获取的MAC地址映射即为所述参考映射的比对MAC地址映射。The reference MAC address including the first MAC address is mapped to the MAC address mapping of the first MAC address that is obtained by the controller for the first time, and the MAC address mapping including the first MAC address is subsequently obtained, and then The obtained MAC address mapping is the comparison MAC address mapping of the reference mapping.
所述控制器获取所述对比MAC地址映射,包括以下两种方式:The controller obtains the comparison MAC address mapping, and includes the following two methods:
第一种方式:所述控制器周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;The first mode: the controller periodically acquires a MAC address mapping of the forwarding device, and obtains a comparison MAC address mapping of each reference MAC address mapping.
第二种方式:所述控制器接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述控制器将所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。其中,所述漂移MAC地址映射为MAC地址发生漂移后所述转发设备学习到的MAC地址映射。The second mode: the controller receives the drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between the ports of the forwarding device, and the port in the drift MAC address mapping is a post-drift port; The controller maps the drift MAC address as a comparison MAC address of the MAC address. The drift MAC address is mapped to a MAC address mapping learned by the forwarding device after the MAC address is drifted.
在第一种方式中,为了保证传输报文的安全性,由于网络中的转发设备会一直处于MAC学习状态,因此,控制器需要按照设定周期对所述网络中的各个转发设备进行轮询,获取每个转发设备学习到的MAC地址映射。In the first mode, in order to ensure the security of the transmitted message, since the forwarding device in the network is always in the MAC learning state, the controller needs to poll each forwarding device in the network according to the set period. Obtain the MAC address mapping learned by each forwarding device.
在第二种方式中,所述网络中的转发设备通过MAC学习,不断对自身保存的MAC地址映射进行更新,因此任意一个转发设备可以确定在本地保存的MAC地址映射中,一个MAC地址对应的所述转发设备的端口发生漂移,此时,所述转发设备可以将包含所述MAC地址和漂移后的所述转发设备的端口作为漂移MAC地址映射,上报给控制器。In the second mode, the forwarding device in the network continuously updates the MAC address mapping saved by itself through MAC learning, so any forwarding device can determine that the MAC address mapping in the local storage corresponds to a MAC address. The port of the forwarding device is flapped. In this case, the forwarding device may map the port including the MAC address and the drifting device to the controller as a drift MAC address.
步骤302:所述控制器在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。Step 302: The controller determines that the MAC addresses mapped by the at least two MAC addresses in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different. There is a loop on the network where the forwarding device is located.
其中,所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对 MAC地址映射;此时在步骤302中,所述所述控制器确定所述网络存在环路,包括以下几种触发条件:The at least two MAC address mappings include a reference MAC address mapping and at least one comparison. MAC address mapping; in this case, in step 302, the controller determines that the network has a loop, including the following trigger conditions:
第一种:当在设定时间段内,所述控制器持续获取到所述参考地址映射的比对MAC地址映射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间,所述设定时间段可以根据实际场景具体设定,例如取值为10秒、20秒。The first type: the controller continuously obtains the comparison MAC address mapping of the reference address mapping during the set time period, and determines that the network has a loop; wherein the set time period is greater than the completion specific The time required for the service, the set time period can be specifically set according to the actual scenario, for example, the value is 10 seconds, 20 seconds.
第二种:所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。The second type: when the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, determining that the network has a loop.
在第一种触发条件中,在网络处理某些特定业务时,一个MAC地址在转发设备的端口间漂移是正常的,例如,在主备链路传输机制下,在终端设备在进行主备链路转换,导致网络拓扑变化,或者终端设备为安装虚拟机的服务器或VXLAN的服务器,且虚拟机发生漂移,这时,短时间内出现少量的MAC地址漂移是正常的,因此,所述控制器在确定所述MAC地址长时间(在大于完成特定业务所需要的时间的设定时间段内)且持续性的处于MAC地址漂移或振荡时,才能确定所述网络存在环路,所述控制器可以通过所述设定时间段,避免了在网络处理一些特定业务时,由于少量MAC地址漂移判断网络存在环路,降低网络环路误判的概率。In the first trigger condition, when a certain service is processed by the network, it is normal for a MAC address to drift between the ports of the forwarding device. For example, under the active/standby link transmission mechanism, the terminal device is in the active/standby chain. If the path is changed, the network topology changes, or the terminal device is a server that installs a virtual machine or a server of a VXLAN, and the virtual machine drifts. In this case, a small amount of MAC address drift occurs normally in a short period of time. Therefore, the controller is normal. Determining that the network has a loop when determining that the MAC address is long (in a set period of time greater than the time required to complete a particular service) and the MAC address is drifting or oscillating, the controller The set time period can be used to prevent the network from having a loop due to a small number of MAC address flapping when the network processes some specific services, thereby reducing the probability of network loop misjudgment.
在第二种触发条件中,一个参考MAC地址映射的比对MAC地址映射数目可以体现改参考MAC地址映射中的MAC地址发生漂移的次数,因此,在一个MAC地址发送多次漂移后,可以确定所述网络存在环路。其中,所述设定阈值可以根据实际场景进行设置,本发明对此不做限定。In the second triggering condition, the number of comparison MAC address mappings of a reference MAC address mapping may reflect the number of times the MAC address in the reference MAC address mapping is drifted. Therefore, after a MAC address is transmitted multiple times, it may be determined. There is a loop in the network. The setting threshold may be set according to an actual scenario, which is not limited by the present invention.
所述控制器在确定网络存在环路后,则根据可以预设的下发策略,进行网络环路消除操作、告警,或者记录日志并定期发送提醒消息等,其中,网络环路消除操作包括:网络关闭端口、退出VLAN等,发送提醒消息包括发送短信或者邮件等。After determining that the network has a loop, the controller performs a network loop elimination operation, an alarm, or records a log and periodically sends an alert message according to a preset delivery policy, where the network loop elimination operation includes: The network closes the port, exits the VLAN, etc., and sends an alert message, including sending a text message or an email.
可选的,在执行步骤302后,还包括:Optionally, after performing step 302, the method further includes:
所述控制器根据所述至少一个比对MAC地址映射,确定所述网络中的环路故障端口;Determining, by the controller, a loop fault port in the network according to the at least one comparison MAC address mapping;
当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,所述控制器根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, the controller is configured according to attributes of each forwarding device in the network and each forwarding The bandwidth occupied by the device determines a ring network blocking port from the at least two loop failure ports.
通过上述方法,所述控制器可以根据比对MAC地址映射中包含的转发设备的端口,确定所述网络中的环路故障端口,并在包含多个环路故障端口时,采用传统技术,在多个环路故障端口中,确定环网阻塞端口,从而实现网络环路消除。Through the above method, the controller may determine a loop fault port in the network according to a port of the forwarding device included in the comparison MAC address mapping, and adopt a conventional technology when the multiple loop fault ports are included. Among the multiple loop fault ports, the loop network blocked port is determined, thereby achieving network loop elimination.
本发明实施例提供的网络环路检测方法可以使用多种类型的网络,例如单机网络、集 群网络,以及各种规模巨大、组网复杂的网络等。其中,该网络中的网络连接可以是通过物理实体连接,或者通过无线连接,对此本发明不做限定。同时,该网络的类型可以为现有的各种网络,例如VLAN、QinQ、VPLS、TRILL、VXLAN、NVGRE、STT等网络。The network loop detection method provided by the embodiment of the present invention can use multiple types of networks, such as a single network, a set. Group networks, as well as networks of various sizes and complex networks. The network connection in the network may be connected through a physical entity or through a wireless connection, which is not limited by the present invention. At the same time, the type of the network may be existing networks, such as VLAN, QinQ, VPLS, TRILL, VXLAN, NVGRE, STT, and the like.
采用本发明上述实施例中的网络环路检测方法,控制器获取所述控制器管理的转发设备发送的多个MAC地址映射,其中每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;所述控制器在确定在所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路这样,所述控制器可以根据收集的多个MAC地址映射,准确迅速地确定网络存在环路,进而确定网络环路的位置,最终实现网络环路消除。According to the network loop detection method in the foregoing embodiment of the present invention, the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and one of the forwarding devices. a port; the controller determines that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining The network in which the forwarding device is located has a loop. In this manner, the controller can accurately and quickly determine a loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally eliminating the network loop.
在如图4所示的网络拓扑连接示例中,所述控制器可以通过上述实施例提供的网络环路检测方法,确定网络是否存在环路。如图所示,其中,每个转发设备/终端设备通过自身的一个端口与另外一个转发设备/终端设备的一个端口互联,例如,转发设备A的PORT1与终端设备E的PORT12互联;转发设备B的PORT5与终端设备F的PORT15互联……In the example of the network topology connection shown in FIG. 4, the controller may determine whether the network has a loop through the network loop detection method provided in the foregoing embodiment. As shown in the figure, each forwarding device/terminal device is interconnected with one port of another forwarding device/terminal device through one port of its own, for example, PORT1 of forwarding device A is interconnected with PORT 12 of terminal device E; forwarding device B PORT5 is interconnected with PORT15 of terminal device F...
例1,终端设备E的PORT12发送以太网数据报文,终端设备F的PORT14发送以太网数据报文,转发设备A能够分别在PORT1和PORT2上学习以太网数据报文的源MAC地址,并可以根据等价多路径(英文:Equal-Cost Multipath Routing,缩写:ECMP)通过以太网数据报文的目的MAC地址确定转发设备C或转发设备D,根据确定的转发设备C或转发设备D对以太网数据报文进行转发,然而,网络中可能出现以下网络环路:Example 1, the PORT 12 of the terminal device E sends an Ethernet data packet, and the PORT 14 of the terminal device F transmits an Ethernet data packet, and the forwarding device A can learn the source MAC address of the Ethernet data packet on PORT1 and PORT2, respectively, and can Determine the forwarding device C or the forwarding device D according to the destination MAC address of the Ethernet data packet according to the equal-cost multipath routing (English: Equal-Cost Multipath Routing, ECMP), and determine the forwarding device C or the forwarding device D to the Ethernet. Data packets are forwarded. However, the following network loops may appear in the network:
终端设备E的PORT12存在自环,即终端设备E通过PORT12转发一个以太网数据报文后,还会通过PORT12接收该以太网数据报文;The PORT 12 of the terminal device E has a self-loop, that is, after the terminal device E forwards an Ethernet data packet through the PORT 12, it also receives the Ethernet data packet through the PORT 12.
终端设备E与转发设备A之间的多路链路因配置错误或基于链路汇聚控制协议(英文:Link Aggregation Control Protocol,缩写:LACP)的端口聚合协商失败,导致网络存在环路;The multi-path link between the terminal device E and the forwarding device A fails to be negotiated or the port aggregation control protocol (English: Link Aggregation Control Protocol, abbreviated as LACP) fails.
终端设备E与终端设备F之间存在互联的链路,且与转发设备A构成网络环路,如图中曲线1所示的网络环路。There is an interconnected link between the terminal device E and the terminal device F, and a network loop is formed with the forwarding device A, as shown in the network loop shown in FIG.
因此,所述控制器在转发设备A学习并上报的多个MAC地址映射,确定满足以下条件时,可以确定出现上述三种中任一种网络环路:Therefore, the controller may determine that any one of the foregoing three types of network loops occurs when the plurality of MAC address mappings learned and reported by the forwarding device A are determined to meet the following conditions:
第一种:转发设备A在PORT1上学习的MAC地址发生多次变化,即转发设备A上报的包含PORT1的多个MAC地址映射中,包含的MAC地址发生多次变化;The first type: the MAC address learned by the forwarding device A on the PORT1 changes multiple times, that is, the MAC address included in the multiple MAC address mappings of the PORT1 reported by the forwarding device A changes multiple times;
第二种:转发设备A上报的包含一MAC地址的多个MAC地址映射中,包含的转发设备A的端口频繁在PORT1和PORT2之间漂移。The second type: the port of the forwarding device A included in the multiple MAC address mappings that include a MAC address reported by the forwarding device A frequently drifts between PORT1 and PORT2.
例2,终端设备F的PORT14和PORT15发送以太网数据报文,在转发设备A的PORT2 和转发设备B的PORT5均能够学习到该以太网数据报文的源MAC地址,并通过该以太网数据报文的目的MAC地址确定转发设备C或转发设备D,根据确定的转发设备C或转发设备D对该以太网数据报文进行转发,然而,网络中可能出现以下网络环路:Example 2, PORT14 and PORT15 of the terminal device F send Ethernet data packets, and PORT2 of the forwarding device A And the PORT5 of the forwarding device B can learn the source MAC address of the Ethernet data packet, and determine the forwarding device C or the forwarding device D by using the destination MAC address of the Ethernet data packet, according to the determined forwarding device C or forwarding. Device D forwards the Ethernet data packet. However, the following network loops may appear in the network:
终端设备F的PORT14和PORT15与转发设备A、转发设备B以及转发设备C构成网络环路,如图中曲线2所示的网络环路,类似的,终端设备F的PORT14和PORT15与转发设备A、转发设备B以及转发设备D构成网络环路。The PORT 14 and PORT 15 of the terminal device F form a network loop with the forwarding device A, the forwarding device B, and the forwarding device C, as shown in the network loop shown in FIG. 2, similarly, the PORT 14 and PORT 15 of the terminal device F and the forwarding device A The forwarding device B and the forwarding device D form a network loop.
因此,所述控制器在各个转发设备上报的多个MAC地址映射中,确定满足以下条件时,可以确定出现上述网络环路:Therefore, the controller may determine that the network loop occurs when the following conditions are met in the multiple MAC address mappings reported by the forwarding devices:
在包含一个MAC地址的多个MAC地址映射中,所包含的转发设备的端口,在不同的转发设备的端口间多次漂移。In a plurality of MAC address mappings including one MAC address, the ports of the forwarding device included are repeatedly moved between ports of different forwarding devices.
例3,转发设备A通过PORT3和PORT4发送给转发设备C和转发设备D的以太网数据报文,由于转发设备C或转发设备D故障,导致转发设备A可以接收到转发设备A发送的所述以太网数据报文。因此,网络中可能出现以下网络环路:Example 3, the forwarding device A sends the Ethernet data packet to the forwarding device C and the forwarding device D through the PORT3 and the PORT4. The forwarding device A can receive the forwarding information sent by the forwarding device A because the forwarding device C or the forwarding device D is faulty. Ethernet datagram. Therefore, the following network loops may appear in the network:
转发设备C或转发设备D故障,导致转发设备A的PORT3和PORT4与转发设备C和转发设备D构成网络环路,如图中曲线3所示的网络环路。The forwarding device C or the forwarding device D is faulty, causing the PORT3 and PORT4 of the forwarding device A to form a network loop with the forwarding device C and the forwarding device D, as shown in the network loop shown in curve 3.
因此,所述控制器在各个转发设备上报的多个MAC地址映射中,确定满足以下条件时,可以确定出现上述网络环路:Therefore, the controller may determine that the network loop occurs when the following conditions are met in the multiple MAC address mappings reported by the forwarding devices:
在转发设备A上报的MAC地址映射中,包含一个MAC地址的多个MAC地址映射所包含的转发设备的端口,频繁在PORT3和PORT1(或PORT2)之间漂移。In the MAC address mapping reported by the forwarding device A, the port of the forwarding device included in the multiple MAC address mappings including one MAC address frequently drifts between PORT3 and PORT1 (or PORT2).
其中,PORT1和PORT2为转发设备A的接入侧端口,PORT3、PORT4为转发设备A的网络侧端口。上述条件还可以表示为,转发设备A上报的包含一个MAC地址的MAC地址映射,所包含的转发设备的端口频繁在网络侧端口和接入侧端口漂移。PORT1 and PORT2 are the access side ports of the forwarding device A, and PORT3 and PORT4 are the network side ports of the forwarding device A. The above condition can also be expressed as a MAC address mapping of a MAC address reported by the forwarding device A, and the ports of the forwarding device included frequently drift on the network side port and the access side port.
在例2中的网络环路由于涉及到转发设备A和转发设备B,因此,采用传统的单个转发设备无法判断出网络环路,更无法确定网络中存在环路的位置,因此采用本发明实施例提供网络环路检测方法,即可通过各个转发设备的MAC地址映射,确定网络存在环路,进而确定网络环路的位置。The network loop in the example 2 is related to the forwarding device A and the forwarding device B. Therefore, the traditional single forwarding device cannot determine the network loop, and the location of the loop in the network cannot be determined. Therefore, the implementation of the present invention is adopted. For example, the network loop detection method is provided, and the MAC address mapping of each forwarding device can be used to determine that the network has a loop, thereby determining the location of the network loop.
在例3中的网络环路中,转发设备A可以确定学习到的MAC地址在网络侧端口和接入侧端口漂移,即转发设备A虽然可以通过传统的方法确定发生了网络环路,并对转发设备A自身进行网络环路消除,然而,由于网络环路的原因并不是由于转发设备A导致的,转发设备A单方面执行网络环路消除会导致进一步网络故障,因此,采用本发明实施例提供网络环路检测方法,即可通过各个转发设备的MAC地址映射,确定网络存在环路,进而 确定网络环路的位置。In the network loop in the example 3, the forwarding device A can determine that the learned MAC address is drifting on the network side port and the access side port, that is, the forwarding device A can determine that a network loop occurs by a conventional method, and The forwarding device A performs the network loop elimination itself. However, because the network loop is not caused by the forwarding device A, the unilateral execution of the network loop elimination by the forwarding device A may cause further network failure. Therefore, the embodiment of the present invention is adopted. Providing a network loop detection method, which can determine a loop of the network through MAC address mapping of each forwarding device, and further Determine the location of the network loop.
基于以上实施例,本发明还提供了一种控制器,参阅图5所示,该控制器500包括:获取单元501和处理单元502,其中,Based on the above embodiment, the present invention further provides a controller. Referring to FIG. 5, the controller 500 includes: an obtaining unit 501 and a processing unit 502, where
获取单元501,用于获取所述控制器管理的转发设备的多个MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;The obtaining unit 501 is configured to acquire multiple MAC address mappings of the forwarding device managed by the controller, where each MAC address mapping includes one MAC address and one port of the forwarding device;
处理单元502,用于在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。The processing unit 502 is configured to determine, when determining that the MAC addresses of the at least two MAC address mappings in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different There is a loop on the network where the forwarding device is located.
可选的,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;Optionally, the multiple MAC address mapping includes a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address mapping include the same MAC address;
所述获取单元501,在获取所述多个MAC地址映射时,用于分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。The acquiring unit 501 is configured to acquire the address mapping of the reference MAC address mapping and the at least one comparison MAC respectively when acquiring the multiple MAC address mappings.
可选的,所述获取单元501,在获取所述参考MAC地址映射时,用于:Optionally, the acquiring unit 501 is configured to: when acquiring the reference MAC address mapping:
根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;或接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射;Obtaining the reference MAC address mapping according to the MAC address of the host that accesses the forwarding device obtained from the cloud platform and the port that the forwarding device communicates with the host; or receiving the first sending of the forwarding device includes one MAC address mapping of the MAC address as a reference MAC address mapping of the MAC address;
所述获取单元501,在获取所述对比MAC地址映射时,用于:The obtaining unit 501 is configured to: when acquiring the comparison MAC address mapping:
周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;或者接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述获取单元501将所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。Obtaining a MAC address mapping of the forwarding device periodically, obtaining a comparison MAC address mapping of each reference MAC address mapping, or receiving a drift sent by the forwarding device when determining that a MAC address is drifting between ports of the forwarding device MAC address mapping, the port in the drift MAC address mapping is a post-drift port; the obtaining unit 501 maps the drift MAC address mapping as a comparison MAC address of the MAC address.
可选的,所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对MAC地址映射;Optionally, the at least two MAC address mappings include a reference MAC address mapping and at least one comparison MAC address mapping.
所述处理单元502,在确定所述网络存在环路时,用于:The processing unit 502 is configured to: when determining that the network has a loop;
当在设定时间段内,所述获取单元501持续获取到所述参考地址映射的比对MAC地址映射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间;或When the acquiring unit 501 continues to acquire the comparison MAC address mapping of the reference address mapping, it is determined that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time; or
所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。When the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, it is determined that the network has a loop.
可选的,所述处理单元502,还用于:Optionally, the processing unit 502 is further configured to:
在所述控制器确定所述网络存在环路后,根据所述至少一个比对MAC地址映射,确定 所述网络中的环路故障端口;After the controller determines that the network has a loop, determining, according to the at least one comparison MAC address mapping, a loop failure port in the network;
当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, according to attributes of each forwarding device in the network and occupied by each forwarding device Bandwidth, determining a ring network blocking port from the at least two loop failure ports.
采用本发明实施例提供的控制器,获取所述控制器管理的转发设备发送的多个MAC地址映射,其中每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;所述控制器在确定在所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。这样,所述控制器可以根据收集的多个MAC地址映射,准确迅速地确定网络存在环路,进而确定网络环路的位置,最终实现网络环路消除。The controller provided by the embodiment of the present invention acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and a port of the forwarding device; the controller Determining, when the MAC addresses of the at least two MAC address mappings in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, determining the network where the forwarding device is located There is a loop. In this way, the controller can accurately and quickly determine the loop existing in the network according to the collected multiple MAC address mappings, thereby determining the location of the network loop, and finally implementing network loop elimination.
需要说明的是,本发明实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner. The functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文:read-only memory,简称:ROM)、随机存取存储器(英文:random access memory,简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (English: read-only memory, abbreviated as: ROM), a random access memory (English: random access memory, abbreviated as: RAM), a magnetic disk or an optical disk, and the like. A variety of media that can store program code.
基于以上实施例,本发明还提供了一种控制器,参阅图6所示,该控制器600包括:收发器601、处理器602、总线603以及存储器604,其中:Based on the above embodiment, the present invention further provides a controller. Referring to FIG. 6, the controller 600 includes a transceiver 601, a processor 602, a bus 603, and a memory 604, where:
收发器601、处理器602以及存储器604通过总线603相互连接;总线603可以是外设部件互连(英文:Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(英文:Extended Industry Standard Architecture,简称EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The transceiver 601, the processor 602, and the memory 604 are connected to each other through a bus 603. The bus 603 may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard architecture (English: Extended Industry Standard Architecture, for short) EISA) bus and so on. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 6, but it does not mean that there is only one bus or one type of bus.
收发器601用于与所述控制器600管理的转发设备,以及云平台进行通信,如从转发设备和云平台获取多个MAC地址映射等。 The transceiver 601 is configured to communicate with the forwarding device managed by the controller 600, and the cloud platform, such as acquiring multiple MAC address mappings from the forwarding device and the cloud platform.
该控制器600还包括存储器604,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括计算机操作指令。存储器604可能包含RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器602执行存储器604所存放的应用程序,实现如上网络环路检测方法。The controller 600 also includes a memory 604 for storing programs and the like. In particular, the program can include program code, the program code including computer operating instructions. Memory 604 may include RAM and may also include non-volatile memory, such as at least one disk storage. The processor 602 executes an application stored in the memory 604 to implement the above network loop detection method.
本发明实施例提供的网络环路检测方法及控制器,控制器获取所述控制器管理的转发设备发送的多个MAC地址映射,其中每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;所述控制器在确定在所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路这样,所述控制器可以根据收集的多个MAC地址映射,准确迅速地确定网络存在环路,进而确定网络环路的位置,最终实现网络环路消除。The network loop detection method and controller provided by the embodiment of the present invention, the controller acquires multiple MAC address mappings sent by the forwarding device managed by the controller, where each MAC address mapping includes a MAC address and the forwarding device a port; the controller determines that the MAC addresses mapped by the at least two MAC addresses in the plurality of MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different, The network in which the forwarding device is located has a loop. The controller can accurately and quickly determine the loop existing on the network according to the collected multiple MAC address mappings, and then determine the location of the network loop, and finally implement network loop elimination.
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the present invention without departing from the scope of the embodiments of the present invention. Thus, it is intended that the present invention cover the modifications and modifications of the embodiments of the invention.

Claims (10)

  1. 一种网络环路检测方法,其特征在于,包括:A network loop detection method, comprising:
    控制器获取所述控制器管理的转发设备的多个媒体访问控制MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;Obtaining, by the controller, a plurality of media access control MAC address mappings of the forwarding device managed by the controller; wherein each MAC address mapping includes a MAC address and a port of the forwarding device;
    所述控制器在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。Determining, by the controller, that the MAC addresses of the at least two MAC address mappings are the same, and the ports of the forwarding device that are included in the at least two MAC address mappings are different, determining the forwarding device There is a loop in the network where it is located.
  2. 如权利要求1所述的方法,其特征在于,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;The method of claim 1, wherein the plurality of MAC address mappings comprise a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address mapping Including the same MAC address;
    所述获取所述多个MAC地址映射,包括分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。And the obtaining the multiple MAC address mappings includes acquiring the reference MAC address mapping and the address mapping of the at least one comparison MAC respectively.
  3. 根据权利要求2所述的方法,其特征在于,The method of claim 2 wherein:
    所述获取所述参考MAC地址映射包括:The obtaining the reference MAC address mapping includes:
    所述控制器根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;或Determining, by the controller, the reference MAC address mapping according to a MAC address of a host that accesses the forwarding device that is obtained from the cloud platform and a port that the forwarding device communicates with the host; or
    所述控制器接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射;Receiving, by the controller, a MAC address mapping including a MAC address sent by the forwarding device for the first time as a reference MAC address mapping of the MAC address;
    所述获取所述对比MAC地址映射包括:The obtaining the comparison MAC address mapping includes:
    所述控制器周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;或者The controller periodically acquires a MAC address mapping of the forwarding device, and obtains a comparison MAC address mapping of each reference MAC address mapping; or
    所述控制器接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述控制器将所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。The controller receives a drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between ports of the forwarding device, where the port in the drift MAC address mapping is a drift port; the controller The drift MAC address mapping is mapped as a comparison MAC address of the MAC address.
  4. 如权利要求2或3所述的方法,其特征在于,A method according to claim 2 or 3, wherein
    所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对MAC地址映射;The at least two MAC address mappings include a reference MAC address mapping and at least one comparison MAC address mapping;
    所述确定所述网络存在环路包括:The determining that the network exists a loop includes:
    当在设定时间段内,所述控制器持续获取到所述参考地址映射的比对MAC地址映射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间; 或The controller continues to acquire the comparison MAC address mapping of the reference address mapping during the set time period, and determines that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time or
    所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。When the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, it is determined that the network has a loop.
  5. 如权利要求2-4中任一项所述的方法,其特征在于,在所述控制器确定所述网络存在环路后,所述方法还包括:所述控制器根据所述至少一个比对MAC地址映射,确定所述网络中的环路故障端口;The method according to any one of claims 2 to 4, wherein after the controller determines that the network has a loop, the method further comprises: the controller according to the at least one comparison MAC address mapping, determining a loop failure port in the network;
    当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,所述控制器根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, the controller is configured according to attributes of each forwarding device in the network and each forwarding The bandwidth occupied by the device determines a ring network blocking port from the at least two loop failure ports.
  6. 一种控制器,其特征在于,包括:A controller, comprising:
    获取单元,用于获取所述控制器管理的转发设备的多个媒体访问控制MAC地址映射;其中,每个MAC地址映射包括一个MAC地址和所述转发设备的一个端口;An acquiring unit, configured to acquire multiple media access control MAC address mappings of the forwarding device managed by the controller; wherein each MAC address mapping includes a MAC address and a port of the forwarding device;
    处理单元,用于在确定所述多个MAC地址映射中至少两个MAC地址映射的MAC地址相同,且所述至少两个MAC地址映射包括的所述转发设备的端口不同时,确定所述转发设备所在的网络存在环路。a processing unit, configured to determine, when determining that the MAC addresses of the at least two MAC address mappings in the multiple MAC address mappings are the same, and the ports of the forwarding device included in the at least two MAC address mappings are different There is a loop on the network where the device is located.
  7. 如权利要求6所述的控制器,其特征在于,所述多个MAC地址映射包括参考MAC地址映射和至少一个比对MAC地址映射;所述参考MAC地址映射和所述至少一个比对MAC地址映射包括同一个MAC地址;The controller of claim 6, wherein the plurality of MAC address mappings comprise a reference MAC address mapping and at least one comparison MAC address mapping; the reference MAC address mapping and the at least one comparison MAC address The mapping includes the same MAC address;
    所述获取单元,在获取所述多个MAC地址映射时,用于分别获取所述参考MAC地址映射和所述至少一个比对MAC的地址映射。And acquiring, by the acquiring unit, the address mapping of the reference MAC address mapping and the at least one comparison MAC respectively when acquiring the multiple MAC address mappings.
  8. 根据权利要求7所述的控制器,其特征在于,The controller of claim 7 wherein:
    所述获取单元,在获取所述参考MAC地址映射时,用于:The acquiring unit, when acquiring the reference MAC address mapping, is used to:
    根据从云平台获取到的接入所述转发设备的主机的MAC地址以及所述转发设备与所述主机通信的端口,得到所述参考MAC地址映射;或接收所述转发设备首次发送的包括一个MAC地址的MAC地址映射作为所述MAC地址的参考MAC地址映射;Obtaining the reference MAC address mapping according to the MAC address of the host that accesses the forwarding device obtained from the cloud platform and the port that the forwarding device communicates with the host; or receiving the first sending of the forwarding device includes one MAC address mapping of the MAC address as a reference MAC address mapping of the MAC address;
    所述获取单元,在获取所述对比MAC地址映射时,用于:The acquiring unit, when acquiring the comparison MAC address mapping, is used to:
    周期性获取所述转发设备的MAC地址映射,得到每个参考MAC地址映射的比对MAC地址映射;或者Obtaining the MAC address mapping of the forwarding device periodically, and obtaining a comparison MAC address mapping of each reference MAC address mapping; or
    接收所述转发设备在确定一个MAC地址在所述转发设备的端口间漂移时发送的漂移MAC地址映射,所述漂移MAC地址映射中的端口为漂移后端口;所述获取单元将 所述漂移MAC地址映射作为所述MAC地址的比对MAC地址映射。Receiving a drift MAC address mapping sent by the forwarding device when determining that a MAC address is drifted between ports of the forwarding device, where the port in the drift MAC address mapping is a drifting port; the acquiring unit The drift MAC address mapping is mapped as a comparison MAC address of the MAC address.
  9. 如权利要求7或8所述的控制器,其特征在于,A controller according to claim 7 or 8, wherein
    所述至少两个MAC地址映射中包括一个参考MAC地址映射和至少一个比对MAC地址映射;The at least two MAC address mappings include a reference MAC address mapping and at least one comparison MAC address mapping;
    所述处理单元,在确定所述网络存在环路时,用于:The processing unit is configured to: when determining that the network has a loop:
    当在设定时间段内,所述获取单元持续获取到所述参考地址映射的比对MAC地址映射,确定所述网络存在环路;其中,所述设定时间段大于完成特定业务所需要的时间;或When the acquiring unit continues to acquire the comparison MAC address mapping of the reference address mapping, it is determined that the network has a loop; wherein the set time period is greater than required to complete a specific service. Time; or
    所述至少一个比对MAC地址映射包括的比对MAC地址映射数大于设定阈值时,确定所述网络存在环路。When the number of comparison MAC address mappings included in the at least one comparison MAC address mapping is greater than a set threshold, it is determined that the network has a loop.
  10. 如权利要求7-9中任一项所述的控制器,其特征在于,所述处理单元,还用于:The controller according to any one of claims 7 to 9, wherein the processing unit is further configured to:
    在所述控制器确定所述网络存在环路后,根据所述至少一个比对MAC地址映射,确定所述网络中的环路故障端口;After the controller determines that the network has a loop, determining, according to the at least one comparison MAC address mapping, a loop fault port in the network;
    当所述网络中存在至少两个环路故障端口,并且所述至少两个环路故障端口属于不同的转发设备时,根据所述网络中每个转发设备的属性以及每个转发设备所占用的带宽,从所述至少两个环路故障端口中确定环网阻塞端口。 When there are at least two loop failure ports in the network, and the at least two loop failure ports belong to different forwarding devices, according to attributes of each forwarding device in the network and occupied by each forwarding device Bandwidth, determining a ring network blocking port from the at least two loop failure ports.
PCT/CN2016/099348 2015-09-23 2016-09-19 Network loop detection method and controller WO2017050199A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510613030.4 2015-09-23
CN201510613030.4A CN106549821B (en) 2015-09-23 2015-09-23 Network loop detection method and controller

Publications (1)

Publication Number Publication Date
WO2017050199A1 true WO2017050199A1 (en) 2017-03-30

Family

ID=58365133

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/099348 WO2017050199A1 (en) 2015-09-23 2016-09-19 Network loop detection method and controller

Country Status (2)

Country Link
CN (1) CN106549821B (en)
WO (1) WO2017050199A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106941634A (en) * 2017-05-18 2017-07-11 烽火通信科技股份有限公司 The method and system of OLT loopback detections in a kind of GPON systems
CN111092782A (en) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612785A (en) * 2017-10-31 2018-01-19 郑州云海信息技术有限公司 A kind of cloud platform management method and its device
CN109412945A (en) * 2018-11-13 2019-03-01 郑州云海信息技术有限公司 The management method and device of routing iinformation in virtualization system
CN111245700B (en) * 2020-01-16 2022-02-22 新华三信息安全技术有限公司 Loop detection method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102236A (en) * 2007-08-27 2008-01-09 杭州华三通信技术有限公司 Method and device for detecting loop
CN102232279A (en) * 2011-06-17 2011-11-02 华为技术有限公司 Method for detecting loop position in Ethernet, and Ethernet switching device
CN102625986A (en) * 2011-12-09 2012-08-01 华为技术有限公司 Method, device and network equipment for processing loops in two layer network
JP2012227772A (en) * 2011-04-20 2012-11-15 Nippon Telegr & Teleph Corp <Ntt> Frame transfer device and maintenance monitoring system
WO2015127643A1 (en) * 2014-02-28 2015-09-03 Telefonaktiebolaget L M Ericsson (Publ) Method and communication node for learning mac address in a layer-2 communication network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102801575B (en) * 2011-05-27 2015-04-08 华为技术有限公司 Loopback detecting method and device
US9007958B2 (en) * 2011-06-29 2015-04-14 Brocade Communication Systems, Inc. External loop detection for an ethernet fabric switch
CN104144082B (en) * 2013-05-08 2017-10-27 新华三技术有限公司 The method and controller of detection loop in double layer network
CN104184628A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Looped network detection method in network, network equipment and looped network detection system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102236A (en) * 2007-08-27 2008-01-09 杭州华三通信技术有限公司 Method and device for detecting loop
JP2012227772A (en) * 2011-04-20 2012-11-15 Nippon Telegr & Teleph Corp <Ntt> Frame transfer device and maintenance monitoring system
CN102232279A (en) * 2011-06-17 2011-11-02 华为技术有限公司 Method for detecting loop position in Ethernet, and Ethernet switching device
CN102625986A (en) * 2011-12-09 2012-08-01 华为技术有限公司 Method, device and network equipment for processing loops in two layer network
WO2015127643A1 (en) * 2014-02-28 2015-09-03 Telefonaktiebolaget L M Ericsson (Publ) Method and communication node for learning mac address in a layer-2 communication network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106941634A (en) * 2017-05-18 2017-07-11 烽火通信科技股份有限公司 The method and system of OLT loopback detections in a kind of GPON systems
CN111092782A (en) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method
CN111092782B (en) * 2018-10-24 2022-04-05 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method

Also Published As

Publication number Publication date
CN106549821A (en) 2017-03-29
CN106549821B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
US11431554B2 (en) Mechanism for control message redirection for SDN control channel failures
EP3808040B1 (en) Apparatus and method to trace packets in a packet processing pipeline of a software defined networking switch
WO2017050199A1 (en) Network loop detection method and controller
US9680746B2 (en) Source routing with fabric switches in an ethernet fabric network
CN108702326B (en) Method, device and non-transitory machine-readable medium for detecting SDN control plane loops
US8107382B2 (en) Loop detection in a communications network
US9019814B1 (en) Fast failover in multi-homed ethernet virtual private networks
US11115328B2 (en) Efficient troubleshooting in openflow switches
CN112262549B (en) Robust node failure detection mechanism for SDN controller clusters
US7995499B2 (en) Minimizing spanning-tree protocol event processing and flooding in distribution networks
CN110945837B (en) Optimizing service node monitoring in SDN
US10277418B2 (en) Method and device for clearing media access control forwarding entry
US10171302B2 (en) Network configuration health check in virtualized computing environment
US10637764B2 (en) Systems and methods for facilitating transparent service mapping across multiple network transport options
US9219687B2 (en) Path optimization in multi-node virtual switch with orphan ports
EP3586482B1 (en) Mechanism to detect data plane loops in an openflow network
US9231821B2 (en) VLAG PIM link failover using PIM hello message
US20140092725A1 (en) Method and first network node for managing an ethernet network
WO2017219868A1 (en) Arp entry processing method and apparatus
US20210306252A1 (en) Loop avoidance protocol
US20170070473A1 (en) A switching fabric including a virtual switch
US11444804B2 (en) System and method for preventing switch loops in layer-2 networks
EP3701686B1 (en) Optimized datapath troubleshooting

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: 16848080

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: 16848080

Country of ref document: EP

Kind code of ref document: A1