WO2015051493A1 - Loop detection method and apparatus - Google Patents

Loop detection method and apparatus Download PDF

Info

Publication number
WO2015051493A1
WO2015051493A1 PCT/CN2013/084834 CN2013084834W WO2015051493A1 WO 2015051493 A1 WO2015051493 A1 WO 2015051493A1 CN 2013084834 W CN2013084834 W CN 2013084834W WO 2015051493 A1 WO2015051493 A1 WO 2015051493A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
loop detection
loop
detection information
lldp message
Prior art date
Application number
PCT/CN2013/084834
Other languages
French (fr)
Chinese (zh)
Inventor
郭海
刘婷
谢小福
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201380001520.8A priority Critical patent/CN103858388A/en
Priority to PCT/CN2013/084834 priority patent/WO2015051493A1/en
Publication of WO2015051493A1 publication Critical patent/WO2015051493A1/en

Links

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a loop detection method and apparatus.
  • PEO Power Over Ethernet
  • a complete P0E system includes two parts: a Power Sourcing Equipment (PSE) and a Powered Device (PD).
  • PSE Power Sourcing Equipment
  • PD Powered Device
  • the PSE is used to power the Ethernet client.
  • the device is also the administrator of the entire P0E Power over Ethernet process
  • the PD is a client device that accepts power, such as a micro base station, a WLAN AP, and a wireless local area network access point (WLAN Local Area Network Access Point). Point) and so on.
  • the Link Layer Discovery Protocol is a link layer discovery method.
  • the information of the local device can be organized into different types, types, lengths, and values (Type, Length, Value, TLV).
  • the cell encapsulation is sent to the directly connected neighbor in the link layer discovery protocol data unit (LLDPDU), and the LLDPDU received from the neighbor is also saved in the form of a standard management information base (MIB). Get up for the network management system to query and judge the communication status of the link.
  • MIB management information base
  • the LLDP packet format is as shown in Figure 1. It includes the Destination Media Access Control (DMAC) address, the source media access control layer (Source MAC, SMAC) address, and the virtual local area network tag (VLAN). The tag type, the Ethernet type, and the payload (Data), where the protocol number included in the Ethertype is a fixed value defined by the LLDP protocol, and all the transmitted LLDP packets carry the protocol number, where the payload That is the LLDPDU.
  • DMAC Destination Media Access Control
  • Source MAC source media access control layer
  • SMAC source media access control layer
  • VLAN virtual local area network tag
  • the IEEE 802.3af (2003) standard specifies that PSE can be powered by Ethernet at 13W. Under the PD power supply, I EEE 802. 3a t (2009) defines that the power that the PSE can provide is about 30W. However, in the wireless network powered by P0E, the power of the base station far exceeds the power of 30 W specified by I EEE 802. 3a t. Therefore, when the micro base station functions as a PD, the solution for powering the micro base station by using two network lines is adopted. . Since the micro base station has two network cables for power supply, the micro base station has two ports for data signal transmission, which will form a loop, which causes waste of bandwidth resources. Therefore, it is necessary to take a loop detection method to detect and remove the ring. road.
  • a packet carrying a specific information is specifically defined and transmitted between the local device and the peer device for loop detection.
  • the DMAC shown in FIG. 1 carries the MAC address of the local device; the Ethernet type is set to a customized specific protocol number, for example, 0x9000; the payload includes the port number for sending the packet. information.
  • the local device After the local device sends the packet carrying the specific information, it needs to monitor the packet received by the other port in real time, and determine whether it is the specific information according to the information carried in the received packet. If yes, the port that receives the packet. There is a loop with the port that sends the packet, and the loop is removed.
  • the defined packet carrying the specific information is not a standard LLDP packet, for example, the Ethernet type carries a customized specific protocol number. , may conflict with other custom user messages, or conflict in the future when the protocol number is extended.
  • the embodiment of the invention provides a loop detection method and device, which avoids the problem that non-standard LLDP messages conflict with user messages.
  • the present invention provides a loop detection method, including:
  • the first device sends the first link layer discovery protocol data unit LLDP packet to the second device by using the first port, where the first LLDP packet includes the first loop detection information, the first loop
  • the detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port; Receiving, by the first device, the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
  • the first device determines that there is a loop between the first port and the second port.
  • the present invention provides another loop detection method, including:
  • the second device receives the first link layer discovery protocol data unit LLDP packet sent by the first device by using the first port, where the first LLDP packet includes the first loop detection information, the first loop
  • the detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • the second device generates a second LLDP packet according to the first loop detection information, where the second LLDP message includes the first loop detection information;
  • the second device sends the second loop detection message to the first device.
  • the present invention provides a network device, including:
  • a sending unit configured to send the first link layer discovery protocol data unit LLDP packet to the second device by using the first port, where the first LLDP packet includes first loop detection information, where the first The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • An acquiring unit configured to acquire, by the second port, a second LLDP packet that is sent by the second device, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
  • the present invention provides a network device, including: a receiving unit, configured to receive a first link layer discovery protocol data unit LLDP packet that is sent by the first device by using the first port, where the first LLDP packet includes first loop detection information, where the first The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • An acquiring unit configured to acquire first loop detection information in the first LLDP packet
  • a generating unit configured to generate, by the second device, second information according to the first loop detection information
  • the first LLDP data includes the first loop detection information
  • the present invention provides a network device, including:
  • a memory for storing software programs and messages
  • a processor configured to execute a software program in the memory, specifically executing:
  • the first link layer discovery protocol data unit LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
  • the first device determines that there is a loop between the first port and the second port.
  • the present invention provides a network device, including:
  • a memory for storing software programs and messages
  • a processor configured to execute a software program in the memory, specifically executing:
  • the first LLDP information includes the first loop detection information, the first loop detection information includes a loop detection type, the device identifier of the first device, and the first The port number of the port;
  • a loop detection method and device are provided by the first embodiment of the present invention.
  • the first device generates a first loop detection packet according to the local device identifier and the first port number, where the first loop detection packet includes a link.
  • a layer discovery protocol data unit LLDPDU the LLD PDU includes a type length value TLV of a loop detection type, the value in the TLV includes a local device identifier and a first port number, and the first port number is a to-be-sent
  • the first loop detects the port number corresponding to the first port of the first loop, the first device has at least two ports, and the first port is any one of the at least two ports, and
  • the first port sends the first loop detection packet to the second device, and then the first device receives the packet sent by the second device by using the second port, and determines whether the packet is the second packet.
  • the LLD PDU in the second loop detection packet includes a TLV of a loop detection type, the value in the TLV includes a local device identifier and a first port number, and the second port is The first setting If the packet is the second loop detection packet, the first port number in the second loop detection packet is determined, and the first port is determined. A loop exists between the first port corresponding to the port number and the second port.
  • the embodiment of the present invention solves the problem that the non-standard LLDP packet carrying a specific protocol number is used in the prior art, which conflicts with other customized user messages, or conflicts in the future when the protocol number is extended. . DRAWINGS
  • Figure 1 is a schematic diagram of a format of an LLDP packet
  • FIG. 2 is a flowchart of a loop detection method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another loop detection method according to an embodiment of the present invention.
  • Figure 4 is a schematic structural view of a P0E system
  • FIG. 5 is a flowchart of still another loop detection method according to an embodiment of the present invention.
  • FIG. 6 is an internal virtual structure diagram of a PD or a PSE in the prior art
  • FIG. 7 is a structural diagram of a network device according to an embodiment of the present disclosure.
  • FIG. 8 is a structural diagram of another network device according to an embodiment of the present disclosure.
  • FIG. 9 is a structural diagram of still another network device according to an embodiment of the present disclosure.
  • FIG. 10 is a hardware structural diagram of a network device according to an embodiment of the present invention.
  • FIG. 1 is a hardware structural diagram of another network device according to an embodiment of the present invention. detailed description
  • a loop detection method is provided by an embodiment of the present invention, where the method includes the following steps:
  • the first device sends the first LLDP packet to the second device by using the first port.
  • the first LLDP information includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port.
  • the destination MAC address in the first LLDP packet is the MAC address of the second device, and the source MAC address.
  • the address is the MAC address of the first device.
  • the first device and the second device are all devices in the P0E system, and may be a PD or a PSE. If the first device is a PD, and the second device is a PSE, if the second device is a PD, the corresponding first device is PSE.
  • the first loop detection information may use a cell defined by the TLV format, for example, the type in the cell defined by the TLV format is defined as loop detection, and the LLDP packet is used to detect the first device. Whether there is a loop between the ports, the length in the cell defined by the TLV format indicates the length of the cell defined by the TLV format, and the value in the cell defined by the TLV format includes the device identifier of the first device and the first port.
  • the port number, the device identifier of the first device is a unique identifier of the first device in the P0E system
  • the first port is a port that sends the first loop detection, for example, when the first device When there are two ports, port 1 and port 2, the port that sends the first loop detection is port 1, and the first port is port 1.
  • the first LLDP packet is generated by the first device according to the set time interval. For example, if the set time is 10 s, the first device generates the first time according to the set time interval of 10 s.
  • An LLDP packet performs loop detection on a port in the first device. The first device is loop-detected by using the set time interval, and the first loop detection message does not need to be generated continuously, and the power consumption of the first device is saved.
  • the first loop detection may be sent by each port of the first device, where the first loop detection sent by each port is detected.
  • the port number carried in the packet is the port number of the corresponding sending port. For example, when the first loop detection packet is to be sent out through port 2, the port number carried in the first loop detection packet is port 2.
  • the first device acquires a second LLDP packet that is sent by the second device from the second port.
  • the second LLDP packet includes the first loop detection information, and the second port is a port different from the first port.
  • the second LLDP packet includes the first loop detection information, that is, the second LLDP packet is included.
  • the LLD PDU includes a TLV of the type of loop detection, and the value in the TLV includes a device identifier of the first device and a port number of the first port, where the second port is the first device except the first port. Any other port.
  • the first device determines that there is a loop between the first port and the second port.
  • the first device sends the first LLDP packet that includes the first loop detection information by using the first port, where After receiving the second device, the second device performs the processing of the second device, and the first loop detection information is carried in the second LLDP packet, and then sent to the first device, indicating that the port of the first device exists.
  • the loop that is, there is a loop between the first port and the second port.
  • step 2 04 may also be included:
  • Step 2 The first device prohibits one of the first port or the second port from being used to transmit a message.
  • the loop between the ports of the device causes some messages to be forwarded. For example, broadcast messages cause a waste of bandwidth resources. Therefore, some measures can be taken to disconnect the packets between the ports that generate loops. Used for P0E.
  • the first device prohibits one of the first port or the second port for transmitting a message to break a loop between the first port and the second port.
  • the loop can be broken by:
  • Manner 1 Display an alarm prompt, the alarm prompt is used to prompt a loop between the first port and the second port of the first device, and receive a configuration instruction, where the configuration command is used to prohibit the first port or The second port is used for transmitting packets, and is only used for Power over Ethernet (P0E). And according to the configuration instruction, the first port or the second port is prohibited from being used for transmitting a message.
  • P0E Power over Ethernet
  • the user can be notified by displaying an alarm prompt, between the first port and the second port of the first device There is a loop, and the user's configuration command for the port is received, and the first port or the second port is prohibited from transmitting the message, and is only used for the power-on P0E.
  • Manner 2 The data link for transmitting the message corresponding to the first port or the second port is actively disconnected.
  • the first device If there is no loop between the ports of the first device, that is, the first device does not receive the second loop detection packet, the first device does not do any for port 1 and port 2. deal with.
  • a loop detection method provided by an embodiment of the present invention includes the following steps:
  • the second device receives the first link layer discovery protocol data unit LLDP packet sent by the first device by using the first port.
  • the first LLDP information includes the first loop detection information, and the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port.
  • the LLD PDU includes a TLV of a loop detection type, and the value in the TLV includes a first device identifier and a first port number, where the first port number is sent by the first loop detection.
  • a port number corresponding to the first port of the file where the first device has at least two ports, the first end The port is any one of the at least two ports, the second device has at least two ports, and the third port is any one of the at least two ports, the third port and the third port One port is directly connected.
  • the second device is a PSE, or the first device is a PSE, the second device is a PD, and the PD and the PSE both have at least two ports. .
  • the second device determines whether the packet is a first loop detection packet by determining whether the type of the TLV carried in the packet is a loop detection.
  • the first loop detection packet is based on an existing LLDP packet, and the LLD PDU in the packet carries a TLV, where the type in the TLV is loop detection, and the LLDP packet is used to detect the LLDP packet.
  • the length in the TLV indicates the length of the TLV
  • the value in the TLV includes the first device identifier and the first port number
  • the first device identifier is the first device a unique identifier in the P0E system, where the first port number is a port number corresponding to the first port that sends the first loop detection, for example, when the first device has two ports, the port 1 and port 2, then the first port number is port 1 or port 2.
  • the first loop detection information is obtained, and the first loop detection information includes the first device identifier in the first loop detection packet. , the first port number and the loop detection type;
  • the second device generates a second LLDP packet according to the first loop detection information.
  • the second loop detection message is an LLDP file, and the second LLDP message includes the first loop detection information.
  • the second loop detection is an LLDP packet encapsulated with an LLDPDU, and the LLD PDU includes a TLV of a loop detection type, and the value in the TLV includes a first device identifier and a first port number. .
  • the second device detects that the packet is the first loop detection packet
  • the second device detects the first device identifier and the first port number in the first loop detection, and identifies the first device identifier.
  • the first port number is carried in the new LLDP packet and sent to the first device.
  • the TLV including the first device identifier and the first port number is carried in the second loop detection document. 304.
  • the second device sends the second loop detection packet to the first device.
  • the fourth port is any port other than the third port.
  • the second loop detection packet is sent out by receiving the port other than the first loop detection packet, that is, the second loop is used to detect the loop.
  • the loop detection message is sent to the first device.
  • the embodiments of the present invention can implement loop detection on the ports of the device based on the existing LLDP packets, and avoid generating non-standard LLDP packets with a specific protocol number, which may result in other custom user reports. Conflicts in text, or conflicts in the future when protocol numbers are extended.
  • the present invention performs loop detection on the P0E system as shown in FIG. 4, wherein PD1 represents a high-power device exceeding the power specified by IEEEE 802.3a, such as a micro base station, and PD2 satisfies I EEE 802. 3a t
  • a small-power device that specifies power for example, a small-power device such as a WLAN AP or a start-up wave.
  • the PSE can be a P0E switch, and performs power transmission while transmitting packets with PD1 and PD2.
  • the solid line indicates the Ethernet line, and the dotted line indicates the AC power line.
  • the network cable is also used for data signal transmission, which may result in a loop in the link. Therefore, in the embodiment of the present invention,
  • the PD1 is used as the first device and the PSE is the second device.
  • the loop detection method is described. For the sake of understanding, the following examples are for illustrative purposes only. The present invention does not impose any restrictions. 1 and port 2, the PSE has port 3 and port 4, port 1 and port 3 are directly connected, and port 2 and port 4 are directly connected. As shown in FIG. 5, the method includes the following steps:
  • the PSE is responsible for managing parameters such as the power supply and current magnitude of the PD 1, and setting the above power supply parameters, and achieving the same at both ends, the following power supply is performed.
  • PD1 generates a first loop detection according to the local device identifier and the first port number.
  • the LLD PDU in the first loop detection carries a TLV, where the type in the TLV is loop detection, and the LLDP packet is used to detect whether the ports of the first device are stored.
  • the value in the TLV includes the local device identifier and the first port number, the local device identifier is the PD1 device identifier, and the first port number is the port number of the port 1.
  • the PD1 sends the first loop detection packet to the PSE through the port 1.
  • the destination MAC address in the first loop detection packet is the MAC address of the PSE, and the source MAC address is the MAC address of the PD1.
  • the first port number is the port number of port 2, and is sent to the PSE through port 2.
  • the PSE receives the first loop detection packet through port 3, and determines whether the type of the TLV carried in the packet is loop detection.
  • the PSE obtains the PD1 device identifier and the port number of the port 1 in the first loop detection.
  • the PSE generates a second loop detection packet according to the PD1 device identifier and the port number of port 1.
  • the destination MAC address in the second loop detection is the MAC address of the PD1
  • the source MAC address is the MAC address of the PSE.
  • the PSE sends the second loop detection packet to the PD1.
  • the second loop detection packet carries the MAC address of the PD1, so the PSE needs to send the second loop detection packet to the PD1 through the port 4 and the port 5, when the PD2 receives the When the second loop detects a packet, it discards it directly.
  • the PD1 receives the second loop detection packet through the port 2, and determines whether the device identifier of the PD1 is carried in the packet.
  • the PD1 obtains the port number of the port 1 in the second loop detection.
  • PD1 determines that there is a loop between port 1 and port 2.
  • the PD1 can use some measures to disconnect the loop between the port 1 and the port 2, as described in the first mode and the second mode in the embodiment shown in FIG. 2, for example, the data link between the port 2 and the port 4. disconnect.
  • the first device may also be a PSE
  • the second device is a PD1, performing loop detection.
  • the process is similar to that of Figure 5, and will not be described here.
  • the PD includes an application module, an LLDP management module, a management information library module, an LLDP proxy module, and a port. 1 and port 2.
  • the LLDP proxy module reports the packet to the LLDP management module after receiving the packet through port 1 or port 2.
  • the LLDP management module is responsible for managing the LLDP protocol and local information of the device, such as device ID and port number.
  • the LLDP management module is also responsible for storing the received peer device, that is, the PSE information, into the management information base for querying by the module.
  • the LLDP management module completes the loop detection process shown in Figure 5, and reports the detection result to the application module.
  • the application module will display an alarm prompt to notify the user, and receive the user's configuration, or automatically. Disconnect one of the links for data transmission, only for P0E.
  • the embodiment of the present invention provides a network device 70, as shown in FIG. 7, including:
  • the sending unit 71 is configured to send, by using the first port, the first link layer discovery protocol data unit LLDP packet to the second device, where the first LLDP packet includes first loop detection information, where The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • the obtaining unit 72 is configured to acquire, by the second port, the second LLDP message that is sent by the second device, where the second LLDP message includes the first loop detection information, where The two ports are different ports from the first port;
  • the determining unit 7 3 is configured to determine, by the first device, that there is a loop between the first port and the second port.
  • the network device generates a first loop detection packet according to the local device identifier and the first port number, where the first loop detection packet includes a link layer discovery protocol data unit LLDPDU.
  • the LLD PDU includes a type length value TLV of the loop detection type, and the value in the TLV includes the local device identifier and the first port number, and the first port number is the first loop detection to be sent.
  • the port number corresponding to the first port of the text the first device exists at least Two ports, the first port is any one of the at least two ports, and the first loop detection packet is sent to the second device by using the first port, and then received by the second port a packet sent by the second device, and determining whether the packet is a second loop detection packet, where the LLDPDU in the second loop detection packet includes a TL V of a loop detection type, The value in the TL V includes the local device identifier and the first port number, and the second port is any port other than the first port in the first device, and the packet is determined to be the second ring.
  • the embodiment of the present invention solves the problem that the non-standard LLDP packet carrying a specific protocol number is used in the prior art, which may conflict with other customized user messages, or may conflict in the future when the protocol number is extended. problem.
  • the generating unit is further configured to generate, according to the set time interval, the first loop detection according to the local device identifier and the first port number.
  • the method may further include:
  • the generating unit 74 is configured to generate the first LLDP packet according to the set time interval.
  • the control unit 75 is configured to: after the determining unit determines that there is a loop between the first port and the second port, prohibiting one of the first port or the second port from transmitting a packet .
  • control unit 75 includes:
  • the display sub-unit 75 1 is configured to display an alarm prompt, where the alarm prompt is used to prompt a loop between the first port and the second port;
  • the receiving subunit 752 is configured to receive a configuration instruction, where the configuration command is used to prohibit the first port or the second port from being used to transmit a message;
  • the port restriction subunit 7 5 3 is further configured to prohibit the first port or the second port from transmitting a message according to the configuration instruction.
  • the embodiment of the present invention further provides a network device 90, as shown in FIG. 9, comprising: a receiving unit 91, configured to receive a first link layer discovery protocol data unit LLDP report sent by the first device through the first port.
  • the first LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port of the first port. number;
  • the obtaining unit 92 is configured to obtain the first loop detection information in the first LLDP packet, and the generating unit 9 3 is configured to generate, by the second device, the second LLDP according to the first loop detection information.
  • the second LLDP message includes the first loop detection information;
  • the sending unit 94 is configured to send the second loop detection message to the first device. If the first device is a power receiving device PD, the second device is a power supply device PSE; or if the first device is a PSE, the second device is a PD.
  • the embodiment of the present invention provides a network device, which receives a packet through a third port, and determines whether the packet is a first loop detection packet, and the first loop detection packet is an LLDP packet encapsulated with an LLDPDU.
  • the LLD PDU includes a TLV of the type of loop detection, and the value in the TLV includes a first device identifier and a first port number, where the first port number is sent by the first loop detection.
  • the port number corresponding to the first port, the first device has at least two ports, the first port is any one of the at least two ports, and the second device has at least two ports,
  • the third port is any one of the at least two ports, and the third port is directly connected to the first port.
  • the first port is obtained.
  • the first device identifier and the first port number in the loop detection packet are generated according to the first device identifier and the first port number, and the second loop detection packet is encapsulated with an LLDPDU.
  • LLDP packet including the type in the LLDPDU a loop detection TLV, the value in the TLV includes a first device identifier and a first port number, and the second loop detection packet is sent to the first device by using a fourth port, where the fourth port is Is any port other than the third port.
  • the embodiment of the present invention solves the problem in the prior art that a non-standard LLDP packet carrying a specific protocol number is used, which may conflict with other customized user messages, or may conflict in the future when the protocol number is extended. problem.
  • the network device shown in FIG. 7 and FIG. 8 above can be implemented based on a hardware structure such as a computer. As shown in FIG. 10, the hardware structure of the network device 10 includes a memory 1001, a communication port 1002, and a processor 1003.
  • the memory 1001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 1001 can store instructions of the operating system and other applications as well as application data. The instructions stored in the memory 1001 are executed by the processor 1003.
  • the memory 1001 in the embodiment of the present invention can be used to store instructions and messages for implementing the functional units in the embodiments shown in Figs. 7 and 8.
  • Communication port 1002 is used to enable communication between network device 10 and other devices.
  • the communication port 1002 is configured to send and receive a message.
  • the processor 1003 can use a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs. .
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the processor 1003 is configured to execute an instruction in the memory 1001, and specifically:
  • the first link layer discovery protocol data unit LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
  • the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
  • the first device determines that there is a loop between the first port and the second port.
  • the specific processing procedure in the processor 1003 may refer to the method embodiment part and the apparatus embodiment part shown in FIG. 7 and FIG. 8 , and details are not described herein again.
  • the network device shown in FIG. 9 above can be implemented based on the hardware structure of the computer. As shown in FIG. 11, the hardware structure of the network device 11 includes a memory 1101, a communication port 1102, and a processor 1103.
  • the memory 1101 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 1101 can store instructions for the operating system and other applications as well as application data. The instructions stored in the memory 1101 are executed by the processor 1103.
  • the memory 1101 can be used to store instructions and messages for implementing the functional units in the embodiment shown in FIG.
  • Communication port 1102 is used to enable communication between network device 11 and other network devices. In the embodiment of the present invention, communication between the network device 11 and the network device 10 is performed through the communication port 1102.
  • the communication port 1102 is configured to send and receive a message
  • the processor 1103 can use a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs. .
  • CPU general-purpose central processing unit
  • ASIC application specific integrated circuit
  • the processor 1103 is configured to execute an instruction in the memory 1101, and specifically:
  • the first LLDP message includes the first loop detection information, and the first loop detection information Include a loop detection type, a device identifier of the first device, and a port number of the first port;
  • the specific processing procedure in the processor 1 1 03 can refer to the method embodiment part and the apparatus embodiment part shown in FIG. 9, and details are not described herein again.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including several
  • the instructions are for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program code. .

Landscapes

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

Abstract

Disclosed are a loop detection method and apparatus, which relate to the technical field of communications and solve the problem that using a non-standard LLDP packet carrying a user-defined specific protocol number causes conflict with other user-defined user packets in the prior art. A first device sends a first link layer discovery protocol LLDP data unit packet to a second device via a first port, the first LLDP packet comprising first loop detection information, the first loop detection information comprising loop detection type, the device identification of the first device and the port number of the first port; the first device acquires a second LLDP packet which is received from a second port and sent by the second device, the second LLDP packet comprising the first loop detection information, and the second port being a port different from the first port; and the first device determines that there is a loop between the first port and the second port. The embodiments of the present invention are applied in a loop detection process.

Description

环路检测方法及装置 技术领域  Loop detection method and device
本发明涉及通信技术领域, 尤其涉及一种环路检测方法及装置。  The present invention relates to the field of communications technologies, and in particular, to a loop detection method and apparatus.
背景技术 Background technique
以太网供电 ( Power Over Ethernet, POE ) 是通过标准的五类网线为 以太网客户端传输数据信号的同时, 还为其提供直流供电的技术。 一个完 整的 P0E ***包括供电端设备 PSE ( Power Sourcing Equipment, PSE供 电端设备) 和受电端设备 PD ( Powered Device, PD受电端设备) 两部分, 其中, PSE是为以太网客户端设备供电的设备, 同时也是整个 P0E 以太网 供电过程的管理者, 而 PD是接受供电的客户端设备, 如微基站、 WLAN AP 无线局域网接入点 (Wireless Local Area Network Access Point, WLAN AP 无线局域网接入点) 等。  Power Over Ethernet (POE) is a technology that provides DC power to Ethernet clients while transmitting data signals through standard Category 5 network cables. A complete P0E system includes two parts: a Power Sourcing Equipment (PSE) and a Powered Device (PD). The PSE is used to power the Ethernet client. The device is also the administrator of the entire P0E Power over Ethernet process, and the PD is a client device that accepts power, such as a micro base station, a WLAN AP, and a wireless local area network access point (WLAN Local Area Network Access Point). Point) and so on.
链路层发现协议 ( Link Layer Discovery Protocol , LLDP ) 是一种 链路层发现方式, 可以将本端设备的信息组织成不同的类型, 长度, 值 ( Type, Length, Value, TLV ) 格式定义的信元封装在链路层发现协议数 据单元 (LLDP Data Unit, LLDPDU ) 中发送给直连的邻居, 同时也把从邻 居接收到的 LLDPDU以标准管理信息库 ( Management Information Base, MIB) 的形式保存起来, 以供网络管理***查询, 并判断链路的通信状况。  The Link Layer Discovery Protocol (LLDP) is a link layer discovery method. The information of the local device can be organized into different types, types, lengths, and values (Type, Length, Value, TLV). The cell encapsulation is sent to the directly connected neighbor in the link layer discovery protocol data unit (LLDPDU), and the LLDPDU received from the neighbor is also saved in the form of a standard management information base (MIB). Get up for the network management system to query and judge the communication status of the link.
LLDP报文格式如图 1所示, 包括目的媒质访问控制层 (Destination Media Access Control, DMAC )地址、源媒质访问控制层( Source MAC, SMAC ) 地址、 虚拟局域网标签 ( Virtual Local Area Network tag, VLAN tag ) 、 以太类型 (Ethernet type ) 和净荷 (Data ) , 其中以太类型中包括的协议 号为 LLDP协议定义的固定值,所有发送的 LLDP报文均会携带所述协议号, 其中, 净荷也就是 LLDPDU。  The LLDP packet format is as shown in Figure 1. It includes the Destination Media Access Control (DMAC) address, the source media access control layer (Source MAC, SMAC) address, and the virtual local area network tag (VLAN). The tag type, the Ethernet type, and the payload (Data), where the protocol number included in the Ethertype is a fixed value defined by the LLDP protocol, and all the transmitted LLDP packets carry the protocol number, where the payload That is the LLDPDU.
IEEE 802.3af ( 2003 ) 标准规定了 PSE可通过以太网向功率在 13W以 下的 PD供电, I EEE 802. 3a t ( 2009 )定义了 PSE可以提供的功率约为 30W。 但是,目前釆用 P0E供电的无线网络中, 啟基站的功率远超过 I EEE 802. 3a t 规定的 30W功率, 因此当微基站作为 PD时, 釆用两根网线对微基站进行供 电的解决方案。 由于所述微基站存在两根网线进行供电, 则所述微基站就 存在两个端口进行数据信号传输, 会形成环路, 导致带宽资源的浪费, 因 此需要釆取环路检测方法检测并去掉环路。 The IEEE 802.3af (2003) standard specifies that PSE can be powered by Ethernet at 13W. Under the PD power supply, I EEE 802. 3a t (2009) defines that the power that the PSE can provide is about 30W. However, in the wireless network powered by P0E, the power of the base station far exceeds the power of 30 W specified by I EEE 802. 3a t. Therefore, when the micro base station functions as a PD, the solution for powering the micro base station by using two network lines is adopted. . Since the micro base station has two network cables for power supply, the micro base station has two ports for data signal transmission, which will form a loop, which causes waste of bandwidth resources. Therefore, it is necessary to take a loop detection method to detect and remove the ring. road.
在现有技术中, 专门定义一个携带有特定信息的报文, 在本端设备与 对端设备之间传输, 来进行环路检测。 在所述报文中, 将图 1所示的 DMAC 中携带有本端设备的 MAC地址; 以太类型设置为自定义的特定协议号, 例 如 0x9000 ; 净荷中包括发送所述报文的端口号信息。 当本端设备将携带有 特定信息的报文发送出去之后, 要实时监控其他端口接收的报文, 根据接 收报文携带的信息判断是否为所述特定信息, 如果是则说明接收报文的端 口与发送所述报文的端口存在环路, 将环路去掉。  In the prior art, a packet carrying a specific information is specifically defined and transmitted between the local device and the peer device for loop detection. In the message, the DMAC shown in FIG. 1 carries the MAC address of the local device; the Ethernet type is set to a customized specific protocol number, for example, 0x9000; the payload includes the port number for sending the packet. information. After the local device sends the packet carrying the specific information, it needs to monitor the packet received by the other port in real time, and determine whether it is the specific information according to the information carried in the received packet. If yes, the port that receives the packet. There is a loop with the port that sends the packet, and the loop is removed.
在实现上述环路检测的过程中, 发明人发现现有技术中至少存在如下 问题: 定义的携带有特定信息的报文不是标准的 LLDP报文, 例如以太类型 中携带了自定义的特定协议号, 可能和其他自定义的用户报文相冲突, 或 者将来在进行协议号扩展时相冲突。 发明内容  In the process of implementing the foregoing loop detection, the inventor has found that at least the following problems exist in the prior art: The defined packet carrying the specific information is not a standard LLDP packet, for example, the Ethernet type carries a customized specific protocol number. , may conflict with other custom user messages, or conflict in the future when the protocol number is extended. Summary of the invention
本发明的实施例提供一种环路检测方法和装置, 避免了釆用非标准 LLDP报文与用户报文相冲突的问题。  The embodiment of the invention provides a loop detection method and device, which avoids the problem that non-standard LLDP messages conflict with user messages.
为达到上述目的, 本发明的实施例釆用如下技术方案:  In order to achieve the above object, embodiments of the present invention use the following technical solutions:
第一方面, 本发明提供一种环路检测方法, 包括:  In a first aspect, the present invention provides a loop detection method, including:
第一设备通过第一端口将第一链路层发现协议数据单元 LLDP 报文发 送给第二设备, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述 第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所述第 一端口的端口号; 所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口; The first device sends the first link layer discovery protocol data unit LLDP packet to the second device by using the first port, where the first LLDP packet includes the first loop detection information, the first loop The detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port; Receiving, by the first device, the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
所述第一设备确定所述第一端口与所述第二端口之间存在环路。 第二方面, 本发明提供另一种环路检测方法, 包括:  The first device determines that there is a loop between the first port and the second port. In a second aspect, the present invention provides another loop detection method, including:
第二设备接收第一设备通过第一端口发送的第一链路层发现协议数 据单元 LLDP报文, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所 述第一端口的端口号;  The second device receives the first link layer discovery protocol data unit LLDP packet sent by the first device by using the first port, where the first LLDP packet includes the first loop detection information, the first loop The detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
获取所述第一 LLDP报文中的第一环路检测信息;  Obtaining first loop detection information in the first LLDP packet;
所述第二设备根据所述第一环路检测信息生成第二 LLDP 报文, 所述 第二 LLDP ^艮文中包括第一环路检测信息;  The second device generates a second LLDP packet according to the first loop detection information, where the second LLDP message includes the first loop detection information;
所述第二设备将所述第二环路检测报文发送给所述第一设备。  The second device sends the second loop detection message to the first device.
第三方面, 本发明提供一种网络设备, 包括: In a third aspect, the present invention provides a network device, including:
发送单元, 用于通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二设备,其中,所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所 述第一端口的端口号;  a sending unit, configured to send the first link layer discovery protocol data unit LLDP packet to the second device by using the first port, where the first LLDP packet includes first loop detection information, where the first The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
获取单元,用于获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口;  An acquiring unit, configured to acquire, by the second port, a second LLDP packet that is sent by the second device, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
确定单元, 用于所述第一设备确定所述第一端口与所述第二端口之间 存在环路。 第四方面, 本发明提供一种网络设备, 包括: 接收单元, 用于接收第一设备通过第一端口发送的第一链路层发现协 议数据单元 LLDP报文, 其中, 所述第一 LLDP报文中包括第一环路检测信 息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识 和所述第一端口的端口号; a determining unit, configured to determine, by the first device, that there is a loop between the first port and the second port. In a fourth aspect, the present invention provides a network device, including: a receiving unit, configured to receive a first link layer discovery protocol data unit LLDP packet that is sent by the first device by using the first port, where the first LLDP packet includes first loop detection information, where the first The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
获取单元, 用于获取所述第一 LLDP报文中的第一环路检测信息; 生成单元, 用于所述第二设备根据所述第一环路检测信息生成第二 An acquiring unit, configured to acquire first loop detection information in the first LLDP packet, and a generating unit, configured to generate, by the second device, second information according to the first loop detection information
LLDP ^艮文, 所述第二 LLDP ^艮文中包括第一环路检测信息; The first LLDP data includes the first loop detection information;
发送单元, 用于将所述第二环路检测报文发送给所述第一设备。 第五方面, 本发明提供一种网络设备, 包括:  And a sending unit, configured to send the second loop detection message to the first device. In a fifth aspect, the present invention provides a network device, including:
存储器, 用于存储软件程序和报文;  a memory for storing software programs and messages;
通信端口, 用于发送和接收报文;  Communication port, used to send and receive messages;
处理器, 用于执行存储器中的软件程序, 具体执行:  a processor, configured to execute a software program in the memory, specifically executing:
通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二 设备, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路 检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一端口的 端口号;  Transmitting, by the first port, the first link layer discovery protocol data unit LLDP packet to the second device, where the first LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口;  Receiving, by the first device, the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
所述第一设备确定所述第一端口与所述第二端口之间存在环路。 第六方面, 本发明提供一种网络设备, 包括:  The first device determines that there is a loop between the first port and the second port. In a sixth aspect, the present invention provides a network device, including:
存储器, 用于存储软件程序和报文;  a memory for storing software programs and messages;
通信端口, 用于发送和接收报文;  Communication port, used to send and receive messages;
处理器, 用于执行存储器中的软件程序, 具体执行:  a processor, configured to execute a software program in the memory, specifically executing:
接收第一设备通过第一端口发送的第一链路层发现协议数据单元 LLDP ^艮文, 其中, 所述第一 LLDP ^艮文中包括第一环路检测信息, 所述第 一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一 端口的端口号; Receiving a first link layer discovery protocol data unit that is sent by the first device through the first port The first LLDP information includes the first loop detection information, the first loop detection information includes a loop detection type, the device identifier of the first device, and the first The port number of the port;
获取所述第一 LLDP报文中的第一环路检测信息;  Obtaining first loop detection information in the first LLDP packet;
根据所述第一环路检测信息生成第二 LLDP报文, 所述第二 LLDP报文 中包括第一环路检测信息;  Generating a second LLDP packet according to the first loop detection information, where the second LLDP packet includes first loop detection information;
将所述第二环路检测报文发送给所述第一设备。  Sending the second loop detection message to the first device.
本发明实施例提供的一种环路检测方法和装置, 第一设备根据本端设 备标识和第一端口号生成第一环路检测报文, 所述第一环路检测报文中包 括链路层发现协议数据单元 LLDPDU , 所述 LLDPDU 中包括类型为环路检测 的类型长度值 TLV , 所述 TLV 中的值包括本端设备标识和第一端口号, 所 述第一端口号为待发送所述第一环路检测 ^艮文的第一端口对应的端口号, 所述第一设备至少存在两个端口, 所述第一端口为所述至少两个端口中的 任意一个,并通过所述第一端口将所述第一环路检测报文发送给第二设备, 然后所述第一设备通过第二端口接收所述第二设备发送的报文, 并判断所 述报文是否为第二环路检测报文,所述第二环路检测报文中的 LLDPDU包括 类型为环路检测的 TLV , 所述 TLV中的值包括本端设备标识和第一端口号, 所述第二端口为所述第一设备中除所述第一端口以外的其他任意端口, 当 判断所述报文为第二环路检测报文时, 获取所述第二环路检测报文中的第 一端口号, 确定所述第一端口号对应的第一端口与所述第二端口之间存在 环路。 本发明实施例解决了现有技术中利用携带了自定义的特定协议号的 非标准 LLDP报文, 导致和其他自定义的用户报文相冲突, 或者将来在进行 协议号扩展时相冲突的问题。 附图说明  A loop detection method and device are provided by the first embodiment of the present invention. The first device generates a first loop detection packet according to the local device identifier and the first port number, where the first loop detection packet includes a link. a layer discovery protocol data unit LLDPDU, the LLD PDU includes a type length value TLV of a loop detection type, the value in the TLV includes a local device identifier and a first port number, and the first port number is a to-be-sent The first loop detects the port number corresponding to the first port of the first loop, the first device has at least two ports, and the first port is any one of the at least two ports, and The first port sends the first loop detection packet to the second device, and then the first device receives the packet sent by the second device by using the second port, and determines whether the packet is the second packet. a loop detection packet, where the LLD PDU in the second loop detection packet includes a TLV of a loop detection type, the value in the TLV includes a local device identifier and a first port number, and the second port is The first setting If the packet is the second loop detection packet, the first port number in the second loop detection packet is determined, and the first port is determined. A loop exists between the first port corresponding to the port number and the second port. The embodiment of the present invention solves the problem that the non-standard LLDP packet carrying a specific protocol number is used in the prior art, which conflicts with other customized user messages, or conflicts in the future when the protocol number is extended. . DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例 中所需要使用的附图作简单地介绍, 显而易见地, 下面所描述的附图仅仅 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性 劳动的前提下, 还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings to be used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1为 LLDP报文格式示意图;  Figure 1 is a schematic diagram of a format of an LLDP packet;
图 2为本发明实施例提供的一种环路检测方法的流程图;  2 is a flowchart of a loop detection method according to an embodiment of the present invention;
图 3为本发明实施例提供的另一种环路检测方法的流程图;  FIG. 3 is a flowchart of another loop detection method according to an embodiment of the present invention;
图 4为 P0E***的结构示意图;  Figure 4 is a schematic structural view of a P0E system;
图 5为本发明实施例提供的又一种环路检测方法的流程图;  FIG. 5 is a flowchart of still another loop detection method according to an embodiment of the present invention;
图 6为现有技术中 PD或者 PSE的内部虚拟结构图;  6 is an internal virtual structure diagram of a PD or a PSE in the prior art;
图 7为本发明实施例提供的一种网络设备的结构图;  FIG. 7 is a structural diagram of a network device according to an embodiment of the present disclosure;
图 8为本发明实施例提供的另一种网络设备的结构图;  FIG. 8 is a structural diagram of another network device according to an embodiment of the present disclosure;
图 9为本发明实施例提供的又一种网络设备的结构图;  FIG. 9 is a structural diagram of still another network device according to an embodiment of the present disclosure;
图 1 0为本发明实施例提供的一种网络设备的硬件结构图;  FIG. 10 is a hardware structural diagram of a network device according to an embodiment of the present invention;
图 1 1为本发明实施例提供的另一种网络设备的硬件结构图。 具体实施方式  FIG. 1 is a hardware structural diagram of another network device according to an embodiment of the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进 行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没 有做出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的 范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
如图 2所示, 本发明实施例提供的一种环路检测方法, 所述方法包括 如下步骤:  As shown in FIG. 2, a loop detection method is provided by an embodiment of the present invention, where the method includes the following steps:
2 01、 第一设备通过第一端口将第一 LLDP报文发送给第二设备。 2 01. The first device sends the first LLDP packet to the second device by using the first port.
其中, 第一 LLDP ^艮文中包括第一环路检测信息, 所述第一环路检测 信息包括环路检测类型, 第一设备的设备标识和第一端口的端口号。 其中, 所述第一 LLDP报文中的目的 MAC地址为所述第二设备的 MAC地址, 源 MAC 地址为所述第一设备的 MAC地址。 The first LLDP information includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port. The destination MAC address in the first LLDP packet is the MAC address of the second device, and the source MAC address. The address is the MAC address of the first device.
第一设备和第二设备都是 P0E***中的设备, 可以是 PD或者 PSE , 如 果第一设备为 PD , 对应地第二设备为 PSE , 如果第二设备为 PD , 则对应地 第一设备为 PSE。  The first device and the second device are all devices in the P0E system, and may be a PD or a PSE. If the first device is a PD, and the second device is a PSE, if the second device is a PD, the corresponding first device is PSE.
其中, 第一环路检测信息可以釆用基于 TLV格式定义的信元, 例如将 TLV格式定义的信元中的类型定义为环路检测, 表示所述 LLDP报文用于检 测所述第一设备的端口之间是否存在环路, TLV 格式定义的信元中的长度 表示所述 TLV格式定义的信元的长度, TLV格式定义的信元中的值包括第 一设备的设备标识和第一端口的端口号, 第一设备的设备标识为第一设备 在 P0E ***中的唯一标识, 所述第一端口为发送所述第一环路检测 ^艮文的 端口, 例如, 当所述第一设备存在两个端口时, 端口 1 和端口 2 , 发送所 述第一环路检测 ^艮文的端口为端口 1 , 则第一端口为端口 1。  The first loop detection information may use a cell defined by the TLV format, for example, the type in the cell defined by the TLV format is defined as loop detection, and the LLDP packet is used to detect the first device. Whether there is a loop between the ports, the length in the cell defined by the TLV format indicates the length of the cell defined by the TLV format, and the value in the cell defined by the TLV format includes the device identifier of the first device and the first port. The port number, the device identifier of the first device is a unique identifier of the first device in the P0E system, and the first port is a port that sends the first loop detection, for example, when the first device When there are two ports, port 1 and port 2, the port that sends the first loop detection is port 1, and the first port is port 1.
可选的, 所述第一 LLDP 报文为所述第一设备按照设置的时间间隔生 成, 例如设置的时间为 1 0 s , 则所述第一设备按照设置的时间间隔 1 0 s , 生 成第一 LLDP报文, 对第一设备中的端口进行环路检测。 利用设置的时间间 隔对第一设备进行环路检测, 而不需要一直不间断地生成所述第一环路检 测报文, 节省所述第一设备的功耗。  Optionally, the first LLDP packet is generated by the first device according to the set time interval. For example, if the set time is 10 s, the first device generates the first time according to the set time interval of 10 s. An LLDP packet performs loop detection on a port in the first device. The first device is loop-detected by using the set time interval, and the first loop detection message does not need to be generated continuously, and the power consumption of the first device is saved.
另外, 为了更快速地找到第一设备端口中的环路, 也可以通过所述第 一设备的各个端口都发送第一环路检测 4艮文, 其中, 各个端口发送出去的 第一环路检测报文中携带的端口号则是对应发送端口的端口号。 例如, 当 第一环路检测报文将要通过端口 2发送出去时, 则第一环路检测报文中携 带的端口号为端口 2。  In addition, in order to find the loop in the first device port more quickly, the first loop detection may be sent by each port of the first device, where the first loop detection sent by each port is detected. The port number carried in the packet is the port number of the corresponding sending port. For example, when the first loop detection packet is to be sent out through port 2, the port number carried in the first loop detection packet is port 2.
2 02、 所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP报文。  2 02. The first device acquires a second LLDP packet that is sent by the second device from the second port.
其中, 所述第二 LLDP 报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口。  The second LLDP packet includes the first loop detection information, and the second port is a port different from the first port.
所述第二 LLDP报文中包括第一环路检测信息, 即包括第二 LLDP报文的 LLDPDU包括类型为环路检测的 TLV , 所述 TLV中的值包括第一设备的设备 标识和第一端口的端口号, 所述第二端口为所述第一设备中除所述第一端 口以外的其他任意端口。 由于要检测所述第一设备的端口之间是否存在环 路, 则检查除所述第一端口以外的其他端口接收到的报文是否为第二 LLDP 报文, 所述第二 LLDP报文, 与所述第一 LLDP报文类似, 只是第二 LLDP报 文中的目的 MAC地址为第一设备的 MAC地址,源 MAC地址为第二设备的 MAC 地址。 The second LLDP packet includes the first loop detection information, that is, the second LLDP packet is included. The LLD PDU includes a TLV of the type of loop detection, and the value in the TLV includes a device identifier of the first device and a port number of the first port, where the second port is the first device except the first port. Any other port. Checking whether a packet is received by the port of the first device, and detecting whether the packet received by the port other than the first port is a second LLDP packet, and the second LLDP packet, Similar to the first LLDP packet, the destination MAC address in the second LLDP packet is the MAC address of the first device, and the source MAC address is the MAC address of the second device.
2 03、 所述第一设备确定所述第一端口与所述第二端口之间存在环路。 当判断第二 LLDP 报文中携带有第一环路检测信息时, 则说明所述第 一设备通过第一端口将包含有第一环路检测信息的第一 LLDP 报文发送出 去, 由所述第二设备接收到之后, 经过所述第二设备的处理, 将第一环路 检测信息携带在第二 LLDP报文中, 再发送给第一设备, 说明所述第一设备 的端口之间存在环路, 也就是第一端口和第二端口之间存在环路。  The first device determines that there is a loop between the first port and the second port. When it is determined that the second LLDP packet carries the first loop detection information, the first device sends the first LLDP packet that includes the first loop detection information by using the first port, where After receiving the second device, the second device performs the processing of the second device, and the first loop detection information is carried in the second LLDP packet, and then sent to the first device, indicating that the port of the first device exists. The loop, that is, there is a loop between the first port and the second port.
可选地, 在步骤 2 0 3之后, 还可以包括步骤 2 04 :  Optionally, after step 2 0 3, step 2 04 may also be included:
步骤 2 04 : 第一设备禁止所述第一端口或者所述第二端口中的一个用 于传输报文。  Step 2: The first device prohibits one of the first port or the second port from being used to transmit a message.
由于设备的端口之间存在环路会使得某些消息不断转发, 例如广播消 息, 导致带宽资源的浪费, 因此可釆用一些措施, 将产生环路的端口之间 的报文传输断开, 仅用于 P0E。  The loop between the ports of the device causes some messages to be forwarded. For example, broadcast messages cause a waste of bandwidth resources. Therefore, some measures can be taken to disconnect the packets between the ports that generate loops. Used for P0E.
第一设备禁止第一端口或者第二端口中的一个用于传输报文可以断 开第一端口和第二端口之间的环路。  The first device prohibits one of the first port or the second port for transmitting a message to break a loop between the first port and the second port.
例如, 可通过下述方式断开环路:  For example, the loop can be broken by:
方式一: 显示报警提示, 所述报警提示用于提示所述第一设备的第一 端口与第二端口之间存在环路; 接收配置指令, 所述配置指令用于禁止所 述第一端口或者所述第二端口用于传输报文, 仅用于以太网供电 P0E。 再 根据所述配置指令, 禁止所述第一端口或者所述第二端口用于传输报文。  Manner 1: Display an alarm prompt, the alarm prompt is used to prompt a loop between the first port and the second port of the first device, and receive a configuration instruction, where the configuration command is used to prohibit the first port or The second port is used for transmitting packets, and is only used for Power over Ethernet (P0E). And according to the configuration instruction, the first port or the second port is prohibited from being used for transmitting a message.
可通过显示报警提示通知用户, 第一设备的第一端口与第二端口之间 存在环路, 并接收用户对于端口的配置指令, 将所述第一端口或者所述第 二端口禁止进行报文传输, 仅用于以太网供电 P0E。 The user can be notified by displaying an alarm prompt, between the first port and the second port of the first device There is a loop, and the user's configuration command for the port is received, and the first port or the second port is prohibited from transmitting the message, and is only used for the power-on P0E.
方式二: 主动断开所述第一端口或者所述第二端口对应的用于传输报 文的数据链路。  Manner 2: The data link for transmitting the message corresponding to the first port or the second port is actively disconnected.
当所述第一设备发现本端设备上的端口之间存在环路时, 直接断开存 在环路的所述第一端口或者所述第二端口对应的用于传输报文的数据链 路, 仅用于 P0E。  When the first device finds that there is a loop between the ports on the local device, directly disconnecting the first port of the loop or the data link for transmitting the packet corresponding to the second port, Used only for P0E.
如果所述第一设备的端口之间不存在环路, 也就是所述第一设备没有 接收到所述第二环路检测报文, 则所述第一设备对端口 1和端口 2不做任 何处理。  If there is no loop between the ports of the first device, that is, the first device does not receive the second loop detection packet, the first device does not do any for port 1 and port 2. deal with.
本发明实施例可以实现基于已有的 LLDP 报文, 对设备的端口之间进 行环路检测, 避免生成自定义的特定协议号的非标准 LLDP报文, 而导致可 能和其他自定义的用户报文相冲突, 或者将来在进行协议号扩展时相冲突 的问题。 相应地, 如图 3所示, 本发明实施例提供的一种环路检测方法, 所述 方法包括如下步骤:  The embodiments of the present invention can implement loop detection on the ports of the device based on the existing LLDP packets, and avoid generating non-standard LLDP packets with a specific protocol number, which may result in other custom user reports. Conflicts in text, or conflicts in the future when protocol numbers are extended. Correspondingly, as shown in FIG. 3, a loop detection method provided by an embodiment of the present invention includes the following steps:
301、 第二设备接收第一设备通过第一端口发送的第一链路层发现协 议数据单元 LLDP报文。  301. The second device receives the first link layer discovery protocol data unit LLDP packet sent by the first device by using the first port.
其中, 所述第一 LLDP ^艮文中包括第一环路检测信息, 所述第一环路 检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一端口的 端口号。  The first LLDP information includes the first loop detection information, and the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port.
可选的, 可以在第二设备通过第三端口接收报文后, 判断所述报文是 否为第一环路检测 4艮文, 所述第一环路检测 4艮文为封装有 LLDPDU的 LLDP 报文, 所述 LLDPDU中包括类型为环路检测的 TLV , 所述 TLV中的值包括第 一设备标识和第一端口号, 所述第一端口号为发送所述第一环路检测 4艮文 的第一端口对应的端口号, 所述第一设备至少存在两个端口, 所述第一端 口为所述至少两个端口中的任意一个, 所述第二设备至少存在两个端口, 所述第三端口为所述至少两个端口中的任意一个, 所述第三端口与所述第 一端口直连。 Optionally, after the second device receives the packet through the third port, it is determined whether the packet is a first loop detection, and the first loop detects that the packet is an LLDP encapsulated with an LLDPDU. a packet, the LLD PDU includes a TLV of a loop detection type, and the value in the TLV includes a first device identifier and a first port number, where the first port number is sent by the first loop detection. a port number corresponding to the first port of the file, where the first device has at least two ports, the first end The port is any one of the at least two ports, the second device has at least two ports, and the third port is any one of the at least two ports, the third port and the third port One port is directly connected.
其中, 当所述第一设备为 PD时, 所述第二设备为 PSE , 或者所述第一 设备为 PSE时, 所述第二设备为 PD , 且所述 PD和 PSE均有至少两个端口。  When the first device is a PD, the second device is a PSE, or the first device is a PSE, the second device is a PD, and the PD and the PSE both have at least two ports. .
所述第二设备在接收到报文之后, 先通过判断所述报文携带的 TLV中 的类型是否为环路检测, 从而来判断所述报文是否为第一环路检测报文。 所述第一环路检测报文是基于已有的 LLDP报文, 在报文中的 LLDPDU中携 带有 TLV , 其中 TLV中的类型为环路检测, 表示所述 LLDP报文用于检测所 述第一设备的端口之间是否存在环路, TLV中的长度表示所述 TLV的长度 , TLV 中的值包括第一设备标识和第一端口号, 所述第一设备标识为所述第 一设备在 P0E ***中的唯一标识, 所述第一端口号为发送所述第一环路检 测才艮文的第一端口对应的端口号, 例如, 当所述第一设备存在两个端口时, 端口 1和端口 2 , 则所述第一端口号为端口 1或者端口 2。  After receiving the packet, the second device determines whether the packet is a first loop detection packet by determining whether the type of the TLV carried in the packet is a loop detection. The first loop detection packet is based on an existing LLDP packet, and the LLD PDU in the packet carries a TLV, where the type in the TLV is loop detection, and the LLDP packet is used to detect the LLDP packet. Whether there is a loop between the ports of the first device, the length in the TLV indicates the length of the TLV, the value in the TLV includes the first device identifier and the first port number, and the first device identifier is the first device a unique identifier in the P0E system, where the first port number is a port number corresponding to the first port that sends the first loop detection, for example, when the first device has two ports, the port 1 and port 2, then the first port number is port 1 or port 2.
302、 获取所述第一 LLDP报文中的第一环路检测信息。  302. Acquire first loop detection information in the first LLDP packet.
例如: 当判断所述报文为第一环路检测报文时, 获取所述第一环路检 测信息,在第一环路检测信息中包括第一环路检测报文中的第一设备标识、 第一端口号和环路检测类型;  For example, when the packet is determined to be the first loop detection packet, the first loop detection information is obtained, and the first loop detection information includes the first device identifier in the first loop detection packet. , the first port number and the loop detection type;
303、 所述第二设备根据所述第一环路检测信息生成第二 LLDP报文。 其中, 所述第二环路检测 4艮文为 LLDP ^艮文, 所述第二 LLDP ^艮文中包 括第一环路检测信息。 比如: 所述第二环路检测 4艮文为封装有 LLDPDU 的 LLDP报文, 所述 LLDPDU中包括类型为环路检测的 TLV , 所述 TLV中的值包 括第一设备标识和第一端口号。  303. The second device generates a second LLDP packet according to the first loop detection information. The second loop detection message is an LLDP file, and the second LLDP message includes the first loop detection information. For example, the second loop detection is an LLDP packet encapsulated with an LLDPDU, and the LLD PDU includes a TLV of a loop detection type, and the value in the TLV includes a first device identifier and a first port number. .
所述第二设备在判断所述报文为第一环路检测报文时, 通过获取所述 第一环路检测 ^艮文中的第一设备标识和第一端口号, 并将第一设备标识和 第一端口号携带在新的 LLDP报文中发送给所述第一设备。 其中, 将包括第 一设备标识和第一端口号的 TLV携带在第二环路检测 文中。 304、 所述第二设备将所述第二环路检测报文发送给所述第一设备。 其中, 所述第四端口为除所述第三端口以外的其他任意端口。 When the second device detects that the packet is the first loop detection packet, the second device detects the first device identifier and the first port number in the first loop detection, and identifies the first device identifier. The first port number is carried in the new LLDP packet and sent to the first device. The TLV including the first device identifier and the first port number is carried in the second loop detection document. 304. The second device sends the second loop detection packet to the first device. The fourth port is any port other than the third port.
由于要检测 P0E***中是否存在环路, 因此通过接收第一环路检测报 文之外的其他端口, 将所述第二环路检测报文发送出去, 即通过第四端口 将所述第二环路检测报文发送给所述第一设备。  The second loop detection packet is sent out by receiving the port other than the first loop detection packet, that is, the second loop is used to detect the loop. The loop detection message is sent to the first device.
本发明实施例可以实现基于已有的 LLDP 报文, 对设备的端口之间进 行环路检测, 避免生成自定义的特定协议号的非标准 LLDP报文, 而导致可 能和其他自定义的用户报文相冲突, 或者将来在进行协议号扩展时相冲突 的问题。 为便于理解,本发明对如图 4所示的 P0E***进行环路检测,其中 PD1 表示超过 I EEE 802. 3a t规定功率的大功率设备, 例如微基站, PD2为满足 I EEE 802. 3a t规定功率的小功率设备, 例如为 WLAN AP、 啟波等小功率设 备, PSE可以为 P0E交换机, 与 PD1和 PD2进行报文传输的同时, 进行供 电。 其中, 实线表示以太网线, 虚线表示交流电源线, 当釆用多网线对 PD1 供电时, 由于网线也用于数据信号传输, 导致链路中可能会形成环路, 因 此在本发明实施例中以 PD1 为第一设备, PSE为第二设备为例, 进行说明 环路检测方法, 为便于理解, 以下示例仅为说明目的, 对本发明不做任何 限制, 其中, 图 4所示 PD 1有端口 1和端口 2 , PSE有端口 3和端口 4 , 端 口 1和端口 3直连, 端口 2和端口 4直连, 如图 5所示, 该方法包括如下 步骤:  The embodiments of the present invention can implement loop detection on the ports of the device based on the existing LLDP packets, and avoid generating non-standard LLDP packets with a specific protocol number, which may result in other custom user reports. Conflicts in text, or conflicts in the future when protocol numbers are extended. For ease of understanding, the present invention performs loop detection on the P0E system as shown in FIG. 4, wherein PD1 represents a high-power device exceeding the power specified by IEEEE 802.3a, such as a micro base station, and PD2 satisfies I EEE 802. 3a t A small-power device that specifies power, for example, a small-power device such as a WLAN AP or a start-up wave. The PSE can be a P0E switch, and performs power transmission while transmitting packets with PD1 and PD2. The solid line indicates the Ethernet line, and the dotted line indicates the AC power line. When the multi-network cable is used to power the PD1, the network cable is also used for data signal transmission, which may result in a loop in the link. Therefore, in the embodiment of the present invention, The PD1 is used as the first device and the PSE is the second device. The loop detection method is described. For the sake of understanding, the following examples are for illustrative purposes only. The present invention does not impose any restrictions. 1 and port 2, the PSE has port 3 and port 4, port 1 and port 3 are directly connected, and port 2 and port 4 are directly connected. As shown in FIG. 5, the method includes the following steps:
1、 PD1与 PSE之间进行 P0E能力协商。  1. P0E capability negotiation between PD1 and PSE.
参考现有技术, 由于 PSE负责管理 PD 1的供电功率、 电流大小等参数, 将上述供电参数进行设置, 并达到两端一致时, 进行下面的供电。  Referring to the prior art, since the PSE is responsible for managing parameters such as the power supply and current magnitude of the PD 1, and setting the above power supply parameters, and achieving the same at both ends, the following power supply is performed.
1、 PD1根据本端设备标识和第一端口号生成第一环路检测 4艮文。  1. PD1 generates a first loop detection according to the local device identifier and the first port number.
所述第一环路检测 4艮文中的 LLDPDU中携带有 TLV ,其中 TLV中的类型 为环路检测,表示所述 LLDP报文用于检测所述第一设备的端口之间是否存 在环路, TLV 中的值包括本端设备标识和第一端口号, 所述本端设备标识 为 PD1设备标识, 所述第一端口号为端口 1的端口号。 The LLD PDU in the first loop detection carries a TLV, where the type in the TLV is loop detection, and the LLDP packet is used to detect whether the ports of the first device are stored. In the loop, the value in the TLV includes the local device identifier and the first port number, the local device identifier is the PD1 device identifier, and the first port number is the port number of the port 1.
3、 PD1通过端口 1将所述第一环路检测报文发送给 PSE。  3. The PD1 sends the first loop detection packet to the PSE through the port 1.
其中, 所述第一环路检测报文中的目的 MAC地址为 PSE的 MAC地址, 源 MAC地址为 PD1的 MAC地址。  The destination MAC address in the first loop detection packet is the MAC address of the PSE, and the source MAC address is the MAC address of the PD1.
可选的, 也可以将所述第一端口号为端口 2的端口号, 并通过端口 2 发送给 PSE。  Optionally, the first port number is the port number of port 2, and is sent to the PSE through port 2.
4、 PSE通过端口 3接收第一环路检测报文, 并判断报文携带的 TLV中 的类型是否为环路检测。  4. The PSE receives the first loop detection packet through port 3, and determines whether the type of the TLV carried in the packet is loop detection.
5、 当判断所述报文为第一环路检测报文时, PSE获取所述第一环路检 测才艮文中的 PD1设备标识和端口 1的端口号。  5. When it is determined that the packet is the first loop detection packet, the PSE obtains the PD1 device identifier and the port number of the port 1 in the first loop detection.
6、 PSE根据 PD1设备标识和端口 1的端口号生成第二环路检测报文。 其中, 所述第二环路检测 4艮文中的目的 MAC地址为 PD1的 MAC地址, 源 MAC地址为 PSE的 MAC地址。  6. The PSE generates a second loop detection packet according to the PD1 device identifier and the port number of port 1. The destination MAC address in the second loop detection is the MAC address of the PD1, and the source MAC address is the MAC address of the PSE.
7、 PSE将所述第二环路检测报文发送给 PD1。  7. The PSE sends the second loop detection packet to the PD1.
其中, 由于所述第二环路检测报文中只携带有 PD1的 MAC地址, 因此 需要 PSE通过端口 4和端口 5将所述第二环路检测报文发送给 PD1,当 PD2 接收到所述第二环路检测报文时, 直接丟弃。  The second loop detection packet carries the MAC address of the PD1, so the PSE needs to send the second loop detection packet to the PD1 through the port 4 and the port 5, when the PD2 receives the When the second loop detects a packet, it discards it directly.
8、 PD1通过端口 2接收第二环路检测报文, 并判断所述报文中是否携 带有 PD1的设备标识。  8. The PD1 receives the second loop detection packet through the port 2, and determines whether the device identifier of the PD1 is carried in the packet.
9、 当判断所述报文为第二环路检测报文时, PD1获取所述第二环路检 测才艮文中的端口 1的端口号。  9. When it is determined that the packet is a second loop detection packet, the PD1 obtains the port number of the port 1 in the second loop detection.
10、 PD1确定端口 1和端口 2之间存在环路。  10. PD1 determines that there is a loop between port 1 and port 2.
PD1可以釆用一些措施将端口 1和端口 2之间的环路断开, 如图 2所 示实施例中的方式一和方式二所述, 例如将端口 2和端口 4之间的数据链 路断开。  The PD1 can use some measures to disconnect the loop between the port 1 and the port 2, as described in the first mode and the second mode in the embodiment shown in FIG. 2, for example, the data link between the port 2 and the port 4. disconnect.
本实施例中第一设备也可以是 PSE, 第二设备为 PD1, 进行环路检测 的流程与图 5类似, 这里就不再赘述。 In this embodiment, the first device may also be a PSE, and the second device is a PD1, performing loop detection. The process is similar to that of Figure 5, and will not be described here.
另外, 现有技术中对于 PD和 PSE 中都会存在如图 6所示的结构图, 以 PD1为例进行说明, 所述 PD 包括应用模块、 LLDP管理模块、 管理信息 库模块、 LLDP代理模块、 端口 1和端口 2。 其中, LLDP代理模块通过端口 1或者端口 2接收到报文之后, 将报文上报给 LLDP管理模块。 LLDP管理模 块负责管理设备的 LLDP 协议和本地信息, 例如设备标识和端口号。 LLDP 管理模块还负责将接收到的对端设备,也就是 PSE的信息存入管理信息库, 以供应用模块进行查询。 其中, 由 LLDP管理模块完成图 5所示的环路检测 流程, 并将检测结果上报给应用模块, 当存在环路时, 应用模块将会显示 报警提示通知用户, 并接收用户的配置, 或者自动断开其中一条用于数据 传输的链路, 仅用于 P0E。 本发明实施例提供一种网络设备 70 , 如图 7所示, 包括:  In addition, in the prior art, a structure diagram as shown in FIG. 6 exists in the PD and the PSE, and the PD1 is taken as an example. The PD includes an application module, an LLDP management module, a management information library module, an LLDP proxy module, and a port. 1 and port 2. The LLDP proxy module reports the packet to the LLDP management module after receiving the packet through port 1 or port 2. The LLDP management module is responsible for managing the LLDP protocol and local information of the device, such as device ID and port number. The LLDP management module is also responsible for storing the received peer device, that is, the PSE information, into the management information base for querying by the module. The LLDP management module completes the loop detection process shown in Figure 5, and reports the detection result to the application module. When there is a loop, the application module will display an alarm prompt to notify the user, and receive the user's configuration, or automatically. Disconnect one of the links for data transmission, only for P0E. The embodiment of the present invention provides a network device 70, as shown in FIG. 7, including:
发送单元 71 ,用于通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二设备,其中,所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所 述第一端口的端口号;  The sending unit 71 is configured to send, by using the first port, the first link layer discovery protocol data unit LLDP packet to the second device, where the first LLDP packet includes first loop detection information, where The loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
获取单元 72 , 用于获取从第二端口接收到所述第二设备发送的第二 LLDP ^艮文, 其中, 所述第二 LLDP ^艮文中包括所述第一环路检测信息, 所 述第二端口为与所述第一端口不同的端口;  The obtaining unit 72 is configured to acquire, by the second port, the second LLDP message that is sent by the second device, where the second LLDP message includes the first loop detection information, where The two ports are different ports from the first port;
确定单元 7 3 ,用于所述第一设备确定所述第一端口与所述第二端口之 间存在环路。  The determining unit 7 3 is configured to determine, by the first device, that there is a loop between the first port and the second port.
本发明实施例提供的一种网络设备, 根据本端设备标识和第一端口号 生成第一环路检测报文, 所述第一环路检测报文中包括链路层发现协议数 据单元 LLDPDU , 所述 LLDPDU中包括类型为环路检测的类型长度值 TLV , 所 述 TLV中的值包括本端设备标识和第一端口号, 所述第一端口号为待发送 所述第一环路检测 4艮文的第一端口对应的端口号, 所述第一设备至少存在 两个端口, 所述第一端口为所述至少两个端口中的任意一个, 并通过所述 第一端口将所述第一环路检测报文发送给第二设备, 然后通过第二端口接 收所述第二设备发送的报文, 并判断所述报文是否为第二环路检测报文, 所述第二环路检测报文中的 LLDPDU包括类型为环路检测的 TL V , 所述 TL V 中的值包括本端设备标识和第一端口号, 所述第二端口为所述第一设备中 除所述第一端口以外的其他任意端口, 当判断所述报文为第二环路检测报 文时, 获取所述第二环路检测报文中的第一端口号, 确定所述第一端口号 对应的第一端口与所述第二端口之间存在环路。 本发明实施例解决了现有 技术中利用携带了自定义的特定协议号的非标准 LLDP报文,导致可能和其 他自定义的用户报文相冲突,或者将来在进行协议号扩展时相冲突的问题。 The network device according to the embodiment of the present invention generates a first loop detection packet according to the local device identifier and the first port number, where the first loop detection packet includes a link layer discovery protocol data unit LLDPDU. The LLD PDU includes a type length value TLV of the loop detection type, and the value in the TLV includes the local device identifier and the first port number, and the first port number is the first loop detection to be sent. The port number corresponding to the first port of the text, the first device exists at least Two ports, the first port is any one of the at least two ports, and the first loop detection packet is sent to the second device by using the first port, and then received by the second port a packet sent by the second device, and determining whether the packet is a second loop detection packet, where the LLDPDU in the second loop detection packet includes a TL V of a loop detection type, The value in the TL V includes the local device identifier and the first port number, and the second port is any port other than the first port in the first device, and the packet is determined to be the second ring. When the packet is detected, the first port number in the second loop detection packet is obtained, and a loop exists between the first port corresponding to the first port number and the second port. The embodiment of the present invention solves the problem that the non-standard LLDP packet carrying a specific protocol number is used in the prior art, which may conflict with other customized user messages, or may conflict in the future when the protocol number is extended. problem.
可选的, 所述生成单元, 还用于按照设置的时间间隔, 根据本端设备 标识和第一端口号生成第一环路检测 4艮文。  Optionally, the generating unit is further configured to generate, according to the set time interval, the first loop detection according to the local device identifier and the first port number.
进一步地, 如图 8所示, 在网络设备 7 0中, 还可以包括:  Further, as shown in FIG. 8, in the network device 70, the method may further include:
生成单元 74 , 用于按照设置的时间间隔生成所述第一 LLDP报文。 控制单元 75 ,用于在所述确定单元确定所述第一端口与所述第二端口 之间存在环路之后, 禁止所述第一端口或者所述第二端口中的一个用于传 输报文。  The generating unit 74 is configured to generate the first LLDP packet according to the set time interval. The control unit 75 is configured to: after the determining unit determines that there is a loop between the first port and the second port, prohibiting one of the first port or the second port from transmitting a packet .
可选的, 所述控制单元 75包括:  Optionally, the control unit 75 includes:
显示子单元 75 1 , 用于显示报警提示, 所述报警提示用于提示所述第 一端口与所述第二端口之间存在环路;  The display sub-unit 75 1 is configured to display an alarm prompt, where the alarm prompt is used to prompt a loop between the first port and the second port;
接收子单元 752 , 用于接收配置指令, 所述配置指令用于禁止所述第 一端口或者所述第二端口用于传输报文;  The receiving subunit 752 is configured to receive a configuration instruction, where the configuration command is used to prohibit the first port or the second port from being used to transmit a message;
端口限制子单元 7 5 3 , 还用于根据所述配置指令, 禁止所述第一端口 或者所述第二端口用于传输报文。  The port restriction subunit 7 5 3 is further configured to prohibit the first port or the second port from transmitting a message according to the configuration instruction.
其中, 若所述第一设备为受电端设备 PD , 则所述第二设备为供电端设 备 PSE ; 或者若所述第一设备为 PSE , 则所述第二设备为 PD。 相应地, 本发明实施例还提供一种网络设备 90 , 如图 9所示, 包括: 接收单元 91 ,用于接收第一设备通过第一端口发送的第一链路层发现 协议数据单元 LLDP报文, 其中, 所述第一 LLDP报文中包括第一环路检测 信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标 识和所述第一端口的端口号; Wherein, if the first device is a power receiving device PD, the second device is a power supply device PSE; or if the first device is a PSE, the second device is a PD. Correspondingly, the embodiment of the present invention further provides a network device 90, as shown in FIG. 9, comprising: a receiving unit 91, configured to receive a first link layer discovery protocol data unit LLDP report sent by the first device through the first port. The first LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port of the first port. number;
获取单元 92 , 用于获取所述第一 LLDP报文中的第一环路检测信息; 生成单元 9 3 ,用于所述第二设备根据所述第一环路检测信息生成第二 LLDP ^艮文, 所述第二 LLDP ^艮文中包括第一环路检测信息;  The obtaining unit 92 is configured to obtain the first loop detection information in the first LLDP packet, and the generating unit 9 3 is configured to generate, by the second device, the second LLDP according to the first loop detection information. The second LLDP message includes the first loop detection information;
发送单元 94 , 用于将所述第二环路检测报文发送给所述第一设备。 其中, 若所述第一设备为受电端设备 PD , 则所述第二设备为供电端设 备 PSE ; 或者若所述第一设备为 PSE , 则所述第二设备为 PD。  The sending unit 94 is configured to send the second loop detection message to the first device. If the first device is a power receiving device PD, the second device is a power supply device PSE; or if the first device is a PSE, the second device is a PD.
本发明实施例提供一种网络设备, 通过第三端口接收报文, 并判断所 述报文是否为第一环路检测报文, 所述第一环路检测报文为封装有 LLDPDU 的 LLDP报文, 所述 LLDPDU中包括类型为环路检测的 TLV , 所述 TLV中的 值包括第一设备标识和第一端口号, 所述第一端口号为发送所述第一环路 检测 4艮文的第一端口对应的端口号, 所述第一设备至少存在两个端口, 所 述第一端口为所述至少两个端口中的任意一个, 所述第二设备至少存在两 个端口, 所述第三端口为所述至少两个端口中的任意一个, 所述第三端口 与所述第一端口直连, 当判断所述报文为第一环路检测报文时, 获取所述 第一环路检测报文中的第一设备标识和第一端口号根据所述第一设备标识 和第一端口号生成第二环路检测报文, 所述第二环路检测报文为封装有 LLDPDU的 LLDP报文,所述 LLDPDU中包括类型为环路检测的 TLV ,所述 TLV 中的值包括第一设备标识和第一端口号, 通过第四端口将所述第二环路检 测报文发送给所述第一设备, 所述第四端口为除所述第三端口以外的其他 任意端口。 本发明实施例解决了现有技术中利用携带了自定义的特定协议 号的非标准 LLDP报文, 导致可能和其他自定义的用户报文相冲突, 或者将 来在进行协议号扩展时相冲突的问题。 所述网络设备 90 中的各单元的具体实现过程, 可参见上述环路检测 方法的处理过程。 上述图 7和图 8所示的网络设备可基于计算机等硬件结构来实现, 如 图 10所示, 网络设备 10的硬件结构包括存储器 1001、 通信端口 1002和 处理器 1003。 The embodiment of the present invention provides a network device, which receives a packet through a third port, and determines whether the packet is a first loop detection packet, and the first loop detection packet is an LLDP packet encapsulated with an LLDPDU. The LLD PDU includes a TLV of the type of loop detection, and the value in the TLV includes a first device identifier and a first port number, where the first port number is sent by the first loop detection. The port number corresponding to the first port, the first device has at least two ports, the first port is any one of the at least two ports, and the second device has at least two ports, The third port is any one of the at least two ports, and the third port is directly connected to the first port. When the packet is determined to be the first loop detection packet, the first port is obtained. The first device identifier and the first port number in the loop detection packet are generated according to the first device identifier and the first port number, and the second loop detection packet is encapsulated with an LLDPDU. LLDP packet, including the type in the LLDPDU a loop detection TLV, the value in the TLV includes a first device identifier and a first port number, and the second loop detection packet is sent to the first device by using a fourth port, where the fourth port is Is any port other than the third port. The embodiment of the present invention solves the problem in the prior art that a non-standard LLDP packet carrying a specific protocol number is used, which may conflict with other customized user messages, or may conflict in the future when the protocol number is extended. problem. For the specific implementation process of each unit in the network device 90, refer to the processing procedure of the loop detection method described above. The network device shown in FIG. 7 and FIG. 8 above can be implemented based on a hardware structure such as a computer. As shown in FIG. 10, the hardware structure of the network device 10 includes a memory 1001, a communication port 1002, and a processor 1003.
其中, 存储器 1001可以是只读存储器 (Read Only Memory, ROM) , 静态存储设备,动态存储设备或者随机存取存储器( Random Access Memory, RAM) 。 存储器 1001 可以存储操作***和其他应用程序的指令以及应用数 据。 存储器 1001 中存储的指令由处理器 1003来运行执行。  The memory 1001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1001 can store instructions of the operating system and other applications as well as application data. The instructions stored in the memory 1001 are executed by the processor 1003.
本发明实施例中存储器 1001可用于存储实现图 7 以及图 8所示实施 例中各功能单元的指令以及报文。  The memory 1001 in the embodiment of the present invention can be used to store instructions and messages for implementing the functional units in the embodiments shown in Figs. 7 and 8.
通信端口 1002用来实现网络设备 10与其他设备之间的通信。  Communication port 1002 is used to enable communication between network device 10 and other devices.
本发明实施例中, 通信端口 1002用于发送和接收报文。  In the embodiment of the present invention, the communication port 1002 is configured to send and receive a message.
处理器 1003可以釆用通用的中央处理器 ( Central Processing Unit, CPU) , 微处理器, 应用专用集成电路( Application Specif ic Integrated Circuit, ASIC) , 或者一个或多个集成电路, 用于执行相关程序。  The processor 1003 can use a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs. .
本发明实施例中, 处理器 1003用于执行存储器 1001 中的指令, 具体 执行:  In the embodiment of the present invention, the processor 1003 is configured to execute an instruction in the memory 1001, and specifically:
通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二 设备, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路 检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一端口的 端口号;  Transmitting, by the first port, the first link layer discovery protocol data unit LLDP packet to the second device, where the first LLDP packet includes the first loop detection information, where the first loop detection information includes a loop detection type, a device identifier of the first device, and a port number of the first port;
所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口;  Receiving, by the first device, the second LLDP packet that is sent by the second device from the second port, where the second LLDP packet includes the first loop detection information, the second port a port different from the first port;
所述第一设备确定所述第一端口与所述第二端口之间存在环路。 其中,处理器 1003中的具体处理过程可参考方法实施例部分以及图 7 以及图 8所示的装置实施例部分, 这里不再赘述。 上述图 9 所示的网络设备可基于计算机的硬件结构来实现, 如图 11 所示, 网络设备 11的硬件结构, 包括存储器 1101、 通信端口 1102和处理 器 1103。 The first device determines that there is a loop between the first port and the second port. The specific processing procedure in the processor 1003 may refer to the method embodiment part and the apparatus embodiment part shown in FIG. 7 and FIG. 8 , and details are not described herein again. The network device shown in FIG. 9 above can be implemented based on the hardware structure of the computer. As shown in FIG. 11, the hardware structure of the network device 11 includes a memory 1101, a communication port 1102, and a processor 1103.
其中, 存储器 1101可以是只读存储器 (Read Only Memory, ROM) , 静态存储设备,动态存储设备或者随机存取存储器( Random Access Memory, RAM) 。 存储器 1101 可以存储操作***和其他应用程序的指令以及应用数 据。 存储器 1101 中存储的指令由处理器 1103来运行执行。  The memory 1101 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1101 can store instructions for the operating system and other applications as well as application data. The instructions stored in the memory 1101 are executed by the processor 1103.
本发明实施例中存储器 1101 可用于存储实现图 9 所示实施例中各功 能单元的指令以及报文。  In the embodiment of the present invention, the memory 1101 can be used to store instructions and messages for implementing the functional units in the embodiment shown in FIG.
通信端口 1102用来实现网络设备 11与其他网络设备之间的通信。 在 本发明实施例中网络设备 11 与网络设备 10 之间的通信都通过通信端口 1102进行。  Communication port 1102 is used to enable communication between network device 11 and other network devices. In the embodiment of the present invention, communication between the network device 11 and the network device 10 is performed through the communication port 1102.
本发明实施例中, 通信端口 1102用于发送和接收报文;  In the embodiment of the present invention, the communication port 1102 is configured to send and receive a message;
处理器 1103可以釆用通用的中央处理器 ( Central Processing Unit, CPU) , 微处理器, 应用专用集成电路( Application Specif ic Integrated Circuit, ASIC) , 或者一个或多个集成电路, 用于执行相关程序。  The processor 1103 can use a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs. .
本发明实施例中, 处理器 1103用于执行存储器 1101 中的指令, 具体 执行:  In the embodiment of the present invention, the processor 1103 is configured to execute an instruction in the memory 1101, and specifically:
接收第一设备通过第一端口发送的第一链路层发现协议数据单元 LLDP ^艮文, 其中, 所述第一 LLDP ^艮文中包括第一环路检测信息, 所述第 一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一 端口的端口号;  Receiving, by the first device, the first link layer discovery protocol data unit LLDP, the first LLDP message includes the first loop detection information, and the first loop detection information Include a loop detection type, a device identifier of the first device, and a port number of the first port;
获取所述第一 LLDP报文中的第一环路检测信息;  Obtaining first loop detection information in the first LLDP packet;
根据所述第一环路检测信息生成第二 LLDP报文, 所述第二 LLDP报文 中包括第一环路检测信息; Generating a second LLDP packet according to the first loop detection information, where the second LLDP packet is The first loop detection information is included therein;
将所述第二环路检测报文发送给所述第一设备。  Sending the second loop detection message to the first device.
其中,处理器 1 1 03中的具体处理过程可参考方法实施例部分以及图 9 所示的装置实施例部分, 这里不再赘述。  The specific processing procedure in the processor 1 1 03 can refer to the method embodiment part and the apparatus embodiment part shown in FIG. 9, and details are not described herein again.
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 仅以 上述各功能模块的划分进行举例说明, 实际应用中, 可以根据需要而将上 述功能分配由不同的功能模块完成, 即将装置的内部结构划分成不同的功 能模块, 以完成以上描述的全部或者部分功能。 上述描述的***, 装置和 单元的具体工作过程, 可以参考前述方法实施例中的对应过程, 在此不再 赘述。  It will be apparent to those skilled in the art that, for convenience and brevity of description, only the division of each functional module described above is exemplified. In practical applications, the above-mentioned function assignment can be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的***, 装置 和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅 是示意性的, 例如, 所述模块或单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方式, 例如多个单元或组件可以结合或者可 以集成到另一个***, 或一些特征可以忽略, 或不执行。 另一点, 所显示 或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口, 装 置或单元的间接耦合或通信连接, 可以是电性, 机械或其它的形式。  In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地 方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的 部分或者全部单元来实现本实施例方案的目的。  The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元 中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在 一个单元中。 上述集成的单元既可以釆用硬件的形式实现, 也可以釆用软 件功能单元的形式实现。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品 销售或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理 解, 本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技 术方案的全部或部分可以以软件产品的形式体现出来, 该计算机软件产品 存储在一个存储介质中, 包括若干指令用以使得一台计算机设备(可以是 个人计算机, 服务器, 或者网络设备等)或处理器(processor )执行本发 明各个实施例所述方法的全部或部分步骤。 而前述的存储介质包括: U盘、 移动硬盘、 只读存储器( ROM, Read-Only Memory )、 随机存取存储器( RAM, Random Access Memory ) 、 磁碟或者光盘等各种可以存储程序代码的介质。 The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on this rationale Solution, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including several The instructions are for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program code. .
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应以所述权利要求的保护范围为准。  The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims

权 利 要 求 书 claims
1、 一种环路检测方法, 其特征在于, 包括: 1. A loop detection method, characterized by including:
第一设备通过第一端口将第一链路层发现协议数据单元 LLDP 报文发 送给第二设备, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述 第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所述第 一端口的端口号; The first device sends a first link layer discovery protocol data unit LLDP message to the second device through the first port, where the first LLDP message includes first loop detection information, and the first loop The detection information includes the loop detection type, the device identification of the first device and the port number of the first port;
所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口; The first device obtains the second LLDP message sent by the second device received from the second port, wherein the second LLDP message includes the first loop detection information, and the second port Is a port different from the first port;
所述第一设备确定所述第一端口与所述第二端口之间存在环路。 The first device determines that a loop exists between the first port and the second port.
2、根据权利要求 1所述的环路检测方法, 其特征在于, 所述第一 LLDP 报文为 2. The loop detection method according to claim 1, characterized in that the first LLDP message is
所述第一设备按照设置的时间间隔生成。 The first device is generated according to a set time interval.
3、 根据权利要求 1 或者 2 所述的环路检测方法, 其特征在于, 在所 述确定所述第一端口与所述第二端口之间存在环路之后,所述方法还包括: 第一设备禁止所述第一端口或者所述第二端口用于传输报文。 3. The loop detection method according to claim 1 or 2, characterized in that, after determining that a loop exists between the first port and the second port, the method further includes: first The device prohibits the first port or the second port from being used for transmitting messages.
4、 根据权利要求 3 所述的环路检测方法, 其特征在于, 所述第一设 备禁止所述第一端口或者所述第二端口用于传输报文包括: 4. The loop detection method according to claim 3, wherein the first device prohibiting the first port or the second port from being used for transmitting messages includes:
所述第一设备显示报警提示, 所述报警提示用于提示所述第一端口与 所述第二端口之间存在环路; The first device displays an alarm prompt, and the alarm prompt is used to prompt that a loop exists between the first port and the second port;
所述第一设备接收配置指令, 所述配置指令用于禁止所述第一端口或 者所述第二端口用于传输报文; The first device receives a configuration instruction, and the configuration instruction is used to disable the first port or the second port from transmitting messages;
所述第一设备根据所述配置指令, 禁止所述第一端口或者所述第二端 口用于传输报文。 The first device prohibits the first port or the second port from being used for transmitting messages according to the configuration instruction.
5、 根据权利要求 1 -4中任意一项所述的环路检测方法, 其特征在于, 若所述第一设备为受电端设备 PD , 则所述第二设备为供电端设备 PSE ; 或者若所述第一设备为 PSE , 则所述第二设备为 PD。 5. The loop detection method according to any one of claims 1 to 4, characterized in that, if the first device is a power receiving end device PD, the second device is a power supply end device PSE; or If the first device is a PSE, the second device is a PD.
6、 一种环路检测方法, 其特征在于, 包括: 6. A loop detection method, characterized by including:
第二设备接收第一设备通过第一端口发送的第一链路层发现协议数 据单元 LLDP报文, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所 述第一端口的端口号; The second device receives the first link layer discovery protocol data unit LLDP message sent by the first device through the first port, wherein the first LLDP message includes first loop detection information, and the first loop The detection information includes the loop detection type, the device identification of the first device and the port number of the first port;
获取所述第一 LLDP报文中的第一环路检测信息; Obtain the first loop detection information in the first LLDP message;
所述第二设备根据所述第一环路检测信息生成第二 LLDP 报文, 所述 第二 LLDP ^艮文中包括第一环路检测信息; The second device generates a second LLDP message according to the first loop detection information, and the second LLDP message includes the first loop detection information;
所述第二设备将所述第二环路检测报文发送给所述第一设备。 The second device sends the second loop detection message to the first device.
7、 根据权利要求 6 所述的环路检测方法, 其特征在于, 若所述第二 设备为供电端设备 PSE , 则所述第一设备为受电端设备 PD; 7. The loop detection method according to claim 6, wherein if the second device is a power supply end device PSE, then the first device is a power receiving end device PD;
或者若所述第二设备为 PD , 则所述第一设备为 PSE。 Or if the second device is a PD, the first device is a PSE.
8、 一种网络设备, 其特征在于, 包括: 8. A network device, characterized by including:
发送单元, 用于通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二设备,其中,所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所 述第一端口的端口号; A sending unit, configured to send a first link layer discovery protocol data unit LLDP message to the second device through the first port, wherein the first LLDP message includes first loop detection information, and the first The loop detection information includes the loop detection type, the device identification of the first device and the port number of the first port;
获取单元, 用于获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口; An acquisition unit configured to acquire the second LLDP message sent by the second device received from the second port, wherein the second LLDP message includes the first loop detection information, and the second port Is a port different from the first port;
确定单元, 用于所述第一设备确定所述第一端口与所述第二端口之间 存在环路。 Determining unit, configured for the first device to determine that a loop exists between the first port and the second port.
9、 根据权利要求 8 所述的网络设备, 其特征在于, 还包括: 生成单 元, 用于按照设置的时间间隔生成所述第一 LLDP报文。 9. The network device according to claim 8, further comprising: a generating unit configured to generate the first LLDP message according to a set time interval.
1 0、 根据权利要求 8或 9所述的网络设备, 其特征在于, 还包括: 控制单元, 用于在所述确定单元确定所述第一端口与所述第二端口之 间存在环路之后, 禁止所述第一端口或者所述第二端口中的一个用于传输 报文。 10. The network device according to claim 8 or 9, further comprising: A control unit configured to prohibit one of the first port or the second port from transmitting messages after the determining unit determines that a loop exists between the first port and the second port.
1 1、 根据权利要求 1 0 所述的网络设备, 其特征在于, 所述控制单元 包括: 11. The network device according to claim 10, characterized in that the control unit includes:
显示子单元, 用于显示报警提示, 所述报警提示用于提示所述第一端 口与所述第二端口之间存在环路; The display subunit is used to display an alarm prompt, and the alarm prompt is used to prompt that a loop exists between the first port and the second port;
接收子单元, 用于接收配置指令, 所述配置指令用于禁止所述第一端 口或者所述第二端口用于传输报文; A receiving subunit, configured to receive configuration instructions, the configuration instructions being used to disable the first port or the second port from transmitting messages;
端口限制子单元, 还用于根据所述配置指令, 禁止所述第一端口或者 所述第二端口用于传输报文。 The port restriction subunit is also configured to prohibit the first port or the second port from being used to transmit messages according to the configuration instruction.
1 2、 根据权利要求 8至 1 1 中任意一项所述的网络设备, 其特征在于, 若所述第一设备为受电端设备 PD , 则所述第二设备为供电端设备 PSE ; 或 者若所述第一设备为 PSE , 则所述第二设备为 PD。 12. The network device according to any one of claims 8 to 11, characterized in that, if the first device is a power receiving end device PD, the second device is a power supply end device PSE; or If the first device is a PSE, the second device is a PD.
1 3、 一种网络设备, 其特征在于, 包括: 1 3. A network device, characterized by including:
接收单元, 用于接收第一设备通过第一端口发送的第一链路层发现协 议数据单元 LLDP报文, 其中, 所述第一 LLDP报文中包括第一环路检测信 息, 所述第一环路检测信息包括环路检测类型, 所述第一设备的设备标识 和所述第一端口的端口号; A receiving unit configured to receive a first link layer discovery protocol data unit LLDP message sent by the first device through the first port, wherein the first LLDP message includes first loop detection information, and the first The loop detection information includes the loop detection type, the device identification of the first device and the port number of the first port;
获取单元, 用于获取所述第一 LLDP报文中的第一环路检测信息; 生成单元, 用于所述第二设备根据所述第一环路检测信息生成第二 LLDP ^艮文, 所述第二 LLDP ^艮文中包括第一环路检测信息; An acquisition unit, configured to acquire the first loop detection information in the first LLDP message; A generation unit, configured to generate a second LLDP message based on the first loop detection information by the second device, so The second LLDP document includes first loop detection information;
发送单元, 用于将所述第二环路检测报文发送给所述第一设备。 A sending unit, configured to send the second loop detection message to the first device.
14、 根据权利要求 1 3 所述的网络设备, 其特征在于, 若所述第二设 备为供电端设备 PSE , 则所述第一设备为受电端设备 PD ; 或者若所述第二 设备为 PD , 则所述第一设备为 PSE。 14. The network device according to claim 13, wherein if the second device is a power supply device PSE, the first device is a power receiving device PD; or if the second device is PD , then the first device is PSE.
1 5、 一种网络设备, 其特征在于, 包括: 15. A network device, characterized by including:
存储器, 用于存储软件程序和报文; Memory, used to store software programs and messages;
通信端口, 用于发送和接收报文; Communication port, used to send and receive messages;
处理器, 用于执行存储器中的软件程序, 具体执行: The processor is used to execute the software program in the memory, specifically:
通过第一端口将第一链路层发现协议数据单元 LLDP 报文发送给第二 设备, 其中, 所述第一 LLDP报文中包括第一环路检测信息, 所述第一环路 检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一端口的 端口号; The first link layer discovery protocol data unit LLDP message is sent to the second device through the first port, where the first LLDP message includes first loop detection information, and the first loop detection information includes Loop detection type, the device identification of the first device and the port number of the first port;
所述第一设备获取从第二端口接收到所述第二设备发送的第二 LLDP 报文, 其中, 所述第二 LLDP报文中包括所述第一环路检测信息, 所述第二 端口为与所述第一端口不同的端口; The first device obtains the second LLDP message sent by the second device received from the second port, wherein the second LLDP message includes the first loop detection information, and the second port Is a port different from the first port;
所述第一设备确定所述第一端口与所述第二端口之间存在环路。 The first device determines that a loop exists between the first port and the second port.
1 6、 根据权利要求 1 5所述的网络设备, 其特征在于, 所述处理器, 还用于执行: 16. The network device according to claim 15, characterized in that the processor is also used to execute:
按照设置的时间间隔生成所述第一 LLDP报文。 The first LLDP message is generated according to the set time interval.
1 7、 根据权利要求 1 5或 1 6所述的网络设备, 其特征在于, 在所述确 定所述第一端口号对应的第一端口与所述第二端口之间存在环路之后, 所 述处理器, 还用于执行: 17. The network device according to claim 15 or 16, characterized in that, after determining that a loop exists between the first port corresponding to the first port number and the second port, The above processor is also used to execute:
禁止所述第一端口或者所述第二端口中的一个用于传输报文。 One of the first port or the second port is prohibited from transmitting messages.
1 8、 根据权利要求 7 所述的网络设备, 其特征在于, 所述处理器, 具体用于执行: 18. The network device according to claim 7, wherein the processor is specifically configured to execute:
显示报警提示, 所述报警提示用于提示所述第一端口与所述第二端口 之间存在环路; Display an alarm prompt, the alarm prompt is used to prompt that a loop exists between the first port and the second port;
接收配置指令, 所述配置指令用于禁止所述第一端口或者所述第二端 口用于传输报文; Receive a configuration instruction, the configuration instruction is used to disable the first port or the second port from transmitting messages;
根据所述配置指令, 禁止所述第一端口或者所述第二端口用于传输报 文。 According to the configuration instruction, the first port or the second port is prohibited from being used for transmitting packets. arts.
1 9、 根据权利要求 1 5至 1 8中的任意一项所述的网络设备, 其特征在 于, 若所述第一设备为受电端设备 PD , 则所述第二设备为供电端设备 PSE ; 或者若所述第一设备为 PSE , 则所述第二设备为 PD。 19. The network device according to any one of claims 15 to 18, characterized in that, if the first device is a power receiving end device PD, the second device is a power supply end device PSE. ; Or if the first device is a PSE, the second device is a PD.
20、 一种网络设备, 其特征在于, 包括: 20. A network device, characterized by including:
存储器, 用于存储软件程序和报文; Memory, used to store software programs and messages;
通信端口, 用于发送和接收报文; Communication port, used to send and receive messages;
处理器, 用于执行存储器中的软件程序, 具体执行: The processor is used to execute the software program in the memory, specifically:
接收第一设备通过第一端口发送的第一链路层发现协议数据单元 LLDP ^艮文, 其中, 所述第一 LLDP ^艮文中包括第一环路检测信息, 所述第 一环路检测信息包括环路检测类型, 所述第一设备的设备标识和所述第一 端口的端口号; Receive a first link layer discovery protocol data unit LLDP message sent by the first device through the first port, wherein the first LLDP message includes first loop detection information, and the first loop detection information Including the loop detection type, the device identification of the first device and the port number of the first port;
获取所述第一 LLDP报文中的第一环路检测信息; Obtain the first loop detection information in the first LLDP message;
根据所述第一环路检测信息生成第二 LLDP报文, 所述第二 LLDP报文 中包括第一环路检测信息; Generate a second LLDP message according to the first loop detection information, and the second LLDP message includes the first loop detection information;
将所述第二环路检测报文发送给所述第一设备。 Send the second loop detection message to the first device.
21、 根据权利要求 20 所述的网络设备, 其特征在于, 若所述第二设 备为供电端设备 PSE , 则所述第一设备为受电端设备 PD ; 或者若所述第二 设备为 PD , 则所述第一设备为 PSE。 21. The network device according to claim 20, wherein if the second device is a power supply end device PSE, the first device is a power receiving end device PD; or if the second device is a PD , then the first device is PSE.
PCT/CN2013/084834 2013-10-08 2013-10-08 Loop detection method and apparatus WO2015051493A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201380001520.8A CN103858388A (en) 2013-10-08 2013-10-08 Loop detection method and apparatus
PCT/CN2013/084834 WO2015051493A1 (en) 2013-10-08 2013-10-08 Loop detection method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/084834 WO2015051493A1 (en) 2013-10-08 2013-10-08 Loop detection method and apparatus

