A method, device, equipment and storage medium for detecting Ethernet layer 2 links

UDP multicast combined with BFD, DNS or NTP protocols solves the problem of Ethernet layer 2 link detection in IP-free scenarios, realizes the universality and practicality of link detection, simplifies configuration, and is suitable for a variety of devices .

CN117395172BActive Publication Date: 2024-11-08GUANGZHOU TOZED KANGWEI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311381969.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-23
Publication Date
2024-11-08
Estimated Expiration
2043-10-23

AI Technical Summary

Technical Problem

The existing technology cannot effectively detect Ethernet layer 2 links in the absence of IP, especially when the CPE device does not plan IP, the traditional PING and 802.1ag MAC Ping methods cannot be applied, and common devices do not support data links. Layer protocol, resulting in low link detection universality.

Method used

UDP multicast combined with BFD, DNS or NTP protocols can realize link detection session establishment between CPE devices and network devices, and conduct Ethernet interactive link message detection, avoiding dependence on layer three IP, and supporting IP-free scenarios Layer 2 link detection.

Benefits of technology

提高了以太网二层链路检测的通用性和实用性,简化了协议配置,常见设备均可支持,实现了无需修改现有网络链路的情况下对链路连通性的检测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117395172B_ABST
    Figure CN117395172B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for detecting Ethernet layer 2 links. The method includes joining multicast and monitoring multicast UDP, and setting the multicast address and port of CPE equipment, so that the network equipment joins multicast and monitors multicast UDP, and sets the multicast address and port; configuring a link detection protocol, based on the link detection protocol, sending a link detection session establishment request to the multicast address, so that the network equipment receives the link detection session establishment request and builds a link detection session; based on the link detection session, performing Ethernet interactive link message detection on the network equipment to obtain a link detection result. This embodiment realizes Ethernet layer 2 link detection in a non-IP scenario, and improves the versatility and practicality of connectivity detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Ethernet link detection, and in particular to a method, device, equipment and storage medium for detecting an Ethernet layer 2 link. Background Art

[0002] In recent years, with the continuous development of the 5G+Industrial Internet industry, 5G network technology has been continuously iterated, the R17 standard has been officially frozen, and the R16 standard has been fully implemented. The low latency and high bandwidth characteristics of 5G networks have been gradually applied to various industrial scenarios. Now more and more scenarios use 5G wireless communication networks to back up the wired Layer 2 network link. However, in the implementation process, CPE devices are part of the Layer 2 wired network link. Without modifying the original network architecture, CPE devices only serve as transparent transmission of the Layer 2 wired link and cannot hold the Layer 3 network IP. However, it is necessary to detect the Layer 2 wired network to determine whether it is necessary to switch to the 5G wireless backup network.

[0003] Since the original wired link does not plan the IP of the 5G CPE device, the CPE device cannot have a layer 3 IP on the wired link, so the traditional PING cannot be used as a means of link detection. In addition, the link device cannot support the layer 2 802.1ag MAC Ping method. BFD is a commonly used link detection method. BFD is a seven-layer network protocol based on UDP, and the traditional method cannot be directly applied. This solution proposes a method of using BFD in multicast mode to solve the above key technical problems. Connectivity failure is the most common type of network failure. As we all know, ping and trace commands are common commands for network connectivity detection, but such commands can only test whether the peer is reachable through the IPv4 address or IPv6 address, and cannot implement connectivity detection at the data link layer. There are also connectivity detection protocols at the data link layer, such as the MAC Ping protocol based on 802.1ag, but the protocol configuration is relatively complex and is not supported by common devices.

[0004] In the prior art, the following three methods are usually used to implement link connectivity detection. The first is ping link detection based on the IP layer to determine the link connectivity. However, ping-based link detection requires the use of IP layer protocols, and the device initiating the detection needs to have an Ethernet layer 3 IP address. The second is MAC Ping based on 802.1ag, which can be used to detect the connectivity of Ethernet layer 2 links. However, the MAC Ping function based on 802.1ag requires all devices on the link to support this function when there are one or more intermediate devices in the intermediate link between the two parties. There are very few devices that support this protocol, and the protocol has poor universality. The third is to implement connectivity detection based on the Ethernet MAC address of the data link layer, which provides a method for customizing the data link layer protocol type. This method realizes detection through the data link layer by customizing the Ethernet protocol type. However, since it is a custom non-standard protocol, both the sender and the receiver need to customize and develop to support this protocol, and it is impossible to add support for this method to an already built network link. The above methods cannot realize Ethernet Layer 2 link detection in the scenario without IP. Since the original network chain does not plan the IP of the new device, when the link needs to add a new device and the device needs to detect the connectivity of the link, the traditional Ethernet Layer 3 or above ping cannot be used to detect the link, and the versatility is low. Summary of the invention

[0005] The present invention provides a method, device, equipment and storage medium for detecting an Ethernet layer 2 link, which realizes Ethernet layer 2 link detection in a non-IP scenario and improves the versatility and practicality of connectivity detection.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a method for detecting an Ethernet layer 2 link, comprising:

[0007] The Ethernet layer 2 link detection method is executed on a CPE device; wherein the CPE device is connected to a network device via an Ethernet layer 2 link, the CPE device is connected to a multicast, and the network device is connected to a multicast;

[0008] Ethernet Layer 2 link detection methods include:

[0009] Join multicast and listen to multicast UDP, and set the multicast address and port of CPE equipment, so that network equipment can join multicast and listen to multicast UDP, and set the multicast address and port;

[0010] Configure a link detection protocol, and based on the link detection protocol, send a link detection session establishment request to a multicast address, so that a network device receives the link detection session establishment request and establishes a link detection session;

[0011] Based on the link detection session, Ethernet interactive link message detection is performed on the network device to obtain the link detection result.

[0012] The embodiment of the present invention is implemented by joining the multicast and listening to the multicast UDP, and setting the multicast address and port of the CPE device, so that the network device joins the multicast and listens to the multicast UDP, and sets the multicast address and port; configuring the link detection protocol, based on the link detection protocol, sending a link detection session establishment request to the multicast address, so that the network device receives the link detection session establishment request and builds a link detection session; based on the link detection session, the network device performs Ethernet interactive link message detection to obtain the link detection result. The UDP multicast method is combined with the link detection protocol (such as: BFD protocol, DNS protocol and NTP protocol) to achieve the data link layer link connection status detection without the need for the sender and the receiver to hold the Ethernet layer 3 IP. During the Ethernet layer 2 link detection, the device is detected when there is no Ethernet layer 3 IP, and the Ethernet layer 2 link detection is realized in the scenario without IP, without modifying the existing network link, the protocol configuration is relatively simple, and common devices can support it, which improves the versatility and practicality of Ethernet layer 2 link connectivity detection.

[0013] As a preferred solution, configure the link detection protocol, specifically:

[0014] Configure a first local end identifier and a first opposite end identifier corresponding to the link detection protocol, and according to the first local end identifier and the first opposite end identifier, enable the network device to configure a second local end identifier and a second opposite end identifier corresponding to the link detection protocol;

[0015] The link detection protocol includes one of a BFD protocol, a DNS protocol and an NTP protocol.

[0016] As a preferred solution, based on the link detection protocol, a link detection session establishment request is sent to a multicast address so that a network device receives the link detection session establishment request and establishes a link detection session, specifically:

[0017] Based on the link detection protocol, a link detection session establishment request is sent to the multicast address, so that the multicast forwarding link detection session establishment request is sent to the network device, so that the network device receives the link detection session establishment request through the port, parses the link detection session establishment request, matches the first peer identifier and the second local identifier in the link detection protocol to be consistent, and sends a link detection session establishment reply to the multicast address, thereby causing the multicast forwarding link detection session establishment reply to the CPE device;

[0018] A link detection session establishment reply is received through a port, and the link detection session establishment reply is parsed, and the second opposite end identifier in the link detection session establishment reply is matched to be consistent with the first local end identifier, so as to establish a link detection session.

[0019] As a preferred solution, based on the link detection session, Ethernet interactive link message detection is performed on the network device to obtain the link detection result, which is specifically:

[0020] According to the sending interval negotiated when establishing the link detection session, a periodic detection message is composed, and based on the periodic detection message and link detection message format, a periodic detection message request is sent to the multicast address, so that the multicast forwarding periodic detection message request is sent to the network device, so that the network device receives the periodic detection message request from the multicast address, updates the periodic detection message based on the link detection message format, sends the updated periodic detection message to the multicast address, and then forwards the updated periodic detection message to the CPE device through multicast, and obtains the link detection result according to the updated periodic detection message.

[0021] As a preferred solution, the network device receives a periodic detection message request from a multicast address, updates the periodic detection message based on the link detection message format, and sends the updated periodic detection message to the multicast address, specifically:

[0022] The network device receives a periodic detection message request from the multicast address, and unpacks the periodic detection message according to the link detection message format, obtains the current peer identifier of the CPE device as the current local identifier of the network device, updates the link detection connection status and the latest link detection protocol reception time, obtains the updated periodic detection message, and sends the updated periodic detection message to the multicast address according to the negotiated sending interval.

[0023] As a preferred solution, the Ethernet layer 2 link includes a backup link layer and an Ethernet data link layer.

[0024] As a preferred solution, the backup link layer includes one of a 5G backup link, a 4G backup link, a WIFI backup link and a Lora backup link.

[0025] In order to solve the same technical problem, an embodiment of the present invention further provides a detection device for an Ethernet layer 2 link, comprising: a CPE device, a multicast, a network device and an Ethernet layer 2 link; wherein the CPE device executes the detection method for the Ethernet layer 2 link;

[0026] The connection of the detection device is as follows: the CPE device is connected to the network device via an Ethernet layer 2 link, the CPE device is connected to multicast, and the network device is connected to multicast.

[0027] In order to solve the same technical problem, an embodiment of the present invention further provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, a method for detecting an Ethernet layer 2 link is implemented.

[0028] In order to solve the same technical problem, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements a method for detecting an Ethernet layer 2 link when the computer program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 : A flow chart of an embodiment of a method for detecting an Ethernet layer 2 link provided by the present invention;

[0030] Figure 2 : A timing diagram of link detection of an embodiment of a method for detecting an Ethernet layer 2 link provided by the present invention;

[0031] Figure 3 : A network topology diagram of an embodiment of a method for detecting an Ethernet layer 2 link provided by the present invention;

[0032] Figure 4 : A BFD message format diagram of an embodiment of a method for detecting an Ethernet layer 2 link provided by the present invention;

[0033] Figure 5 : A structural schematic diagram of an embodiment of a detection device for an Ethernet layer 2 link provided by the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Embodiment 1

[0036] Please refer to Figure 1 , which is a flow chart of a method for detecting an Ethernet layer 2 link provided by an embodiment of the present invention. This embodiment uses the UDP multicast method in combination with the link detection protocol to perform Ethernet interactive link message detection, thereby realizing Ethernet layer 2 link detection in a non-IP scenario and improving the versatility and practicality of connectivity detection. The method for detecting an Ethernet layer 2 link is executed on a CPE device; wherein the CPE device is connected to a network device via an Ethernet layer 2 link, the CPE device is connected to multicast, and the network device is connected to multicast. The method for detecting an Ethernet layer 2 link includes steps 101 to 104, and each step is specifically as follows:

[0037] Step 101: Join the multicast and listen to the multicast UDP, and set the multicast address and port of the CPE device, so that the network device joins the multicast and listens to the multicast UDP, and sets the multicast address and port.

[0038] In this embodiment, the link detection protocol is taken as the BFD protocol for example. The timing diagram of the link detection is as follows: Figure 2 As shown, the CPE device joins the multicast group and listens to the multicast UDP. The multicast address is 224.0.0.184 and the port is 3784. The network device A joins the multicast group and listens to the multicast UDP. The multicast address is 224.0.0.184 and the port is 3784.

[0039] It should be noted that UDP multicast is based on IP multicast technology and uses a specific range in the IP address range, which is called a multicast address. The sender sends data to the multicast address, and all receivers that have joined the multicast can receive the data. A multicast address is a special IP address used to identify a group of receivers. The 224.0.0.184 multicast address is usually used, and BFD (link detection protocol) usually uses 3784 as the receiving port of UDP. The present invention uses the multicast address 224.0.0.184 as an example, and is also applicable to other multicast addresses.

[0040] The present invention is a method for detecting Ethernet layer 2 links in a scenario without IP. Since the original network link does not plan the IP of the newly added device, when the link needs to add a new device and the device needs to detect the connectivity of the link, the traditional Ethernet layer 3 or above PING cannot be used to perform the link. The present invention provides a method of using UDP multicast, combined with link detection protocols (such as BFD protocol, DNS protocol and NTP protocol), to achieve a method for detecting the link connection status of the data link layer without the need for the sender and the receiver to hold the Ethernet layer 3 IP.

[0041] It should be noted that the CPE equipment, or Customer Premise Equipment, is often deployed at the client end of the FTTX home customer service to provide home customers with wired broadband, IPTV, VOIP and other services. Customer terminal equipment is a device that inputs programs and data into a computer or receives computer output processing results via communication facilities. Terminal equipment is usually set up in a convenient place where communication facilities can be used to connect to a remote computer for work. It is mainly composed of a communication interface control device and a dedicated or selected input and output device. A system in which many dispersed terminal devices are connected to a computer via communication facilities is called an online system. When a small amount of frequent information needs to be input and output to a computer, or when a computer information database needs to be queried and retrieved, a keyboard display terminal device with flexible operation is often used.

[0042] Optionally, the Ethernet layer 2 link includes a backup link layer and an Ethernet data link layer. The backup link layer includes one of a 5G backup link, a 4G backup link, a WIFI backup link, and a Lora backup link.

[0043] In this embodiment, the network topology diagram in the detection of Ethernet layer 2 link is as follows: Figure 3 As shown in the figure, the second layer of the wired Ethernet link and the 5G VxLAN backup link are used as examples. It is also applicable to other Ethernet data link layer detection scenarios. The wired link can be other Ethernet data links. It is not only applicable to 5G VxLAN as a backup link, but also applicable to other three-layer network links, including but not limited to 4G, WIFI, Lora and other three-layer network technologies as backup links. Taking the 5G link as an example of a backup link, since the 5G link belongs to the three-layer network, the 5G link uses the VXLAN technology to implement the second-layer link backup and obtain the 5G VxLAN backup link. At this time, the CPE device needs to detect the connectivity status of the wired link. Since the original wired link does not plan the three-layer IP of the CPE device, the UDP multicast technology is used to detect the connectivity status of the wired link through the BFD protocol.

[0044] Step 102: configure a link detection protocol, and based on the link detection protocol, send a link detection session establishment request to a multicast address, so that a network device receives the link detection session establishment request and establishes a link detection session.

[0045] Optionally, configure the link detection protocol, specifically:

[0046] Configure a first local end identifier and a first opposite end identifier corresponding to the link detection protocol, and according to the first local end identifier and the first opposite end identifier, enable the network device to configure a second local end identifier and a second opposite end identifier corresponding to the link detection protocol;

[0047] The link detection protocol includes one of a BFD protocol, a DNS protocol and an NTP protocol.

[0048] In this embodiment, taking the BFD protocol as an example, the BFD local identifier of the CPE device is configured to be 1, that is, the first local identifier, the local identifier of the link detection protocol of the CPE device. The BFD peer identifier of the CPE device is configured to be 2, that is, the first peer identifier, the peer identifier of the link detection protocol of the CPE device.

[0049] Configure the BFD local identifier of network device A to 2, that is, the second local identifier, the local identifier of the link detection protocol of network device A. During the session establishment, the value of the second local identifier will match the peer identifier (first peer identifier) ​​of the link detection protocol of the CPE device. Configure the peer identifier of network device A to 1, that is, the second peer identifier, the peer identifier of the link detection protocol of network device A. During the session establishment, the value of the second peer identifier will match the local identifier (first local identifier) ​​of the link detection protocol of the CPE device.

[0050] It should be noted that the link detection protocol includes one of the BFD protocol, the DNS protocol and the NTP protocol. When the link detection protocol is the BFD protocol, the BFD based on the UDP multicast usage scenario realizes the data link layer Ethernet connectivity detection. BFD (Bidirectional Forwarding Detection) is a set of international standard protocols for realizing rapid detection, providing a light load and continuous period detection. However, since BFD is a seven-layer application layer protocol based on UDP, it is usually required that both the sender and the receiver have IP and communication ports. A method using UDP multicast is provided to realize the method of data link layer link connection status detection without the sender and the receiver having Ethernet layer 3 IP. The present invention is not only applicable to BFD as a link detection protocol, but also to other protocols that use UDP for link detection, including but not limited to DNS, NTP, etc.; DNS and NTP protocols are both implemented using the UDP protocol, and can also interact using multicast technology, wherein the 4-layer UDP communication process is consistent, and only the 7-layer application layer encapsulation and parsing process needs to be processed according to the specific application layer protocol specification.

[0051] Optionally, based on the link detection protocol, a link detection session establishment request is sent to a multicast address so that a network device receives the link detection session establishment request. Building a link detection session specifically includes steps 1021 to 1025, and each step is as follows:

[0052] Step 1021: Based on the link detection protocol, a link detection session establishment request is sent to the multicast address.

[0053] In this embodiment, taking the BFD protocol as an example, the CPE device sends a BFD session establishment request (BFD Control Packet) to the multicast address, and the BFD session establishment request is a link detection session establishment request.

[0054] Step 1022: Multicast forwarding link detection session establishment request to the network device.

[0055] In this embodiment, the BFD session establishment request is forwarded to network device A via multicast.

[0056] Step 1023: The network device receives the link detection session establishment request through the port, parses the link detection session establishment request, matches the first peer identifier and the second local identifier in the link detection protocol to be consistent, and sends a link detection session establishment reply to the multicast address.

[0057] In this embodiment, network device A receives the BFD session establishment request, parses it, and matches the peer identifier 2 (first peer identifier) ​​and the local identifier 2 (second local identifier) ​​in the protocol. Network device A replies to the session establishment request to the multicast address, that is, sends a link detection session establishment reply to the multicast address.

[0058] Step 1024: The multicast forwarding link detection session establishment is replied to the CPE device.

[0059] In this embodiment, the BFD session establishment reply (link detection session establishment reply) is multicast forwarded to the CPE device.

[0060] Step 1025: Receive a link detection session establishment reply through the port, parse the link detection session establishment reply, match the second peer identifier in the link detection session establishment reply with the first local identifier to be consistent, and establish a link detection session.

[0061] In this embodiment, the CPE device receives the BFD session establishment reply, parses and matches the peer identifier (second peer identifier) ​​in the reply to 1, which is consistent with the local identifier (first local identifier) ​​1. At this point, BFD completes the session establishment and builds a link detection session, and the two parties can exchange link detection messages.

[0062] Step 103: Based on the link detection session, perform Ethernet interactive link message detection on the network device to obtain a link detection result.

[0063] Optionally, step 103 specifically includes step 1031 to step 1034, each step is as follows:

