CN106549821A - A kind of network loop detection method and controller - Google Patents

A kind of network loop detection method and controller Download PDF

Info

Publication number
CN106549821A
CN106549821A CN201510613030.4A CN201510613030A CN106549821A CN 106549821 A CN106549821 A CN 106549821A CN 201510613030 A CN201510613030 A CN 201510613030A CN 106549821 A CN106549821 A CN 106549821A
Authority
CN
China
Prior art keywords
mac address
network
address mapping
forwarding unit
loop
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201510613030.4A
Other languages
Chinese (zh)
Other versions
CN106549821B (en
Inventor
鞠文彬
顾勤丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510613030.4A priority Critical patent/CN106549821B/en
Priority to PCT/CN2016/099348 priority patent/WO2017050199A1/en
Publication of CN106549821A publication Critical patent/CN106549821A/en
Application granted granted Critical
Publication of CN106549821B publication Critical patent/CN106549821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

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

Abstract

The invention discloses a kind of network loop detection method and controller, to solve the problems, such as that prior art accurately cannot form a prompt judgement out network loop.Controller obtains multiple MAC Address mappings that the forwarding unit of the controller management sends, and wherein each MAC Address mapping includes a port of a MAC Address and the forwarding unit;The controller is it is determined that the MAC Address of at least two MAC Address mapping is identical in the mapping of the plurality of MAC Address, and the port of the forwarding unit that includes of at least two MAC Address mapping it is different when, determine that the network that the forwarding unit is located has loop.So, the controller accurately can promptly determine that network has loop, and then the position of determination network loop, finally realize that network loop is eliminated according to the multiple MAC Address mappings collected.

Description

A kind of network loop detection method and controller
Technical field
The present invention relates to communication technical field, more particularly to a kind of network loop detection method and controller.
Background technology
In network as shown in Figure 1, comprising switches at different levels, and all kinds of servers.Due to server The reason such as configuration error, network failure or switch configuration error or operation troubles, can cause network ring occur Road (English:loop).For example, Fig. 1 shows four kinds of scenes for being likely to occur loop.
Wherein, curve 1 represents General Physics server due to net card failure or the net of the General Physics server Line loop from caused by ring, wherein, caused by netting twine is to be connected due to the receiving terminal and transmitting terminal of netting twine from ring; In the server of virtual machine is mounted with, comprising virtual machine, and the void forwarded by the message of virtual machine Intend switch, curve 2 is represented is led due to the configuration error for being mounted with virtual switch in the server of virtual machine The loop of cause;Curve 4 represents virtual expansible LAN (English:Virtual eXtensible Local Area Network, abbreviation:Ring caused by the configuration error of the virtual switch included in server VXLAN) Road;Curve 3 and curve 5 represent due to switch connection or configuration error caused by loop.
Traditional, a switch in network is by Spanning-Tree Protocol (English:Spanning Tree Protocol, abbreviation:STP) or proprietary protocol actively sends broadcasting packet or multicast message and carries out loop detection, If the switch detects following any one situation, need to abolish (break) loop, that is, perform obstruction Port, close port make port exit business VLAN (English:Virtual Local Area Network, abbreviation:The operation such as VLAN).
However, in actual scene, network size is huge, networking is complicated, therefore, the single friendship in network Change planes the network loop that accurately can not form a prompt judgement out, and then cause network loop process, cause network Long-time is in broadcast storm, affects the forwarding of normal message.
The content of the invention
The present invention provides a kind of network loop detection method and controller, cannot be accurate to solve prior art The problem of the network loop that forms a prompt judgement out.
The concrete technical scheme that the present invention is provided is as follows:
In a first aspect, a kind of network loop detection method, including:
Controller obtains multiple MAC address of the forwarding unit of the controller management and reflects Penetrate;Wherein, each MAC Address mapping includes an end of a MAC Address and the forwarding unit Mouthful;
The controller is it is determined that at least two MAC Address mapping in the mapping of the plurality of MAC Address MAC Address is identical, and at least two MAC Address maps the port of the forwarding unit for including not Meanwhile, determine that the network that the forwarding unit is located has loop.
With reference in a first aspect, in the first possible implementation of first aspect, the plurality of MAC Address of cache includes comparing MAC Address mapping with reference to MAC Address mapping and at least one;The reference MAC Address maps and described at least one comparison MAC Address mapping includes same MAC Address;
It is described to obtain the plurality of MAC Address mapping, reflect including the reference MAC Address is obtained respectively Penetrate and described at least one address of cache for comparing MAC.
With reference to the first possible implementation of first aspect, in second possible realization of first aspect It is in mode, described to obtain reference MAC Address mapping and include:
MAC Address of the controller according to the main frame of the access forwarding unit got from cloud platform And the forwarding unit and the port of the main-machine communication, obtain the reference MAC Address mapping;Or
The controller receives the MAC ground including a MAC Address that the forwarding unit is sent first Location maps the reference MAC Address mapping as the MAC Address;
It is described obtain it is described contrast MAC Address mapping include:
The controller periodically obtains the MAC Address mapping of the forwarding unit, obtains each reference The comparison MAC Address mapping of MAC Address mapping;Or
The controller receives the forwarding unit it is determined that a MAC Address is at the end of the forwarding unit The drift MAC Address mapping sent when drifting about between mouthful, the port in the drift MAC Address mapping is Drift rear port;The drift MAC Address is mapped the ratio as the MAC Address by the controller MAC Address is mapped.
With reference to the first or second possible implementation of first aspect, the third in first aspect can In the implementation of energy, at least two MAC Address mapping includes that one reflects with reference to MAC Address Penetrate MAC Address mapping is compared with least one;
It is described to determine that the network has loop and includes:
When, in setting time section, the controller persistently gets the comparison of the reference address mapping MAC Address maps, and determines that the network has loop;Wherein, the setting time section is more than completing spy Determine the time required for business;Or
The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes is more than setting During threshold value, determine that the network has loop.
With reference to first aspect the first any one of to the third possible implementation, in first aspect The 4th kind of possible implementation in, after the controller determines that the network has loop, the side Method also includes:The controller compares MAC Address mapping according to described at least one, determines the network In loop fault port;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouthful belonging to different forwarding units, the controller according to the attribute of each forwarding unit in the network with And the bandwidth shared by each forwarding unit, looped network obstruction is determined from least two loop faults port Port.
Second aspect, a kind of controller, including:
Acquiring unit, for obtaining multiple media access controls of the forwarding unit of the controller management MAC Address maps;Wherein, each MAC Address mapping includes that a MAC Address and the forwarding set Standby a port;
Processing unit, for it is determined that at least two MAC Address reflect in the mapping of the plurality of MAC Address The MAC Address penetrated is identical, and the forwarding unit that at least two MAC Address mapping includes When port is different, determine that the network that the forwarding unit is located has loop.
With reference to second aspect, in the first possible implementation of second aspect, the plurality of MAC Address of cache includes comparing MAC Address mapping with reference to MAC Address mapping and at least one;The reference MAC Address maps and described at least one comparison MAC Address mapping includes same MAC Address;
The acquiring unit, when the plurality of MAC Address mapping is obtained, for obtaining the ginseng respectively Examine MAC Address mapping and described at least one and compare the address of cache of MAC.
With reference to the first possible implementation of second aspect, in second possible realization of second aspect In mode, the acquiring unit, when the reference MAC Address mapping is obtained, is used for:
According to the MAC Address of the main frame of the access forwarding unit got from cloud platform and described turn The equipment of sending out and the port of the main-machine communication, obtain the reference MAC Address mapping;Or receive described turning The MAC Address including a MAC Address that the equipment of sending out is sent first is mapped as the MAC Address Reference MAC Address mapping;
The acquiring unit, when the contrast MAC Address mapping is obtained, is used for:
The MAC Address mapping of the forwarding unit is periodically obtained, each is obtained and is reflected with reference to MAC Address The comparison MAC Address mapping penetrated;Or the forwarding unit is received it is determined that a MAC Address is in institute State the drift MAC Address mapping sent during drift between the port of forwarding unit, the drift MAC Address Port in mapping is drift rear port;The acquiring unit maps the drift MAC Address as institute State the comparison MAC Address mapping of MAC Address.
With reference to the first or second possible implementation of second aspect, the third in second aspect can In the implementation of energy, at least two MAC Address mapping includes that one reflects with reference to MAC Address Penetrate MAC Address mapping is compared with least one;
The processing unit, when it is determined that the network has loop, is used for:
When, in setting time section, the acquiring unit persistently gets the comparison of the reference address mapping MAC Address maps, and determines that the network has loop;Wherein, the setting time section is more than completing spy Determine the time required for business;Or
The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes is more than setting During threshold value, determine that the network has loop.
With reference to second aspect the first any one of to the third possible implementation, in second aspect The 4th kind of possible implementation in, the processing unit is additionally operable to:
After the controller determines that the network has loop, MAC ground is compared according to described at least one Location maps, and determines the loop fault port in the network;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouth belongs to different forwarding units, according to the attribute of each forwarding unit in the network and each forwarding Bandwidth shared by equipment, determines looped network port blocked from least two loop faults port.
The network loop detection method provided using the present invention, controller obtain the forwarding of the controller management Multiple MAC Address mappings that equipment sends, wherein each MAC Address mapping include a MAC ground Location and a port of the forwarding unit;The controller is it is determined that map in the plurality of MAC Address In the mapping of at least two MAC Address MAC Address it is identical, and at least two MAC Address reflects Penetrate including the forwarding unit port it is different when, determine that the network that the forwarding unit is located has ring Road.So, the controller accurately can be promptly determined according to the multiple MAC Address mappings collected There is loop, and then the position of determination network loop in network, finally realize that network loop is eliminated.
Description of the drawings
Fig. 1 is network loop schematic diagram in prior art;
Fig. 2 is a kind of network architecture diagram for realizing network loop detection method provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of network loop detection method provided in an embodiment of the present invention;
Fig. 4 is a kind of example schematic of network loop detection method provided in an embodiment of the present invention;
Fig. 5 is a kind of controller architecture schematic diagram provided in an embodiment of the present invention;
Fig. 6 is the structural representation of another kind of controller provided in an embodiment of the present invention.
Specific embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with accompanying drawing to this It is bright to be described in further detail, it is clear that described embodiment is only a part of embodiment of the invention, Rather than the embodiment of whole.Based on the embodiment in the present invention, those of ordinary skill in the art are not doing The all other embodiment obtained under the premise of going out creative work, belongs to the scope of protection of the invention.
The embodiment of the present invention provides a kind of network loop detection method, cannot be accurately fast to solve prior art The problem of network loop is judged fastly.Wherein, the method for the invention and controller are based on same invention structure Think, as the principle of method and device solve problem is similar, therefore the enforcement of apparatus and method mutually can join See, repeat part and repeat no more.
In the embodiment of the present invention, controller obtains multiple media that the forwarding unit of the controller management sends Access control (English:Medium Access Control, abbreviation:MAC) address of cache, wherein each MAC Address mapping includes a port of a MAC Address and the forwarding unit;The controller exists It is determined that the MAC Address of at least two MAC Address mapping is identical in the mapping of the plurality of MAC Address, And the port of the forwarding unit that includes of at least two MAC Address mapping it is different when, it is determined that described There is loop in the network that forwarding unit is located.So, the controller can be according to the multiple MAC for collecting Address of cache, accurately promptly determines that network has loop, and then the position of determination network loop, final real Existing network loop is eliminated.
Network loop detection method provided in an embodiment of the present invention, it is adaptable to which the data link layer shown in Fig. 2 is (i.e. Two layers) the network architecture in, as illustrated, include cloud platform 210, controller 220, at least one turn Send out equipment (forwarding unit 231, forwarding unit 232 and forwarding unit 233) and terminal unit 240.Wherein,
The cloud platform 210 manages all devices in whole network, the cloud by the controller 220 Platform 210 is after network sets up connection, you can determine the terminal unit for accessing each forwarding unit in network The MAC ground of (as illustrated, accessing the terminal unit 240 of forwarding unit 232 and forwarding unit 233) Location and the interface of the forwarding unit and the terminal equipment in communication, i.e. MAC Address mapping, wherein, each MAC Address mapping includes the port of a MAC Address and a forwarding unit;
The controller 220 can be arranged on independent equipment, such as, on server, the server can be with It is physical server or virtual server, the controller 220 can also be arranged on forwarding unit, its In, the forwarding unit can be switch or router.The controller 220 can be by from cloud platform 210 obtain MAC Address mapping, can be with the forwarding unit 231 from network, the forwarding unit 232 and the forwarding unit 233 in obtain MAC Address mapping, and by collect multiple MAC Address of cache is determined with the presence or absence of loop in network, and further determines that the position of network loop, and is performed Network loop eliminates operation or alerts;
Any one forwarding in the forwarding unit 231, the forwarding unit 232 and the forwarding unit 233 Equipment (in the present embodiment, is only illustrated by taking forwarding unit 231 as an example), can is switch, or is Other network equipments of compatible switch function, such as router etc., the present invention are not limited to this.Described turn Sending out equipment 231 is used for based on open stream (English:OpenFlow) agreement or other protocol forward messages; The forwarding unit 231 during packet sending and receiving, with mac learning ability, for example, forwarding unit 231 receive the message that source MAC is the first MAC Address in port PO RT1, then described turn Send out equipment 231 and may learn a MAC Address mapping --- (the first MAC Address, forwarding unit 231 PORT1);The MAC Address for learning can also be mapped by the forwarding unit 231, report to institute State controller 220;
The terminal unit 240 can be common server or switch, or other-end, Huo Zhejian Hold the network equipment of server and switch, the present invention is not limited to this.
Wherein, in the above-mentioned network architecture, the forwarding unit 231, the forwarding unit 232, and The forwarding unit 233 can also directly pass through Link Layer Discovery Protocol (English:Link Layer Discovery Protocol, abbreviation:) etc. LLDP mode determines the port connection of the network equipment, and then according to the end for determining Mouth connection obtains MAC Address mapping.
Refering to shown in Fig. 3, a kind of network loop detection method provided in an embodiment of the present invention is applied to data Controller 220 in controller in the network of link layer, such as in the network architecture shown in Fig. 2.The party The handling process of method includes:
Step 301:Controller obtains multiple MAC Address mappings of the forwarding unit of the controller management; Wherein, each MAC Address mapping includes a port of a MAC Address and the forwarding unit.
Wherein, any one MAC Address is mapped for representing the destination address or source that include in transmitting message When address is the MAC Address that the MAC Address mapping includes, the transmitting message is by described The port of the forwarding unit that MAC Address mapping includes is forwarded.For example, any one MAC Address reflects Penetrate (the first MAC Address, the PORT1 of the first forwarding unit) expression, the source address in transmitting message For the first MAC Address when, then the transmitting message is used as source port by the PORT1 of the first forwarding unit Forwarded;When destination address in transmitting message is the first MAC Address, then the transmitting message is led to The PORT1 for crossing the first forwarding unit is forwarded as destination interface.
The a port of the forwarding unit included in any one MAC Address mapping, can be following any A kind of port in tunnel:Multi-link transparent interconnection (English:Transparent Interconnection of Lots of Links, abbreviation:TRILL) tunnel, Virtual Private LAN Service (English:Virtual Private LAN Service, abbreviation:VPLS) tunnel, VXLAN, stateless transmission tunnel (English:Stateless Transport Tunneling, abbreviation:STT) and network virtualization generic route encapsulation (English:Network Virtualization Generic Routing Encapsulation, abbreviation:NVGRE) tunnel etc..
Optionally, the plurality of MAC Address mapping is included with reference to MAC Address mapping and at least one ratio MAC Address is mapped;The reference MAC Address mapping and described at least one compares MAC Address Mapping includes same MAC Address;The reference MAC Address is mapped as the MAC as comparison basis Address of cache;It is described to compare the MAC that MAC Address is mapped as and compares with reference to MAC Address mapping Address of cache.
The controller obtains the plurality of MAC Address mapping, including:The reference MAC is obtained respectively The address of cache of address of cache and at least one comparison MAC.
Wherein, the controller obtains the reference MAC Address mapping, can include following two modes:
First kind of way:Main frame of the controller according to the access forwarding unit got from cloud platform MAC Address and the forwarding unit and the port of the main-machine communication, obtain the reference MAC Address of cache;
The second way:The controller receive that the forwarding unit sent first including a MAC ground The MAC Address mapping of location is mapped as the reference MAC Address of the MAC Address.
In first kind of way, due to network set up connection after, during the cloud platform is assured that network The MAC Address and each forwarding unit of the main frame of each forwarding unit and the port of main-machine communication are accessed, Therefore, the controller can pass through active request or the cloud platform is actively issued, and obtain in cloud platform Access forwarding unit main frame MAC Address and the end of the forwarding unit and the main-machine communication Mouthful, obtain the reference MAC Address mapping.
In the second way, as each forwarding unit in the network of the controller management has The ability of mac learning, therefore, during the network operation, each forwarding unit in the network is equal May learn MAC Address mapping.For example, the PORT2 of the second forwarding unit receives a source first Address is the transmitting message of the second MAC Address, then the MAC Address of the second forwarding unit study reflects Penetrate as (the second MAC Address, the PORT2 of the second forwarding unit).Each forwarding unit learns first To after the mapping of the MAC Address comprising a MAC Address, to the controller report MAC Address Mapping.
Wherein, the reference MAC Address comprising the first MAC Address is mapped as the controller and obtains first The mapping of the MAC Address comprising first MAC Address arrived, and subsequently also get comprising this first The MAC Address mapping of MAC Address, then the follow-up MAC Address mapping for obtaining is described with reference to mapping Comparison MAC Address mapping.
The controller obtains the contrast MAC Address mapping, including following two modes:
First kind of way:The controller periodically obtains the MAC Address mapping of the forwarding unit, obtains Map to each comparison MAC Address with reference to MAC Address mapping;
The second way:The controller receives the forwarding unit it is determined that a MAC Address is described The drift MAC Address mapping sent when drifting about between the port of forwarding unit, the drift MAC Address are reflected The port hit is drift rear port;The controller is using the drift MAC Address mapping as described The comparison MAC Address mapping of MAC Address.Wherein, the drift MAC Address is mapped as MAC ground The MAC Address mapping that the forwarding unit learns after the generation drift of location.
In first kind of way, in order to ensure the safety of transmitting message, due to the forwarding unit meeting in network Be constantly in mac learning state, therefore, controller need according to setting cycle to the network in it is each Individual forwarding unit is polled, and obtains the MAC Address mapping that each forwarding unit learns.
In the second way, the forwarding unit in the network is constantly protected to itself by mac learning The MAC Address mapping deposited is updated, therefore any one forwarding unit is can determine in local preservation In MAC Address mapping, there is drift in the port of the corresponding forwarding unit of MAC Address, now, The forwarding unit can using comprising the MAC Address and drift after the forwarding unit port as Drift MAC Address mapping, reports controller.
Step 302:The controller it is determined that the plurality of MAC Address mapping at least two MAC The MAC Address of address of cache is identical, and the forwarding that at least two MAC Address mapping includes When the port of equipment is different, determine that the network that the forwarding unit is located has loop.
Wherein, at least two MAC Address mapping includes one with reference to MAC Address mapping and extremely Few one compares MAC Address mapping;Now in step 302, the controller determines the net There is loop, including following several trigger conditions in network:
The first:When, in setting time section, the controller persistently gets the reference address mapping MAC Address mapping is compared, determines that the network has loop;Wherein, the setting time section has been more than Into the time required for specific transactions, the setting time section can be specifically set according to actual scene, for example Value is 10 seconds, 20 seconds.
Second:The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes During more than given threshold, determine that the network has loop.
In the first trigger condition, in some specific transactions of network processes, a MAC Address is turning Between the port of the equipment of sending out, drift is normal, for example, under main/slave link transmission mechanism, is existed in terminal unit Main/slave link conversion is carried out, causes network topology change, or terminal unit is the server for installing virtual machine Or the server of VXLAN, and there is drift in virtual machine, at this moment, occur a small amount of MAC in the short time Address drift be it is normal, therefore, the controller it is determined that the MAC Address long-time (be more than Complete in the setting time section of the time required for specific transactions) and persistence in MAC Address drift about Or during vibration, just can determine that the network has a loop, the controller can by the setting time section, Avoid in some specific transactions of network processes, as the drift of a small amount of MAC Address judges that network has ring Road, reduces the probability of network loop erroneous judgement.
In second trigger condition, a comparison MAC Address mapping number with reference to MAC Address mapping Mesh can embody and change the number of times that drift occurs with reference to the MAC Address in MAC Address mapping, therefore, One MAC Address is sent after repeatedly drifting about, it may be determined that the network has loop.Wherein, it is described to set Determine threshold value to be configured according to actual scene, the present invention does not limit this.
After it is determined that network has loop, then basis can carry out net with default distributing policy to the controller Network loop eliminates operation, alarm, or log and periodically sends reminder message etc., wherein, network rings Road eliminates operation to be included:Network close port, VLAN etc. is exited, sending reminder message includes sending note Or mail etc..
Optionally, after execution step 302, also include:
The controller compares MAC Address mapping according to described at least one, determines the ring in the network Road non-working port;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouthful belonging to different forwarding units, the controller according to the attribute of each forwarding unit in the network with And the bandwidth shared by each forwarding unit, looped network obstruction is determined from least two loop faults port Port.
By said method, the forwarding that the controller can be included in mapping according to MAC Address is compared sets Standby port, determines the loop fault port in the network, and when comprising multiple loop fault ports, Using conventional art, in multiple loop fault ports, looped network port blocked is determined, so as to realize network rings Road eliminates.
Network loop detection method provided in an embodiment of the present invention can use polytype network, for example singly Machine network, cluster network, and the complicated network of various huge, networkings etc..Wherein, in the network Network connection can be connected by physical entity, or by wireless connection, this present invention is not limited It is fixed.Meanwhile, the type of the network can be existing various networks, such as VLAN, QinQ, VPLS, The networks such as TRILL, VXLAN, NVGRE, STT.
Using the network loop detection method in the above embodiment of the present invention, controller obtains the controller pipe Multiple MAC Address mappings that the forwarding unit of reason sends, wherein each MAC Address mapping include one The a port of MAC Address and the forwarding unit;The controller is it is determined that in the plurality of MAC In address of cache, the MAC Address of at least two MAC Address mapping is identical, and at least two MAC When the port of the forwarding unit that address of cache includes is different, determine that the network that the forwarding unit is located is deposited In loop so, the controller can be accurately promptly true according to the multiple MAC Address mappings collected Determine network and there is loop, and then the position of determination network loop, finally realize that network loop is eliminated.
In network topology connection example as shown in Figure 4, the controller can be carried by above-described embodiment For network loop detection method, determine network whether there is loop.As illustrated, wherein, each forwarding Equipment/terminal unit is by a port of itself and a port of another forwarding unit/terminal unit Interconnection, for example, the PORT12 interconnections of the PORT1 and terminal unit E of forwarding unit A;Forwarding unit The PORT15 interconnections ... of the PORT5 and terminal unit F of B
Example 1, the PORT12 of terminal unit E send Ethernet data message, the PORT14 of terminal unit F Ethernet data message is sent, forwarding unit A can learn Ethernet respectively on PORT1 and PORT2 The source MAC of data message, it is possible to according to equal cost multipath (English:Equal-Cost Multipath Routing, abbreviation:ECMP forwarding unit is determined by the target MAC (Media Access Control) address of Ethernet data message) C or forwarding unit D, is carried out to Ethernet data message according to the forwarding unit C or forwarding unit D that determine Forwarding, however, following network loop is likely to occur in network:
The PORT12 of terminal unit E exist from ring, i.e. terminal unit E by PORT12 forwardings one with Too after network data message, also the Ethernet data message can be received by PORT12;
Multichannel link between terminal unit E and forwarding unit A is because of configuration error or is based on link aggregation control Agreement (English processed:Link Aggregation Control Protocol, abbreviation:LACP port trunking) Consult failure, cause network to there is loop;
There is the link of interconnection between terminal unit E and terminal unit F, and net is constituted with forwarding unit A Network loop, the network loop as shown in curve 1 in figure.
Therefore, multiple MAC Address mappings that the controller learns and reports in forwarding unit A, it is determined that When meeting following condition, it may be determined that any one network loop during appearance is above-mentioned three kinds:
The first:The MAC Address that forwarding unit A learns on PORT1 occurs repeatedly to change, that is, turn Send out in the mapping of the multiple MAC Address comprising PORT1 that device A is reported, comprising MAC Address occur Repeatedly change;
Second:In the multiple MAC Address mappings comprising a MAC Address that forwarding unit A is reported, Comprising forwarding unit A port frequently between PORT1 and PORT2 drift about.
Example 2, the PORT14 and PORT15 of terminal unit F send Ethernet data message, set in forwarding The PORT5 of the PORT2 and forwarding unit B of standby A can learn the source to the Ethernet data message MAC Address, and forwarding unit C is determined by the target MAC (Media Access Control) address of the Ethernet data message or is turned Equipment D is sent out, the Ethernet data message is carried out turning according to the forwarding unit C or forwarding unit D that determine Send out, however, following network loop is likely to occur in network:
The PORT14 and PORT15 of terminal unit F and forwarding unit A, forwarding unit B and forwarding set Standby C constitutes network loop, and the network loop as shown in curve 2 in figure is similar, terminal unit F's PORT14 and PORT15 constitutes network loop with forwarding unit A, forwarding unit B and forwarding unit D.
Therefore, the controller is in the multiple MAC Address mapping that each forwarding unit is reported, it is determined that full When being enough to lower condition, it may be determined that above-mentioned network loop occur:
In the mapping of the multiple MAC Address comprising a MAC Address, comprising forwarding unit end Mouthful, repeatedly drift about between the port of different forwarding units.
Example 3, forwarding unit A are sent to forwarding unit C and forwarding unit D by PORT3 and PORT4 Ethernet data message, due to forwarding unit C or forwarding unit D failures, cause the forwarding unit A can To receive the Ethernet data message of forwarding unit A transmissions.Therefore, it is likely to occur in network following Network loop:
Forwarding unit C or forwarding unit D failures, cause the PORT3 and PORT4 of forwarding unit A with Forwarding unit C and forwarding unit D constitutes network loop, the network loop as shown in curve 3 in figure.
Therefore, the controller is in the multiple MAC Address mapping that each forwarding unit is reported, it is determined that full When being enough to lower condition, it may be determined that above-mentioned network loop occur:
In the MAC Address mapping that forwarding unit A is reported, the multiple MAC comprising a MAC Address The port of the forwarding unit included by address of cache, frequently PORT3 and PORT1 (or PORT2) it Between drift about.
Wherein, access side ports of the PORT1 and PORT2 for forwarding unit A, PORT3, PORT4 For the network-side port of forwarding unit A.Above-mentioned condition is also denoted as, the bag that forwarding unit A is reported Containing a MAC Address MAC Address mapping, comprising forwarding unit port frequently in network side Port and access side ports drift.
Network loop in example 2 due to being related to forwarding unit A and forwarding unit B, therefore, using biography The single forwarding unit of system cannot judge network loop, there is the position of loop in cannot more determining network, Therefore network loop detection method is provided using the embodiment of the present invention, you can by each forwarding unit MAC Address maps, and determines that network has loop, and then determines the position of network loop.
In network loop in example 3, forwarding unit A can determine MAC Address that study arrives in network Side ports and access side ports drift, although i.e. forwarding unit A can be determined by traditional method there occurs Network loop, and network loop elimination is carried out to forwarding unit A itself, however, due to the original of network loop Caused by because being not due to forwarding unit A, forwarding unit A unilaterally performs network loop and eliminates and can lead Further network failure is caused, therefore, network loop detection method is provided using the embodiment of the present invention, you can logical The MAC Address mapping of each forwarding unit is crossed, is determined that network has loop, and then is determined network loop Position.
Based on above example, present invention also offers a kind of controller, refering to shown in Fig. 5, the controller 500 include:Acquiring unit 501 and processing unit 502, wherein,
Acquiring unit 501, the multiple MAC Address for obtaining the forwarding unit of the controller management reflect Penetrate;Wherein, each MAC Address mapping includes an end of a MAC Address and the forwarding unit Mouthful;
Processing unit 502, for it is determined that the plurality of MAC Address mapping at least two MAC Address The MAC Address of mapping is identical, and the forwarding unit that at least two MAC Address mapping includes Port it is different when, determine that the network that the forwarding unit is located has loop.
Optionally, the plurality of MAC Address mapping is included with reference to MAC Address mapping and at least one ratio MAC Address is mapped;The reference MAC Address mapping and described at least one compares MAC Address Mapping includes same MAC Address;
The acquiring unit 501, when the plurality of MAC Address mapping is obtained, for obtaining institute respectively State the address of cache that MAC is compared with reference to MAC Address mapping and described at least one.
Optionally, the acquiring unit 501, when the reference MAC Address mapping is obtained, is used for:
According to the MAC Address of the main frame of the access forwarding unit got from cloud platform and described turn The equipment of sending out and the port of the main-machine communication, obtain the reference MAC Address mapping;Or receive described turning The MAC Address including a MAC Address that the equipment of sending out is sent first is mapped as the MAC Address Reference MAC Address mapping;
The acquiring unit 501, when the contrast MAC Address mapping is obtained, is used for:
The MAC Address mapping of the forwarding unit is periodically obtained, each is obtained and is reflected with reference to MAC Address The comparison MAC Address mapping penetrated;Or the forwarding unit is received it is determined that a MAC Address is in institute State the drift MAC Address mapping sent during drift between the port of forwarding unit, the drift MAC Address Port in mapping is drift rear port;The drift MAC Address mapping is made by the acquiring unit 501 Comparison MAC Address for the MAC Address maps.
Optionally, at least two MAC Address mapping include one with reference to MAC Address map with At least one compares MAC Address mapping;
The processing unit 502, when it is determined that the network has loop, is used for:
When, in setting time section, the acquiring unit 501 persistently gets the ratio of the reference address mapping MAC Address is mapped, determines that the network has loop;Wherein, the setting time section is more than and completes Time required for specific transactions;Or
The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes is more than setting During threshold value, determine that the network has loop.
Optionally, the processing unit 502, is additionally operable to:
After the controller determines that the network has loop, MAC ground is compared according to described at least one Location maps, and determines the loop fault port in the network;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouth belongs to different forwarding units, according to the attribute of each forwarding unit in the network and each forwarding Bandwidth shared by equipment, determines looped network port blocked from least two loop faults port.
Using controller provided in an embodiment of the present invention, the forwarding unit transmission of the controller management is obtained Multiple MAC Address mappings, wherein each MAC Address mapping include a MAC Address and described turn The a port of the equipment of sending out;The controller is it is determined that at least two in the mapping of the plurality of MAC Address MAC Address mapping MAC Address it is identical, and at least two MAC Address mapping include it is described When the port of forwarding unit is different, determine that the network that the forwarding unit is located has loop.So, it is described According to the multiple MAC Address mappings collected, controller accurately can promptly determine that network has loop, And then the position of determination network loop, finally realize that network loop is eliminated.
It should be noted that being schematic to the division of unit in the embodiment of the present invention, only one kind is patrolled Collect function to divide, when actually realizing, there can be other dividing mode.Each work(in embodiments herein Can unit can be integrated in a processing unit in, or unit be individually physically present, it is also possible to Two or more units are integrated in a unit.Above-mentioned integrated unit can both adopt the shape of hardware Formula is realized, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized and as independent production marketing using in the form of SFU software functional unit Or when using, can be stored in a computer read/write memory medium.Based on such understanding, this Shen Part that technical scheme please is substantially contributed to prior art in other words or the technical scheme it is complete Portion or part can be embodied in the form of software product, and the computer software product is stored in a storage In medium, use including some instructions so that computer equipment (can be personal computer, server, Or the network equipment etc.) or processor (processor) perform the complete of the application each embodiment methods described Portion or part steps.And aforesaid storage medium includes:USB flash disk, portable hard drive, read only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic Dish or CD etc. are various can be with the medium of store program codes.
Based on above example, present invention also offers a kind of controller, refering to shown in Fig. 6, the controller 600 include:Transceiver 601, processor 602, bus 603 and memorizer 604, wherein:
Transceiver 601, processor 602 and memorizer 604 are connected with each other by bus 603;Bus 603 It can be Peripheral Component Interconnect standard (peripheral component interconnect, abbreviation PCI) bus Or EISA (extended industry standard architecture, abbreviation EISA) bus Deng.The bus can be divided into address bus, data/address bus, controlling bus etc..For ease of representing, Fig. 6 In only represented with a thick line, it is not intended that only one bus or a type of bus.
Transceiver 601 is communicated for the forwarding unit that managed with the controller 600, and cloud platform, Such as multiple MAC Address mappings etc. are obtained from forwarding unit and cloud platform.
The controller 600 also includes memorizer 604, for depositing program etc..Specifically, program can be wrapped Program code is included, the program code includes computer-managed instruction.Memorizer 604 may include random access memory Memorizer (random access memory, RAM), it is also possible to also including nonvolatile memory (non-volatile memory), for example, at least one disk memory.Processor 602 performs memorizer 604 application programs deposited, realize as above network loop detection method.
Network loop detection method provided in an embodiment of the present invention and controller, controller obtain the controller Multiple MAC Address mappings that the forwarding unit of management sends, wherein each MAC Address mapping include one The a port of individual MAC Address and the forwarding unit;The controller is it is determined that in the plurality of MAC In address of cache, the MAC Address of at least two MAC Address mapping is identical, and at least two MAC When the port of the forwarding unit that address of cache includes is different, determine that the network that the forwarding unit is located is deposited In loop so, the controller can be accurately promptly true according to the multiple MAC Address mappings collected Determine network and there is loop, and then the position of determination network loop, finally realize that network loop is eliminated.
, but those skilled in the art once know base although preferred embodiments of the present invention have been described This creative concept, then can make other change and modification to these embodiments.So, appended right will Ask and be intended to be construed to include preferred embodiment and fall into the had altered of the scope of the invention and change.
Obviously, those skilled in the art can carry out various changes and modification and not take off to the embodiment of the present invention From the spirit and scope of the embodiment of the present invention.So, if these modifications of the embodiment of the present invention and modification belong to Within the scope of the claims in the present invention and its equivalent technologies, then the present invention be also intended to comprising these change and Including modification.

Claims (10)

1. a kind of network loop detection method, it is characterised in that include:
Controller obtains multiple MAC address of the forwarding unit of the controller management and reflects Penetrate;Wherein, each MAC Address mapping includes an end of a MAC Address and the forwarding unit Mouthful;
The controller is it is determined that at least two MAC Address mapping in the mapping of the plurality of MAC Address MAC Address is identical, and at least two MAC Address maps the port of the forwarding unit for including not Meanwhile, determine that the network that the forwarding unit is located has loop.
2. the method for claim 1, it is characterised in that the plurality of MAC Address mapping includes MAC Address mapping is compared with reference to MAC Address mapping and at least one;The reference MAC Address reflects Penetrating includes same MAC Address with described at least one comparison MAC Address mapping;
It is described to obtain the plurality of MAC Address mapping, reflect including the reference MAC Address is obtained respectively Penetrate and described at least one address of cache for comparing MAC.
3. method according to claim 2, it is characterised in that
It is described to obtain reference MAC Address mapping and include:
MAC Address of the controller according to the main frame of the access forwarding unit got from cloud platform And the forwarding unit and the port of the main-machine communication, obtain the reference MAC Address mapping;Or
The controller receives the MAC ground including a MAC Address that the forwarding unit is sent first Location maps the reference MAC Address mapping as the MAC Address;
It is described obtain it is described contrast MAC Address mapping include:
The controller periodically obtains the MAC Address mapping of the forwarding unit, obtains each reference The comparison MAC Address mapping of MAC Address mapping;Or
The controller receives the forwarding unit it is determined that a MAC Address is at the end of the forwarding unit The drift MAC Address mapping sent when drifting about between mouthful, the port in the drift MAC Address mapping is Drift rear port;The drift MAC Address is mapped the ratio as the MAC Address by the controller MAC Address is mapped.
4. method as claimed in claim 2 or claim 3, it is characterised in that
At least two MAC Address mapping includes one with reference to MAC Address mapping and at least one Compare MAC Address mapping;
It is described to determine that the network has loop and includes:
When, in setting time section, the controller persistently gets the comparison of the reference address mapping MAC Address maps, and determines that the network has loop;Wherein, the setting time section is more than completing spy Determine the time required for business;Or
The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes is more than setting During threshold value, determine that the network has loop.
5. the method as any one of claim 2-4, it is characterised in that true in the controller After the fixed network has loop, methods described also includes:The controller is compared according to described at least one MAC Address maps, and determines the loop fault port in the network;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouthful belonging to different forwarding units, the controller according to the attribute of each forwarding unit in the network with And the bandwidth shared by each forwarding unit, looped network obstruction is determined from least two loop faults port Port.
6. a kind of controller, it is characterised in that include:
Acquiring unit, for obtaining multiple media access controls of the forwarding unit of the controller management MAC Address maps;Wherein, each MAC Address mapping includes that a MAC Address and the forwarding set Standby a port;
Processing unit, for it is determined that at least two MAC Address reflect in the mapping of the plurality of MAC Address The MAC Address penetrated is identical, and the forwarding unit that at least two MAC Address mapping includes When port is different, determine that the network that the forwarding unit is located has loop.
7. controller as claimed in claim 6, it is characterised in that the plurality of MAC Address mapping bag Include MAC Address mapping is compared with reference to MAC Address mapping and at least one;The reference MAC Address Mapping and described at least one comparison MAC Address mapping include same MAC Address;
The acquiring unit, when the plurality of MAC Address mapping is obtained, for obtaining the ginseng respectively Examine MAC Address mapping and described at least one and compare the address of cache of MAC.
8. controller according to claim 7, it is characterised in that
The acquiring unit, when the reference MAC Address mapping is obtained, is used for:
According to the MAC Address of the main frame of the access forwarding unit got from cloud platform and described turn The equipment of sending out and the port of the main-machine communication, obtain the reference MAC Address mapping;Or receive described turning The MAC Address including a MAC Address that the equipment of sending out is sent first is mapped as the MAC Address Reference MAC Address mapping;
The acquiring unit, when the contrast MAC Address mapping is obtained, is used for:
The MAC Address mapping of the forwarding unit is periodically obtained, each is obtained and is reflected with reference to MAC Address The comparison MAC Address mapping penetrated;Or
The forwarding unit is received when it is determined that a MAC Address drifts about between the port of the forwarding unit The drift MAC Address mapping of transmission, the port in the drift MAC Address mapping are drift rear port; The drift MAC Address is mapped the acquiring unit comparison MAC ground as the MAC Address Location maps.
9. controller as claimed in claim 7 or 8, it is characterised in that
At least two MAC Address mapping includes one with reference to MAC Address mapping and at least one Compare MAC Address mapping;
The processing unit, when it is determined that the network has loop, is used for:
When, in setting time section, the acquiring unit persistently gets the comparison of the reference address mapping MAC Address maps, and determines that the network has loop;Wherein, the setting time section is more than completing spy Determine the time required for business;Or
The comparison MAC Address mapping number that at least one comparison MAC Address mapping includes is more than setting During threshold value, determine that the network has loop.
10. controller as claimed in any one of claims 7-9, it is characterised in that the processing unit, It is additionally operable to:
After the controller determines that the network has loop, MAC ground is compared according to described at least one Location maps, and determines the loop fault port in the network;
When there is at least two loop fault ports, and at least two loop faults end in the network When mouth belongs to different forwarding units, according to the attribute of each forwarding unit in the network and each forwarding Bandwidth shared by equipment, determines looped network port blocked from least two loop faults port.
CN201510613030.4A 2015-09-23 2015-09-23 Network loop detection method and controller Active CN106549821B (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN106549821A true CN106549821A (en) 2017-03-29
CN106549821B CN106549821B (en) 2021-01-01

Family

ID=58365133

Family Applications (1)

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

Country Status (2)

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

Cited By (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
CN111245700A (en) * 2020-01-16 2020-06-05 新华三信息安全技术有限公司 Loop detection method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106941634B (en) * 2017-05-18 2020-07-14 烽火通信科技股份有限公司 O L T loopback detection method and system in GPON system
CN111092782B (en) * 2018-10-24 2022-04-05 迈普通信技术股份有限公司 Tested communication equipment, communication equipment port data forwarding test system and method

Citations (7)

* 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
CN102801575A (en) * 2011-05-27 2012-11-28 华为技术有限公司 Loopback detecting method and device
US20130003601A1 (en) * 2011-06-29 2013-01-03 Brocade Communications Systems, Inc. External loop detection for an ethernet fabric switch
CN104144082A (en) * 2013-05-08 2014-11-12 杭州华三通信技术有限公司 Method for detecting loop in two-layer network and controller
CN104184628A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Looped network detection method in network, network equipment and looped network detection system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Patent Citations (7)

* 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
CN102801575A (en) * 2011-05-27 2012-11-28 华为技术有限公司 Loopback detecting method and device
CN102232279A (en) * 2011-06-17 2011-11-02 华为技术有限公司 Method for detecting loop position in Ethernet, and Ethernet switching device
US20130003601A1 (en) * 2011-06-29 2013-01-03 Brocade Communications Systems, Inc. External loop detection for an ethernet fabric switch
CN102625986A (en) * 2011-12-09 2012-08-01 华为技术有限公司 Method, device and network equipment for processing loops in two layer network
CN104144082A (en) * 2013-05-08 2014-11-12 杭州华三通信技术有限公司 Method for detecting loop in two-layer network and controller
CN104184628A (en) * 2013-05-24 2014-12-03 华为技术有限公司 Looped network detection method in network, network equipment and looped network detection system

Cited By (4)

* 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
CN111245700A (en) * 2020-01-16 2020-06-05 新华三信息安全技术有限公司 Loop detection method and device
CN111245700B (en) * 2020-01-16 2022-02-22 新华三信息安全技术有限公司 Loop detection method and device

Also Published As

Publication number Publication date
WO2017050199A1 (en) 2017-03-30
CN106549821B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
US11245631B2 (en) Bum traffic control method, related apparatus, and system
CN103595648B (en) Method and system for balancing load at receiving side of server
US9729430B2 (en) System, device, and method of dense-mode multicast tunneling using interlayer group membership control
CN106549821A (en) A kind of network loop detection method and controller
US8107382B2 (en) Loop detection in a communications network
US20130259050A1 (en) Systems and methods for multi-level switching of data frames
US20160254991A1 (en) Failure protection for traffic-engineered bit indexed explicit replication
CN106254256B (en) Data message forwarding method and equipment based on three layers of VXLAN gateway
WO2020073685A1 (en) Forwarding path determining method, apparatus and system, computer device, and storage medium
CN103475583B (en) The method and apparatus for removing medium education forwarding-table item
US9548917B2 (en) Efficient multicast delivery to dually connected (VPC) hosts in overlay networks
US9059901B1 (en) Methods and apparatus for multicast traffic failover in a network
CN106209638A (en) From VLAN to the message forwarding method of virtual expansible LAN and equipment
CN104702506B (en) A kind of message transmitting method, network node and message transfer system
US8654769B2 (en) Convergence of multicast traffic in response to a topology change
CN105634952A (en) Fast notification method and apparatus for LSP message
CN104618189A (en) Link failure detection method and device
US20130279513A1 (en) Systems and methods for pseudo-link creation
US8854949B2 (en) Network relay device and network relay method
CN101969395B (en) Method for configuring code, method and system for detecting path and network equipment
CN109347734A (en) A kind of file transmitting method, device, the network equipment and computer-readable medium
US10003469B2 (en) Multicast forwarding method and apparatus in transparent interconnection of lots of link network, and routing bridge
CN105704067A (en) Switching device
EP4012976A1 (en) Layer-two tunnel switching method, system, and apparatus
CN111130816B (en) Message forwarding processing equipment, method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant