CN107040431B - Method and system for detecting LAN port loop of AP - Google Patents

Method and system for detecting LAN port loop of AP Download PDF

Info

Publication number
CN107040431B
CN107040431B CN201710158959.1A CN201710158959A CN107040431B CN 107040431 B CN107040431 B CN 107040431B CN 201710158959 A CN201710158959 A CN 201710158959A CN 107040431 B CN107040431 B CN 107040431B
Authority
CN
China
Prior art keywords
lan port
detected
loop
lan
tested
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.)
Active
Application number
CN201710158959.1A
Other languages
Chinese (zh)
Other versions
CN107040431A (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.)
Taizhou Jiji Intellectual Property Operation Co.,Ltd.
Original Assignee
Taizhou Jiji Intellectual Property Operation 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 Taizhou Jiji Intellectual Property Operation Co ltd filed Critical Taizhou Jiji Intellectual Property Operation Co ltd
Priority to CN201710158959.1A priority Critical patent/CN107040431B/en
Publication of CN107040431A publication Critical patent/CN107040431A/en
Application granted granted Critical
Publication of CN107040431B publication Critical patent/CN107040431B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/103Active monitoring, e.g. heartbeat, ping or trace-route with adaptive polling, i.e. dynamically adapting the polling rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Environmental & Geological Engineering (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method for detecting an LAN port loop of an AP, which comprises the following steps: judging whether a first LAN port to be detected and a second LAN port to be detected of the AP are both in a starting state, if so, entering the next step; starting a loop detection polling mechanism, and regularly sending loop detection data frames by a first LAN port to be detected according to a preset detection period; judging whether the data frame received by the second LAN port to be detected is consistent with the loop detection data frame, if so, judging that loops appear in the first LAN port to be detected and the second LAN port to be detected; otherwise, judging that the first LAN port to be detected and the second LAN port to be detected have no loop, closing a loop detection polling mechanism, and stopping loop detection. The invention also discloses a system for detecting the LAN port loop of the AP. The method and the system can simply, effectively and quickly detect whether a loop exists between the two LAN ports of the AP or not.

Description

Method and system for detecting LAN port loop of AP
Technical Field
The invention belongs to the technical field of local area networks, and particularly relates to a method and a system for detecting a LAN port loop of an AP.
Background
In a device with two local ethernet networks, it is necessary to ensure that the two ethernet interfaces do not form a loop, if the device is in a loop state, messages will be continuously and circularly received and forwarded in the device, which will inevitably result in a loop storm, and once the loop storm is formed, a CPU of the device will be fatigued to receive and forward tens of thousands of data messages per second or more than millions of data messages per second, and is innocent to process network messages of normal communication.
Two common network topologies that result in a network access device loop include device port self-looping, where a port may be the same port or two different ports under the same device. The self-loop caused by the same port is generally caused by setting a register of a device chip, and a user generally does not involve professional operations in daily application. The self-loop of different ports can be easily achieved, for example, a network cable connects two different downstream ports a and B of the device. That is, the data message sent from the a port by the device is received through the B port without being changed.
The above loop situation: if the data packet received from one port is not judged and has no limitation and prevention of relevant measures, the same data message is forwarded by the previous method and path, and as a result, the same data message is received from the same port again, and the circulation causes a loop storm to affect normal network communication.
In a device with two local ethernet networks, it is necessary to ensure that the two ethernet interfaces do not form a loop, and generally, Switch adopts STP to solve the problem, and in an AP, STP is complex.
Disclosure of Invention
The invention provides a method and a system for detecting a loop of an LAN (local area network) port of an AP (access point), which are used for solving the problem that the loop is difficult to discover due to short circuit of two LAN ports on the AP.
The invention discloses a method for detecting a LAN port loop of an AP, which comprises the following steps:
s100, judging whether a first LAN port to be detected and a second LAN port to be detected of the AP are both in a starting state, if so, entering the next step;
s200, starting a loop detection polling mechanism, and controlling the first LAN port to be detected to regularly send loop detection data frames according to a preset detection period;
s300, judging whether the data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, entering the step S400, otherwise, entering the step S500;
s400, judging that a loop circuit appears in the first LAN port to be detected and the second LAN port to be detected;
s500, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, closing the loop detection polling mechanism and stopping loop detection.
Whether the two LAN ports of the AP are detected by sending the detection data frame because a loop is caused by the short circuit of the network wire or not is detected. The method is simple and effective and has strong operability.
Further, after the step S400, the method further includes the steps of:
s450, sending a loop alarm signal, and closing the second LAN port to be detected.
If the loop appears, an alarm signal is sent out in time to inform the user. When a loop occurs in two LAN ports, if any one LAN port is closed, the two LAN ports do not have a loop, and the loop detection function is also closed.
Further, before the step S200, the method further includes the steps of:
s150, respectively acquiring the starting absolute time values of the first LAN port to be tested and the second LAN port to be tested; acquiring the time difference between the absolute time value of the starting of the second LAN port to be tested and the absolute time value of the starting of the first LAN port to be tested;
s160 determines whether the time difference is smaller than a preset enabled time interval, if so, the process goes to step S200.
The scheme adopts a method of sending the detection data frame at regular time under the condition that two LAN ports are enabled, so that CPU resources of the AP are greatly consumed. In fact, the AP is the last link in the access, and the most likely loop is for a non-technician to connect the two ports directly with the network cable. And generally, the AP is not connected to the switch any more at the back. An improved idea is proposed here to detect only loops resulting from the direct connection of two ports with a network cable. Considering the situation that a non-technician directly connects two ports of the ethernet by using a network cable, theoretically, two ethernet ports up should exist at the same time, and considering that in the actual situation, the processing of hardware and software cannot be completely synchronized, we consider that if the time interval of two ethernet ports up is less than B seconds, we perform loop detection, and in other situations, we do not need to perform loop detection at all. Of course, when the AP is powered on, we must do a loop check. Because we detect loops only in a very few cases, the burden on the CPU is negligible. The absolute time value here refers to a time point of opening and enabling the LAN ports, generally, when two LAN ports are shorted, the time points of their enabling are still slightly different, and it is not theoretically to open and enable the LAN ports at the same time, but because the difference is small, one enabling time interval can be reasonably set, if the time interval of opening and enabling the two LAN ports is within the preset enabling time interval, loop detection is performed, otherwise, it indicates that the two LAN ports are not shorted, and loop detection is not required.
Further, after step S450, the method further includes the steps of:
s460, controlling the first LAN port to be detected to continuously send loop detection data frames at regular time according to the preset detection period, releasing the second LAN port to be detected according to the preset release interval time, and controlling the second LAN port to be detected to only receive messages and not to forward the messages;
s470 judges whether the data frame received by the second LAN port to be tested is consistent with the loop detection data frame sent by the first LAN port to be tested, if yes, the step S480 is executed, otherwise, the step S490 is executed;
s480, closing the second LAN port to be tested, and returning to the step S460;
s490, the loop alarm is released, the second LAN port to be tested is started, and the step S500 is entered.
If both LAN ports of the AP have been found to have a loop condition, but the system does not know when the loop will be released, it is also necessary to periodically detect if the loop is released. Specifically, the first LAN port to be tested will continue to send the loop detection data frame at regular time, and the second LAN port to be tested will also be released at regular time according to the preset release interval, where release means that the second LAN port to be tested can receive the message, but does not perform any forwarding. If the data frame received by the second LAN port to be detected is the loop detection data frame sent by the first LAN port to be detected, the loop of the two LAN ports is still present and is not released, so that the second LAN port to be detected is still closed, and when the next release time comes, the second LAN port to be detected is released to continue loop detection. If the loop of the two LAN ports is judged not to exist, the alarm is released, and the LAN ports work normally.
Further, the step S300 includes the steps of:
s310 determines whether the length, destination MAC, and payload of the data frame received by the second LAN port to be tested are consistent with those of the loop detection data frame, if yes, step S400 is performed, otherwise step S500 is performed.
The invention also provides a system for detecting the LAN port loop of the AP, which comprises a first LAN port to be detected of the AP, a second LAN port to be detected of the AP and a detection control unit, wherein the detection control unit is respectively connected with the first LAN port to be detected and the second LAN port to be detected, the detection control unit comprises a state detection module, a control module and an operation module, the control module is respectively connected with the state detection module and the operation module, and the system comprises: the state detection module detects and judges whether the first LAN port to be detected and the second LAN port to be detected are both in a starting state; if yes, the operation module starts a loop detection polling mechanism under the control of the control module, and the first LAN port to be detected sends and sends loop detection data frames at regular time according to a preset detection period under the control of the control module; the control module judges whether a data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, the control module judges that loops appear in the first LAN port to be tested and the second LAN port to be tested; otherwise, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, and closing the loop detection polling mechanism by the operation module to stop loop detection.
Further, the detection control unit further comprises an alarm module electrically connected with the control module, wherein: when the control module judges that a loop appears in the first LAN port to be detected and the second LAN port to be detected, the alarm module sends a loop alarm signal, and the operation module closes the second LAN port to be detected.
Further, the detection control unit further comprises an acquisition module, the acquisition module is connected with the control module, wherein: the acquisition module respectively acquires the starting absolute time values of the first LAN port to be detected and the second LAN port to be detected; acquiring the time difference between the absolute time value of the starting of the second LAN port to be tested and the absolute time value of the starting of the first LAN port to be tested; and the control module judges whether the time difference is smaller than a preset starting time interval, and if so, the operation module starts a loop detection polling mechanism under the control of the control module.
Further, when the control module determines that a loop occurs in the first LAN port to be detected and the second LAN port to be detected, and the alarm module sends a loop alarm signal, after the operation module closes the second LAN port to be detected, the first LAN port to be detected continues to send loop detection data frames at regular time according to the preset detection period under the control of the control module, and the operation module releases the second LAN port to be detected according to a preset release interval time, controls the second LAN port to be detected to receive only a message and cannot forward the message; the control module judges whether a data frame received on the second LAN port to be detected is consistent with a loop detection data frame sent by the first LAN port to be detected, if so, the operation module closes the second LAN port to be detected, waits for the next preset release interval time and releases the second LAN port to be detected, and loop detection is carried out; otherwise, the operation module releases the loop alarm and starts the second LAN port to be tested.
Further, the determining, by the control module, whether the data frame received and to be forwarded by the second LAN interface to be tested is consistent with the loop detection data frame includes: and the control module judges whether the length, the target MAC and the effective load of the data frame received by the second LAN port to be detected are consistent with the length, the target MAC and the effective load of the loop detection data frame.
The invention detects and judges whether a loop appears between two LAN ports of the AP or not by sending the loop detection frame at regular time, and has simple method and strong operability. When a loop exists, the loop state can be effectively shielded, and the danger of falling into a loop storm can be basically avoided. In addition, before the loop detection frame is sent at regular time, an event trigger condition is set, and the time interval of the two Ethernet ports Up is interpreted to improve the loop detection, so that the load of system operation is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a first embodiment of a method for detecting a LAN port loop of an AP according to the present invention;
FIG. 2 is a flowchart illustrating another embodiment of a method for detecting a LAN port ring of an AP according to the present invention;
fig. 3 is a block diagram of an embodiment of a system for detecting a LAN interface loop of an AP according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention discloses a method for detecting an LAN port loop of an AP, the embodiment is shown in figure 1, and the method comprises the following steps:
s100, judging whether a first LAN port to be detected and a second LAN port to be detected of the AP are both in a starting state, if so, entering the next step;
s200, starting a loop detection polling mechanism, and controlling the first LAN port to be detected to regularly send loop detection data frames according to a preset detection period;
s300, judging whether the data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, entering the step S400, otherwise, entering the step S500;
s400, judging that a loop circuit appears in the first LAN port to be detected and the second LAN port to be detected;
s500, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, closing the loop detection polling mechanism and stopping loop detection.
The present invention detects whether a loop occurs between two LAN ports of an AP by transmitting a loop detection data frame (Ethernet Date frame). Firstly, a loop detection function is started when a first LAN port to be detected and a second LAN port to be detected are both in an enabled state, after loop detection is started, the first LAN port to be detected sends a data frame (loop detection data frame) for detecting a loop, then whether the data frame received by the second LAN port to be detected and about to be forwarded is the loop detection data frame sent by the first LAN port to be detected is detected, and if so, the loop of the first LAN port to be detected and the second LAN port to be detected is judged.
In step S300 of the above embodiment, determining whether the data frame received and to be forwarded by the second LAN interface to be tested is consistent with the loop detection data frame includes determining whether the length, destination MAC, and payload of the data frame received by the second LAN interface to be tested are consistent with the length, destination MAC, and payload of the loop detection data frame, if yes, step S400 is performed, otherwise step S500 is performed.
If the length, destination MAC address and payload (payload) of the data frame received and to be forwarded by the ethernet are all consistent with the loop detection data frame sent by the first LAN port to be tested, it means that the data frame received and forwarded by the second LAN port to be tested is the data frame sent by the first LAN port to be tested. Preferably, after the data received and prepared to be forwarded by the second LAN port to be tested is judged to be consistent with the loop detection data frame sent by the first LAN port to be tested, if it is further judged that the second LAN port to be tested forwards the received data to the first LAN port to be tested, the loop appears on the first LAN port to be tested and the second LAN port to be tested undoubtedly, and the loop is forwarded in such a cycle, so that a loop storm is caused, and normal communication is affected.
Preferably, on the basis of the above embodiment, the method further includes the steps of:
s450, sending a loop alarm signal, and closing the second LAN port to be detected.
Now, suppose that the AP has two ethernet ports, and in order to be able to detect the loop quickly, we adopt a form of sending a message at a fixed time, where the fixed time is N. After the AP is powered on, it starts to detect whether both ethernet ports are up. In the case where only one LAN is used or no LAN port is used, the loop discovery function is turned off. The detection mode does not need polling, and only needs to detect when a certain LAN port is up or down.
When both ports up are detected, the loop discovery function is turned on.
The loop discovery function is designed as a polling mechanism. The timing is N (3 seconds is recommended for N). At each timing trigger, an Ethernet Data frame is sent from the LAN1, dest MAC is a specific value, where a and payload are assumed to be a (note that this embodiment sets the payload to be the target MAC address value, but of course, it may be set to other values as long as both parties agree). Thus, the length of this Ethernet Data frame is a fixed value, assumed here to be L.
For all frames received on LAN2, the following logic is followed:
Figure BDA0001247524510000081
another embodiment of the method of the present invention, as shown in fig. 2, comprises the steps of:
s100, judging whether a first LAN port to be detected and a second LAN port to be detected of the AP are both in a starting state, if so, entering the next step;
s150, respectively acquiring the starting absolute time values of the first LAN port to be tested and the second LAN port to be tested; acquiring the time difference between the absolute time value of the starting of the second LAN port to be tested and the absolute time value of the starting of the first LAN port to be tested;
s160, judging whether the time difference is smaller than a preset starting time interval or not, if so, entering the step S200;
s200, starting a loop detection polling mechanism, and controlling the first LAN port to be detected to regularly send loop detection data frames according to a preset detection period;
s300, judging whether the data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, entering the step S400, otherwise, entering the step S500;
s400, judging that a loop circuit appears in the first LAN port to be detected and the second LAN port to be detected;
s450, sending a loop alarm signal, and closing the second LAN port to be detected;
s500, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, closing the loop detection polling mechanism and stopping loop detection.
Considering the situation that a non-technician directly connects two ports of the ethernet by using a network cable, theoretically, two ethernet ports up should exist at the same time, and considering that in the actual situation, the processing of hardware and software cannot be completely synchronized, we consider that if the time interval of two ethernet ports up is less than B seconds, we perform loop detection, and in other situations, we do not need to perform loop detection at all. Of course, when the AP is powered on, we must do a loop check.
The logic is as follows:
suppose a port, already up, for a significant time M.
At this time, if the absolute time of another up is N, the following judgment is made:
If(N-M<B)
opening loop detection function, if no loop is detected, immediately closing loop detection function
Else
Do nothing
Because we detect loops only in a very few cases, the burden on the CPU is negligible.
Another embodiment of the method of the present invention, on the basis of any of the above embodiments, further includes, after step S450:
s460, controlling the first LAN port to be detected to continuously send loop detection data frames at regular time according to the preset detection period, releasing the second LAN port to be detected according to the preset release interval time, and controlling the second LAN port to be detected to only receive messages and not to forward the messages;
s470 judges whether the data frame received by the second LAN port to be tested is consistent with the loop detection data frame sent by the first LAN port to be tested, if yes, the step S480 is executed, otherwise, the step S490 is executed;
s480, closing the second LAN port to be tested, and returning to the step S460;
s490, the loop alarm is released, the second LAN port to be tested is started, and the step S500 is entered.
If two LAN ports of the AP are found to have loop conditions, but the system does not know when the loop is to be released, therefore, whether the loop is released or not needs to be detected regularly, if not, one LAN port needs to be closed, and the loop is avoided; if deactivated, the alarm is deactivated, and the previously closed LAN port is also activated, so that both LAN ports operate normally.
Therefore, if a loop already exists, the LAN1 continues to send frames for N seconds, releases LAN2M seconds (release means receiving a message from LAN2, but does not forward any message), and then detects whether a loop exists on LAN 2. Block LAN2, if present, waits until the next M seconds timed trigger. If the LAN2 does not receive the Frame within M seconds (N > M), then the Alert is released and the LAN port operates normally.
In the case of loop, any one down is returned to the initial state, and the loop discovery function is closed.
Based on the same technical concept, the embodiment of the invention also provides a system for detecting the LAN port loop of the AP, and the system can execute the method embodiment. The system provided in the embodiment of the present invention is shown in fig. 3, and includes a first LAN port to be detected 10 of an AP, a second LAN port to be detected 20 of the AP, and a detection control unit 30, where the detection control unit 30 is respectively connected to the first LAN port to be detected 10 and the second LAN port to be detected 20, the detection control unit 30 includes a state detection module 11, a control module 13, and an operation module 12, and the control module 13 is respectively connected to the state detection module 11 and the operation module 12, where: the state detection module 11 detects and judges whether the first LAN interface to be detected 10 and the second LAN interface to be detected 20 are both in an enabled state; if yes, the operation module 12 starts a loop detection polling mechanism under the control of the control module 13, and the first LAN port 10 to be detected periodically sends and sends a loop detection data frame according to a preset detection period under the control of the control module 13; the control module 13 determines whether the data frame received and to be forwarded by the second LAN interface 20 to be tested is consistent with the loop detection data frame, and if so, determines that a loop appears in the first LAN interface 10 to be tested and the second LAN interface 20 to be tested; otherwise, it is determined that no loop exists in the first LAN interface to be detected 10 and the second LAN interface to be detected 20, and the operation module 12 closes the loop detection polling mechanism and stops loop detection.
Preferably, on the basis of the first embodiment of the system, the detection control unit 30 further includes an alarm module 14, and the alarm module 14 is electrically connected to the control module 13, wherein:
when the control module 13 determines that a loop occurs in the first LAN port 10 to be tested and the second LAN port 20 to be tested, the alarm module 14 sends a loop alarm signal, and the operation module 12 closes the second LAN port 20 to be tested.
Once the loop is found, the LAN port at one end of the loop is closed immediately, so that the loop state can be effectively shielded, and the influence of the loop on network communication is avoided.
On the basis of the above system embodiment, the detection control unit 30 further includes an obtaining module 15, and the obtaining module 15 is connected to the control module 13, wherein:
the obtaining module 15 obtains the absolute time values of the first LAN port to be tested 10 and the second LAN port to be tested 20 respectively; acquiring the time difference between the absolute time value of the starting of the second LAN port 20 to be tested and the absolute time value of the starting of the first LAN port 10 to be tested;
the control module 13 determines whether the time difference is smaller than a preset enabling time interval, and if so, the operation module 12 starts a loop detection polling mechanism under the control of the control module 13.
Because the timing polling detection consumes the system memory, the scheme is improved on the basis of the first system embodiment, and the condition of the timing polling loop detection is added before the timing polling loop detection. Considering the situation that a non-technician directly connects two ports of the ethernet by using a network cable, theoretically, two ethernet ports up should exist at the same time, and considering that in an actual situation, the processing of hardware and software cannot be completely synchronized, we consider that if the time interval of two ethernet ports up is less than the preset time B seconds, we perform loop detection, and in other situations, we do not need to perform loop detection at all. Of course, when the AP is powered on, we must do a loop check.
On the basis of the above system embodiment, when the control module 13 determines that the first LAN port to be tested 10 and the second LAN port to be tested 20 have a loop, and the alarm module 14 sends a loop alarm signal, after the operation module 12 closes the second LAN port to be tested 20:
the first LAN port 10 to be tested continues to send loop detection data frames at regular time according to the preset detection period under the control of the control module 13, the operation module 12 releases the second LAN port 20 to be tested according to the preset release interval time, and controls the second LAN port 20 to be tested to receive only messages and cannot forward the messages;
the control module 13 determines whether the data frame received by the second LAN port 20 to be detected is consistent with the loop detection data frame sent by the first LAN port 10 to be detected, if so, the operation module 12 closes the second LAN port 20 to be detected, and releases the second LAN port 20 to be detected after waiting for the next preset release interval time to perform loop detection; otherwise, the operation module 12 releases the loop alarm and starts the second LAN port 20 to be tested.
After the loop is detected, the system can not know when the loop is eliminated, so that the system can intelligently detect whether the loop is eliminated, and once the loop is detected to be eliminated, the LAN port which is limited to be used by the loop before can be intelligently started.
Preferably, in any of the above embodiments, the determining, by the control module 13, whether the data frame received and prepared to be forwarded by the second LAN interface 20 to be tested is consistent with the loop detection data frame includes: the control module 13 determines whether the length, the destination MAC, and the payload of the data frame received by the second LAN port to be detected 20 are consistent with those of the loop detection data frame.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method for detecting a LAN port loop of an AP, comprising the steps of:
s100, judging whether a first LAN port to be detected and a second LAN port to be detected of the AP are both in a starting state, if so, entering the next step;
s150, respectively acquiring the starting absolute time values of the first LAN port to be tested and the second LAN port to be tested; acquiring the time difference between the absolute time value of the starting of the second LAN port to be tested and the absolute time value of the starting of the first LAN port to be tested;
s160, judging whether the time difference is smaller than a preset starting time interval or not, if so, entering the step S200;
s200, starting a loop detection polling mechanism, and controlling the first LAN port to be detected to regularly send loop detection data frames according to a preset detection period;
s300, judging whether the data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, entering the step S400, otherwise, entering the step S500;
s400, judging that a loop circuit appears in the first LAN port to be detected and the second LAN port to be detected;
s500, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, closing the loop detection polling mechanism and stopping loop detection.
2. The method for detecting the LAN port loop of the AP according to claim 1, further comprising, after the step S400, the steps of:
s450, sending a loop alarm signal, and closing the second LAN port to be detected.
3. The method of claim 2, further comprising, after the step S450, the step of:
s460, controlling the first LAN port to be detected to continuously send loop detection data frames at regular time according to the preset detection period, releasing the second LAN port to be detected according to the preset release interval time, and controlling the second LAN port to be detected to only receive messages and not to forward the messages;
s470 judges whether the data frame received by the second LAN port to be tested is consistent with the loop detection data frame sent by the first LAN port to be tested, if yes, the step S480 is executed, otherwise, the step S490 is executed;
s480, closing the second LAN port to be tested, and returning to the step S460;
s490, the loop alarm is released, the second LAN port to be tested is started, and the step S500 is entered.
4. The method for detecting LAN port loop of AP according to any of claims 1-3, wherein said step S300 comprises the steps of:
s310 determines whether the length, destination MAC, and payload of the data frame received by the second LAN port to be tested are consistent with those of the loop detection data frame, if yes, step S400 is performed, otherwise step S500 is performed.
5. The utility model provides a detect system of LAN mouth loop circuit of AP, its characterized in that, including the AP first LAN mouth that awaits measuring, the AP second LAN mouth that awaits measuring, detection control unit respectively with the first LAN mouth that awaits measuring the second LAN mouth that awaits measuring links to each other, detection control unit includes state detection module, control module, operating module, control module respectively with state detection module, operating module link to each other, wherein:
the detection control unit also comprises an acquisition module, the acquisition module is connected with the control module, and the state detection module detects and judges whether the first LAN port to be detected and the second LAN port to be detected are both in a starting state; if yes, respectively acquiring the enabled absolute time values of the first LAN port to be detected and the second LAN port to be detected through the acquisition module; acquiring the time difference between the absolute time value of the starting of the second LAN port to be tested and the absolute time value of the starting of the first LAN port to be tested;
the control module judges whether the time difference is smaller than a preset starting time interval, if so, the operation module starts a loop detection polling mechanism under the control of the control module, and the first LAN port to be detected regularly sends a loop detection data frame according to a preset detection period under the control of the control module;
the control module judges whether a data frame received and prepared to be forwarded by the second LAN port to be tested is consistent with the loop detection data frame, if so, the control module judges that loops appear in the first LAN port to be tested and the second LAN port to be tested; otherwise, judging that no loop exists in the first LAN port to be detected and the second LAN port to be detected, and closing the loop detection polling mechanism by the operation module to stop loop detection.
6. The system for detecting the LAN port loop of the AP according to claim 5, wherein the detection control unit further comprises an alarm module electrically connected to the control module, wherein:
when the control module judges that a loop appears in the first LAN port to be detected and the second LAN port to be detected, the alarm module sends a loop alarm signal, and the operation module closes the second LAN port to be detected.
7. The system for detecting LAN port loop of AP according to claim 6,
when the control module judges that the first LAN port to be detected and the second LAN port to be detected have loops, the alarm module sends a loop alarm signal, and after the operation module closes the second LAN port to be detected:
the first LAN port to be detected continues to send loop detection data frames at regular time according to the preset detection period under the control of the control module, and the operation module releases the second LAN port to be detected according to the preset release interval time, controls the second LAN port to be detected to only receive messages and cannot forward the messages;
the control module judges whether a data frame received on the second LAN port to be detected is consistent with a loop detection data frame sent by the first LAN port to be detected, if so, the operation module closes the second LAN port to be detected, waits for the next preset release interval time and releases the second LAN port to be detected, and loop detection is carried out; otherwise, the operation module releases the loop alarm and starts the second LAN port to be tested.
8. The system according to any of claims 5-7, wherein the controlling module determining whether the data frame received and ready-to-forward by the second LAN interface under test matches the loop detection data frame comprises: and the control module judges whether the length, the target MAC and the effective load of the data frame received by the second LAN port to be detected are consistent with the length, the target MAC and the effective load of the loop detection data frame.
CN201710158959.1A 2017-03-16 2017-03-16 Method and system for detecting LAN port loop of AP Active CN107040431B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710158959.1A CN107040431B (en) 2017-03-16 2017-03-16 Method and system for detecting LAN port loop of AP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710158959.1A CN107040431B (en) 2017-03-16 2017-03-16 Method and system for detecting LAN port loop of AP

Publications (2)

Publication Number Publication Date
CN107040431A CN107040431A (en) 2017-08-11
CN107040431B true CN107040431B (en) 2021-06-04

Family

ID=59534444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710158959.1A Active CN107040431B (en) 2017-03-16 2017-03-16 Method and system for detecting LAN port loop of AP

Country Status (1)

Country Link
CN (1) CN107040431B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743234B (en) * 2019-03-01 2022-04-22 苏州盛科通信股份有限公司 Loop detection method and system based on tolerance mechanism

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845512A (en) * 2006-05-25 2006-10-11 杭州华为三康技术有限公司 Method and apparatus for detecting loop
CN101707538A (en) * 2009-11-25 2010-05-12 烽火通信科技股份有限公司 Method for detecting and automatically recovering Ethernet loopback
CN103858388A (en) * 2013-10-08 2014-06-11 华为技术有限公司 Loop detection method and apparatus
CN104158706A (en) * 2014-08-26 2014-11-19 杭州华三通信技术有限公司 Method and device of loopback detection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6388434B2 (en) * 2014-07-18 2018-09-12 アライドテレシスホールディングス株式会社 Network device, communication method, program, recording medium
CN105704020B (en) * 2014-11-25 2019-05-17 华为技术有限公司 Loop prevention method, equipment and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845512A (en) * 2006-05-25 2006-10-11 杭州华为三康技术有限公司 Method and apparatus for detecting loop
CN101707538A (en) * 2009-11-25 2010-05-12 烽火通信科技股份有限公司 Method for detecting and automatically recovering Ethernet loopback
CN103858388A (en) * 2013-10-08 2014-06-11 华为技术有限公司 Loop detection method and apparatus
CN104158706A (en) * 2014-08-26 2014-11-19 杭州华三通信技术有限公司 Method and device of loopback detection

Also Published As

Publication number Publication date
CN107040431A (en) 2017-08-11

Similar Documents

Publication Publication Date Title
JP3429806B2 (en) Network connection system, data processing network, and operation method thereof
EP2352253A1 (en) Method and apparatus for protecting link aggregation group of ethernet ring
CN110808873B (en) Method and device for detecting link failure
JP2016535956A5 (en)
TW201121264A (en) Loop detection method and network device applying the same
US20200067956A1 (en) Detection of manipulations in a can network by checking can identifiers
US11792099B2 (en) Troubleshooting method, device, and readable storage medium
GB2355373B (en) Network device including automatic detection of duplex mismatch
CN109062847A (en) System on chip, IP kernel and its control method for RS485 serial communication
CN103973509A (en) Loop detection method and network device
CN107040431B (en) Method and system for detecting LAN port loop of AP
EP3024160A1 (en) Control method, device and optical transceiver
WO2017059715A1 (en) Data configuration method and device for protecting ring network
JP2006174375A (en) Frame transfer device and looping suppressing method for frame
US11088897B2 (en) Bidirectional forwarding detection control packet to indicate maintenance mode operation
CN105703967A (en) Method and apparatus for detecting label switching path connectivity
CN108933732B (en) Loop detection method, device and system
CN102347859A (en) Link rapidly recovering method and device
US9606604B1 (en) Energy efficient high-speed link and method to maximize energy savings on the energy efficient high-speed link
US9525590B2 (en) Relay system and relay device
US11272384B2 (en) Systems and methods for increasing the reliability of a wireless communication connection
CN102647298B (en) A kind of method and device for realizing data transmission based on double layer network tangent rings
EP3076604B1 (en) Communication device and link establishment method
CN109428643A (en) Wireless communication device and its method of controlling antenna
JP2014150503A (en) Communication device, communication method, and communication program

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
TA01 Transfer of patent application right

Effective date of registration: 20201027

Address after: 318015 no.2-3167, zone a, Nonggang City, no.2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province

Applicant after: Taizhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Applicant before: Phicomm (Shanghai) Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant