CN101222435B - Method and device for detecting network loopback - Google Patents

Method and device for detecting network loopback Download PDF

Info

Publication number
CN101222435B
CN101222435B CN2008100071514A CN200810007151A CN101222435B CN 101222435 B CN101222435 B CN 101222435B CN 2008100071514 A CN2008100071514 A CN 2008100071514A CN 200810007151 A CN200810007151 A CN 200810007151A CN 101222435 B CN101222435 B CN 101222435B
Authority
CN
China
Prior art keywords
port
mac
learning
network loopback
network
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.)
Expired - Fee Related
Application number
CN2008100071514A
Other languages
Chinese (zh)
Other versions
CN101222435A (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 CN2008100071514A priority Critical patent/CN101222435B/en
Publication of CN101222435A publication Critical patent/CN101222435A/en
Application granted granted Critical
Publication of CN101222435B publication Critical patent/CN101222435B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method for detecting the appearance of a loopback in a network and a device, which belongs to the communication field. The method comprises the following steps that: learning times of a device and total number of the learning to an MAC are read; whether the difference value of the read MAC learning times twice is larger than the difference value of the read total number of the learning to the MAC and whether the total number of the learning to the MAC read in the last time is less than the maximum value of the MAC learning of the device are judged; if yes, the network loopback is detected. The device comprises a read module, a determine module and a judge module. The invention realizes the detection of the network loopback by reading the MAC learning times and the total number of the learning to the MAC periodically on the network device, reduces the dependency on other devices in the detection of network loopback and reduces the impact and influence of the network loopback detection on the network normal service flow to the utmost extent.

Description

A kind of method and apparatus that detects network loopback
Technical field
The present invention relates to the communications field, particularly a kind of method and apparatus that detects network loopback.
Background technology
Expansion day by day along with network size, internet security and reliability requirement become more and more important, so, network redundancy design (corresponding redundant link promptly is provided) becomes a kind of important means that solves internet security and reliability, if but the redundant link of network redundancy design is not controlled well, message will cause the message storm even cause network paralysis transmitting the formation loopback repeatedly in the equipment or on the network.At such network loopback, the most frequently used and effective solution adopts STP (Spanning-Tree Protocol, Spanning-Tree Protocol) exactly at present.So-called STP is a kind of two layer-management agreements, reaches the purpose of eliminating the network loopback by blocking network redundant link selectively.Wherein, because the STP performance is lower, after STP having been carried out modification and having replenished, produced convergence rate RSTP (Rapid Spanning-Tree Protocol, RSTP) faster; Because in the actual double layer network, message is all transmitted in VLAN (Virtual Local Area Network, VLAN) usually, has produced the MSTP (Multiple Spanning Tree Protocol, Multiple Spanning Tree Protocol) that is applicable to VLAN again.No matter be STP, RSTP still be its essence of MSTP all be identical: the two-layer network device of having disposed agreement, after having started agreement, by mutual transmission BPDU (Bridge Protocol Data Unit, the bridge protocol data unit) message, after each two-layer network device compares and calculates according to the information of carrying among the BPDU, the equipment that priority is the highest can be elected as root switch, other non-root switch is according to calculating and comparing, draw the optimal path of root switch, the path of so non-optimum is considered to redundant link, correspondingly, each non-root switch blocks redundant link.
The inventor finds that the STP/RSTP/MSTP that passes through that provides in the prior art detects network loopback when realization is of the present invention, there are following characteristics in the method that solves the network loopback:
Needing in advance, relevant each network equipment node in double layer network carries out the agreement deployment, and need through after each network equipment node negotiation, agreement just can come into force, and relate to a plurality of network equipment nodes when disposing, occur easily failing mutual communication because certain network equipment node is omitted related deployment configuration or negotiation packet, and cause agreement to fail really to come into force, cause to detect the network loopback, and then cause the network loopback can't suppress the network loopback.
Summary of the invention
In order in time to detect the network loopback, to the dependence of miscellaneous equipment node, the embodiment of the invention provides a kind of method and apparatus that detects network loopback when reducing the network loopback detection.Described technical scheme is as follows:
A kind of method that detects network loopback, described method comprises:
The mac learning number of times of fetch equipment and learn the MAC sum, the difference of the mac learning number of times that reads that judges whether twice is greater than the maximum of the MAC sum of once learning after the study that reads is in the difference of MAC sum and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if then judge to detect the network loopback.
A kind of equipment that detects network loopback, described equipment comprises:
Read module is used for the mac learning number of times of fetch equipment and learns the MAC sum;
Judge module, be used for the mac learning number of times of the equipment that reads according to described read module and learn the MAC sum, the mac learning number of times difference that judges whether twice is greater than the maximum of the MAC sum of once learning after in the difference of learning the MAC sum and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep;
Determination module is used for the result that judges when described judge module for being that then judgement detects the network loopback.
The beneficial effect of the technical scheme that the embodiment of the invention provides is:
By on the network equipment, realizing detection to the network loopback, reduced when carrying out the network loopback detection dependence to greatest extent, and can reduce of impact and the influence of network loopback detection to greatest extent network regular traffic flow to the miscellaneous equipment in the network.
Description of drawings
Fig. 1 is a kind of network organizing schematic diagram that the embodiment of the invention provides;
Fig. 2 is the another kind of network organizing schematic diagram that the embodiment of the invention provides;
Fig. 3 is the networking schematic diagram of the H-VPLS network that provides of the embodiment of the invention;
Fig. 4 is a kind of method flow diagram that detects loopback that the embodiment of the invention 1 provides;
Fig. 5 is a kind of method flow diagram that detects loopback that the embodiment of the invention 2 provides;
Fig. 6 is a kind of equipment schematic diagram that detects loopback that the embodiment of the invention 3 provides.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Behind network loopback, evident characteristic is exactly that message can be in some equipment be transmitted back and forth, just is in an equipment in the loopback, same message can from different ports repeatedly access arrangement forward again.
As shown in Figure 1, provide a kind of networking schematic diagram, wherein, normal packet route is: the port one 1 of message slave unit 1 enters, and is forwarded to equipment 2 through port one 2, after the port 21 of equipment 2 receives, forwards through the port 22 of equipment 2.(or the fiber port of port 2 is set to from ring) will cause network loopback if the port 22 of equipment 2 is set to loopback: equipment 1 is forwarded to equipment 2 through port one 2 after receiving message by port one 1; Equipment 2 is transmitted through the port 22 of self after receiving this message by self port 21, because port 22 is set to loopback, so this message will be forwarded from port 21, the port one 2 of equipment 1 receives this message.This shows, work as network loopback, port one 1 and the port one 2 of same message by equipment 1 enters this equipment 1 twice.For equipment 1:
When message enters from port one 1, when being transmitted to equipment 2, carry out MAC (Media Access Control, media access control layer agreement) study, the MAC address entries of learning is: MACl (source MAC of this message)+PORT11 (port one 1)+VLAN X(suppose that message is from VLAN X);
When because the loopback of equipment 2, and when causing this message the port one 2 of slave unit 1 entering once more, equipment 1 still can carry out mac learning, and the MAC address entries of learning is: MAC1+PORT12 (port one 2)+VLAN X
As a result, equipment 1 has carried out 2 mac learnings, but because the MAC Address of learning is identical, equipment 1 can be thought the repetition list item and cover, finally only keep list item a: MAC1+PORT12+VLAN X
As shown in Figure 2, a kind of networking schematic diagram is provided, and wherein, normal packet route is: port one 1 access arrangement 1 of message slave unit 1, enter into equipment 2, enter into equipment 3 through port one 2 respectively, respectively message is forwarded by equipment 2 and equipment 3 then through port one 3.STP function in being deployed in equipment fails to come into force, and will form the network loopback: all slave units 1 send to the message of equipment 2 and equipment 3, and slave unit 2 and equipment 3 are transmitted and got back in the equipment 1 respectively.For equipment 1:
When message enters from port one 1, when port one 2,13 was transmitted, equipment 1 carried out mac learning, and the MAC address entries of learning is: MAC1+PORT11+VLAN X(suppose that message is from VLAN X);
When message slave unit 2 is forwarded, when the port one 2 by equipment 1 entered, the MAC address entries that equipment 1 is learnt was: MAC1+PORT12+VLAN X
In like manner, when message slave unit 3 is forwarded, when the port one 3 by equipment 1 entered, the MAC address entries that equipment 1 is learnt was: MAC1+PORT13+VLAN X
As a result, equipment 1 has carried out 3 mac learnings, but because the MAC Address of learning is identical, equipment 1 can be thought the repetition list item and cover, finally only keep list item a: MAC1+PORT13+VLAN X
As shown in Figure 3, provide standard H-VPLS (Hierarchical Virtual Private LAN service, Virtual Private Network service) the networking schematic diagram of network, wherein equipment 1, equipment 2, equipment 3, equipment 4 and equipment 5 belong to network equipment.Wherein, normal packet route is: message slave unit 1 enters, select main tunnel after, be forwarded to equipment 3 through equipment 2, offer each equipment of user side then by equipment 3.If the horizontal dividing function of equipment 3 is in unusually, will form the network loopback, the message from equipment 2 that equipment 3 will be received is forwarded in the equipment 5, and equipment 5 can be forwarded to equipment 1 with the message of receiving.At equipment 1:
When the port one 1 of message slave unit 1 enters, when being transmitted to equipment 2, the MAC address entries of learning is: MAC1+PORT11+VLAN X(suppose message from user side equipment, what learn for equipment 1 is user's vlan information);
When message slave unit 5 is transmitted, when the port one 2 by equipment 1 entered, the MAC address entries of learning was: MAC1+PORT12+VSI X(for equipment 1, this message is from network side for Virtual Switch Instance, virtual switch instance, so what learn is VSI information)
As a result, equipment 1 has carried out 2 mac learnings, but because the MAC Address of learning is identical, equipment 1 can be thought the repetition list item and cover, finally only keep list item a: MAC1+PORT12+VSI X
In sum, in case network loopback, then single-point equipment must return and the result of mac learning number of times greater than the MAC sum of finally learning occur, and under the bigger situation of message flow on the loopback, this result can be more obvious.
The technical scheme that the embodiment of the invention provides, mac learning number of times by fetch equipment and learn the MAC sum, judge whether that the mac learning number of times difference that reads for twice is greater than the maximum of the MAC sum of once learning after the study that reads is in the difference of MAC sum and twice less than the equipment mac learning, if then judge to detect the network loopback.
The technical scheme that provides by the embodiment of the invention, reduced when carrying out the network loopback detection dependence to the miscellaneous equipment in the network, and can find the network loopback timely and effectively, and after finding the network loopback, by handling timely releasing network loopback accordingly, reduced the influence that causes of network loopback.
Allow dissimilar (as at port, at business etc.) of the loopback detection of carrying out to describe respectively at equipment below, wherein, it is that example describes that embodiment 1 carries out loopback detection with equipment at port; (port+VLAN) carry out loopback detection is that example describes to embodiment 2 at professional with equipment.
Embodiment 1
Referring to Fig. 4, the embodiment of the invention provides a kind of method that detects loopback, and method thes contents are as follows:
101: equipment is initiated at the loopback detection state, the mac learning number of times of fetch equipment and learn the MAC sum.
Wherein, when the reading of mac learning number of times that carries out equipment and the MAC sum learnt, can adopt the mode that regularly reads, promptly set the cycle of reading, also can carry out reading at any time according to concrete needs.Present embodiment is that example describes in the mode that regularly reads.For example: T N-1The mac learning number of times that constantly reads equipment 1 is N1, and the MAC that this moment, equipment 1 was learnt adds up to M1; T NThe mac learning number of times that constantly reads equipment 1 is N2, and the MAC that this moment, equipment 1 was learnt adds up to M2.
102: according to the mac learning number of times of the equipment that regularly reads with learn the MAC sum, detect the network loopback.Specifically comprise:
According to the mac learning number of times of the equipment that regularly reads with learn the MAC sum, if satisfy following detection formula
{ (N2-N1)>(M2-M1) } ﹠amp; ﹠amp; (M2<M MAX), then think network loopback.
Promptly, whether the difference of judging mac learning number of times that reads for the N time and the mac learning number of times that reads for the N-1 time is greater than MAC sum of acquiring for the N time and the MAC sum of acquiring for the N-1 time, and the MAC sum of learning for the N time is less than the maximum of the MAC sum of permission reservation in this equipment mac learning table; If then can think to detect the network loopback.The scheme that present embodiment provides is applicable to the situation that has data traffic in the network, if there is not data traffic in the network, has just lost the meaning of the detection of carrying out the network loopback.Behind network loopback, when the detection formula that using present embodiment provides detects, if regularly the mac learning number of times of the equipment that reads equates, the result who detects loopback do not occur for network, and because the mac learning number of times equates that indication equipment does not receive new data message, also just mean in this network and do not had data traffic, though network loopback, but owing to do not have data traffic in the network, even if can not impact, so just lost the meaning of carrying out the network loopback detection to network so the network loopback occurs yet yet.
At this detection formula, a difference threshold can also be set, the sum that promptly ought determine the difference of mac learning number of times and learn is greater than this difference threshold value, and the MAC sum of learning for the N time is less than the maximum of the MAC sum that allows in this equipment mac learning table to keep; If then think to detect the network loopback.By difference threshold is set, reduce the influence of accidentalia to testing result, guarantee the correctness of testing result.
Further, concrete needs according to equipment, in order to reduce the influence of accidentalia to detecting, guarantee the correct of testing result, this step can also be set to: if the mac learning number of times of the equipment that N continuous time regularly reads and learn the MAC sum and all satisfy detection formula is just thought network loopback.For example, satisfy detection formula when detecting for the first time, be because some accidentalia in the equipment causes, but this accidentalia can rapidly disappear, for example, a certain port of equipment is made as unintentionally from ring is found back cancellation again rapidly from ring, fully takes into account the influence to testing result of the accidentalia that exists in the network environment, thereby double when satisfying detection formula by setting, just really think network loopback.
103: after detecting the network loopback,, search and close the port of the equipment that causes the network loopback according to the loopback detection order.Particular content is as follows:
Search when causing the device port of network loopback occurring, it is that example describes that present embodiment has 6 ports with equipment, comprise and be used for and the network-side port A that communicates of network side, be used for and user-side port B, user-side port C, user-side port D, network-side port E and user-side port F that user side communicates.This moment, port A, port B, port C, port D were in effective status (not closed condition), and port E, port F are in closed condition, supposed that port C is the port that causes the network loopback that occurs.So it is as follows correspondingly, to search the process of the port C that causes occurring the network loopback:
103A, each port on the closing device.
In this step, usually for an equipment, the network side interface compare with user-side port for an equipment, its effect wants important many, and the outline that network-side port causes occurring the network loopback is very little, so when searching,, can not close the network side interface, and close all the other ports except that network-side port in order to reduce the impact and the influence of loopback detection to greatest extent to this equipment regular traffic message flow.For example: the port of this equipment is carried out the difference according to priority of being provided with of different priorities, the port on the closing device selectively: have higher priority for port A is provided with, close port B and port C, port D except that port A.Correspondingly, be that port B, port C, port D are that example describes hereinafter with the port of in this step, closing.
103B is open at pent port among the 103A successively, and in port of every unlatching, utilizes detection formula, judges whether to exist the network loopback, till discovery causes the port of network loopback occurring.Particular content is as follows:
For example, owing in step 103A, closed port B, port C, port D, in this step, need open successively this moment to pent port, as, open port B earlier, when opening port B, utilize detection formula { (N2-N1)>(M2-M1) }; ﹠amp; (M2<M MAX), judge whether network loopback, if, just close this port, carry out the detection of next port, if not, then keep the opening of this port, carry out the detection of next port.Owing to supposed that port B is not the port that causes occurring the network loopback, so correspondingly keep the opening of this port B, carries out the detection of port C then in the present embodiment;
In like manner, open port C, utilize detection formula { (N2-N1)>(M2-M1) } simultaneously; ﹠amp; (M2<M MAX), judge whether network loopback, if, just close this port, carry out the detection of next port, if not, then keep the opening of this port, carry out the detection of next port.Owing to supposed that port C is the port that causes occurring the network loopback, so correspondingly close this port C, carries out the detection of port D then in the present embodiment;
In like manner, open port D, utilize detection formula { (N2-N1)>(M2-M1) } simultaneously; ﹠amp; (M2<M MAX), judge whether network loopback, if, just close this port, carry out the detection of next port, if not, then keep the opening of this port, carry out the detection of next port.Owing to supposed that port D is not the port that causes occurring the network loopback in the present embodiment, so correspondingly keep the opening of this port D.At this moment, finished detection to all pent ports in step 103A of equipment.
By said method, when all the effective ports to equipment test finish after, found out and closed the port that causes occurring the network loopback in the equipment, can carry out follow-up operation according to testing result.。
Further, when found and closed cause the port of network loopback in the equipment after, because the regularly existence of measuring ability, if when this equipment detects in the regular hour less than the network loopback occurring, can open known pent loopback port termly, if opened pent some loopback ports, detection the network loopback occurs less than equipment, then keeps the opening of this loopback port; After having opened this pent loopback port, exist if still can detect loopback, then close this loopback port once more, wait for the arrival in the moment of next time regularly opening.For example:
For device A, the port that causes the network loopback that it finds and closes is X and port Y, when this device A detects in the regular hour less than the network loopback occurring, can open port x earlier, if opened port A, detection the network loopback occurs less than equipment, then can open this port A, illustrates that this moment, port A can not cause the network loopback having occurred; Exist if still can detect loopback, then close port A once more illustrate that this moment, port A still caused occurring the network loopback, waits for the arrival of next time regularly opening the moment.Then, open port Y, in like manner judge, carry out corresponding the processing then, method is similar, repeats no more.
In sum, pass through detection formula, realized whether network is occurred the detection of network loopback, and according to testing result, search and close the port that causes occurring the network loopback, finish at equipment self owing to detect, reduced to greatest extent and carried out of the dependence of network loopback other equipment in the network.
Especially, at present embodiment, above-mentioned present embodiment is being searched when causing the port of network loopback occurring, what adopt is that the mode of searching of close port realizes, this moment can also be only mac learning by close port realize, by closing the mac learning of all effective ports, open successively then, in the mac learning while of an effective port of every unlatching, utilize detection formula { (N2-N1)>(M2-M1) }; ﹠amp; (M2<M MAX), thereby find out the port that causes occurring the network loopback, on to greatest extent, reduced and carried out of the influence of network loopback detection equipment.
The method that the embodiment of the invention provides, by on the network equipment, utilizing detection formula, realization is at the detection of the network loopback of port level, the configuration that only needs single-point equipment to be correlated with, can finish the network loopback detection, reduced dependence, can also solve setting owing to network equipment node self and cause the network sn wrap-around issue that occurs, be set to cause occurring the network loopback from ring as the fiber port of the network equipment to the network others device node; Simultaneously, can also be as to the replenishing of other detection protocol such as STP, guarantee that various occasions can both in time find and solve network problem, and can reduce of impact and the influence of network loopback detection to greatest extent network regular traffic flow.
Embodiment 2
The foregoing description 1 is that example is illustrated so that the network loopback detection that causes at port to be provided, referring to Fig. 5, present embodiment with provide at professional (the network loopback detection of port+VLAN) cause describes, and method is similar, thes contents are as follows:
201: equipment is initiated at the loopback detection state, regularly the mac learning number of times of fetch equipment and learn the MAC sum.
202: according to the mac learning number of times of the equipment that regularly reads with learn the MAC sum, detect the network loopback.
203: after detecting the network loopback,, search and close the business of the equipment that causes the network loopback according to the loopback detection order.
Particular content is as follows:
For equipment, a common one corresponding a plurality of VLAN of port meeting, therefore, corresponding and port also has a plurality of business.For example, corresponding and 3 VLAN of the port x in the equipment 1, therefore, port x+VLAN1, port x+VLAN2, port x+VLAN3 constitutes 3 kinds of different business as being respectively IP operation, business of networking, video traffic, in like manner, the port Y of equipment 1 also has a plurality of VLAN, corresponding a plurality of business.
203A: after detecting the network loopback, according to the loopback detection order, the method equipment of finding that the network loopback provides by embodiment 1 causes the port of network loopback; As port x, port Y.
Wherein, ((it is that example describes that port x+VLAN3) and a certain business of port Y cause occurring the network loopback to present embodiment for port x+VLAN2) and video traffic with the business of networking of the port x of equipment 1.
203B: there is the port of loopback closing device in all.Be close port X and port Y.
203C: be open at pent effective port among the 203B successively, and in effective port of every unlatching, close all VLAN of this port correspondence, open the pent VLAN of this port then successively, utilize detection formula, judge whether to exist the network loopback, till discovery causes the service VLAN of network loopback occurring.Particular content is as follows:
Owing to closed port x, port Y in step 203A, in this step, need open successively this moment to pent port.
For example, open port x earlier, when opening port x, close all VLAN (being VLAN1, VLAN2, VLAN3) of this port x correspondence, open the pent VLAN of this port x then successively, utilize detection formula { (N2-N1)>(M2-M1) }; ﹠amp; (M2<M MAX), judge whether network loopback, if, just close the VLAN of this port, carry out the detection of the next VLAN of this port, if not, the VLAN opening that then keeps this port, carry out the detection of next VLAN: after detection finishes to port x, adopt and use the same method the detection of execution next port Y.After repeating query has detected all ports, closed the business that causes occurring the network loopback.Concrete example is as follows:
The VLAN1 that opens port x in the present embodiment earlier is an example, utilizes detection formula to judge, finds that this VLAN1 is not the port that causes occurring the network loopback, so correspondingly keep this VLAN1 opening, carries out the detection of VLAN2 then;
In like manner, open VLAN2, utilize detection formula { (N2-N1)>(M2-M1) } ﹠amp simultaneously; ﹠amp; (M2<M MAX), judge whether network loopback, owing to supposed that VLAN2 is the business that causes occurring the network loopback, so correspondingly close this VLAN2, carries out the detection of VLAN3 then in the present embodiment;
In like manner, open VLAN3, utilize detection formula { (N2-N1)>(M2-M1) } ﹠amp simultaneously; ﹠amp; (M2<M MAX), judge whether network loopback, find that this VLAN3 is not the port that causes occurring the network loopback, so correspondingly keep this VLAN3 opening.At this moment, all VLAN of this port x detected finish, search except causing occurring the business of network loopback under this port.
Then, open port Y, adopt and use the same method, carry out the detection to the VLAN of port Y, in like manner, can find the VLAN that causes occurring the network loopback under this port Y, method is similar, repeats no more.
In sum,, after there is the business of loopback in all repeating query disposes in the equipment, cause the business of network loopback to be closed in the equipment, can carry out follow-up operation according to testing result by detection formula.
Further, when searched and closed cause in the equipment business of network loopback occurring after, because the regularly existence of measuring ability, if the network loopback occurs in the regular hour when this equipment detects less than equipment, can open known pent loopback business termly, if opened pent some loopback business, detection the network loopback occurs less than equipment, then can keep the opening of this loopback business; Exist if still can detect loopback, then close this loopback business once more, wait for next regular open detection arrival constantly.For example:
Suppose for device A, the business that causes the network loopback that it finds and closes is (port x+VLAN2) and (port Y+VLAN6), when this device A detects in the regular hour less than the network loopback occurring, can open the VLAN2 of port x earlier, if opened this VLAN2, detection the network loopback occurs less than equipment, then can keep the opening of this VLAN2, illustrates that the VLAN2 of port x this moment can not cause occurring the network loopback; Exist if can detect loopback, then close this VLAN2,, illustrate that this moment, VLAN2 still caused occurring the network loopback, wait for the arrival constantly of next open detection regularly.Then, open the VLAN6 of port Y, adopting uses the same method judges detection, carries out accordingly and handles, and method is similar, repeats no more.
Especially, equally at present embodiment, above-mentioned present embodiment is being searched when causing the port of network loopback occurring, what adopt is that the mode of searching of close port realizes, this moment can also be only mac learning by close port realize, by closing the mac learning of all effective ports, open successively then, in the mac learning while of an effective port of every unlatching, utilize detection formula { (N2-N1)>(M2-M1) }; ﹠amp; (M2<M MAX), thereby find out the port that causes occurring the network loopback, on to greatest extent, reduced and carried out of the influence of network loopback detection equipment.
The method that the embodiment of the invention provides, by on the network equipment, utilizing detection formula, realized detection at the network loopback of service level, reduced dependence to the network others device node, can also solve setting owing to network equipment node self and cause the network sn wrap-around issue that occurs, be set to cause occurring the network loopback from ring as the fiber port of the network equipment; Simultaneously, can also be as to the replenishing of other detection protocol such as STP, guarantee that various occasions can both in time find and solve network problem; And can reduce of impact and the influence of network loopback detection to greatest extent to network regular traffic flow.
Embodiment 3
Referring to Fig. 6, the embodiment of the invention provides a kind of equipment that detects network loopback, and wherein, equipment comprises:
Read module is used for the mac learning number of times of fetch equipment and learns the MAC sum;
Judge module, be used for the mac learning number of times of the equipment that reads according to read module and learn the MAC sum, the mac learning number of times difference that judges whether twice is greater than the maximum of the MAC sum of once learning after in the difference of learning the MAC sum and twice less than the equipment mac learning;
Determination module is used for the result that judges when judge module for being that then judgement detects the network loopback.
After detecting the network loopback, port or the business that has the network loopback can also be searched and be closed to the equipment that the embodiment of the invention provides, correspondingly;
1) when the port of network loopback is searched and closed to needs, equipment also comprised:
First processing module is used for when the determination module judgement detects the network loopback, and all of the port of closing device is opened pent port successively; When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then working as front port exists the network loopback, closes the front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged.
When the port of network loopback is searched and closed to needs, equipment also comprised:
Second processing module is used for when the determination module judgement detects the network loopback mac learning of all of the port of closing device, the mac learning of opening pent port successively; When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then working as front port exists the network loopback, closes the front port of working as of the mac learning that is unlocked; Otherwise, open the mac learning of the next port in the pent port and judge.
Equipment also comprises:
Recover module, be used for after there is the port of network loopback in the processing module equipment of having closed, in the default time, detect less than the network loopback pent port that has the network loopback of time opening then, judge whether to detect the network loopback, if then close the port that has the network loopback that is unlocked.
2) when network loopback professional searched and closed to needs, equipment also comprised:
The 3rd processing module is used for when the determination module judgement detects the network loopback, and all of the port of closing device is opened pent port successively; When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then working as front port exists the network loopback, closes the front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged.After there is the port of network loopback in all of having closed equipment, open the pent port that has the network loopback successively; Open one current when being closed the port that has the network loopback, all business of close port are opened the current pent business of the port that has the network loopback that is closed successively; Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then there is the network loopback in current business, closes the current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
Equipment also comprises:
The manages module everywhere, is used for judging when detecting the network loopback mac learning of all of the port of closing device, the mac learning of opening pent port successively when determination module;
When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then working as front port exists the network loopback, closes the front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged; After there is the port of network loopback in all of having closed equipment, open the pent port that has the network loopback successively; Open one current when being closed the port that has the network loopback, all business of close port are opened the current pent business of the port that has the network loopback that is closed successively; Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and twice less than the equipment mac learning, if, judge that then there is the network loopback in current business, closes the current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
Equipment also comprises:
Recover module, be used for after there is the business of network loopback in the Service Processing Module equipment of having closed, in the default time, detect less than the network loopback pent business that has the network loopback of time opening then, judge whether to detect the network loopback, if then close the business that has the network loopback that is unlocked.
The equipment that the embodiment of the invention provides can be realized the detection to the network loopback, the configuration that only needs single-point equipment to be correlated with, can finish the network loopback detection, reduced dependence to the network others device node, can also solve setting owing to network equipment node self and cause the network sn wrap-around issue that occurs, be set to cause occurring the network loopback from ring as the fiber port of the network equipment; Simultaneously, can also be as to the replenishing of other detection protocol such as STP, guarantee that various occasions can both in time find and solve network problem, can reduce of impact and the influence of network loopback detection to greatest extent to network regular traffic flow.
The technical scheme of utilizing the embodiment of the invention to provide, the configuration that only needs single-point equipment to be correlated with, can finish the network loopback detection, reduced dependence to the network others device node, can also solve setting owing to network equipment node self and cause the network sn wrap-around issue that occurs, be set to cause occurring the network loopback from ring as the fiber port of the network equipment; Simultaneously, can also be as to the replenishing of other detection protocol such as STP, guarantee that various occasions can both in time find and solve network problem.
Part steps in the embodiment of the invention can utilize software to realize that corresponding software programs can be stored in the storage medium that can read, as CD or hard disk etc.
The above only is specific embodiments of the invention;, for those skilled in the art, not all under the prerequisite that does not break away from the principle of the invention in order to restriction the present invention; any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (15)