[0064] Step 1031: According to the transmission interval negotiated when establishing the link detection session, a periodic detection message is composed, and a periodic detection message request is sent to the multicast address based on the periodic detection message and link detection message format.

[0065] In this embodiment, the CPE device forms a BFD periodic detection message according to the sending interval negotiated during session establishment. The message core needs to set the local identifier (My Discriminator) to 1 and the peer identifier (Your Discriminator) to 2, and sends the BFD periodic detection message request to the multicast address according to the negotiated Desired Min TX Interval and Required Min RX Interval periodic interval. As an example, the BFD message format is as follows: Figure 4 shown.

[0066] Step 1032: Multicast forwarding of the periodic detection message request to the network device.

[0067] In this embodiment, the BFD periodic detection message request is forwarded to the network device A via multicast.

[0068] Step 1033: The network device receives a periodic detection message request from the multicast address, updates the periodic detection message based on the link detection message format, and sends the updated periodic detection message to the multicast address.

[0069] Optionally, step 1033 is specifically as follows: the network device receives a periodic detection message request from the multicast address, and unpacks the periodic detection message according to the link detection message format, obtains the current peer identifier of the CPE device as the current local identifier of the network device, updates the link detection connection status and the latest link detection protocol reception time, obtains an updated periodic detection message, and sends the updated periodic detection message to the multicast address according to the negotiated sending interval.

[0070] In this embodiment, network device A receives a BFD periodic detection message from a multicast address, unpacks the protocol according to the BFD message format (link detection message format), obtains the peer identifier (Your Discriminator) as the local identifier, and directly discards the message if network device A recognizes that the peer identifier is not the local ID. Network device A updates the BFD connection status to UP and the latest BFD reception time. Like the CPE device, network device A sends BFD periodic detection messages to the multicast address according to the sending interval negotiated by the session.

[0071] Step 1034: Multicast forwarding the updated periodic detection message to the CPE device, and obtaining the link detection result according to the updated periodic detection message.

[0072] In this embodiment, the BFD periodic detection message of the network device A is multicast forwarded to the CPE device, and the effect of link connectivity detection without IP at the data link layer is achieved through UDP multicast technology combined with the BFD general detection protocol.

[0073] The embodiment of the present invention is implemented by joining the multicast and listening to the multicast UDP, and setting the multicast address and port of the CPE device, so that the network device joins the multicast and listens to the multicast UDP, and sets the multicast address and port; configuring the link detection protocol, based on the link detection protocol, sending a link detection session establishment request to the multicast address, so that the network device receives the link detection session establishment request and builds a link detection session; based on the link detection session, the network device performs Ethernet interactive link message detection to obtain the link detection result. The UDP multicast method is combined with the link detection protocol (such as: BFD protocol, DNS protocol and NTP protocol) to achieve the data link layer link connection status detection without the need for the sender and the receiver to hold the Ethernet layer 3 IP. During the Ethernet layer 2 link detection, the device is detected when there is no Ethernet layer 3 IP, and the Ethernet layer 2 link detection is realized in the scenario without IP, without modifying the existing network link, the protocol configuration is relatively simple, and common devices can support it, which improves the versatility and practicality of Ethernet layer 2 link connectivity detection.

[0074] Embodiment 2

[0075] Accordingly, see Figure 5 , Figure 5 1 is a schematic diagram of the structure of a second embodiment of a detection device for Ethernet layer 2 links provided by the present invention. Figure 5 As shown, the detection device of Ethernet layer 2 link includes CPE equipment, multicast, network equipment and Ethernet layer 2 link; wherein, the CPE equipment executes the detection method of Ethernet layer 2 link;

[0076] The connection of the detection device is as follows: the CPE device is connected to the network device via an Ethernet layer 2 link, the CPE device is connected to multicast, and the network device is connected to multicast.

[0077] In addition, an embodiment of the present application further provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the steps in any of the above method embodiments are implemented.

