Communication method and related device

By updating the outer VLAN tag of packets in the ring network to match the protection VLAN identifier and forwarding packets using the non-faulty outgoing interface, the problem of long link failure recovery time in ring network switching technology is solved, achieving rapid fault recovery and improved network stability.

CN121841901APending Publication Date: 2026-04-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing ring network switching technology is complex to operate during link failure recovery, resulting in long recovery times and affecting network reliability and availability.

Method used

By updating the outer VLAN tag of the packet in the ring network to match the protection VLAN identifier, and forwarding the packet using the non-faulty outgoing interface, fault information transmission and opening of blocking point operations are avoided, thus achieving rapid fault recovery.

Benefits of technology

It improves the efficiency of link failure recovery, reduces network recovery time, and enhances the network's disaster recovery capability and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121841901A_ABST
    Figure CN121841901A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method and a related device. In the method, a first communication device in a ring network receives a first message, an outer layer VALN label of the first message is a first VLAN label, and the first VLAN label comprises a first VLAN identifier. And under the condition that a first output interface used for forwarding the first message fails, the first communication device processes the first message based on a matching result between the first VLAN identifier and the first protection VLAN identifier to obtain a second message. Wherein the first protection VLAN identifier is used for identifying a first protection VLAN added by the first output interface, the outer VLAN label of the second message is a second VLAN label, and the second VLAN label comprises a second VLAN identifier. And the first communication device sends the second message to a second communication device in the ring network through the second output interface. In the application, when the first output interface of the first communication device has a fault, the first communication device updates the outer VLAN label of the message, and continues to forward the message to the second communication device through the second output interface, thereby realizing fault recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication method and related apparatus. Background Technology

[0002] Ring switching technology is a technique used to improve network reliability and availability. When a part of the network fails, ring switching technology can automatically switch to a backup path to maintain packet transmission within the network. For example, the Ethernet Ring Protection Switching (ERPS) protocol will be used below as an example to illustrate ring switching technology.

[0003] In ERPS, a blocking point exists on the ring network. A blocking point is one or more pre-defined nodes (such as network devices or ports on network devices) in the network. When the link is normal, data packets cannot be transmitted through the blocking point. However, when a link, port, or network device in the ring network fails, the blocking point is unblocked, allowing data packets to be transmitted through it, thus enabling rapid network recovery.

[0004] The recovery process of the aforementioned link involves operations such as detecting port failures, transmitting fault information, clearing media access control (MAC) addresses, and opening blocking points. The process is relatively complex, resulting in a long recovery time. Summary of the Invention

[0005] This application provides a communication method and related apparatus for improving the efficiency of link fault recovery.

[0006] Firstly, this application provides a communication method. The method is applied to a first communication device, which may be a network device, or a communication module / processing module within the network device, or a circuit or chip within the network device for performing some or all of the operations of the method described in this application. The network device mentioned in this application may be, for example, a router, a switch, or a packet transport network (PTN) device. In this method, the first communication device in a ring network receives a first message, wherein the outer VLAN tag of the first message is a first VLAN tag, which includes a first VLAN identifier. In this application, the communication devices in the ring network (including the first communication device and the second communication device) forward the message based on the outer VLAN tag of the message (e.g., the first message and the second message).

[0007] In the event of a failure in the first outgoing interface used for forwarding the first packet, the first communication device processes the first packet based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain the second packet. The first protection VLAN identifier identifies the first protection VLAN to which the first outgoing interface is joined, and the outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier.

[0008] As shown above, the outer VLAN tag of the first packet is the first VLAN tag, which includes the first VLAN identifier. The outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier. Therefore, compared to the first packet, the outer VLAN tag and the VLAN identifier within the outer VLAN tag of the second packet have changed.

[0009] Because the first outgoing interface failed, the second message could not be forwarded through the first outgoing interface. Therefore, the first communication device sent the second message to the second communication device in the ring network through the second outgoing interface, based on the outer VLAN tag (i.e., the second VLAN tag) of the second message.

[0010] In this application, when the first outgoing interface of the first communication device fails, the first communication device can update the outer VLAN tag of the message (i.e., the first message), so that the message with the updated outer VLAN tag (i.e., the second message) can continue to be forwarded through the second outgoing interface, thereby realizing fault recovery in the ring network.

[0011] On the other hand, since the first communication device forwards the packet to another non-faulty outgoing interface by updating the outer VLAN tag of the packet, the communication devices in the ring network do not need to perform operations such as transmitting fault information, MAC address and opening blocking points, which improves the efficiency of fault recovery and packet forwarding.

[0012] In this application, a first protection VLAN is added to the first outgoing interface of the first communication device. The first protection VLAN identifier is used to identify the first protection VLAN. When the VLAN identifier in the outer VLAN tag of a packet (e.g., the first packet and the second packet) is the first protection VLAN identifier, the packet is not blocked by the blocking points in the first protection VLAN.

[0013] Based on the first aspect, in an optional implementation, if the first outgoing interface used for forwarding the first packet fails, and if the first VLAN identifier in the first VLAN tag is different from the first protection VLAN identifier, the first communication device encapsulates the first packet with a second VLAN tag to obtain a second packet. Therefore, the outer VLAN tag of the second packet is the second VLAN tag, and the inner VLAN tag of the second packet is the first VLAN tag, wherein the second VLAN identifier in the second VLAN tag is the first protection VLAN identifier. Thus, if the outgoing interface used for forwarding the packet fails, the first communication device can forward the packet through another outgoing interface, achieving rapid fault recovery.

[0014] Based on the first aspect, in one optional implementation, the ring network includes a main ring and a sub-ring. The main ring and the sub-ring are each joined to a protection VLAN. The identifier of the protection VLAN joined to the main ring (hereinafter referred to as the main ring protection VLAN identifier) ​​is different from the identifier of the protection VLAN joined to the sub-ring (hereinafter referred to as the sub-ring protection VLAN identifier).

[0015] When the first communication device belongs to a sub-ring, the identifier of the first protection VLAN added to the first outgoing interface of the first communication device is used to identify the sub-ring protection VLAN. When the first communication device encapsulates a first packet with a second VLAN tag to obtain a second packet, the outer VLAN tag of the second packet is the second VLAN tag, and the second VLAN identifier in the second VLAN tag is the first protection VLAN identifier. Therefore, the second packet is not blocked by the sub-ring's blocking point; or,

[0016] When the first communication device belongs to the main ring, the identifier of the first protection VLAN added to the first outgoing interface of the first communication device is used to identify the main ring protection VLAN. When the first communication device encapsulates the first packet with a second VLAN tag to obtain a second packet, the outer VLAN tag of the second packet is the second VLAN tag, and the second VLAN identifier in this second VLAN tag is the first protection VLAN identifier. Therefore, the second packet is not blocked by the main ring's blocking points.

[0017] Based on the first aspect, in one optional implementation, the ring network includes a main ring and sub-rings. The first communication device belongs to the main ring, and its first outgoing interface also belongs to the main ring. The first communication device receives a first message, which includes an inner service VLAN tag and an outer first VLAN tag. The first VLAN identifier of the first VLAN tag is used to identify the sub-ring protection VLAN. Therefore, the first message is not blocked by the sub-ring's blocking points, but it is blocked by the main ring's blocking points. Since the first outgoing interface of the first communication device also belongs to the main ring, the first protection VLAN added to the first outgoing interface is the main ring protection VLAN. It is evident that the first VLAN identifier in the first message is different from the first protection VLAN identifier. Therefore, in the event of a failure at the first outgoing interface of the first communication device, the first communication device encapsulates the first message with a second VLAN tag to obtain a second message. The second protection VLAN identifier in the second VLAN tag is used to identify the main ring protection VLAN. Therefore, the second message encapsulates three layers of VLAN tags from the outermost to the innermost layer: the main ring protection VLAN tag, the sub-ring protection VLAN tag, and the service VLAN tag. In this method, the outer VLAN tag of the second message is the main ring protection VLAN tag, the inner VLAN tag of the main ring protection VLAN tag is the sub-ring protection VLAN tag, and the inner VLAN tag of the sub-ring protection VLAN tag is the service VLAN tag. Therefore, when both the main ring and the sub-ring fail simultaneously, the message can continue to be forwarded by encapsulating the main ring protection VLAN tag and the sub-ring protection VLAN tag, thereby achieving fault recovery. Thus, the communication method of this application is applicable to scenarios where both the main ring and the sub-ring fail simultaneously, improving the network's disaster recovery capability and stability.

[0018] Based on the first aspect, in one optional implementation, a first communication device receives a first message, wherein the first message includes an inner second VLAN tag and an outer first VLAN tag. In the event of a failure of the first outgoing interface used for forwarding the first message, if the first VLAN identifier is the same as the first protection VLAN identifier of the first outgoing interface, the first communication device removes the first VLAN tag from the first message to obtain a second message, whereby the second VLAN tag becomes the outer VLAN tag of the second message. Thus, after a communication device in the ring network transmits a message to the other end of the failed interface, it can remove the protection VLAN tag from the message so that the message can continue to be forwarded normally.

[0019] Based on the first aspect, in one optional implementation, a first communication device receives a first packet. The first VLAN tag (outer VLAN tag) in the first packet carries first information, indicating that the first packet has passed a congestion point. Therefore, the first communication device removes the first VLAN tag from the first packet. If the first VLAN tag (outer VLAN tag) of the first packet does not carry the first information, but the first communication device still removes the first VLAN tag (outer VLAN tag) to maintain forwarding, the first packet may continue to encapsulate the same first VLAN tag (outer VLAN tag) on ​​other nodes in the ring network and return to the first communication device again, causing the first packet to be repeatedly encapsulated and decapsulated with the same VLAN tag in the ring network. Therefore, for packets whose outer VLAN tags do not carry the first information, the first communication device will not remove the outer VLAN tag of the packet, and the first communication device can discard the packet, avoiding network storms caused by packets in the ring network.