1. a method that detects network loopback is characterized in that, described method comprises:
The mac learning number of times of fetch equipment and learn the MAC sum, the difference of the mac learning number of times that reads that judges whether twice is greater than the maximum of the MAC sum of once learning after the study that reads is in the difference of MAC sum and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if then judge to detect the network loopback.
2. the method for detection network loopback as claimed in claim 1 is characterized in that, described method also comprises:
When detecting the network loopback, search and close the port that there is the network loopback in described equipment;
Or;
When detecting the network loopback, search and close the business that there is the network loopback in described equipment.
3. the method for detection network loopback as claimed in claim 2 is characterized in that, describedly searches and close the port that there is the network loopback in described equipment, comprising:
Close all of the port of described equipment, open pent port successively;
When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged.
4. the method for detection network loopback as claimed in claim 2 is characterized in that, describedly searches and close the port that there is the network loopback in described equipment, comprising:
Close the mac learning of all of the port of described equipment, open the mac learning of pent port successively;
When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as of the mac learning that is unlocked; Otherwise, open the mac learning of the next port in the pent port and judge.
5. as the method for claim 3 or 4 described detection network loopbacks, it is characterized in that described method also comprises:
Closed after there is the port of network loopback in described equipment, in the default time, detect and then regularly open the pent port that has the network loopback less than the network loopback, judge whether to detect the network loopback, if close the port that has the network loopback that is unlocked.
6. the method for detection network loopback as claimed in claim 2 is characterized in that, describedly searches and close the business that there is the network loopback in described equipment, comprising:
Close all of the port of described equipment, open described pent port successively;
When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged;
After there is the port of network loopback in all of having closed described equipment, open the described pent port that has the network loopback successively;
Open one current when being closed the port that has the network loopback, close all business of described port, open the described current pent business that is closed the port that has the network loopback successively;
Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then there is the network loopback in current business, close the described current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
7. the method for detection network loopback as claimed in claim 2 is characterized in that, describedly searches and close the business that there is the network loopback in described equipment, comprising:
Close the mac learning of all of the port of described equipment, open the mac learning of described pent port successively;
When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged;
After there is the port of network loopback in all of having closed described equipment, open the described pent port that has the network loopback successively;
Open one current when being closed the port that has the network loopback, close all business of described port, open the described current pent business that is closed the port that has the network loopback successively;
Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then there is the network loopback in current business, close the described current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
8. as the method for claim 6 or 7 described detection network loopbacks, it is characterized in that described method also comprises:
Closed after there is the business of network loopback in described equipment, in the default time, detect and then regularly open the pent business that has the network loopback less than the network loopback, judge whether to detect the network loopback, if close the business that has the network loopback that is unlocked.
9. an equipment that detects network loopback is characterized in that, described equipment comprises:
Read module is used for the mac learning number of times of fetch equipment and learns the MAC sum;
Judge module, be used for the mac learning number of times of the equipment that reads according to described read module and learn the MAC sum, the mac learning number of times difference that judges whether twice is greater than the maximum of the MAC sum of once learning after in the difference of learning the MAC sum and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep;
Determination module is used for the result that judges when described judge module for being that then judgement detects the network loopback.
10. the equipment of detection network loopback as claimed in claim 9 is characterized in that, described equipment also comprises:
First processing module is used for closing all of the port of described equipment when described determination module judgement detects the network loopback, opens pent port successively; When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged.
11. the equipment of detection network loopback as claimed in claim 9 is characterized in that, described equipment also comprises:
Second processing module is used for closing the mac learning of all of the port of described equipment, the mac learning of opening pent port successively when described determination module judgement detects the network loopback; When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as of the mac learning that is unlocked; Otherwise, open the mac learning of the next port in the pent port and judge.
12. the equipment as claim 10 or 11 described detection network loopbacks is characterized in that, described equipment also comprises:
Recover module, be used for having closed after there is the port of network loopback in described equipment when described processing module, in the default time, detect less than the network loopback pent port that has the network loopback of time opening then, judge whether to detect the network loopback, if then close the port that has the network loopback that is unlocked.
13. the equipment of detection network loopback as claimed in claim 9 is characterized in that, described equipment also comprises:
The 3rd processing module is used for closing all of the port of described equipment when described determination module judgement detects the network loopback, opens described pent port successively; When opening a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged; After there is the port of network loopback in all of having closed described equipment, open the described pent port that has the network loopback successively; Open one current when being closed the port that has the network loopback, close all business of described port, open the described current pent business that is closed the port that has the network loopback successively; Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then there is the network loopback in current business, close the described current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
14. the equipment of detection network loopback as claimed in claim 9 is characterized in that, described equipment also comprises:
The manages module everywhere, is used for judging when detecting the network loopback when described determination module, closes the mac learning of all of the port of described equipment, the mac learning of opening described pent port successively;
When opening the mac learning of a current pent port, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then working as front port exists the network loopback, closes the described front port of working as that is unlocked; Otherwise the next port of opening in the pent port is judged; After there is the port of network loopback in all of having closed described equipment, open the described pent port that has the network loopback successively; Open one current when being closed the port that has the network loopback, close all business of described port, open the described current pent business that is closed the port that has the network loopback successively; Open one current pent when professional, the difference that judges whether the mac learning number of times that reads for twice is greater than the maximum of the MAC sum of once learning after in the difference of the MAC sum of learning and described twice less than the MAC sum that allows in the mac learning table of described equipment to keep, if, judge that then there is the network loopback in current business, close the described current business that is unlocked; Otherwise the next business of opening in pent all business is judged.
15. the equipment as claim 13 or 14 described detection network loopbacks is characterized in that, described equipment also comprises:
Recover module, be used for having closed after there is the business of network loopback in described equipment when described processing module, in the default time, detect less than the network loopback pent business that has the network loopback of time opening then, judge whether to detect the network loopback, if then close the business that has the network loopback that is unlocked.
CN2008100071514A 2008-02-02 2008-02-02 Method and device for detecting network loopback Expired - Fee Related CN101222435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100071514A CN101222435B (en) 2008-02-02 2008-02-02 Method and device for detecting network loopback

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100071514A CN101222435B (en) 2008-02-02 2008-02-02 Method and device for detecting network loopback

