Method for detecting 802.1 CB link, 802.1 CB link, electronic equipment and storage medium

By adding redundant tags to the 802.1CB link and comparing the difference between sampling points and the difference between redundant tags, the problems of complex configuration and difficult diagnosis of IEEE 802.1CB links are solved, and fast and accurate link detection is achieved.

CN120896867APending Publication Date: 2025-11-04WXILICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511003866.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

The configuration of existing IEEE 802.1CB links is complex and it is difficult to detect the correctness of the links, which makes problem diagnosis difficult.

Method used

The correctness of the 802.1CB link is determined by adding redundant tags during the message replication process and comparing the difference between the sampling points and the difference between the redundant tags during the sampling process.

Benefits of technology

It enables rapid detection of the correctness of 802.1CB links, solves the problems of complex configuration and difficult diagnosis, and improves the efficiency and accuracy of link detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120896867A_ABST
    Figure CN120896867A_ABST
Patent Text Reader

Abstract

The invention provides a method for detecting an 802.1 CB link, the 802.1 CB link, electronic equipment and a storage medium. The 802.1 CB link detection method applied to a source node comprises the following steps: copying each original message, and adding a redundant label in the copied message to obtain a target message corresponding to each original message; sampling all the original messages according to a target sampling rate to obtain original sampling messages; sampling all the target messages according to a target sampling rate to obtain a first target sampling message; and under the condition that a sampling point difference value between the original sampling messages sampled for two adjacent times is consistent with a redundant label difference value between the first target sampling messages sampled for two adjacent times, judging that the message copying of the source node is correct. According to the method and the device, the problem that the correctness of the 802.1 CB link is difficult to detect in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network, and particularly relates to a method for detecting 802.1CB link, 802.1CB link, electronic equipment and storage medium. BACKGROUND

[0002] IEEE 802.1CB is a sub-protocol in the TSN (Time-Sensitive Network) protocol family, which defines a frame replication and elimination mechanism (Frame Replication and Elimination for Reliability) to improve network reliability through redundant transmission.

[0003] IEEE 802.1CB can implement the following functions: frame replication: redundant messages of a key data stream (such as industrial control instructions, sensor data on a vehicle) are sent through multiple independent paths; frame elimination: the receiving end only retains the first valid message that arrives and discards subsequent redundant frames.

[0004] And generally, IEEE 802.1CB adopts a redundant path design to facilitate the transmission of data streams through disjoint paths in the network, so that even if a certain path fails due to link failure, data can still be guaranteed to be reachable through other paths.

[0005] However, due to the relatively complex configuration of 802.1CB, the roles of 802.1CB at different nodes are different, and the configuration is relatively complex. If the expected result is different from the actual result, the configuration personnel will also have a relatively difficult situation to troubleshoot. In addition, during the operation of the protocol, if there is a link problem, it is also difficult to diagnose the problem.

[0006] Therefore, there is a problem in the related art that it is difficult to detect the correctness of the 802.1CB link. SUMMARY

[0007] The present application provides a method for detecting 802.1CB link and 802.1CB link, electronic equipment and storage medium to at least solve the problem that it is difficult to detect the correctness of the 802.1CB link in the related art.

[0008] According to an aspect of an embodiment of the present application, a method for detecting 802.1CB link is provided, applied to a source node, comprising:

[0009] copying each original message and adding a redundancy label in the copied message to obtain a target message corresponding to each original message;

[0010] sampling all original messages according to a target sampling rate to obtain original sampling messages; sampling all target messages according to the target sampling rate to obtain first target sampling messages;

[0011] in a case where a difference between the sampling points of the original sampled packets of two adjacent samplings is consistent with a difference between the redundancy labels of the first target sampled packets of two adjacent samplings, it is determined that the packet replication of the source node is correct.

[0012] Optionally, the method as described in the preceding embodiment further comprises:

[0013] in a case where a difference between the sampling points of the original sampled packets of two adjacent samplings is inconsistent with a difference between the redundancy labels of the first target sampled packets of two adjacent samplings, it is determined that the packet replication of the source node is abnormal;

[0014] in a case where the redundancy label is absent in at least one of the first target sampled packets, it is determined that the packet replication of the source node is abnormal.

[0015] According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, applied to a replication relay node, comprising:

[0016] replicating each packet to obtain a first replicated packet corresponding to the each packet;

[0017] sampling all the packets according to a target sampling rate to obtain second target sampled packets, and sampling each group of first replicated packets according to the target sampling rate to obtain first replicated sampled packets, wherein the each group of first replicated packets comprises the first replicated packet corresponding to the each packet;

[0018] in a case where a difference between the redundancy labels of the second target sampled packets of two adjacent samplings is consistent with a difference between the redundancy labels of the first replicated sampled packets of two adjacent samplings, it is determined that the packet replication of the replication relay node is correct.

[0019] Optionally, the method as described in the preceding embodiment further comprises:

[0020] in a case where a difference between the redundancy labels of the second target sampled packets of two adjacent samplings is inconsistent with a difference between the redundancy labels of the first replicated sampled packets of two adjacent samplings, it is determined that the packet replication of the replication relay node is abnormal;