[0020] Based on the first aspect, in one optional implementation, the ring network includes a main ring and sub-rings. The first communication device belongs to the main ring, and its first outgoing interface also belongs to the main ring. The first packet is encapsulated with three layers of VLAN tags from the outermost to the innermost layer: the outermost VLAN tag is the first VLAN tag, the innermost layer of the first VLAN tag contains a second VLAN tag, and the innermost layer of the second VLAN tag contains a service VLAN tag. The first VLAN identifier of the first VLAN tag is used to identify the main ring protection VLAN; therefore, the first packet is not blocked by the main ring's blocking points. The second VLAN identifier of the second VLAN tag is used to identify the sub-ring protection VLAN. After receiving the first packet, if the first outgoing interface used for forwarding the first packet fails, since the first VLAN identifier is the same as the first protection VLAN identifier of the first outgoing interface (belonging to the main ring), the first communication device removes the first VLAN tag from the first packet to obtain the second packet. The second packet then encapsulates two layers of VLAN tags from the outermost to the innermost layer: the outermost VLAN tag of the first packet is the second VLAN tag, and the innermost layer of the second VLAN tag contains a service VLAN tag. Therefore, the communication method of this application can achieve fault recovery when both the main ring and the sub-ring fail simultaneously, thereby improving the network's disaster recovery capability and stability.

[0021] Based on the first aspect, in one optional implementation, the ring network includes a main ring and a sub-ring. The first communication device is the first intersection node of the main ring and the sub-ring, and the first outgoing interface of the first communication device belongs to the sub-ring. The outer VLAN tag of the first packet is a first VLAN tag, and the inner layer of the first VLAN tag also encapsulates a second VLAN tag. The first VLAN identifier of the first VLAN tag is used to identify the sub-ring protection VLAN; therefore, the first packet is not blocked by the main ring's blocking point. The second VLAN identifier of the second VLAN tag is used to identify the service VLAN. After receiving the first packet, if the first outgoing interface used to forward the first packet fails, since the first VLAN identifier is the same as the first protection VLAN identifier of the first outgoing interface (belonging to the sub-ring), the first communication device removes the first VLAN tag from the first packet to obtain the second packet. Then, the outer VLAN tag of the second packet is the service VLAN tag.

[0022] Based on the first aspect, in an optional implementation, the ring network includes a main ring and a sub-ring. A first communication device is a first intersection node between the main ring and the sub-ring, and a first output interface of the first communication device belongs to the sub-ring. A third communication device is a second intersection node between the main ring and the sub-ring. In this application, the link between the two intersection nodes of the main ring and the sub-ring can be added to the sub-ring protection VLAN; in other words, the sub-ring protection VLAN includes the link between the two intersection nodes of the main ring and the sub-ring. In this application, when the first VLAN identifier of the first packet is used to identify the sub-ring protection VLAN, since the sub-ring protection VLAN includes the link between the two intersection nodes of the main ring and the sub-ring, the third communication device can transmit the first packet to the first communication device through the link between the two intersection nodes of the main ring and the sub-ring (i.e., the link between the third communication device and the first communication device). Therefore, packets with the outer VLAN tag of the sub-ring protection VLAN can be transmitted through the two intersection nodes, reducing the packet forwarding hops, improving packet forwarding efficiency, and reducing packet transmission latency.

[0023] Secondly, this application provides a communication method. This method is applied to a first communication device, which may be a network device, or a communication module / processing module within the network device, or a circuit or chip within the network device for performing some or all of the operations of the method described in this application. In this method, a ring network includes the first communication device. Before stripping the outer VLAN tag of a packet, the first communication device requires the outer VLAN tag of the packet to carry first information, which indicates that the packet has passed a congestion point. In other words, the first communication device only strips the outer VLAN tag of packets whose outer VLAN tags carry the first information. In this application, the first communication device receives a first packet whose outer VLAN tag carries the first information, and the first information indicates that the first packet has passed a congestion point. Therefore, the first communication device strips the outer VLAN tag of the first packet based on the first information carried by the outer VLAN tag in the first packet. If a packet whose outer VLAN tag does not carry the first information is still stripped of its outer VLAN tag by the first communication device to maintain forwarding, the packet may continue to be encapsulated with the same outer VLAN tag on other nodes in the ring network and return to the first communication device again, causing the packet to be repeatedly encapsulated and stripped of the same VLAN tag in the ring network. Therefore, for packets whose outer VLAN tag does not carry the first information, the first communication device will not strip the outer VLAN tag of the packet and can discard the packet, avoiding the formation of a network storm in the ring network.

[0024] Based on the second aspect, in an optional implementation, the first message includes an inner second VLAN tag and an outer first VLAN tag. The first VLAN tag includes a first VLAN identifier, and the second VLAN tag includes a second VLAN identifier. If the first outgoing interface used for forwarding the first message fails, and the first VLAN identifier is the same as the first protection VLAN identifier, the first communication device removes the first VLAN tag from the first message to obtain the second message. The first protection VLAN identifier identifies the first protection VLAN joined by the first outgoing interface, and the second VLAN tag is the outer VLAN tag of the second message. Therefore, after the communication device in the ring network transmits the message to the other end of the failed interface, it can remove the protection VLAN tag from the message so that the message can continue to be forwarded normally.

[0025] Based on the second aspect, in an optional implementation, the ring network includes a main ring and sub-rings. The first communication device belongs to the main ring, and its first outgoing interface also belongs to the main ring. The first packet is encapsulated with three layers of VLAN tags from the outermost to the innermost layer: the outermost VLAN tag is the first VLAN tag, the innermost layer of the first VLAN tag contains a second VLAN tag, and the innermost layer of the second VLAN tag contains a service VLAN tag. The first VLAN identifier of the first VLAN tag is used to identify the main ring protection VLAN; therefore, the first packet is not blocked by the main ring's blocking points. The second VLAN identifier of the second VLAN tag is used to identify the sub-ring protection VLAN. After receiving the first packet, if the first outgoing interface used to forward the first packet fails, since the first VLAN identifier in the first packet is the same as the first protection VLAN identifier of the first outgoing interface (belonging to the main ring), the first communication device removes the first VLAN tag from the first packet to obtain the second packet. The second packet then encapsulates two layers of VLAN tags from the outermost to the innermost layer: the outermost VLAN tag is the second VLAN tag, and the innermost layer of the second VLAN tag contains a service VLAN tag. Therefore, the communication method of this application can achieve fault recovery when both the main ring and the sub-ring fail simultaneously, thereby improving the network's disaster recovery capability and stability.

[0026] Based on the second aspect, in one optional implementation, the ring network includes a main ring and sub-rings. In this ring network, when an intersecting node between the main ring and the sub-ring receives a packet with an outer VLAN tag that is a protection VLAN tag, the intersecting node can remove the outer VLAN tag (i.e., the protection VLAN tag) of the packet without needing to determine whether an interface has failed. A first communication device receives a first packet, the outer VLAN tag of which includes a first VLAN identifier, which is used to identify the sub-ring's protection VLAN. When the first communication device is the first intersecting node between the main ring and the sub-ring, the first communication device removes the outer VLAN tag of the first packet to obtain a second packet. This reduces the number of hops the packet forwards, improves packet forwarding efficiency, and reduces packet transmission latency.

[0027] Thirdly, this application provides a communication device, which is a first communication device in a ring network. The communication device includes a transceiver unit and a processing unit. The transceiver unit is used to perform operations related to receiving and / or transmitting as described in any of the foregoing aspects or any optional embodiments of any of the foregoing aspects.

[0028] The processing unit is used to perform operations other than receiving and sending in the method described in any of the foregoing aspects or any optional embodiments of any aspect.

[0029] Specifically:

[0030] The transceiver unit is used to receive the first message, the outer VLAN tag of the first message is the first VLAN tag, and the first VLAN tag includes the first VLAN identifier;

[0031] The processing unit is configured to, in the event of a failure of the first outgoing interface used for forwarding the first packet, process the first packet based on the matching result between the first VLAN identifier and the first protection VLAN identifier configured on the first outgoing interface to obtain a second packet, wherein the first protection VLAN identifier is used to identify the first protection VLAN joined by the first outgoing interface, and the outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier.

[0032] The transceiver unit is also used to send a second message to a second communication device in the ring network through the second output interface.

[0033] Based on the third aspect, in one optional implementation, the processing unit is specifically used for:

[0034] When the first VLAN identifier is different from the first protection VLAN identifier, the processing unit encapsulates the first packet with a second VLAN tag to obtain a second packet. The inner VLAN tag of the second packet is the first VLAN tag, wherein the second VLAN identifier is the same as the first protection VLAN identifier.

[0035] Based on the third aspect, in one optional implementation, the ring network includes a main ring and sub-rings;

[0036] The first communication device belongs to the sub-ring, the first protection VLAN identifier is used to identify the sub-ring protection VLAN, the second packet is not blocked by the sub-ring's blocking points, and the second packet is blocked by the main ring's blocking points; or,

[0037] The first communication device belongs to the main ring, the first protection VLAN identifier is used to identify the main ring protection VLAN, and the second packet is not blocked by the main ring blocking point.

[0038] Based on the third aspect, in an optional implementation, the ring network includes a main ring and a sub-ring, the first communication device belongs to the main ring, the first message includes an inner service VLAN tag and a first VLAN tag, the first VLAN identifier is used to identify the sub-ring protection VLAN, the first message is blocked by the main ring blocking point but not by the sub-ring blocking point, the second protection VLAN identifier is used to identify the main ring protection VLAN, and the second message includes a service VLAN tag, a first VLAN tag and a second VLAN tag.

[0039] Based on the third aspect, in an optional implementation, the first packet is encapsulated with a second VLAN tag inside the first VLAN tag, and the processing unit is specifically used for:

[0040] When the first VLAN identifier is the same as the first protection VLAN identifier, the processing unit is used to remove the first VLAN tag from the first message to obtain the second message.

[0041] Based on the third aspect, in an optional implementation, the first VLAN tag includes first information, which is used to indicate that the first packet has passed the congestion point.

[0042] Based on the third aspect, in an optional implementation, the ring network includes a main ring and a sub-ring, the first communication device is a node on the main ring, the first message is further encapsulated with a service VLAN tag inside the second VLAN tag, the second VLAN tag includes a second VLAN identifier, the first VLAN identifier is used to identify the main ring protection VLAN, the second VLAN identifier is used to identify the sub-ring protection VLAN, and the first message is not blocked by the main ring blocking point.