Publications (2)

Publication Number Publication Date
CN101222435A CN101222435A (en) 2008-07-16
CN101222435B true CN101222435B (en) 2010-08-04

Family

ID=39632017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100071514A Expired - Fee Related CN101222435B (en) 2008-02-02 2008-02-02 Method and device for detecting network loopback

Country Status (1)

Country Link
CN (1) CN101222435B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102281172B (en) * 2011-09-20 2013-11-06 杭州华三通信技术有限公司 Loop detection method and device
CN102594616B (en) * 2011-11-23 2014-12-24 国家计算机网络与信息安全管理中心 Network security detection method and device
TWI514821B (en) * 2014-02-26 2015-12-21 Accton Technology Corp Network devices and loopback detection methods
CN107306210B (en) * 2016-04-20 2023-04-18 中兴通讯股份有限公司 Method and device for determining cyclization
CN112003783B (en) * 2020-08-21 2022-07-22 烽火通信科技股份有限公司 Method and device for preventing Ethernet from being looped at two layers

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1725731A (en) * 2005-05-19 2006-01-25 杭州华为三康技术有限公司 Method for controlling number of Layer2 Ethernet ring equipment MAC address learning

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1725731A (en) * 2005-05-19 2006-01-25 杭州华为三康技术有限公司 Method for controlling number of Layer2 Ethernet ring equipment MAC address learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2007-235691A 2007.09.13