[0021] in a case where the redundancy label is absent in at least one of the first replicated sampled packets, it is determined that the packet replication of the replication relay node is abnormal.

[0022] According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, applied to a replication relay node, comprising:

[0023] stripping the redundancy label in each obtained packet to obtain a stripped packet corresponding to the each packet;

[0024] sampling all the packets according to a target sampling rate to obtain third target sampling packets, and sampling all the stripped packets according to the target sampling rate to obtain stripped sampling packets;

[0025] in a case where a redundancy label difference between the third target sampling packets sampled at adjacent two times is consistent with a sampling point difference between the stripped sampling packets sampled at the adjacent two times, determining that the elimination end node operates correctly;

[0026] sending the stripped packets.

[0027] Optionally, the method as described in the preceding embodiment further comprises:

[0028] in a case where a redundancy label difference between the third target sampling packets sampled at adjacent two times is inconsistent with a sampling point difference between the stripped sampling packets sampled at the adjacent two times, determining that the elimination end node operates abnormally.

[0029] According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, which is applied to an elimination end node and comprises:

[0030] sampling a plurality of obtained packet groups according to a target sampling rate to obtain fourth target sampling packets corresponding to at least one packet group in the plurality of packet groups, and sampling the merged packet group according to the target sampling rate to obtain a merged sampling packet, wherein the merged packet group is a packet group obtained by merging the plurality of packet groups;

[0031] in a case where a redundancy label difference between the fourth target sampling packets sampled at adjacent two times is consistent with a redundancy label difference between the merged sampling packets sampled at the adjacent two times, determining that packet merging of the elimination end node is correct.

[0032] Optionally, the method as described in the preceding embodiment further comprises:

[0033] in a case where a redundancy label difference between the fourth target sampling packets sampled at adjacent two times is inconsistent with a redundancy label difference between the merged sampling packets sampled at the adjacent two times, determining that packet merging of the elimination end node is abnormal.

[0034] According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, which is applied to a node and comprises:

[0035] determine all target CB states included by the node according to the traffic of the node, wherein the target CB states include at least one of a CB state as a source node, a CB state as a replication relay node, a CB state as a stripping end node, and a CB state as a stripping relay node;

[0036] in a case where the node includes the CB state as the source node, maintain the CB state as the source node according to the method implemented by any one of the embodiments applied to the source node;

[0037] in a case where the node includes the CB state as the replication relay node, maintain the CB state as the replication relay node according to the method implemented by any one of the embodiments applied to the replication relay node;

[0038] in a case where the node includes the CB state as the stripping end node, maintain the CB state as the stripping end node according to the method implemented by any one of the embodiments applied to the stripping end node;

[0039] in a case where the node includes the CB state as the stripping relay node, maintain the CB state as the stripping relay node according to the method implemented by any one of the embodiments applied to the stripping relay node.

[0040] According to another aspect of the embodiments of the present application, there is also provided an 802.1CB link, comprising: a source node implementing the method of any one of the embodiments applied to the source node, a replication relay node implementing the method of any one of the embodiments applied to the replication relay node, a stripping end node implementing the method of any one of the embodiments applied to the stripping end node, a stripping relay node implementing the method of any one of the embodiments applied to the stripping relay node, and a node implementing the method of any one of the embodiments applied to the node.

[0041] According to still another aspect of the embodiments of the present application, there is also provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; wherein the memory is configured to store a computer program; and the processor is configured to execute the method steps in any one of the embodiments by running the computer program stored on the memory.

[0042] According to still another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, which stores a computer program, wherein the computer program is configured to execute the method steps in any one of the embodiments when running.

[0043] In the method for detecting an 802.1CB link applied to a source node, each original packet is copied, and a redundant label is added to the copied packet to obtain a target packet corresponding to each original packet; all original packets are sampled at a target sampling rate to obtain original sample packets; all target packets are sampled at the target sampling rate to obtain first target sample packets; and in a case where a sampling point difference between adjacent two original sample packets is consistent with a redundant label difference between adjacent two first target sample packets, it is determined that the packet replication of the source node is correct. Since whether the packet replication of the source node is correct can be determined by whether the sampling point difference between adjacent two original sample packets is consistent with the redundant label difference between adjacent two target sample packets, the technical effect that the correctness of the 802.1CB link can be quickly detected is achieved, and the problem that the correctness of the 802.1CB link is difficult to detect in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0044] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate the embodiments of the present application and, together with the description, serve to explain the principles of the present application.

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative labor.

[0046] Figure 1 FIG. 1 is a schematic diagram of a hardware environment of an optional method for detecting an 802.1CB link according to an embodiment of the present application;

[0047] Figure 2 FIG. 2 is a flowchart of an optional method for detecting an 802.1CB link applied to a source node according to an embodiment of the present application;

[0048] Figure 3 FIG. 3 is a flowchart of an optional method for detecting an 802.1CB link applied to a replication relay node according to an embodiment of the present application;