[0043] Based on the third aspect, in one optional implementation, the ring network includes a main ring and a sub-ring, a first communication device is the first intersection node of the main ring and the sub-ring, a first VLAN identifier is used to identify the sub-ring protection VLAN, and a second VLAN tag is used to identify the service VLAN.

[0044] Based on the third aspect, in one optional implementation, the transceiver unit is specifically used for:

[0045] The first message is received from the third communication device, which is the second intersecting node of the main ring and the sub-ring.

[0046] Or receive the first message from the second communication device in the main ring.

[0047] Fourthly, this application provides a communication device, which is a first communication device in a ring network, and the communication device includes a transceiver unit and a processing unit.

[0048] The transceiver unit is used to receive a first message. The outer VLAN tag of the first message includes first information, which is used to indicate that the first message has passed through a blocking point.

[0049] The processing unit is used to remove the outer VLAN tag from the first packet to obtain the second packet;

[0050] The transceiver unit is also used to send a second message to a second communication device in the ring network.

[0051] Based on the fourth aspect, in an optional implementation, the outer VLAN tag of the first message is a first VLAN tag, and the first message is encapsulated with a second VLAN tag inside the first VLAN tag. The first VLAN tag includes a first VLAN identifier, and the second VLAN tag includes a second VLAN identifier.

[0052] The processing unit is specifically used for:

[0053] If the first outgoing interface used to forward the first packet fails, and the first VLAN identifier is the same as the first protection VLAN identifier configured on the first outgoing interface, the first VLAN tag in the first packet is removed to obtain the second packet, wherein the outer VLAN tag of the second packet is the second VLAN tag.

[0054] Based on the fourth aspect, in an optional implementation, the ring network includes a main ring and a sub-ring, the first communication device is a node on the main ring, the first message is further encapsulated with a service VLAN tag inside the second VLAN tag, the second VLAN tag includes a second VLAN identifier, the first VLAN identifier is used to identify the main ring protection VLAN, the second VLAN identifier is used to identify the sub-ring protection VLAN, and the first message is not blocked by the main ring blocking point.

[0055] Based on the fourth aspect, in one optional implementation, the ring network includes a main ring and sub-rings;

[0056] The processing unit is specifically used for:

[0057] In the case of the first communication device being the first intersection node of the main ring and the sub-ring, the outer VLAN tag of the first message is removed to obtain the second message. The outer VLAN tag is the first VLAN tag, which includes the first VLAN identifier. The first VLAN identifier is used to identify the main ring or the sub-ring protection VLAN.

[0058] The fifth aspect of this application provides a communication system that includes the first communication device, the second communication device, and / or the third communication device described above.

[0059] A sixth aspect of this application provides a computer-readable storage medium for storing one or more computer-executable instructions, which, when executed by a processor, perform the method as described in any possible implementation of any of the first to second aspects described above.

[0060] The seventh aspect of this application provides a computer program product (or computer program) that, when executed by a processor, performs the method described in any possible implementation of any of the first to second aspects described above.

[0061] The eighth aspect of this application provides a chip system including at least one processing circuit for supporting a communication device to implement the method described in any possible implementation of any of the first to second aspects described above.

[0062] In one possible design, the chip system may further include a memory for storing program instructions and data necessary for the communication device. The chip system may be composed of chips or may include chips and other discrete devices. Optionally, the chip system may also include interface circuitry that provides program instructions and / or data to the at least one processing circuit.

[0063] The technical effects of any of the design methods in aspects three through eight can be found in the technical effects of the different design methods in aspect one above, and will not be repeated here. Attached Figure Description

[0064] Figure 1 This is a schematic diagram illustrating one implementation of ring network switching technology.

[0065] Figure 2 This is a schematic diagram illustrating another implementation of ring network switching technology;

[0066] Figure 3 This is a schematic diagram illustrating another implementation of ring network switching technology;

[0067] Figure 4 This is a schematic diagram of one possible, non-limiting system used in the communication method and related apparatus of this application;

[0068] Figure 5 This is a schematic diagram illustrating one possible implementation of the communication method in this application;

[0069] Figures 6-10 This is an example diagram illustrating an application scenario of the communication method in this application;

[0070] Figure 11 A schematic diagram of the communication device provided in this application;

[0071] Figure 12 A schematic diagram of the communication device provided in this application. Detailed Implementation

[0072] The present application will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the application. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in this application are equally applicable to similar technical problems.

[0073] First, some of the nouns or terms used in this application will be explained, and these nouns or terms are also part of the content of the invention.

[0074] (1) The terms “system” and “network” in this application are used interchangeably. “Multiple” refers to two or more. “And / or” describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone, where A and B can be singular or plural. The character “ / ” generally indicates that the related objects before and after are in an “or” relationship. “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, “at least one of A, B and C” includes A, B, C, AB, AC, BC or ABC. Unless otherwise specified, the ordinal numbers such as “first” and “second” mentioned in this application are used to distinguish multiple objects and are not used to limit the order, sequence, priority or importance of multiple objects. Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0075] (2) Ethernet Ring Protection Switching (ERPS) is a standard protocol used to enhance the reliability of Ethernet in ring topologies. ERPS ensures that the network can quickly restore communication when a link failure occurs by rapidly detecting and switching faulty links. Specifically, ERPS is typically deployed in a ring network consisting of a group of interconnected network devices configured with the same control virtual local area network (VLAN). These network devices are connected in a ring via Ethernet links to improve network reliability. To prevent problems such as broadcast storms and unstable media access control (MAC) address tables, ERPS eliminates loops by blocking specific ports (also known as blocking points) in the ring network. These blocking points are normally blocked to prevent loop formation. When a link in the ring network fails, ERPS can quickly detect the fault and restore communication by detecting port failures, transmitting fault information, clearing media access control (MAC) addresses, and opening blocking points, and then forwarding packets to an alternative path.

[0076] Next, we will introduce the possible, non-limiting scenarios involved in this application.

[0077] Ring switching technology is a technique used to improve network reliability and availability. When a part of the network fails, ring switching technology can automatically switch to a backup path to maintain packet transmission within the network. For example, the Ethernet Ring Protection Switching (ERPS) protocol will be used below as an example to illustrate ring switching technology.

[0078] Ethernet Ring Protection Switching (ERPS) is a standard protocol for enhancing the reliability of Ethernet in ring topologies. ERPS ensures rapid network recovery in the event of a link failure by quickly detecting and switching faulty links. Specifically, ERPS is typically deployed in a ring network consisting of a group of interconnected network elements (NEs) configured with the same control virtual local area network (VLAN). These network elements are connected in a ring via Ethernet links to improve network reliability.