Publications (1)

Publication Number Publication Date
WO2015051493A1 true WO2015051493A1 (en) 2015-04-16

Family

ID=50864345

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084834 WO2015051493A1 (en) 2013-10-08 2013-10-08 Loop detection method and apparatus

Country Status (2)

Country Link
CN (1) CN103858388A (en)
WO (1) WO2015051493A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227420B (en) * 2014-06-13 2018-10-19 华为技术有限公司 Processing method, device and the system of data frame
CN105450432A (en) * 2014-07-31 2016-03-30 华为技术有限公司 Method for positioning port connection error and associated equipment
CN105812201A (en) * 2014-12-31 2016-07-27 华为技术有限公司 Link state detection method, device and system
CN107566143B (en) * 2016-06-30 2022-02-25 深圳市中兴通讯技术服务有限责任公司 Longitudinal stacking discovery method and device
CN106792857A (en) * 2016-12-27 2017-05-31 上海斐讯数据通信技术有限公司 Loop detecting method, loop detection means and system
US10397095B2 (en) * 2017-01-03 2019-08-27 Cisco Technology, Inc. Detecting and mitigating loops
CN107040431B (en) * 2017-03-16 2021-06-04 台州市吉吉知识产权运营有限公司 Method and system for detecting LAN port loop of AP
CN113353231A (en) * 2020-03-06 2021-09-07 深圳艾迪宝智能***有限公司 Energy-saving method and system for ventilation of block chain cargo hold
CN112134775B (en) * 2020-09-25 2022-08-09 苏州浪潮智能科技有限公司 Switch loop detection method and device
CN112968846B (en) * 2021-02-02 2022-08-16 武汉迈威通信股份有限公司 Detection system for illegal short circuit of switch port

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242315A (en) * 2008-02-26 2008-08-13 中兴通讯股份有限公司 Loop detection method
CN102055525A (en) * 2010-12-17 2011-05-11 北京格林伟迪科技有限公司 Loop detecting and controlling method
CN102821009A (en) * 2012-08-08 2012-12-12 中兴通讯股份有限公司 Method for monitoring ring network on basis of link layer discovery protocol and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7948922B2 (en) * 2006-04-18 2011-05-24 Cisco Technology, Inc. Blocked redundant link-aware spanning tree protocol enhancement
CN101197648B (en) * 2008-01-02 2012-06-06 中兴通讯股份有限公司 Self-loop detection method and device used for access network
CN101252479A (en) * 2008-04-01 2008-08-27 杭州华三通信技术有限公司 Loop detection method and switch
CN102546311B (en) * 2012-03-14 2015-01-14 成都广达电子股份有限公司 Method for realizing loop detection on EOC (Ethernet Over Coax) device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242315A (en) * 2008-02-26 2008-08-13 中兴通讯股份有限公司 Loop detection method
CN102055525A (en) * 2010-12-17 2011-05-11 北京格林伟迪科技有限公司 Loop detecting and controlling method
CN102821009A (en) * 2012-08-08 2012-12-12 中兴通讯股份有限公司 Method for monitoring ring network on basis of link layer discovery protocol and device