[0049] Figure 4 FIG. 4 is a flowchart of an optional method for detecting an 802.1CB link applied to an elimination end node according to an embodiment of the present application;

[0050] Figure 5 is a flow diagram of an optional method for detecting 802.1CB links of a relay node according to an embodiment of the present application;

[0051] Figure 6 is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] According to an aspect of an embodiment of the present application, a method for detecting 802.1CB links is provided. Optionally, in the present embodiment, the above-mentioned method for detecting 802.1CB links can be applied in the hardware environment composed of the terminal 1402 and the server 1404 as shown in Figure 1 As shown in Figure 1 The server 1404 is connected with the terminal 1402 through the network, and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal, and a database can be set on the server or independently of the server, to provide data storage services for the server 1404.

[0055] The network can include, but is not limited to, at least one of the following: a wired network, a wireless network. The wired network can include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, a local area network. The wireless network can include, but is not limited to, at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal can be, but is not limited to, a PC, a mobile phone, a tablet computer, etc.

[0056] The method for detecting the 802.1CB link in the embodiment of the application can be executed by a server, or by a terminal, or by both the server and the terminal. The terminal can execute the method for detecting the 802.1CB link in the embodiment of the application by a client installed thereon.

[0057] Taking the method for detecting the 802.1CB link in the embodiment as an example, Figure 2 A method for detecting an 802.1CB link provided in the embodiment of the application is applied to a source node and includes the following steps.

[0058] In step S202, each original packet is copied, and a redundancy tag is added to the copied packet to obtain a target packet corresponding to each original packet.

[0059] The method for detecting the 802.1CB link in the embodiment of the application can be applied to a scenario in which it is necessary to detect whether the source node in the 802.1CB link is abnormal.

[0060] In the embodiment, the source node is a device at the copy starting point.

[0061] The source node can copy each original packet collected to obtain a copied packet corresponding to each original packet, and then add a redundancy tag (R-TAG) to each copied packet to obtain a target packet corresponding to each original packet.

[0062] In step S204, all original packets are sampled at a target sampling rate to obtain original sampling packets.

[0063] That is, after all original packets are obtained, the original packets can be sampled at a preset target sampling rate to obtain original sampling packets.

[0064] The target sampling rate in the embodiment is configured according to the ability of the CPU, and all the traffic matched by the ACL (Access Control List) is processed by the CPU, which causes the CPU to be unable to process all the traffic, i.e., unable to process all the original packets. Therefore, a fixed proportion sampling needs to be configured according to the ability of the CPU. In the embodiment, the target sampling rate can be 1000 packets collected per one. That is, one original sampling packet is sampled from 1000 original packets, i.e., sampling once every 999 original packets.

[0065] Further, the collected original sampling packet is sent to the CPU for comparison with the packet sampled subsequently.

[0066] In step S206, all the target packets are sampled at the target sampling rate to obtain the first target sampling packet.

[0067] That is, after all the target packets are obtained, the target packets can be sampled at the preset target sampling rate to obtain the first target sampling packet.

[0068] The target sampling rate in the embodiment is configured according to the ability of the CPU, and all the traffic matched by the ACL (Access Control List) is processed by the CPU, which causes the CPU to be unable to process all the traffic, i.e., unable to process all the target packets. Therefore, a fixed proportion sampling needs to be configured according to the ability of the CPU. In the embodiment, the target sampling rate can be 1000 packets collected per one. That is, one first target sampling packet is sampled from 1000 target packets, i.e., sampling once every 999 target packets.

[0069] Further, after the target packet is obtained, the target packet is sent from the specified port according to the configuration, and at the same time, the first target sampling packet sampled is sent to the CPU for comparison with other sampled packets.

[0070] In step S208, in the case that the sampling point difference between the original sampling packets sampled at adjacent two times is consistent with the redundancy label difference between the first target sampling packets sampled at adjacent two times, it is determined that the packet replication of the source node is correct.

[0071] After the original sampling packet and the target sampling packet are sampled, the serial number of the sampling point of the original packet and the redundancy tag R-TAG of the target sampling packet can be compared by the CPU, and the difference value is required to be equal, otherwise a copy error alarm will be caused. For example, when the original sampling packet is sampled, the sampling point can be recorded at the end of the original sampling packet. For example, the sampling rate is 1000, that is, 1000 samples, if the first sampling falls on the 100th packet, the recorded sampling point is 100, the next sampling is 1100, and so on. That is, when the target sampling rate is 1000, the difference value of the sampling points of the original sampling packets sampled by adjacent two times is 1000. The first target sampling packet obtained by copying is added with R-TAG at the export, and the R-TAG of the first target sampling packet sampled first is 101, and the R-TAG of the next first target sampling packet is 1101. That is, when the target sampling rate is 1000, the difference value of the redundancy tags of the first target sampling packets sampled by adjacent two times is 1000. Further, since the target sampling rate is consistent, when the sampling point difference value and the redundancy tag difference value are consistent, it is determined that the packet copying of the source node is correct.