[0079] For example, please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating one implementation of ring network switching technology. For example... Figure 1 As shown, in ERPS, there are blockage points on the ring network (e.g. Figure 1 (The ports connecting NE1 and NE4 are shown). A blocking point is one or more pre-defined nodes (such as network devices or ports on network devices) in a network. Under normal link conditions, these blocking points are blocked, preventing data packets from being transmitted through them to prevent loops. When a link in the loop fails (e.g., a failure in the link between NE1 and NE2), the blocking point is unblocked, opening the link between NE1 and NE4, allowing data packets to be transmitted through the blocking point, thus enabling rapid network recovery.

[0080] For example, please refer to Figure 2 , Figure 2 This is a schematic diagram illustrating another implementation of ring network switching technology. (Example:) Figure 2 As shown, the communication system has a main ring and sub-ring topology. Both the main ring and sub-ring are configured with blocking points. When an uplink failure occurs in the sub-ring, the intersecting nodes of the main ring and sub-ring (such as...) Figure 2Network devices A and D in the main ring will send topology change (TC) messages to the network devices on the main ring so that the network devices on the main ring can clear the media access control (MAC) address, allowing data packets to be transmitted through the blockage point, thereby achieving rapid network recovery.

[0081] The recovery process of the aforementioned link involves operations such as detecting port failures, transmitting fault information, clearing media access control (MAC) addresses, and opening blocking points. The process is relatively complex, resulting in a long recovery time.

[0082] For example, please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating another implementation of ring network switching technology. (Example:) Figure 3 As shown, the Resilient Packet Ring (RPR) introduces a wrapping technique. When a network device fails, packets will be routed through a non-faulty ring (such as...). Figure 3 In this process, if ring 0 fails, then ring 1 is a non-faulty ring. The message is transmitted to the other end of the faulty port, and then the message is forwarded normally back to the faulty ring. The fault switching time is consistent with the fault detection and ring switching time, thus eliminating the need for protocol interaction between nodes in RPR (such as transmitting fault information or clearing MAC addresses), which improves the speed of fault switching.

[0083] To address the aforementioned problems, this application provides a communication method and related apparatus for improving the efficiency of link fault recovery. The communication method and related apparatus provided in this application can be applied to various communication systems, which may include multiple communication devices.

[0084] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram of one possible, non-limiting system used in the communication method and related apparatus of this application. Figure 4 As shown, the communication system includes various network devices on the ring network. Figure 4 (S1 to S8 in the network equipment). Optionally, the communication system also includes devices connected to network equipment S1 (such as...). Figure 4 H1 in the network and the devices connected to network device S5 (such as H1 in the network) and S5 in the network (such as S1 in the network) Figure 4 (H2 in the example). The ring network is configured with service VLANs and protection VLANs, and the interface between network device S3 and network device S4 is used as the blocking point.

[0085] For example, the communication method and related apparatus in this application can also be applied to, for example, Figure 2The communication system shown has a main ring and sub-ring topology. The ring network is configured with service VLANs and protection VLANs (including main ring protection VLANs and sub-ring protection VLANs), and both the main ring and sub-rings are configured with blocking points.

[0086] The communication method and related apparatus of this application will be further described below with reference to the accompanying drawings.

[0087] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating one possible implementation of the communication method in this application. It should be understood that... Figure 5 This application illustrates the method using communication devices (such as a first communication device, a second communication device, and a third communication device) as the execution subject in this interactive illustration, but it does not limit the execution subject of this interactive illustration. For example, the communication device in this application can be a network device, or it can be a circuit or chip in a network device used to perform some or all of the operations of the method described in this application. In this application, when referring to a communication device, it can refer to the communication device itself, or it can refer to the chip, communication module, integrated circuit, processor, logic module, or software in the communication device used to implement the communication method provided in this application, etc., and this application does not make any specific limitations. The network device described in this application can be, for example, a switch, a router, or a PTN device.

[0088] like Figure 5 As shown, the communication method of this application includes, but is not limited to, steps 101 to 103.

[0089] 101. The first communication device in the ring network receives the first message.

[0090] The communication method described in this application is applicable to various communication devices (also referred to as nodes in the ring network) within a ring network. In the ring network, each node is connected to two adjacent nodes via point-to-point connections, forming a closed ring structure. Packets are transmitted from one node to the next in the ring network until they reach their destination. A blocking point is configured in the ring network to block packets whose outer VLAN tag is a service VLAN tag; in other words, the blocking point is used to block packets whose outer VLAN identifier is a service VLAN identifier. The first communication device and the second communication device in this application are different communication devices within the ring network.

[0091] A first communication device receives a first message, wherein the outer VLAN tag of the first message is a first VLAN tag, and the first VLAN tag includes a first VLAN identifier. In this application, communication devices in a ring network (including a first communication device and a second communication device) forward the message based on the outer VLAN tag of the message (e.g., the first message and the second message).

[0092] For example, a VLAN tag may include one or more of the following:

[0093] The type identification (TPID) is used to identify that the frame contains VLAN information;

[0094] Priority is used to distinguish messages of different priorities;

[0095] Canonical format indicator (CFI): Used to represent the format of a MAC address;

[0096] VLAN identifier (VLAN ID): Used to identify a VLAN. For example, the value of VLAN ID ranges from 1 to 4094.

[0097] Optionally, the first VLAN identifier in the first VLAN tag, in the example above, is the VLAN ID in the first VLAN tag.

[0098] Optionally, the first message can be sent from the second communication device in the ring network to the first communication device, i.e., the first communication device is the next hop of the second communication device in the ring network; or, the first message can be sent from the device connected to the first communication device (e.g., a router, switch or terminal device) to the first communication device.

[0099] Optionally, the bottleneck in the ring network can be the owner port in the ring protection link (RPL) protocol.

[0100] 102. The first communication device processes the first message to obtain the second message.

[0101] In the event of a failure in the first outgoing interface used for forwarding the first packet, the first communication device processes the first packet based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain the second packet. The first protection VLAN identifier identifies the first protection VLAN to which the first outgoing interface is joined, and the outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier.

[0102] In this application, the first output interface is the physical output interface in the first communication device used for forwarding the first message. Optionally, the aforementioned "failure of the first output interface used for forwarding the first message" can be understood as the first communication device being unable to forward the first message through the first output interface. Specifically, the "failure of the first output interface used for forwarding the first message" includes, but is not limited to, one or more of the following situations:

[0103] The first output interface failed;

[0104] The peer interface of the first outgoing interface has failed. Because the peer interface of the first outgoing interface has failed, even if the first outgoing interface itself has not failed, the first communication device still cannot forward the first message to the peer interface through the first outgoing interface.

[0105] A link failure occurs between the first outgoing interface and its peer interface. This could be caused by factors such as fiber optic cable breakage, signal attenuation, or electromagnetic interference.

[0106] It should be understood that the above situation is merely an exemplary description of "the situation where the first outgoing interface used to forward the first message fails". This application still applies to other implementation methods, and no specific limitations are made here.

[0107] A first protection VLAN is configured in the ring network, and a first protection VLAN identifier is used to identify this first protection VLAN. Specifically, the first outgoing interface of the first communication device is added to the first protection VLAN. When the VLAN identifier in the outer VLAN tag of a packet (e.g., the first packet and the second packet) is the first protection VLAN identifier, the packet will not be blocked by any blocking points within the first protection VLAN.

[0108] As shown above, the outer VLAN tag of the first packet is the first VLAN tag, which includes the first VLAN identifier. The outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier. Therefore, compared to the first packet, the outer VLAN tag and the VLAN identifier within the outer VLAN tag of the second packet have changed.

[0109] 103. The first communication device sends a second message to the second communication device in the ring network through the second output interface.

[0110] Because the first outgoing interface failed, the second message could not be forwarded through the first outgoing interface. Therefore, the first communication device sent the second message to the second communication device in the ring network through the second outgoing interface, based on the outer VLAN tag (i.e., the second VLAN tag) of the second message.

[0111] In this application, when the first outgoing interface of the first communication device fails, the first communication device can update the outer VLAN tag of the message (i.e., the first message), so that the message with the updated outer VLAN tag (i.e., the second message) can continue to be forwarded through the second outgoing interface, thereby realizing fault recovery in the ring network.

[0112] On the other hand, since the first communication device forwards the packet to another non-faulty outgoing interface by updating the outer VLAN tag of the packet, the communication devices in the ring network do not need to perform operations such as transmitting fault information, MAC address and opening blocking points, which improves the efficiency of fault recovery and packet forwarding.

[0113] Optionally, the second output interface in this application is the same physical interface as the input interface in the first communication device used to receive the first message. Therefore, when the first communication device sends the second message to the second communication device in the ring network through the second output interface, it is equivalent to the first communication device forwarding the second message in the reverse direction of the first message.

[0114] In this application, the step 102, "in the event of a failure of the first outgoing interface used for forwarding the first message, the first communication device processes the first message based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain the second message," can be implemented in various ways. These will be described below.

[0115] Implementation Method 1: As mentioned above, the outer VLAN tag of the first packet is the first VLAN tag, which includes the first VLAN identifier. If the first outgoing interface used for forwarding the first packet fails, and the first VLAN identifier in the first VLAN tag differs from the first protection VLAN identifier, the first communication device encapsulates the first packet with a second VLAN tag to obtain the second packet. Therefore, the outer VLAN tag of the second packet is the second VLAN tag, while the inner VLAN tag of the second packet is the first VLAN tag, where the second VLAN identifier in the second VLAN tag is the first protection VLAN identifier.

[0116] Implementation Method Two: The first packet encapsulates a second VLAN tag within the first VLAN tag. In other words, the outer VLAN tag of the first packet is the first VLAN tag, while the second VLAN tag is encapsulated within the first VLAN tag. If the first outgoing interface used to forward the first packet fails, and if the first VLAN identifier in the first VLAN tag is the same as the first protection VLAN identifier, the first communication device removes the first VLAN tag from the first packet to obtain the second packet. Therefore, the outer VLAN tag of the second packet is the second VLAN tag.

[0117] In one possible implementation, in Implementation Method Two, before removing the outer VLAN tag of a packet, the first communication device needs the outer VLAN tag of the packet to carry first information. This first information indicates that the packet has passed a congestion point. In other words, the first communication device only removes the outer VLAN tag from packets whose outer VLAN tags carry the first information. In this application, the first communication device receives a first packet containing a first VLAN tag (outer VLAN tag) carrying first information. This first information indicates that the first packet has passed a congestion point. Therefore, the first communication device removes the first VLAN tag from the first packet based on the first information in the first VLAN tag. If the first VLAN tag (outer VLAN tag) of the first packet does not carry the first information, but the first communication device still removes the first VLAN tag (outer VLAN tag) to maintain forwarding, the first packet may continue to encapsulate the same first VLAN tag (outer VLAN tag) on ​​other nodes in the ring network and return to the first communication device again, causing packets to be repeatedly encapsulated and decapsulated with the same VLAN tag in the ring network. Therefore, for packets whose outer VLAN tag does not carry the first information, the first communication device will not remove the outer VLAN tag of the packet, and the first communication device can discard the packet, thus avoiding the formation of a network storm in the ring network.

[0118] Combining the above implementation methods one and two, it can be seen that after the first communication device receives the first message, and in the event of a failure in the first outgoing interface used to forward the first message, it determines whether the VLAN identifier in the outer VLAN tag of the first message is the same as the first protection VLAN identifier. If they are different, a second VLAN tag is encapsulated, and the second VLAN identifier in the second VLAN tag is the same as the first protection VLAN identifier; if they are the same, the outer VLAN tag (i.e., the first VLAN tag) of the first message is removed.

[0119] The above implementation methods one and two are applicable to ring networks with a single-ring structure, or to ring networks with a master-slave ring structure (i.e., the ring network includes a master ring and a slave ring). Next, using specific implementation examples, we will introduce the process of encapsulating and removing VLAN tags from packets within a ring network.

[0120] Implementation Example 1: The ring network is a single-ring structure. For example, in Figure 6 The example single-ring structure includes multiple communication devices (such as...) Figure 6As shown in S1 to S8, communication device S1 is connected to communication device H1, and communication device S5 is connected to communication device H2. Therefore, messages can enter or exit the ring network through communication devices H1 and H2. The ring network is configured with service VLANs and protection VLANs, and the interface between network devices S3 and S4 serves as the blocking point.

[0121] In this application, when the VLAN identifier in the outer VLAN tag of the packet is a service VLAN identifier, the packet is blocked by the blocking point and cannot be transmitted through the blocking point; when the VLAN identifier in the outer VLAN tag of the packet is a protection VLAN identifier, the packet is not blocked by the blocking point and can be transmitted through the blocking point.

[0122] For example, please refer to Figure 6 , Figure 6 This is a possible forwarding diagram of a message in this application. For example... Figure 6 As shown, the message enters the ring network from communication device H1 and is transmitted to communication device S7 via the service VLAN. The outer VLAN tag of this message is the service VLAN tag. Figure 6 As shown, the first outgoing interface of communication device S7, used for forwarding the packet, fails, and the VLAN identifier in the outer VLAN tag of the packet is the VLAN identifier corresponding to the service VLAN. Therefore, the VLAN identifier in the outer VLAN tag of the packet is different from the protection VLAN identifier of the first outgoing interface. Communication device S7 then executes implementation method one in step 102: communication device S7 encapsulates the protection VLAN tag corresponding to the protection VLAN as the outer VLAN tag of the packet, and sends the packet encapsulated with the protection VLAN tag to communication device S8 through the second outgoing interface. In the process of the communication device encapsulating the packet with a VLAN tag, communication device S7 is equivalent to the first communication device in this application, or in other words, communication device S7 implements the function of the first communication device in this application. Communication device S8 is equivalent to the second communication device in this application. The packet with the outer VLAN tag being the service VLAN tag is the first packet in this application, and the first VLAN identifier in the first packet is used to identify the service VLAN of the ring network. The message encapsulating the protection VLAN tag corresponding to the protection VLAN is the second message in this application. The second VLAN identifier in the second message is used to identify the protection VLAN of the ring network. The second message is not blocked by the blocking point.

[0123] Next, the message encapsulated with the protection VLAN tag is transmitted to communication device S6 via the protection VLAN. This message is not blocked by any congestion points. The transmission path is S7>S8>S7>S2>S3>S4>S5>S6. Since the message passes through a congestion point in the ring network, the outer VLAN tag of the message carries first information indicating that the message has passed through the congestion point. After the message arrives at communication device S6, the first outgoing interface of communication device S8 used to forward the message fails, and the VLAN identifier in the outer VLAN tag of the message is the VLAN identifier corresponding to the protection VLAN. Because the VLAN identifier in the outer VLAN tag of the message is the same as the protection VLAN identifier of the first outgoing interface, and the message has passed through a congestion point in the ring network, communication device S6 executes the second implementation method in step 102: communication device S6 removes the current outer VLAN tag (i.e., the protection VLAN tag) of the message. At this time, the outer VLAN tag of the message is the service VLAN tag. Next, communication device S6 sends a message encapsulated with a service VLAN tag to communication device S5 through the second outgoing interface. This message is then forwarded through the service VLAN and reaches communication device H2. The transmission path of this message is S6>S5>H2. In the process of removing the VLAN tag from the message, communication device S6 is equivalent to the first communication device in this application, or in other words, communication device S6 implements the function of the first communication device in this application. Communication device S5 is equivalent to the second communication device in this application. The message with the outer VLAN tag corresponding to the protection VLAN is the first message in this application, and the first VLAN identifier in the first message is used to identify the protection VLAN of the ring network. The message after removing the protection VLAN tag (equivalent to the message with the outer VLAN tag being the service VLAN tag) is the second message in this application, and the second VLAN identifier in the second message is used to identify the service VLAN of the ring network.

[0124] Example 2: The ring network consists of a main ring and sub-rings. Each ring has a protection VLAN. The identifier of the protection VLAN added to the main ring (hereinafter referred to as the main ring protection VLAN identifier) ​​is different from the identifier of the protection VLAN added to the sub-ring (hereinafter referred to as the sub-ring protection VLAN identifier). In Example 2, the sub-ring protection VLAN identifier is the same as the identifier of the service VLAN on the main ring. For example, if the identifier of the service VLAN on the main ring is 1 to 100, then the sub-ring protection VLAN identifier can be any one of 1 to 100. Therefore, when the outer VLAN tag of a packet carries the sub-ring protection VLAN identifier, the packet is not blocked by the sub-ring's blocking point. However, because the sub-ring protection VLAN identifier of the packet is the same as the identifier of the service VLAN on the main ring, the packet is blocked by the main ring's blocking point. When the outer VLAN tag of a packet carries the main ring protection VLAN identifier, the packet is not blocked by the main ring's blocking point.

[0125] In the event of a main ring failure, the process of encapsulating or removing VLAN tags from packets within the ring network is similar to that described in Implementation Example 1. Please refer to the description of Implementation Example 1 for details; it will not be repeated here. Below, we will describe the scenario of a sub-ring failure in Implementation Example 2.

[0126] For example, please refer to Figure 7 , Figure 7 This is an illustration of another possible forwarding of the message in this application. For example... Figure 7 As shown, the message enters the sub-ring from communication device S9 and is transmitted to communication device S7 via the service VLAN. The outer VLAN tag of this message is the service VLAN tag. Figure 7As shown, interface 1 of communication device S7 malfunctions, and the VLAN identifier in the outer VLAN tag of the packet is the VLAN identifier corresponding to the service VLAN. Therefore, the VLAN identifier in the outer VLAN tag of the packet is different from the protection VLAN identifier (i.e., the sub-ring protection VLAN identifier) ​​of interface 1 of communication device S7. Then, communication device S7 executes implementation method one in step 102: communication device S7 encapsulates the protection VLAN tag corresponding to the sub-ring protection VLAN (hereinafter referred to as the sub-ring protection VLAN tag) as the outer VLAN tag of the packet, and sends the packet encapsulated with the sub-ring protection VLAN tag to communication device S9 through interface 2 of communication device S7. In the process of communication device S7 encapsulating the packet with a VLAN tag, communication device S7 is equivalent to the first communication device in this application, or in other words, communication device S7 implements the function of the first communication device in this application. Interface 1 of communication device S7 is equivalent to the first outgoing interface, and interface 2 of communication device S7 is equivalent to the second outgoing interface. Communication device S9 is equivalent to the second communication device in this application. A message with an outer VLAN tag of service VLAN is the first message in this application, and the first VLAN identifier in the first message is used to identify the service VLAN. A message encapsulating a sub-ring protection VLAN tag is the second message in this application, and the second VLAN identifier in the second message is used to identify the sub-ring protection VLAN. The second message is not blocked by the sub-ring's blocking points.

[0127] Next, the message encapsulated with the sub-ring protection VLAN tag is transmitted through various communication devices in the sub-ring and main ring to communication device S5. During its journey to communication device S5, the message will pass through a blockage point in the sub-ring (e.g., ...). Figure 7If the packet is forwarded via interface 2 of communication device S8, the outer VLAN tag of the packet carries first information, which indicates that the packet has passed a blocking point. In this application, since the communication devices in the ring network do not need to configure MAC entries for the protection VLAN, the packet is forwarded in the form of a broadcast. After the packet is transmitted to communication device S6, there are two outgoing interfaces on communication device S6 that can be used to forward the packet (interface 2 and interface 3 of communication device S6). Therefore, the packet will be forwarded through interface 2 and interface 3 respectively. However, in implementation example two, the packet is encapsulated with a sub-ring protection VLAN tag. The packet is not blocked by the sub-ring blocking point, but it is blocked by the main ring blocking point. Therefore, when the packet is forwarded from interface 3 of communication device S6, it will be blocked by the blocking point on communication device S5, causing the packet to be dropped. Therefore, the message can only be forwarded through interface 2 of communication device S6. Thus, the transmission path of the message encapsulated with the protection VLAN tag from communication device S7 to communication device S5 is S7>S9>S8>S6>S4>S3>S5. After the message arrives at communication device S5, interface 1 of communication device S5 fails. Furthermore, the VLAN identifier in the outer VLAN tag of the message is the sub-ring protection VLAN identifier. Since interface 1 of communication device S5 belongs to a sub-ring, the VLAN identifier in the outer VLAN tag of the message is the same as the protection VLAN identifier of interface 1 of communication device S5. Moreover, the outer VLAN tag of the message carries the first information. Therefore, communication device S5 executes the second implementation method in step 102: communication device S5 removes the current outer VLAN tag (i.e., the sub-ring protection VLAN tag) of the message. At this time, the outer VLAN tag of the message is the service VLAN tag. Next, communication device S5 sends a message encapsulated with the service VLAN tag to communication device S3 through interface 2. This message continues to be forwarded through the service VLAN and arrives at communication device S1. The transmission path of this message is S5>S6>S3>S1. In the process of removing the VLAN tag from the message by the communication device, communication device S5 is equivalent to the first communication device in this application, or in other words, communication device S5 implements the function of the first communication device in this application. Interface 1 of communication device S5 is equivalent to the first outgoing interface, interface 2 of communication device S5 is equivalent to the second outgoing interface, and communication device S3 is equivalent to the second communication device in this application. The message with the outer VLAN tag being the sub-ring protection VLAN tag is the first message in this application, and the first VLAN identifier in the first message is used to identify the sub-ring protection VLAN. The message after removing the sub-ring protection VLAN tag (equivalent to the message with the outer VLAN tag being the service VLAN tag) is the second message in this application, and the second VLAN identifier in the second message is used to identify the service VLAN.

[0128] The second implementation example described above can also be applied to scenarios where both the main ring and the sub-ring fail simultaneously. This will be explained below with reference to the accompanying diagram.

[0129] Please see Figure 8 , Figure 8 This is an illustration of another possible forwarding of the message in this application. For example... Figure 8 As shown, the message enters the sub-ring from communication device S9 and is transmitted to communication device S7 via the service VLAN. The outer VLAN tag of this message is the service VLAN tag. Figure 8 As shown, interface 1 (located in the sub-ring) of communication device S7 malfunctions, and the VLAN identifier in the outer VLAN tag of the packet is the VLAN identifier corresponding to the service VLAN. Therefore, the VLAN identifier in the outer VLAN tag of the packet is different from the protection VLAN identifier (i.e., the sub-ring protection VLAN identifier) ​​of interface 1 of communication device S7. Then, communication device S7 executes the first implementation method in step 102: communication device S7 encapsulates the protection VLAN tag corresponding to the sub-ring protection VLAN (hereinafter referred to as the sub-ring protection VLAN tag) as the outer VLAN tag of the packet, and sends the packet encapsulated with the sub-ring protection VLAN tag to communication device S9 through interface 2 of communication device S7. In the process of communication device S7 encapsulating the sub-ring VLAN tag in the packet, communication device S7 is equivalent to the first communication device in this application, or in other words, communication device S7 implements the function of the first communication device in this application. Interface 1 of communication device S7 is equivalent to the first outgoing interface, and interface 2 of communication device S7 is equivalent to the second outgoing interface. Communication device S9 is equivalent to the second communication device in this application. A message with an outer VLAN tag that is a service VLAN tag is the first message in this application, and the first VLAN identifier in the first message is used to identify the service VLAN. A message encapsulating the protection VLAN tag corresponding to the sub-ring protection VLAN is the second message in this application, and the second VLAN identifier in the second message is used to identify the sub-ring protection VLAN. The second message is not blocked by the sub-ring's blocking points.

[0130] Next, the message with the outer VLAN tag being the sub-ring protection VLAN tag and the inner VLAN tag being the service VLAN tag is transmitted to communication device S6. During its journey to communication device S6, the message will pass through a sub-ring bottleneck (e.g., Figure 8If the packet is forwarded via interface 2 of communication device S8, the outer VLAN tag of the packet carries the first information, which indicates that the packet has passed the blocking point. The path of the packet to communication device S6 is S7>S9>S8>S6. In this application, since each communication device in the ring network does not need to configure the MAC entry of the protection VLAN, when the packet is forwarded in the form of broadcast, after the packet is transmitted to communication device S6, there are two outgoing interfaces on communication device S6 that can be used to forward the packet (interface 2 and interface 3 of communication device S6). Therefore, the packet will be forwarded through interface 2 and interface 3 respectively. However, in implementation example two, the packet is encapsulated with a sub-ring protection VLAN tag. The packet is not blocked by the sub-ring blocking point, but is blocked by the main ring blocking point. Therefore, when the packet is forwarded from interface 3 of communication device S6, it will be blocked by the blocking point on communication device S5, causing the packet to be dropped. Then, the packet can only be forwarded through interface 2 of communication device S6. However, if Figure 8As shown, if interface 2 (located in the main ring) of communication device 6 also fails, the protection VLAN identifier of interface 2 of communication device 6 will be the main ring protection VLAN identifier. Since the identifier in the outer VLAN tag of this packet is the sub-ring protection VLAN identifier, communication device S6 executes the first implementation method in step 102: communication device S6 encapsulates the protection VLAN tag corresponding to the main ring protection VLAN (hereinafter referred to as the main ring protection VLAN tag) as the outer VLAN tag of this packet, and sends the packet encapsulated with the main ring protection VLAN tag to communication device S5 through interface 3 of communication device S6. It should be understood that at this time, the packet is encapsulated with three layers of VLAN tags from the outer layer to the inner layer: the main ring protection VLAN tag, the sub-ring protection VLAN tag, and the service VLAN tag. Among them, the outer VLAN tag of the packet is the main ring protection VLAN tag, the inner VLAN tag of the main ring protection VLAN tag is the sub-ring protection VLAN tag, and the inner VLAN tag of the sub-ring protection VLAN tag is the service VLAN tag. In the process of encapsulating VLAN tags on the main ring of a message by communication device S6, communication device S6 is equivalent to the first communication device in this application, or in other words, communication device S6 implements the function of the first communication device in this application. Interface 2 of communication device S6 is equivalent to the first outgoing interface, interface 3 of communication device S6 is equivalent to the second outgoing interface, and communication device S5 is equivalent to the second communication device in this application. The message with an outer VLAN tag of sub-ring protection VLAN tag and an inner VLAN tag of service VLAN tag is the first message in this application. The first VLAN identifier in the first message is used to identify the sub-ring protection VLAN. The message encapsulated with the main ring protection VLAN tag (the message with three layers of VLAN tags) is the second message in this application. The second VLAN identifier in the second message is used to identify the main ring protection VLAN. The second message is not blocked by the main ring blocking point.

[0131] Next, the outer VLA tag transmits the main ring protection VLAN tag message (the Layer 3 VLAN tag message) to communication device S4. During its journey to communication device S4, the message will pass through a bottleneck point in the sub-ring (e.g., Figure 8If the packet passes through interface 3 of communication device S5, the outer VLAN tag of the packet carries the first information, which indicates that the packet has passed the congestion point. The path of the packet to communication device S4 is S6>S5>S3>S4. After the packet arrives at communication device S4, interface 1 of communication device S4 fails. The VLAN identifier in the outer VLAN tag of the packet is the VLAN identifier corresponding to the main ring protection VLAN. Since interface 1 of communication device S4 belongs to the main ring, the VLAN identifier in the outer VLAN tag of the packet is the same as the protection VLAN identifier of interface 1 of communication device S4. Furthermore, the outer VLAN tag of the packet carries the first information. Therefore, communication device S4 executes the second implementation method in step 102: communication device S4 removes the current outer VLAN tag (i.e., the main ring protection VLAN tag) of the packet. At this time, the outer VLAN tag of the packet is the sub-ring protection VLAN tag, and the packet is blocked by the congestion point of the main ring. Next, communication device S4 sends the packet to communication device S3 through interface 2. The message arrives at communication device S5 along the path S4>S3>S5. During the process of removing the VLAN tag from the message by the communication device, communication device S4 is equivalent to the first communication device in this application, or in other words, communication device S4 performs the functions of the first communication device in this application. Interface 1 of communication device S4 is equivalent to the first outgoing interface, interface 2 of communication device S4 is equivalent to the second outgoing interface, and communication device S3 is equivalent to the second communication device in this application. The message with the outer VLAN tag being the main ring protection VLAN tag is the first message in this application, and the first VLAN identifier in the first message is used to identify the main ring protection VLAN. The message after removing the main ring protection VLAN tag (equivalent to a message with the outer VLAN tag being the sub-ring protection VLAN tag) is the second message in this application, and the second VLAN identifier in the second message is used to identify the sub-ring protection VLAN.

[0132] After receiving a packet with an outer VLAN tag that is a sub-ring protection VLAN tag, communication device S5's interface 3 becomes a congestion point. The packet with the outer VLAN tag being a sub-ring protection VLAN tag is blocked by this congestion point and cannot be forwarded through interface 3. However, if interface 1 of communication device S5 (belonging to the sub-ring) fails, the VLAN identifier in the outer VLAN tag of the packet will be the same as the protection VLAN identifier of interface 1 of communication device S5. Furthermore, the outer VLAN tag of the packet carries first information, which indicates that the packet has passed through the congestion point on the sub-ring. Figure 8The communication device S8 shown uses interface 2). Therefore, the communication device S5 executes the second implementation method in step 102: the communication device S5 removes the current outer VLAN tag (i.e., the sub-ring protection VLAN tag) of the message. Next, the communication device S5 sends the message to the communication device S3 through interface 2. The outer VLAN tag of the message is the service VLAN tag. The message arrives at the communication device S1 along the path S5>S1>S1. In the process of the communication device S5 removing the VLAN tag from the message, the communication device S5 is equivalent to the first communication device in this application, or in other words, the communication device S5 implements the function of the first communication device in this application. Interface 1 of the communication device S5 is equivalent to the first outgoing interface, interface 2 of the communication device S5 is equivalent to the second outgoing interface, and the communication device S3 is equivalent to the second communication device in this application. The message with the outer VLAN tag being the sub-ring protection VLAN tag is the first message in this application, and the first VLAN identifier in the first message is used to identify the sub-ring protection VLAN. The message after the sub-ring protection VLAN tag has been removed is the second message in this application. The second VLAN identifier in the second message is used to identify the service VLAN.

[0133] Therefore, the second implementation example of this application can realize link switching in the scenario where the main ring and sub-ring fail simultaneously, thereby improving the disaster recovery capability and stability of the network.

[0134] Example 3: The ring network consists of a main ring and sub-rings. The first communication device can belong to either the sub-ring or the main ring. The main ring and sub-rings are each added to a protection VLAN, with the main ring protection VLAN identifier differing from the sub-ring protection VLAN identifier. In Example 3, the link between two intersecting nodes between the main ring and the sub-ring is added to the sub-ring protection VLAN; in other words, the sub-ring protection VLAN includes the link between the two intersecting nodes between the main ring and the sub-ring. Therefore, packets with an outer VLAN tag of the sub-ring protection VLAN tag can be transmitted through the two intersecting nodes, reducing the packet forwarding hop count, improving packet forwarding efficiency, and reducing packet transmission latency. When the outer VLAN tag of a packet carries the sub-ring protection VLAN identifier, the packet is not blocked by the sub-ring blocking points, nor by the main ring blocking points; similarly, when the outer VLAN tag of a packet carries the main ring protection VLAN identifier, the packet is not blocked by the main ring blocking points, nor by the sub-ring blocking points.

[0135] In the event of a main ring failure, the process of encapsulating or removing VLAN tags from packets within the ring network is similar to that described in Implementation Example 1. Please refer to the description of Implementation Example 1 for details; it will not be repeated here. Below, we will describe the scenario of a sub-ring failure in Implementation Example 3.

[0136] For example, please refer to Figure 9 , Figure 9 This is an illustration of another possible forwarding of the message in this application. For example... Figure 9 As shown, the message enters the sub-ring from communication device S9 and is transmitted to communication device S7 via the service VLAN. For example... Figure 9 As shown, interface 1 of communication device S7 malfunctions, and the VLAN identifier in the outer VLAN tag of the packet is the VLAN identifier corresponding to the service VLAN. Therefore, the VLAN identifier in the outer VLAN tag of the packet is different from the protection VLAN identifier (i.e., the sub-ring protection VLAN identifier) ​​of interface 1 of communication device S7. Then, communication device S7 executes implementation method one in step 102: communication device S7 encapsulates the sub-ring protection VLAN tag as the outer VLAN tag of the packet, and sends the packet encapsulated with the sub-ring protection VLAN tag to communication device S9 through interface 2 of communication device S7. In the process of communication device S7 encapsulating the packet with a VLAN tag, communication device S7 is equivalent to the first communication device in this application, or in other words, communication device S7 implements the function of the first communication device in this application. Interface 1 of communication device S7 is equivalent to the first outgoing interface, interface 2 of communication device S7 is equivalent to the second outgoing interface, communication device S9 is equivalent to the second communication device in this application, and the packet with the outer VLAN tag being the service VLAN tag is the first packet in this application. The first VLAN identifier in the first packet is used to identify the service VLAN. The message encapsulating the sub-protection VLAN tag is the second message in this application. The second VLAN identifier in the second message is used to identify the sub-ring protection VLAN. The second message is not blocked by the sub-ring's blocking points.

[0137] Next, the message encapsulated with the VLAN tag is transmitted to communication device S5. During its journey to communication device S5, the message will pass through a bottleneck in the sub-ring (e.g., Figure 9 If the outer VLAN tag of the communication device S8 (interface 2) carries first information, the first information is used to indicate that the packet has passed a congestion point. In implementation example three, the sub-ring protection VLAN includes the link between two intersecting nodes between the main ring and the sub-ring. Therefore, packets can be forwarded from one intersecting node to another. Figure 9In the illustrated scenario, the intersection of the main ring and the sub-ring is communication device 5 and communication device 6. When a message arrives at communication device S6, it can be forwarded to communication device S5 through interface 2 of communication device S6. Therefore, the transmission path of a message encapsulated with a protection VLAN tag from communication device S7 to communication device S5 is S7>S9>S8>S6>S5. After the message arrives at communication device S5, interface 1 of communication device S5 fails. Furthermore, the VLAN identifier in the outer VLAN tag of the message is the sub-ring protection VLAN identifier. Since interface 1 of communication device S5 belongs to the sub-ring, the VLAN identifier in the outer VLAN tag of the message is the same as the protection VLAN identifier of the first outgoing interface. Moreover, the outer VLAN tag of the message carries the first information. Then, communication device S5 executes the second implementation method in step 102: communication device S5 removes the current outer VLAN tag (i.e., the sub-ring protection VLAN tag) of the message. At this time, the outer VLAN tag of the message is the service VLAN tag. Next, communication device S5 sends a message encapsulated with a service VLAN tag to communication device S3 through interface 2. This message is then forwarded through the service VLAN to communication device S1. The transmission path of this message is S5>S6>S3>S1. In the process of removing the VLAN tag from the message, communication device S5 is equivalent to the first communication device in this application, or in other words, communication device S5 implements the function of the first communication device in this application. The first communication device is the first intersection point between the main ring and the sub-ring. Interface 1 of communication device S5 is equivalent to the first outgoing interface, and interface 2 of communication device S5 is equivalent to the second outgoing interface. Communication device S3 is equivalent to the second communication device in this application, and communication device S6 is equivalent to the third communication device in this application. The third communication device is the second intersection point between the main ring and the sub-ring. The message with the outer VLAN tag being the sub-ring protection VLAN tag is the first message in this application, and the first VLAN identifier in the first message is used to identify the sub-ring protection VLAN. The message after the sub-ring protection VLAN tag has been removed (equivalent to a message with the outer VLAN tag being the service VLAN tag) is the second message in this application. The second VLAN identifier in the second message is used to identify the service VLAN.

[0138] Example 4: The ring network consists of a main ring and sub-rings. The first communication device can belong to either the sub-ring or the main ring. Both the main ring and sub-rings are equipped with protection VLANs, with the main ring protection VLAN identifier differing from the sub-ring protection VLAN identifier. When the outer VLAN tag of a packet carries the sub-ring protection VLAN identifier, the packet is not blocked by any congestion point in the sub-ring, nor by any congestion point in the main ring; similarly, when the outer VLAN tag of a packet carries the main ring protection VLAN identifier, the packet is not blocked by any congestion point in the main ring, nor by any congestion point in the sub-ring. Furthermore, in Example 4, this application also provides a third method for removing VLAN tags: when an intersecting node between the main ring and the sub-ring receives a packet with an outer VLAN tag that is a sub-ring protection VLAN tag, the intersecting node can remove the outer VLAN tag (i.e., the protection VLAN tag) of the packet without needing to determine whether an interface failure has occurred. This reduces the number of hops the packet needs to be forwarded, improves packet forwarding efficiency, and reduces packet transmission latency. The following section, using a sub-ring failure as an example and in conjunction with the attached diagram, will introduce implementation method three.

[0139] For example, please refer to Figure 10 , Figure 10 This is an illustration of another possible forwarding of the message in this application. For example... Figure 10 As shown, interface 1 of communication device S7 malfunctions, and the VLAN identifier in the outer VLAN tag of the packet is the service VLAN identifier. Therefore, the VLAN identifier in the outer VLAN tag of the packet is different from the protection VLAN identifier (i.e., the sub-ring protection VLAN identifier) ​​of interface 1 of communication device S7. Then, communication device S7 executes implementation method one in step 102: communication device S7 encapsulates the sub-ring protection VLAN tag as the outer VLAN tag of the packet, and sends the packet encapsulated with the sub-ring protection VLAN tag to communication device S9 through interface 2 of communication device S7. In the process of communication device S7 encapsulating the packet with a VLAN tag, communication device S7 is equivalent to the first communication device in this application, or in other words, communication device S7 implements the function of the first communication device in this application. Interface 1 of communication device S7 is equivalent to the first outgoing interface, interface 2 of communication device S7 is equivalent to the second outgoing interface, communication device S9 is equivalent to the second communication device in this application, and the packet with the outer VLAN tag being the service VLAN tag is the first packet in this application. The first VLAN identifier in the first packet is used to identify the service VLAN. The message encapsulating the sub-ring protection VLAN tag is the second message in this application. The second message is not blocked by the sub-ring blocking point, and the second VLAN identifier in the second message is used to identify the sub-ring protection VLAN.

[0140] Next, the message encapsulated with the VLAN tag is transmitted to communication device S6. During its journey to communication device S6, the message will pass through a bottleneck in the sub-ring (e.g., Figure 10 If the outer VLAN tag of the packet carries first information, it indicates that the packet has passed the congestion point. When communication device S6 receives the packet encapsulated with the sub-ring protection VLAN tag, since communication device S6 is the intersection node of the main ring and the sub-ring, and the outer VLAN tag of the packet carries the first information, the current packet satisfies the execution conditions of the above-mentioned implementation method three. Therefore, communication device S6 removes the current outer VLAN tag (i.e., the sub-ring protection VLAN tag) of the packet. At this time, the outer VLAN tag of the packet is the service VLAN tag. Next, since there is a congestion point on communication device S5, communication device S6 sends a packet encapsulated with the service VLAN tag to communication device S4 through interface 2. This packet continues to be forwarded through the service VLAN and reaches communication device S1. The transmission path of this packet is S6>S4>S3>S1. In the process of removing VLAN tags from packets by the communication device, communication device S6 is equivalent to the first communication device in this application, or in other words, communication device S6 implements the function of the first communication device in this application. The first communication device is the first intersection point between the main ring and the sub-ring, and communication device S4 is equivalent to the second communication device in this application. The packet with the outer VLAN tag being the sub-ring protection VLAN tag is the first packet in this application, and the first VLAN identifier in the first packet is used to identify the sub-ring protection VLAN. The packet after removing the sub-ring protection VLAN tag (equivalent to the packet with the outer VLAN tag being the service VLAN tag) is the second packet in this application, and the second VLAN identifier in the second packet is used to identify the service VLAN.

[0141] In the event of a main ring failure, the process of encapsulating or stripping VLAN tags from packets within the ring network is similar to the aforementioned... Figure 10 The examples shown are similar; please refer to the previous ones for details. Figure 10 The examples shown will not be repeated here.

[0142] Accordingly, this application also provides related apparatus for implementing the above-described scheme. Please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of a communication device 200 provided in an embodiment of this application. The communication device 200 can implement the functions of the first communication device in the above method embodiments, and therefore can also achieve the beneficial effects of the above method embodiments. In this application embodiment, the communication device 200 can be the first communication device, or it can be a circuit or chip inside the first communication device for performing part or all of the operations of the method described in this application.

[0143] like Figure 11 As shown, the first communication device 200 includes a transceiver unit 201 and a processing unit 202. Optionally, the transceiver unit 201 may include a sending unit and a receiving unit, respectively used to perform sending and receiving.

[0144] Transceiver unit 201 is used to receive a first message, the outer VLAN tag of the first message is a first VLAN tag, and the first VLAN tag includes a first VLAN identifier;

[0145] The processing unit 202 is configured to process the first packet to obtain a second packet in the event of a failure of the first outgoing interface used for forwarding the first packet, based on the matching result between the first VLAN identifier and the first protection VLAN identifier configured on the first outgoing interface. The first protection VLAN identifier is used to identify the first protection VLAN joined by the first outgoing interface, and the outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier.

[0146] The transceiver unit 201 is also used to send a second message to a second communication device in the ring network through the second output interface.

[0147] In one possible implementation, the processing unit 202 is specifically used for:

[0148] When the first VLAN identifier is different from the first protection VLAN identifier, the processing unit encapsulates the first packet with a second VLAN tag to obtain a second packet. The inner VLAN tag of the second packet is the first VLAN tag, wherein the second VLAN identifier is the same as the first protection VLAN identifier.

[0149] In one possible implementation, the ring network includes a main ring and sub-rings;

[0150] The first communication device belongs to the sub-ring, the first protection VLAN identifier is used to identify the sub-ring protection VLAN, the second packet is not blocked by the sub-ring's blocking points, and the second packet is blocked by the main ring's blocking points; or,

[0151] The first communication device belongs to the main ring, the first protection VLAN identifier is used to identify the main ring protection VLAN, and the second packet is not blocked by the main ring blocking point.

[0152] In one possible implementation, the ring network includes a main ring and sub-rings. The first communication device belongs to the main ring. The first message includes an inner service VLAN tag and a first VLAN tag. The first VLAN identifier is used to identify the sub-ring protection VLAN. The first message is blocked by the main ring's blocking point but not by the sub-ring's blocking point. The second protection VLAN identifier is used to identify the main ring protection VLAN. The second message includes a service VLAN tag, a first VLAN tag, and a second VLAN tag.

[0153] In one possible implementation, the first packet encapsulates a second VLAN tag inside the first VLAN tag, and the processing unit 202 is specifically used for:

[0154] When the first VLAN identifier is the same as the first protection VLAN identifier, the processing unit is used to remove the first VLAN tag from the first message to obtain the second message.

[0155] In one possible implementation, the first VLAN tag includes first information, which is used to indicate that the first packet has passed the congestion point.

[0156] In one possible implementation, the ring network includes a main ring and a sub-ring. The first communication device is a node on the main ring. The first message is also encapsulated with a service VLAN tag inside the second VLAN tag. The second VLAN tag includes a second VLAN identifier. The first VLAN identifier is used to identify the main ring protection VLAN, and the second VLAN identifier is used to identify the sub-ring protection VLAN. The first message is not blocked by the blocking point of the main ring.

[0157] In one possible implementation, the ring network includes a main ring and a sub-ring, the first communication device is the first intersection node of the main ring and the sub-ring, the first VLAN identifier is used to identify the sub-ring protection VLAN, and the second VLAN tag is used to identify the service VLAN.

[0158] In one possible implementation, the transceiver unit 201 is specifically used for:

[0159] The first message is received from the third communication device, which is the second intersecting node of the main ring and the sub-ring.

[0160] Or receive the first message from the second communication device in the main ring.

[0161] It should be noted that the information interaction and execution process between the modules / units in the communication device 200 are different from those in this application. Figure 5 The corresponding method embodiments are based on the same concept, and the details can be found in the descriptions of the method embodiments shown above in this application, which will not be repeated here.

[0162] Please see Figure 12 , Figure 12 This is a schematic diagram of the logical structure of a communication device 30 provided in an embodiment of this application. Figure 12 The communication device 30 can be a chip or circuit used to support the first communication device in implementing the communication method of this application; or, the communication device 30 can be a logic node, logic module, or software used to implement all or part of the functions of the communication device 30; the communication device 30 can also be a collective term for multiple logic nodes, multiple logic modules, or multiple software used to implement the communication method. The communication device 30 may be equipped with... Figure 11 The first communication device described in the corresponding embodiment is used to implement Figure 5 The first communication device in the corresponding embodiment performs the following functions. The communication device 30 includes: a memory 301, a processor 302, a communication interface 303, and a bus 304. The memory 301, processor 302, and communication interface 303 are interconnected via the bus 304.

[0163] The memory 301 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 301 may store a program. When the program stored in the memory 301 is executed by the processor 302, the processor 302 and the communication interface 303 are used to execute steps 101-103 of the above-described communication method embodiment.

[0164] Processor 302 may be a central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), digital signal processing (DSP), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or any combination thereof, used to execute relevant programs to implement one or more steps in steps 101-103 of the communication method embodiments of this application. The steps of the data processing method disclosed in conjunction with the embodiments of this application can be executed by a compiler and executor, wherein the compiler and executor can be executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 301. Processor 302 reads information from memory 301 and, in conjunction with its hardware, executes one or more steps in steps 101-103 of the communication method embodiments of this application.

[0165] The communication interface 303 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the communication device 30 and other devices or communication networks.

[0166] Bus 304 enables a pathway for information transmission between various components of computer device 30 (e.g., memory 301, processor 302, and communication interface 303). For ease of illustration, Figure 12 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0167] It should be noted that the information interaction and execution process between the modules / units in the communication device are different from those in this application. Figure 5 The corresponding method embodiments are based on the same concept, and the details can be found in the descriptions of the method embodiments shown above in this application, which will not be repeated here.

[0168] This application also provides a computer-readable storage medium for storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor performs the method described in the possible implementation of the first communication device in the foregoing embodiments.

[0169] This application also provides a computer program product (or computer program) that, when executed by the processor, executes the method described above for a possible implementation of the first communication device.

[0170] This application also provides a chip system including at least one processor for supporting a communication device in implementing the functions involved in the possible implementations of the communication device described above. Optionally, the chip system further includes an interface circuit that provides program instructions and / or data to the at least one processor. In one possible design, the chip system may further include a memory for storing the program instructions and data necessary for the communication device. The chip system may be composed of chips or may include chips and other discrete devices, wherein the communication device may specifically be the first communication device in the aforementioned method embodiments.

[0171] This application also provides a communication system, which includes a first communication device, a second communication device, and / or a third communication device in any of the above embodiments.

[0172] This application also provides a chip device, including a processor, configured to call computer programs or computer instructions stored in the memory, so that the processor executes the above-described... Figure 5 The method provided in the illustrated embodiment.

[0173] In one possible implementation, the input of the chip device corresponds to the above. Figure 5 In any of the embodiments shown, the receiving operation of the chip device corresponds to the above-described... Figure 5 The sending operation in any of the embodiments shown.

[0174] Optionally, the processor is coupled to the memory via an interface.

[0175] Optionally, the chip device may also include a memory that stores computer programs or computer instructions.

[0176] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an application-specific integrated circuit (ASIC), or one or more devices used to control the above. Figure 5The illustrated embodiments provide an integrated circuit for program execution of the method provided in any of the embodiments. The memory mentioned above may be read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0177] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.

[0178] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0179] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0180] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0181] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms. Whether a function is implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0182] It should be understood that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.