Also Published As

Publication number Publication date
CN103858388A (en) 2014-06-11

Similar Documents

Publication Publication Date Title
WO2015051493A1 (en) Loop detection method and apparatus
US10999834B2 (en) Method and apparatus for generating and maintaining an accurate network map in a communications network
EP3005822B1 (en) Mac layer transport for wi-fi direct services application service platform without internet protocol
EP3836577B1 (en) Session management method and device for user groups
US9743225B2 (en) Method and apparatus for forming communication link using bluetooth
WO2021232568A1 (en) Method, terminal and system for transceiving data over wireless local area network, and network access device
CN107820262B (en) Parameter configuration method, device and system
JP2016535956A (en) Coverage hole detection and minimization in communication networks
US9155117B2 (en) Directly transferring data between devices
EP2218214B1 (en) Network location service
WO2016062165A1 (en) Method and apparatus for implementing operations, administration and maintenance function
US11038898B2 (en) Slow protocol packet processing method and related apparatus
JP5974911B2 (en) Communication system and network relay device
WO2011157001A1 (en) Method, device and system for modifying network parameters of terminal
WO2014187241A1 (en) Method and wireless device for controlling disconnection of a wireless device in a wi-fi direct group of a wireless network
CN104835990A (en) Low power consumption Bluetooth-based charger charging method and system
WO2015024523A1 (en) Ip bearer network failure determining method and system
WO2015035852A1 (en) Method and device for announcing state between nodes
CN113873554B (en) Method and system for synchronous configuration acquisition and transmission of Mesh networking
WO2011057544A1 (en) Method and system for implementing operation administration and maintenance (oam) from point to multi-points based on 802.3ah protocol
JP6802530B2 (en) Communication method
WO2015051696A1 (en) Method and apparatus for transmitting oam packet
CN105634786B (en) link keep-alive method and device
KR101643512B1 (en) Data transmission method, multi-medium access point and multi-medium client
WO2024016985A1 (en) Message processing method, communication system and related apparatus

Legal Events

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

Ref document number: 13895421

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13895421

Country of ref document: EP

Kind code of ref document: A1