[0072] Alternatively, the original sampling packet and the first target sampling packet sampled at adjacent time points can also be taken as a group, and the difference value of each group of sampling packets is calculated. For example, based on the foregoing example, when the sampling point of the original sampling packet sampled first is 100, and the R-TAG of the first target sampling packet is 101, the difference value of the sampling packets in this group is 1, and when the sampling point of the original sampling packet sampled second is 1100, and the R-TAG of the second first target sampling packet is 1101, the difference value of the sampling packets in this group is also 1, so the packet copying of the source node can also be determined to be correct.

[0073] In the embodiment, each original packet is copied, and a redundancy tag is added in the copied packet to obtain a target packet corresponding to each original packet; all original packets are sampled at a target sampling rate to obtain original sampling packets; all target packets are sampled at the target sampling rate to obtain first target sampling packets; and in a case where the difference value of the sampling points between the original sampling packets sampled by adjacent two times is consistent with the difference value of the redundancy tags between the target sampling packets sampled by adjacent two times, it is determined that the packet copying of the source node is correct. Since whether the difference value of the sampling points between the original sampling packets sampled by adjacent two times is consistent with the difference value of the redundancy tags between the target sampling packets sampled by adjacent two times can be used to determine whether the packet copying of the source node is correct, the technical effect that the correctness of the 802.1CB link can be quickly detected is achieved, and the problem that the correctness of the 802.1CB link is difficult to detect in the related art is solved.

[0074] As an optional implementation, the method further comprises the following steps of:

[0075] In a case where the difference between the sampling points of the original sampled packets of the adjacent two times is inconsistent with the difference between the redundant labels of the first target sampled packets of the adjacent two times, it is determined that the packet replication of the source node is abnormal. That is, in a case where the difference between the sampling points of the original sampled packets of the adjacent two times is inconsistent with the difference between the redundant labels of the first target sampled packets of the adjacent two times, it is indicated that the replication of the original packet appears repeated replication (i.e., the number of target packets is more than that of original packets) or missing replication (i.e., the number of target packets is less than that of original packets), which further causes the above-mentioned situation to occur. For example, taking the target sampling rate of 1000 as an example, if repeated replication occurs, since the sampling rate is unchanged, and the target packets corresponding to one or more original packets are more than one, the difference between the redundant labels of the first target sampled packets of the adjacent two times will be less than 1000; if missing replication occurs, since the sampling rate is unchanged, and the target packets corresponding to one or more original packets are missing, the difference between the redundant labels of the first target sampled packets of the adjacent two times will be greater than 1000; thus, in a case where the difference between the sampling points of the original sampled packets of the adjacent two times is inconsistent with the difference between the redundant labels of the first target sampled packets of the adjacent two times, it is determined that the packet replication of the source node is abnormal.

[0076] In a case where the at least one first target sampled packet does not have a redundant label, it is determined that the packet replication of the source node is abnormal. That is, the CPU determines that the packet replication of the source node is abnormal in a case where the at least one first target sampled packet does not have a redundant label, i.e., the at least one first target sampled packet does not carry an R-TAG.

[0077] As shown in Figure 3 According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, applied to a replication relay node, comprising the following steps:

[0078] In step S302, each packet obtained is replicated to obtain a first replicated packet corresponding to each packet.

[0079] That is, after the replication relay node obtains a packet from a source node or other replication relay nodes or the like, each packet obtained can be replicated to obtain a first replicated packet corresponding to each packet.

[0080] In step S304, all packets are sampled at a target sampling rate to obtain second target sampled packets.

[0081] That is, after obtaining all the packets, the above all packets can be sampled according to a preset target sampling rate to obtain second target sampling packets.

[0082] In the embodiment, the target sampling rate is configured according to the capability of the CPU, and all the traffic matched by the ACL (Access Control List) is processed by the CPU, which causes the CPU to be unable to process all the traffic, that is, unable to process all the packets. Therefore, a fixed proportion sampling needs to be configured according to the capability of the CPU. In the embodiment, the target sampling rate can be one packet in 1000 packets. That is, one second target sampling packet is sampled in 1000 packets, that is, sampling once every 999 original packets.

[0083] Further, the obtained second target sampling packets are sent to the CPU for comparison with other sampled packets.

[0084] In step S306, the first copy sampling packets are obtained by sampling each group of first copy packets according to the target sampling rate, wherein each group of first copy packets includes a first copy packet corresponding to each packet.

[0085] The replication relay node can replicate each packet to obtain at least one group of copy packets corresponding to all the packets, and sample each group of first copy packets according to the target sampling rate to obtain first copy sampling packets. That is, after obtaining at least one group of copy packets, each group of copy packets can be sampled according to a preset target sampling rate to obtain first copy sampling packets.

[0086] In the embodiment, the target sampling rate is configured according to the capability of the CPU, and all the traffic matched by the ACL (Access Control List) is processed by the CPU, which causes the CPU to be unable to process all the traffic, that is, unable to process all the first copy packets. Therefore, a fixed proportion sampling needs to be configured according to the capability of the CPU. In the embodiment, the target sampling rate can be one packet in 1000 packets. That is, one first copy sampling packet is sampled in 1000 first copy packets, that is, sampling once every 999 first copy packets.