[0183] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0184] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to it, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0185] In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions between different embodiments are consistent and can be referenced by each other. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0186] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A communication method, characterized in that, The method includes: The first communication device in the ring network receives a first message, the outer VLAN tag of the first message is a first VLAN tag, and the first VLAN tag includes a first VLAN identifier; In the event of a failure of the first outgoing interface used to forward the first packet, the first communication device processes the first packet based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain a second packet. The first protection VLAN identifier is used to identify the first protection VLAN to which the first outgoing interface is joined, and the outer VLAN tag of the second packet is the second VLAN tag, which includes the second VLAN identifier. The first communication device sends the second message to the second communication device in the ring network through the second output interface.

2. The method according to claim 1, characterized in that, The first communication device processes the first message based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain a second message, including: If the first VLAN identifier is different from the first protection VLAN identifier, the first communication device encapsulates the first message with the second VLAN tag to obtain the second message. In the second message, the inner VLAN tag of the second VLAN tag is the first VLAN tag, wherein the second VLAN identifier is the same as the first protection VLAN identifier.

3. The method according to claim 2, characterized in that, The ring network includes a main ring and sub-rings; The first communication device belongs to the sub-ring, the first protection VLAN identifier is used to identify the sub-ring protection VLAN, the second packet is not blocked by the blocking point of the sub-ring, and the second packet is blocked by the blocking point of the main ring; or, The first communication device belongs to the main ring, the first protection VLAN identifier is used to identify the main ring protection VLAN, and the second packet is not blocked by the main ring's blocking point.