[0078] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0079] The above-mentioned Ethernet Layer 2 link detection device can implement an Ethernet Layer 2 link detection method of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.

[0080] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting an Ethernet layer 2 link, characterized in that: include: The Ethernet layer 2 link detection method is performed on a 5G CPE device; wherein the 5G CPE device is connected to a network device via an Ethernet layer 2 link; The Ethernet layer 2 link detection method comprises: Join the multicast and listen to the multicast UDP, and set the multicast address and port of the 5GCPE device, so that the network device joins the multicast and listens to the multicast UDP, and sets the multicast address and the port; Configuring a link detection protocol, based on the link detection protocol, sending a link detection session establishment request to the multicast address, so that the network device receives the link detection session establishment request, and builds a link detection session; wherein the link detection protocol includes one of the BFD protocol, the DNS protocol and the NTP protocol; The sending of a link detection session establishment request to the multicast address based on the link detection protocol so that the network device receives the link detection session establishment request and builds a link detection session is specifically: Based on the link detection protocol, the link detection session establishment request is sent to the multicast address, and the link detection session establishment request is forwarded to the network device through multicast, so that the network device receives the link detection session establishment request through the port, and parses the link detection session establishment request, matches the first peer identifier and the second local identifier in the link detection protocol to be consistent, and sends a link detection session establishment reply to the multicast address, and then forwards the link detection session establishment reply to the 5G CPE device through multicast; Receiving the link detection session establishment reply through the port, parsing the link detection session establishment reply, matching the second peer identifier in the link detection session establishment reply with the first local identifier to be consistent, and building the link detection session; Based on the link detection session, performing Ethernet interactive link message detection on the network device to obtain a link detection result; Based on the link detection session, performing Ethernet interactive link message detection on the network device to obtain a link detection result is specifically: According to the sending interval negotiated when establishing the link detection session, a periodic detection message is formed, and based on the periodic detection message and the link detection message format, a periodic detection message request is sent to the multicast address, and the periodic detection message request is forwarded to the network device through multicast, so that the network device receives the periodic detection message request from the multicast address, performs a detection message update on the periodic detection message based on the link detection message format, sends the updated periodic detection message to the multicast address, and then forwards the updated periodic detection message to the 5GCPE device through multicast, and obtains the link detection result according to the updated periodic detection message; The network device receives the periodic detection message request from the multicast address, performs detection message update on the periodic detection message based on the link detection message format, and sends the updated periodic detection message to the multicast address, specifically: The network device receives the periodic detection message request from the multicast address, and unpacks the periodic detection message according to the link detection message format, obtains the current peer identifier of the 5GCPE device as the current local identifier of the network device, updates the link detection connection status and the latest link detection protocol reception time, obtains the updated periodic detection message, and sends the updated periodic detection message to the multicast address according to the negotiated sending interval.

2. The method for detecting an Ethernet layer 2 link according to claim 1, wherein: The configuration link detection protocol is specifically: A first local end identifier and a first opposite end identifier corresponding to the link detection protocol are configured, and according to the first local end identifier and the first opposite end identifier, a second local end identifier and a second opposite end identifier corresponding to the link detection protocol are configured on the network device.

3. The method for detecting an Ethernet layer 2 link according to any one of claims 1 to 2, characterized in that: The Ethernet layer 2 link includes a backup link layer and an Ethernet data link layer.

4. The method for detecting an Ethernet layer 2 link as claimed in claim 3, wherein: The backup link layer includes one of a 5G backup link, a 4G backup link, a WIFI backup link and a Lora backup link.

5. A detection device for an Ethernet layer 2 link, characterized in that: include: 5G CPE equipment and network equipment; wherein, the 5G CPE equipment executes the Ethernet Layer 2 link detection method as described in any one of claims 1 to 4.

6. A computer device, characterized in that: The invention comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for detecting an Ethernet layer 2 link as claimed in any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed by a processor, it implements the Ethernet layer 2 link detection method as described in any one of claims 1 to 4.