[0087] Further, after obtaining the first copy packets, the first copy packets are sent from the specified port according to the configuration, and at the same time, the first copy sampling packets sampled are sent to the CPU for comparison with other sampled packets.

[0088] Step S308, if the difference of the redundancy labels between the second target sampling packets of the adjacent two times of sampling is consistent with the difference of the redundancy labels between the first copy sampling packets of the adjacent two times of sampling, it is determined that the packet copying of the copy relay node is correct.

[0089] After the second target sampling packet and the first copy sampling packet are sampled, the redundancy label of the second target sampling packet can be compared with the redundancy label R-TAG of the first copy sampling packet by the CPU, and the difference should be maintained equal, otherwise the copy error alarm will be caused. For example, when the second target sampling packet is sampled, the redundancy label can be recorded at the end of the second target sampling packet. For example, the sampling rate is 1000, that is, 1000 samples, if the second target sampling packet of the first sampling falls in the 100th packet, the redundancy label of the first sampling of the second target sampling packet is 100, and the redundancy label of the next sampling of the second target sampling packet is 1100, and so on. That is, when the target sampling rate is 1000, the difference of the sampling points of the adjacent two times of sampling of the original sampling packet is 1000. The R-TAG of the first copy sampling packet of the first sampling is 101, and the R-TAG of the next sampling of the first copy sampling packet is 1101. That is, when the target sampling rate is 1000, the difference of the redundancy labels of the adjacent two times of sampling of the first copy sampling packet is 1000. Further, since the target sampling rate is consistent, when the difference of the redundancy labels between the second target sampling packets of the adjacent two times of sampling is consistent with the difference of the redundancy labels between the first copy sampling packets of the adjacent two times of sampling, it is determined that the packet copying of the copy relay node is correct.

[0090] Alternatively, the second target sampling packet and the first copy sampling packet sampled at adjacent time can also be taken as a group, and the difference of each group of sampling packets is calculated. For example, based on the foregoing example, when the R-TAG of the second target sampling packet of the first sampling is 100, and the R-TAG of the first copy sampling packet of the first sampling is 101, the difference of the sampling packets of the group is 1, when the R-TAG of the second target sampling packet of the second sampling is 1100, and the R-TAG of the first copy sampling packet of the first sampling is 1101, the difference of the sampling packets of the group is also 1, so it can also be determined that the packet copying of the copy relay node is correct.

[0091] In the embodiment, the message replication of the replication relay node is determined to be correct in the case that the redundancy label difference between the second target sampling messages of adjacent two times of sampling is consistent with the redundancy label difference between the first replication sampling messages of adjacent two times of sampling, so that the technical effect that the correctness of the replication relay node in the 802.1CB link can be quickly detected is achieved, and the problem that the correctness of the 802.1CB link is difficult to detect in the related art is solved.

[0092] As an optional implementation, the method further includes the following steps:

[0093] In the case that the redundancy label difference between the second target sampling messages of adjacent two times of sampling is inconsistent with the redundancy label difference between the first replication sampling messages of adjacent two times of sampling, it is determined that the message replication of the replication relay node is abnormal. That is, in the case that the redundancy label difference between the second target sampling messages of adjacent two times of sampling is inconsistent with the redundancy label difference between the first replication sampling messages of adjacent two times of sampling, it is indicated that the replication of the second target sampling message appears repeated replication (i.e., the number of target messages is more than the original message) or missed replication (i.e., the number of target messages is less than the original message), which further causes the above-mentioned situation to occur. For example, taking the target sampling rate of 1000 as an example, if repeated replication occurs, since the sampling rate is unchanged, and the first replication message corresponding to one or more messages is more than one, the redundancy label difference between the first replication sampling messages of adjacent two times of sampling will be less than 1000; if missed replication occurs, since the sampling rate is unchanged, and the first replication message corresponding to one or more messages is missing, the redundancy label difference between the first replication sampling messages of adjacent two times of sampling will be greater than 1000; so that in the case that the sampling point difference between the original sampling messages of adjacent two times of sampling is inconsistent with the redundancy label difference between the first target sampling messages of adjacent two times of sampling, it is determined that the message replication of the replication relay node is abnormal.

[0094] In the case that the at least one first replication sampling message does not have a redundancy label, it is determined that the message replication of the replication relay node is abnormal. That is, the CPU determines that the message replication of the source node is abnormal in the case that the at least one first target sampling message does not have a redundancy label, i.e., the at least one first target sampling message does not carry an R-TAG.

[0095] As shown in Figure 4 According to another aspect of the embodiment of the present application, a method for detecting an 802.1CB link is also provided, which is applied to an elimination end node and includes the following steps:

[0096] In step S402, the redundancy label in each message obtained is stripped to obtain a stripped message corresponding to each message.