4. The method according to claim 2, characterized in that, The ring network includes a main ring and a sub-ring. The first communication device belongs to the main ring. The first message includes an inner service VLAN tag and a first VLAN tag. The first VLAN identifier is used to identify the sub-ring protection VLAN. The first message is blocked by the blocking point of the main ring, but not by the blocking point of the sub-ring. The second protection VLAN identifier is used to identify the main ring protection VLAN. The second message includes the service VLAN tag, the first VLAN tag, and the second VLAN tag.

5. The method according to claim 1, characterized in that, The first message encapsulates the second VLAN tag inside the first VLAN tag. The first communication device processes the first message based on the matching result between the first VLAN identifier and the first protection VLAN identifier to obtain the second message, including: If the first VLAN identifier is the same as the first protection VLAN identifier, the first communication device removes the first VLAN tag from the first message to obtain the second message.

6. The method according to claim 5, characterized in that, The first VLAN tag includes first information, which is used to indicate that the first packet has passed the congestion point.

7. The method according to claim 5 or 6, characterized in that, The ring network includes a main ring and a sub-ring. The first communication device is a node on the main ring. The first packet is also encapsulated with a service VLAN tag inside the second VLAN tag. The first VLAN tag is used to identify the main ring protection VLAN, and the second VLAN tag is used to identify the sub-ring protection VLAN. The first packet is not blocked by the blocking point of the main ring.