Also Published As

Publication number Publication date
CN101222435A (en) 2008-07-16

Similar Documents

Publication Publication Date Title
US7532588B2 (en) Network system, spanning tree configuration method and configuration program, and spanning tree configuration node
US7126923B1 (en) Method and system for inter-domain loop protection using a hierarchy of loop resolving protocols
US9203735B2 (en) Packet forwarding apparatus and method
US8315158B2 (en) Methods and apparatus for decentralized rapid recovery for Ethernet rings
CN101047601B (en) Implementing method and system of double-attach network based on VPLS
US9882838B2 (en) Forwarding inter-switch connection (ISC) frames in a network-to-network interconnect topology
US8724519B2 (en) Technique for dual homing interconnection between communication networks
US7590126B2 (en) Frame transfer processing method and device
US7555774B2 (en) Inline intrusion detection using a single physical port
US20150288559A1 (en) Relay System and Switching Device
CN101222435B (en) Method and device for detecting network loopback
US20100232322A1 (en) Node, network system, frame transfer method, and frame transfer program
JP2011517209A (en) Reduction of traffic loss in EAPS system
US20130177021A1 (en) Communication device, communication system and communication method
JP5862445B2 (en) Communication device
US7804768B2 (en) Method for redundant linking lines and wide area network node device
EP2178249B1 (en) Method of redundancy of ring network
CN100559772C (en) Mixed virtual private network system and backbone network edge apparatus and collocation method thereof
CN103457756B (en) A kind of loop path detection, Apparatus and system
CN106453091A (en) Equivalent routing management method and device of router forwarding plane
CN100555985C (en) A kind of switch and routing table method of operating
CN110365578A (en) Network interface control and link switching method, device, network equipment and medium
CN101938388A (en) Loop detection method and device in selective virtual local area network (SVLAN)
JP2011182045A (en) Device, system and method for evaluating network
CN103051499A (en) Message detection method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100804

Termination date: 20170202

CF01 Termination of patent right due to non-payment of annual fee