[0097] That is, after the elimination end node obtains the message from the source node or other copy relay nodes, etc., the redundant label difference in each obtained message can be stripped to obtain the stripped message corresponding to each message.

[0098] In step S404, all messages are sampled according to the target sampling rate to obtain third target sampling messages.

[0099] In the embodiment, the sampling mode of sampling all messages according to the target sampling rate to obtain the third target sampling messages can refer to the sampling mode of sampling to obtain the first target sampling messages in step S206 of the foregoing embodiment, which will not be described here.

[0100] Further, the collected third target sampling messages are sent to the CPU for comparison with messages obtained by subsequent sampling.

[0101] In step S406, all stripped messages are sampled according to the target sampling rate to obtain stripped sampling messages.

[0102] In the embodiment, the sampling mode of sampling all stripped messages according to the target sampling rate to obtain the stripped sampling messages can refer to the sampling mode of sampling to obtain the original sampling messages in step S204 of the foregoing embodiment, which will not be described here.

[0103] Meanwhile, the stripped sampling messages obtained by sampling are sent to the CPU for comparison with other messages obtained by sampling.

[0104] In step S408, in the case that the redundant label difference between the third target sampling messages obtained by adjacent sampling is consistent with the sampling point difference between the stripped sampling messages obtained by adjacent sampling, it is determined that the elimination end node is running correctly.

[0105] In the embodiment, the implementation mode of determining that the elimination end node is running correctly can refer to the related implementation mode of determining that the message replication of the source node is correct in step S208 of the foregoing embodiment, which will not be described here.

[0106] In step S410, the stripped messages are sent.

[0107] In the embodiment, the sampling port of the message and the out port of the stripped message need to be set. Further, after the stripped messages are obtained, the stripped messages can be sent.

[0108] As an optional implementation mode, the method as described above further includes:

[0109] In a case where the redundancy tag difference between the third target sampling packet and the adjacent two times of sampling is inconsistent with the redundancy tag difference between the stripped sampling packet and the adjacent two times of sampling, it is determined that the operation of the elimination end node is abnormal. The implementation manner of determining that the operation of the elimination end node is abnormal in this embodiment can refer to the related implementation manners of determining that the packet replication of the source node is abnormal in the foregoing embodiments, and details are not described herein again.

[0110] As shown in Figure 5 According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link is also provided, applied to an elimination relay node, and includes the following steps:

[0111] In step S502, the obtained multiple groups of packets are sampled according to a target sampling rate to obtain a fourth target sampling packet corresponding to at least one group of packets in the multiple groups of packets.

[0112] In this embodiment, the elimination relay node is a node for merging the multiple groups of packets, and the elimination relay node does not eliminate the R-TAG.

[0113] After obtaining the multiple groups of packets, the elimination relay node can sample at least one group of packets to obtain a fourth target sampling packet corresponding to the at least one group of packets. The sampling manner of obtaining the fourth target sampling packet can refer to the sampling manner of obtaining the second target sampling packet in the foregoing embodiments, and details are not described herein again.

[0114] Further, the collected fourth target sampling packet is sent to the CPU and compared with a packet sampled subsequently.

[0115] In step S504, the merged group of packets is sampled according to the target sampling rate to obtain a merged sampling packet, where the merged group of packets is a group of packets obtained by merging the multiple groups of packets.

[0116] In this embodiment, the elimination relay node can merge the multiple groups of packets to obtain a merged group of packets after removing the redundancy of the packets, and the merged sampling packet can be obtained by referring to the sampling manner of obtaining the second target sampling packet in the foregoing embodiments.

[0117] In step S506, in a case where the redundancy tag difference between the fourth target sampling packet and the adjacent two times of sampling is consistent with the redundancy tag difference between the merged sampling packet and the adjacent two times of sampling, it is determined that the packet merging of the elimination relay node is correct.

[0118] The implementation manner of determining that the packet merging of the elimination relay node is correct in this embodiment can refer to the related implementation manners of determining that the packet replication of the replication relay node is correct in step S306 in the foregoing embodiments, and details are not described herein again.

[0119] As an optional implementation, the method as the foregoing method further comprises:

[0120] In a case where the redundancy label difference between the fourth target sampling packet of the adjacent two times of sampling and the redundancy label difference between the merged sampling packet of the adjacent two times of sampling are inconsistent, it is determined that the packet merging of the elimination relay node is abnormal. The implementation of determining that the packet merging of the elimination relay node is abnormal in the embodiment can refer to the related implementation of determining that the packet replication of the replication relay node is abnormal in the foregoing embodiment, which will not be described here in detail.

[0121] According to another aspect of the embodiments of the present application, a method for detecting an 802.1CB link applied to any node is further provided, comprising the following steps:

[0122] According to the traffic of the node, all target CB states included in the node are determined, wherein the target CB state comprises at least one of the following: a CB state as a source node, a CB state as a replication relay node, a CB state as an elimination end node, and a CB state as an elimination relay node;

[0123] In a case where the node includes the CB state as the source node, the CB state as the source node is maintained according to the implementation of any one of the foregoing embodiment methods applied to the source node;