8. The method according to claim 5 or 6, characterized in that, The ring network includes a main ring and a sub-ring. The first communication device is the first intersection node of the main ring and the sub-ring. The first VLAN identifier is used to identify the sub-ring protection VLAN, and the second VLAN tag is used to identify the service VLAN.

9. The method according to claim 8, characterized in that, The first communication device in the ring network receives a first message, including: The first communication device receives the first message from the third communication device, wherein the third communication device is the second intersection node of the main ring and the sub-ring; Alternatively, the first communication device may receive the first message from the second communication device in the main ring.

10. A communication method, characterized in that, include: The first communication device in the ring network receives a first message, the outer VLAN tag of the first message includes first information, the first information being used to indicate that the first message passes through a blocking point; The first communication device removes the outer VLAN tag from the first message to obtain the second message; The first communication device sends the second message to the second communication device in the ring network.

11. The method according to claim 10, characterized in that, The outer VLAN tag of the first packet is a first VLAN tag, and the first packet is encapsulated with a second VLAN tag inside the first VLAN tag. The first VLAN tag includes a first VLAN identifier, and the second VLAN tag includes a second VLAN identifier. The first communication device removes the outer VLAN tag from the first message to obtain a second message, including: If the first outgoing interface used to forward the first message fails, and the first VLAN identifier is the same as the first protection VLAN identifier, then the first communication device removes the first VLAN tag from the first message to obtain the second message. The first protection VLAN identifier is used to identify the first protection VLAN joined by the first outgoing interface, and the outer VLAN tag of the second message is the second VLAN tag.