[0124] In a case where the node includes the CB state as the replication relay node, the CB state as the replication relay node is maintained according to the implementation of any one of the foregoing embodiment methods applied to the replication relay node;

[0125] In a case where the node includes the CB state as the elimination end node, the CB state as the elimination end node is maintained according to the implementation of any one of the foregoing embodiment methods applied to the elimination end node;

[0126] In a case where the node includes the CB state as the elimination relay node, the CB state as the elimination relay node is maintained according to the implementation of any one of the foregoing embodiment methods applied to the elimination relay node.

[0127] That is, for any node, it can simultaneously serve as one or more of the source node (the corresponding target CB state is the CB state as the source node), the replication relay node (the corresponding target CB state is the CB state as the replication relay node), the elimination end node (the corresponding target CB state is the CB state as the elimination end node), and the elimination relay node (the corresponding target CB state is the CB state as the elimination relay node).

[0128] In this embodiment, according to the traffic of the node, the CB state of the node is determined, which can be identified according to the direction of the traffic. For example, when the traffic includes receiving external data, the corresponding target CB state can include the CB state of the source node, and when the traffic is used for sending data externally, the corresponding target CB state can include the CB state of the elimination end point.

[0129] After the target CB state is determined, the node can be maintained by the CPU according to the target CB state of the node by using the method for detecting the 802.1CB link in the foregoing embodiments applied to the source node, the replication relay node, the elimination end point node, and the elimination relay node, respectively. Here, details are not described again. By using the method of this embodiment, the node is maintained according to different CB states, which can effectively maintain each CB state and improve the performance of the node.

[0130] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.

[0131] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a plurality of instructions for causing an end device (which can be a mobile phone, a computer, a server, or a network device) to execute the method described in each embodiment of the present application.

[0132] According to another aspect of the embodiments of the present application, an 802.1CB link is also provided, which includes a source node implementing any of the foregoing embodiment methods applied to the source node, a replication relay node implementing any of the foregoing embodiment methods applied to the replication relay node, an elimination end point node implementing any of the foregoing embodiment methods applied to the elimination end point node, and an elimination relay node implementing any of the foregoing embodiment methods applied to the elimination relay node.

[0133] According to another aspect of the embodiments of the present application, an electronic device for implementing the method for detecting the 802.1CB link is further provided. The electronic device can be a server, a terminal, or a combination thereof.

[0134] According to another aspect of the embodiments of the present application, a computer readable storage medium is further provided. The storage medium stores a computer program. The computer program is configured to perform the method steps of any of the above embodiments when running.

[0135] It should be noted that the nodes and the corresponding steps achieve the same examples and application scenarios as the above embodiments, but are not limited to the above embodiments. It should be noted that the nodes as part of the 802.1CB link can run in the hardware environment as shown in Figure 1 The hardware environment can include a network environment. The nodes can be implemented by software or hardware.

[0136] According to another aspect of the embodiments of the present application, an electronic device for implementing the method for detecting the 802.1CB link is further provided. The electronic device can be a server, a terminal, or a combination thereof.

[0137] According to another embodiment of the present application, an electronic device is further provided. As shown in Figure 6 The electronic device can include a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504. The processor 1501, the communication interface 1502, and the memory 1503 can communicate with each other through the communication bus 1504.

[0138] The memory 1503 is configured to store a computer program.

[0139] The processor 1501 is configured to execute the program stored in the memory 1503 to implement the following steps.

[0140] Step S202, copying each original packet and adding a redundancy label in the copied packet to obtain a target packet corresponding to each original packet.

[0141] Step S204, sampling all original packets according to a target sampling rate to obtain original sampling packets.

[0142] Step S206, sampling all target packets according to the target sampling rate to obtain first target sampling packets.

[0143] Step S208, in the case that the difference of the sampling points between the original sampling packets of the adjacent two times of sampling is consistent with the difference of the redundant labels between the first target sampling packets of the adjacent two times of sampling, it is determined that the packet replication of the source node is correct.

[0144] Optionally, in the embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.

[0145] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), for example, at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0146] As an example, the memory 1503 can include, but is not limited to, a unit corresponding to the method implemented by each node in the 802.1CB link. In addition, other module units in the 802.1CB link can also be included, but not limited to, which will not be described in detail in the present example.

[0147] The processor can be a general-purpose processor, which can include, but is not limited to, a CPU (Central Processing Unit), a NP (Network Processor), and the like; and can also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0148] The embodiment of the present application also provides a computer readable storage medium, the storage medium includes a stored program, wherein the program runs to execute the method steps of the method embodiment.

[0149] Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk, and various storage medium capable of storing program codes.

[0150] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0151] The integrated units in the above embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above computer-readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0152] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0153] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Of course, the above device embodiment is only illustrative, for example, the division of the units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.

[0154] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the scheme provided in the embodiments.

[0155] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0156] The above merely describes the preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, some improvements and refinements can be made without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A method of detecting an 802.1CB link, the method comprising: The application is applied to a source node, comprising: copying each original message and adding a redundancy label in the copied message to obtain a target message corresponding to each original message; sampling all original messages according to a target sampling rate to obtain original sampling messages, and sampling all target messages according to the target sampling rate to obtain first target sampling messages; in the case that a sampling point difference between adjacent two times of sampling of the original sampling messages is consistent with a redundancy label difference between adjacent two times of sampling of the first target sampling messages, it is determined that message copying of the source node is correct.

2. The method of claim 1, wherein, The method further comprises: in the case that the sampling point difference between adjacent two times of sampling of the original sampling messages is not consistent with the redundancy label difference between adjacent two times of sampling of the first target sampling messages, it is determined that message copying of the source node is abnormal; in the case that the redundancy label does not exist in at least one of the first target sampling messages, it is determined that message copying of the source node is abnormal.

3. A method of detecting an 802.1CB link, the method comprising: The application is applied to a copy relay node, comprising: copying each message obtained to obtain a first copy message corresponding to each message; sampling all messages according to a target sampling rate to obtain second target sampling messages, and sampling each group of first copy messages according to the target sampling rate to obtain first copy sampling messages, wherein the first copy messages in each group of first copy messages include the first copy message corresponding to each message; in the case that a redundancy label difference between adjacent two times of sampling of the second target sampling messages is consistent with a redundancy label difference between adjacent two times of sampling of the first copy sampling messages, it is determined that message copying of the copy relay node is correct.

4. The method of claim 3, wherein, The method further comprises: in the case that the redundancy label difference between adjacent two times of sampling of the second target sampling messages is not consistent with the redundancy label difference between adjacent two times of sampling of the first copy sampling messages, it is determined that message copying of the copy relay node is abnormal; in the case that the redundancy label does not exist in at least one of the first copy sampling messages, it is determined that message copying of the copy relay node is abnormal.

5. A method of detecting an 802.1CB link, the method comprising: The application is applied to an elimination terminal node, comprising: stripping the redundancy label in each message obtained to obtain a stripped message corresponding to each message; sampling all messages according to a target sampling rate to obtain third target sampling messages, and sampling all stripped messages according to the target sampling rate to obtain stripped sampling messages; in the case that a redundancy label difference between adjacent two times of sampling of the third target sampling messages is consistent with a sampling point difference between adjacent two times of sampling of the stripped sampling messages, it is determined that the elimination terminal node operates correctly; sending the stripped message.

6. The method of claim 5, wherein, The method further comprises: in the case that the redundancy label difference between adjacent two times of sampling of the third target sampling messages is not consistent with the sampling point difference between adjacent two times of sampling of the stripped sampling messages, it is determined that the elimination terminal node operates abnormally.

7. A method of detecting an 802.1CB link, the method comprising: The application is applied to an elimination relay node, comprising: The obtained multiple groups of packets are sampled according to a target sampling rate to obtain fourth target sampling packets corresponding to at least one of the multiple groups of packets; and the merged group of packets is sampled according to the target sampling rate to obtain a merged sampling packet, wherein the merged group of packets is obtained by merging the multiple groups of packets; In a case where a redundancy label difference between the fourth target sampling packets sampled at adjacent two times is consistent with a redundancy label difference between the merged sampling packets sampled at adjacent two times, it is determined that the packet merging of the elimination relay node is correct.

8. The method of claim 7, wherein, The method further includes: In a case where a redundancy label difference between the fourth target sampling packets sampled at adjacent two times is inconsistent with a redundancy label difference between the merged sampling packets sampled at adjacent two times, it is determined that the packet merging of the elimination relay node is abnormal.

9. A method of detecting an 802.1CB link, the method comprising: The application is applied to a node, and includes: According to the traffic of the node, all target CB states included in the node are determined, wherein the target CB states include at least one of a CB state as a source node, a CB state as a replication relay node, a CB state as an elimination end node, and a CB state as an elimination relay node; In a case where the node includes the CB state as the source node, the CB state as the source node is maintained according to the method in any one of claims 1 to 2; In a case where the node includes the CB state as the replication relay node, the CB state as the replication relay node is maintained according to the method in any one of claims 3 to 4; In a case where the node includes the CB state as the elimination end node, the CB state as the elimination end node is maintained according to the method in any one of claims 5 to 6; In a case where the node includes the CB state as the elimination relay node, the CB state as the elimination relay node is maintained according to the method in any one of claims 7 to 8.

10. An 802.1CB link, characterized in that, The application includes: a source node implementing the method in any one of claims 1 to 2, a replication relay node implementing the method in any one of claims 3 to 4, an elimination end node implementing the method in any one of claims 5 to 6, an elimination relay node implementing the method in any one of claims 7 to 8, and a node implementing the method in claim 9.

11. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein, The processor, the communication interface, and the memory complete communication with each other through the communication bus, and the application is characterized in that: The memory is configured to store a computer program; The processor is configured to execute the method in any one of claims 1 to 9 by running the computer program stored in the memory.

12. A computer readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is configured to execute the method in any one of claims 1 to 9 when running on a processor.