12. The method according to claim 11, characterized in that, The ring network includes a main ring and a sub-ring. The first communication device is a node on the main ring. The first packet is further encapsulated with a service VLAN tag inside the second VLAN tag. The second VLAN tag includes a second VLAN identifier. The first VLAN identifier is used to identify the main ring protection VLAN, and the second VLAN identifier is used to identify the sub-ring protection VLAN. The first packet is not blocked by the blocking point of the main ring.

13. The method according to claim 10, characterized in that, The ring network includes a main ring and sub-rings; The first communication device removes the outer VLAN tag from the first message to obtain a second message, including: When the first communication device is the first intersection node of the main ring and the sub-ring, the first communication device removes the outer VLAN tag of the first message to obtain the second message. The outer VLAN tag of the first message includes a first VLAN identifier, which is used to identify the sub-ring protection VLAN.

14. A communication device, characterized in that, The communication device is the first communication device in the ring network, and the communication device includes: A transceiver unit, configured to perform operations related to receiving and / or transmitting in the method according to any one of claims 1-13; The processing unit is used to perform operations other than receiving and sending in the method according to any one of claims 1-13.

15. A readable storage medium, characterized in that, The storage medium stores a computer program or instructions, which, when executed by a communication device, implement the method as described in any one of claims 1 to 13.

16. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 13.

17. A communication device, characterized in that, include: Memory, used to store instructions; as well as A processor, when the instructions are executed in the processor, causes the communication device to perform the method according to any one of claims 1-13.