Mode switching method, electronic equipment and computer readable storage medium

By introducing tag mapping identification and corresponding message processing into the tag switching router, the problem of LSP global oscillation caused by LDP session disconnection is solved, smooth mode switching is achieved, and network reliability and service continuity are improved.

CN120416149APending Publication Date: 2025-08-01TP-LINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510599590.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When the LDP session is disconnected, LSP will fluctuate globally, causing problems such as service packet loss and service interruption.

Method used

By introducing tag mapping identifiers in the tag switching router, we determine whether the forwarding equivalent class carries tag mapping relationship one by one, and send corresponding tag withdrawal or mapping messages during mode switching, avoid interrupting the session between tag switching routers to achieve smooth mode switching.

Benefits of technology

It avoids large-scale shocks in the entire network, improves the reliability of the network, and ensures business continuity and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416149A_ABST
    Figure CN120416149A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and provides a mode switching method, electronic equipment and a computer readable storage medium, and the method comprises the steps: determining whether a first forwarding equivalence class carries a label mapping identifier or not after a mode switching instruction is received; the mode switching instruction is an instruction for switching the independent mode to the ordered mode or an instruction for switching the ordered mode to the independent mode. And if the first forwarding equivalence class carries the label mapping identifier, the current mode is an independent mode, and the mode switching instruction is an instruction of switching the independent mode into an ordered mode, sending a label withdrawing message to the upstream label distribution device. And if the first forwarding equivalence class carries a label mapping identifier, the current mode is an ordered mode, and the mode switching instruction is an instruction of switching the ordered mode into an independent mode, sending a label mapping message to the upstream label distribution device. The modes can be smoothly switched, large-scale oscillation of the whole network is avoided, and the reliability of the network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a mode switching method, an electronic device, and a computer-readable storage medium. Background Art

[0002] LDP (Label Distribution Protocol) is a signaling protocol in the MPLS (Multiprotocol Label Switching) system, and is used to construct an LSP (Label Switched Path) between LSRs (Label Switching Routers). The LDP label control mode includes an ordered control mode (Ordered Control) and an independent control mode (Independent Control).

[0003] In the traditional technical solution, when an LSR performs a control mode switch (from the ordered control mode to the independent control mode, or from the independent control mode to the ordered control mode), the control mode switch is performed by disconnecting the current LDP session and re-establishing the LDP session.

[0004] However, when the LDP session is disconnected, all LSPs with the LDP peer that disconnects the LDP session as the next hop will be deleted, causing global oscillation of the LSP, resulting in service packet loss and even service interruption. Summary of the Invention

[0005] Embodiments of this application provide a mode switching method, apparatus, chip, electronic device, and computer-readable storage medium, which can smoothly switch the mode, avoid large-scale oscillation of the entire network, and improve the reliability of the network.

[0006] In a first aspect, the present application provides a mode switching method, which can be applied to a label allocation device. The label allocation device is provided with a label forwarding information table, and the label forwarding information table includes at least one forwarding equivalence class. The method includes: in response to a received mode switching instruction, determining one by one whether at least one forwarding equivalence class carries a label mapping identifier. The mode switching instruction is a first mode switching instruction or a second mode switching instruction. The first mode switching instruction is used to instruct the label allocation device to switch from an independent mode to an ordered mode, and the second mode switching instruction is used to instruct the label allocation device to switch from an ordered mode to an independent mode. The label mapping identifier is used to characterize that the first forwarding equivalence class has not established a mapping relationship with the label allocated by the downstream label allocation device, and the first forwarding equivalence class is any one of the at least one forwarding equivalence class. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, then a first label withdrawal message is sent to the upstream label allocation device. The first label withdrawal message is used to instruct the upstream label allocation device to release the label mapping relationship of the first forwarding equivalence class published by the label allocation device. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, then a first label mapping message is sent to the upstream label allocation device. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class.

[0007] In some embodiments, sending the first label mapping message to the upstream label allocation device includes: determining a first local label corresponding to the first forwarding equivalence class based on a preset label distribution protocol. Sending the first label mapping message to the upstream label allocation device, and the first label mapping message is used to characterize the label mapping relationship between the first forwarding equivalence class and the first local label.

[0008] In some embodiments, sending the first label mapping message to the upstream label allocation device includes: determining whether the current label publishing method is a downstream autonomous method. If the current label publishing method is a downstream autonomous method, then the first label mapping message is sent to the upstream label allocation device.

[0009] In some embodiments, if the current label publishing method is not a downstream autonomous method, then after receiving a label request message sent by the upstream label allocation device, the first label mapping message is sent to the upstream label allocation device. The label request message is used to obtain the first label mapping message.

[0010] In some embodiments, sending a first label withdrawal message to an upstream label distribution device includes: obtaining a first local label corresponding to a first forwarding equivalence class. Sending a first label withdrawal message to the upstream label distribution device, where the first label withdrawal message is used to instruct the upstream label distribution device to release the label mapping relationship between the first forwarding equivalence class and the first local label. Releasing the label mapping relationship between the first forwarding equivalence class and the first local label.

[0011] In some embodiments, the above method further includes: in response to receiving a second forwarding equivalence class addition instruction, adding a second forwarding equivalence class to the label forwarding information table. Adding a label mapping identifier to an entry corresponding to the second forwarding equivalence class in the label forwarding information table.

[0012] In some embodiments, the above method further includes: in response to a second label mapping message sent by a downstream label distribution device, deleting a label mapping identifier corresponding to a third forwarding equivalence class, where the second label mapping message is used to represent that there is a label mapping relationship between the third forwarding equivalence class and a first remote label.

[0013] In some embodiments, the above method further includes: in response to a second label withdrawal message sent by a downstream label distribution device, adding a label mapping identifier to a fourth forwarding equivalence class, where the second label withdrawal message is used to instruct to release the label mapping relationship between the fourth forwarding equivalence class and a second remote label.

[0014] In a second aspect, the present application provides a mode switching device. The mode switching device may be a label distribution device. The label distribution device is provided with a label forwarding information table, and the label forwarding information table includes at least one forwarding equivalence class. The device includes:

[0015] A processing module, configured to, in response to receiving a mode switching instruction, determine one by one whether at least one forwarding equivalence class carries a label mapping identifier. The mode switching instruction is a first mode switching instruction or a second mode switching instruction. The first mode switching instruction is used to instruct the label distribution device to switch from an independent mode to an ordered mode, and the second mode switching instruction instructs the label distribution device to switch from the ordered mode to the independent mode. The label mapping identifier is used to represent that a first forwarding equivalence class has not established a mapping relationship with a label assigned by a downstream label distribution device, and the first forwarding equivalence class is any one of the at least one forwarding equivalence class.

[0016] A sending module, configured to, when the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, send a first label withdrawal message to the upstream label distribution device, where the first label withdrawal message is used to instruct the upstream label distribution device to release the label mapping relationship of the first forwarding equivalence class published to the label distribution device.

[0017] The sending module is further configured to send a first label mapping message to the upstream label allocation device when the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class.

[0018] In a third aspect, the present application provides a chip, which is used to execute the method in any one of the above first aspects.

[0019] In a fourth aspect, the present application provides an electronic device, including a processor and a memory. The processor is configured to execute a computer program stored in the memory to implement the method in any one of the above first aspects. Or,

[0020] The electronic device includes the chip in the third aspect.

[0021] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method in any one of the above first aspects.

[0022] In the technical solution provided by the present application, the label allocation device can determine whether at least one forwarding equivalence class carries a label mapping identifier one by one after receiving the mode switching instruction. The mode switching instruction is the first mode switching instruction or the second mode switching instruction. The first mode switching instruction is used to instruct the label allocation device to switch from the independent mode to the ordered mode, and the second mode switching instruction instructs the label allocation device to switch from the ordered mode to the independent mode. The label mapping identifier is used to characterize that the first forwarding equivalence class has not established a mapping relationship with the label allocated by the downstream label allocation device. The first forwarding equivalence class is any one of the at least one forwarding equivalence class. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, then a first label withdrawal message is sent to the upstream label allocation device. The first label withdrawal message is used to instruct the upstream label allocation device to release the label mapping relationship of the first forwarding equivalence class published by the label allocation device. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, then a first label mapping message is sent to the upstream label allocation device. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class. The label allocation device can smoothly switch the label allocation control mode without interrupting the session between label switching routers, so as to update the label switching path in a timely manner, avoid large-scale oscillations in the entire network, and improve the reliability of the network. Description of the Drawings

[0023] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments or the description of the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0024] Figure 1 It is an example diagram of the label publishing direction in the downstream autonomous mode provided by the embodiments of the present application;

[0025] Figure 2 It is an example diagram of the label publishing direction in the downstream on-demand mode provided by the embodiments of the present application;

[0026] Figure 3 It is an example diagram of the label publishing direction in the DU + independent mode combination provided by the embodiments of the present application;

[0027] Figure 4 It is an example diagram of the label publishing direction in the DoD + independent mode combination provided by the embodiments of the present application;

[0028] Figure 5 It is an example diagram of the label publishing direction in the DU + ordered mode combination provided by the embodiments of the present application;

[0029] Figure 6 It is an example diagram of the label publishing direction in the DoD + ordered mode combination provided by the embodiments of the present application;

[0030] Figure 7 It is a schematic diagram of the label mapping identifier generation method in the DU + independent mode combination provided by the embodiments of the present application;

[0031] Figure 8 It is a schematic diagram of the label mapping identifier generation method in the DU + ordered mode combination provided by the embodiments of the present application;

[0032] Figure 9 It is a schematic diagram of the label mapping identifier deletion method in the DU + independent mode combination provided by the embodiments of the present application;

[0033] Figure 10 It is a schematic diagram of the label mapping identifier deletion method in the DU + ordered mode combination provided by the embodiments of the present application;

[0034] Figure 11 It is a schematic diagram of another label mapping identifier generation method in the DU + independent mode combination provided by the embodiments of the present application;

[0035] Figure 12It is a schematic diagram of a method for generating a label mapping identifier in another DU+ ordered mode combination provided by an embodiment of the present application;

[0036] Figure 13 It is a schematic flowchart of a mode switching method provided by an embodiment of the present application;

[0037] Figure 14 It is a schematic diagram of a switching method of a mode switching method provided by an embodiment of the present application;

[0038] Figure 15 It is another schematic diagram of a switching method of a mode switching method provided by an embodiment of the present application;

[0039] Figure 16 It is another schematic flowchart of a mode switching method provided by an embodiment of the present application;

[0040] Figure 17 It is yet another schematic flowchart of a mode switching method provided by an embodiment of the present application;

[0041] Figure 18 It is a schematic diagram of the structure of a mode switching device provided by an embodiment of the present application;

[0042] Figure 19 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0043] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from obstructing the description of the present application.

[0044] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0045] It should also be understood that the term "and / or" as used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] As used in the specification of this application and the appended claims, the term "if" can be construed, depending on the context, as "when", or "once", or "in response to determining", or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be construed, depending on the context, as meaning "once determined", or "in response to determining", or "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".

[0047] In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are used only for distinguishing descriptions and cannot be construed as indicating or implying relative importance.

[0048] Reference to "one embodiment" or "some embodiments" or the like described in the specification of this application means that a particular feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0049] RFC 3031 defines the architecture of MPLS, the data forwarding mechanism, and the label operation rules. In the scenario of packet transmission in a connectionless network protocol, when a packet flows through a routing device (such as a label switching router), each routing device needs to independently execute the forwarding decision process, that is, the routing device determines the next-hop node (the next routing device for transmitting the packet) for the packet by parsing the packet header information and combining the network layer routing algorithm.

[0050] The forwarding decision process may include: First step, determining the forwarding equivalence class corresponding to the packet. The routing device determines the FEC (Forwarding Equivalence Class) corresponding to the packet based on the packet header characteristics. Second step, determining the next-hop corresponding to the forwarding equivalence class (the next routing device for transmitting the packet), and forwarding the packets of the same forwarding equivalence class received to the next-hop.

[0051] In the MPLS system, the partitioning mechanism of the forwarding equivalence class depends on the "label" technology. This label is a short fixed-length identifier with local semantics, embedded between the layer 2 and layer 3 packet headers, and adopts a stack-like nested structure.

[0052] The control plane of MPLS adopts a connectionless architecture, and its core function lies in the dynamic maintenance of routing information and label information. Among them, the IP (Internet Protocol Address) routing protocol module is responsible for the interaction of routing information across the network and the generation of the routing information table, while the Label Distribution Protocol (LDP) is used for the interaction of label information and the construction of the label information table, and a label forwarding path is established based on the forwarding information table. The corresponding data plane adopts a connection-oriented mechanism, mainly responsible for the dual forwarding tasks of ordinary IP packets and MPLS packets. The data plane contains an IP forwarding information table and a label forwarding information table: the former is generated by streamlining the routing information table and is used for forwarding ordinary IP packets; the latter is constructed by the LDP protocol and is specifically used for MPLS label forwarding.

[0053] MPLS technology can break through the forwarding efficiency bottleneck of traditional IP routing, avoid the per-hop parsing of the IP packet header through the label forwarding mechanism, and significantly reduce the processing delay. Due to the multi-layer label nesting ability and the connection characteristics of the data plane of MPLS technology, it shows significant advantages in scenarios such as VPN (Virtual Private Network), traffic engineering, and QoS (Quality of Service). Currently, MPLS has become one of the core technologies for building highly reliable and scalable networks.

[0054] RFC 5036 clearly defines and elaborates on the LDP protocol. In the MPLS system, two LSRs need to reach an agreement on the mapping relationship between labels and FECs. The LDP protocol sets a series of processes aimed at achieving the unification of this mapping relationship. Exemplarily, the LDP protocol can be used to publish the FEC label mapping information generated by one LSR to another LSR, thereby building a label forwarding path in the MPLS network. The operation process of the LDP protocol mainly includes two stages: session establishment and LSP establishment.

[0055] It should be understood that two LSRs that exchange FEC label mapping information through the LDP protocol can be called LDP peers. LDP peers can obtain the FEC label mapping information of each other through the LDP session between them. It should be understood that the LDP protocol has bidirectionality (bidirectional propagation characteristics). The LDP session mainly transmits the following four types of messages:

[0056] Discovery message: used to announce and maintain the existence status of LSRs in the network. An LSR can broadcast a discovery message to convey the existence of the current label switching router; an LSR can also monitor the discovery message to monitor whether there are other label switching routers in the network.

[0057] Session messages: Used to establish, maintain, and terminate sessions (i.e., TCP connections) between LDP peers. Session messages can include initialization messages (carrying session parameter information) and initialization reply messages (carrying information on whether to accept session parameters). An exemplary first LSR can send an initialization message to a second LSR. When the second LSR receives the initialization message, if it agrees to establish an LDP session with the first LSR, it can reply with an initialization reply message to the first LSR to establish the LDP session.

[0058] Advertisement messages: Used to create, modify, and delete label mappings for FECs, and can include subtypes such as label mapping messages, label request messages, label withdrawal messages, and label release messages. It should be understood that label request messages are used to obtain label mapping messages, label withdrawal messages are used to withdraw label mapping status, and label release messages are used to delete label mapping status.

[0059] Notification messages: Used to provide advisory information and error notifications.

[0060] In the embodiments of this application, discovery messages can be transmitted via UDP (User Datagram Protocol), and LDP session messages, advertisement messages, and notification messages can be transmitted via TCP (Transmission Control Protocol).

[0061] In the embodiments of this application, LDP advertises the binding relationship between FECs and labels between LDP peers by sending advertisement messages, thereby establishing an LSP. The publication and management of labels are jointly determined by the label advertisement mode, label assignment control mode, and label retention mode. In the MPLS architecture, the LDP label distribution direction rule is that the downstream (Downstream LSR) assigns and advertises to the upstream (Upstream LSR). In the forwarding path of a specific FEC (Forwarding Equivalence Class), the LSR closer to the destination network is the downstream, and the LSR closer to the source network is the upstream. That is, it follows the principle of "the label is specified by the downstream, and label assignment is distributed in the direction from downstream to upstream". There are two label advertisement modes, including DU (Downstream Unsolicited) and DoD (Downstream on Demand). The label advertisement modes adopted by the upstream LSR and the downstream LSR with a label distribution adjacency relationship are usually the same.

[0062] Downstream autonomous mode: The LSR can directly perform label assignment and distribution without waiting for a label request message from the upstream. When the label distribution method is DU, the system default supports the downstream LSR in the LDP session to assign labels (send label mapping messages) to the upstream LSR, that is, the LSR of each node can send label mapping messages to all peer LSRs upstream.

[0063] For example, Figure 1 FIG. is an example diagram of the label distribution direction in the downstream autonomous mode provided by the embodiment of the present application. As Figure 1 shown, the ingress LSR and the transit LSR are a pair of LDP peers, and the transit LSR is closer to the destination network, that is, the transit LSR is the downstream LSR. The transit LSR and the egress LSR are a pair of LDP peers, and the egress LSR is closer to the destination network and is the egress node LSR, that is, the egress LSR is the downstream LSR. When the label distribution method is DU, the egress LSR can actively assign labels (send label mapping messages) to its upstream LSR (i.e., the transit LSR), and the transit LSR can actively assign labels (send label mapping messages) to its upstream LSR (i.e., the ingress LSR).

[0064] Downstream on-demand mode: The LSR will perform label assignment and distribution only after receiving a label request message.

[0065] For example, Figure 2 FIG. is an example diagram of the label distribution direction in the downstream on-demand mode provided by the embodiment of the present application. As Figure 2 shown, when the label distribution method is DoD, the egress LSR can only assign labels (send label mapping messages) to its upstream LSR (i.e., the transit LSR) after receiving the label request message sent by the transit LSR. The transit LSR can only assign labels (send label mapping messages) to its upstream LSR (i.e., the ingress LSR) after receiving the label request message sent by the ingress LSR.

[0066] The label distribution control mode refers to the processing logic followed by the label switching router when performing label assignment operations during the construction of the label switching path. The label distribution control mode includes the following two modes: independent control mode and ordered control mode:

[0067] Independent control mode (abbreviated as independent mode): In this mode, the local LSR has the independent right to publish labels, that is, it binds the label to a specific forwarding equivalence class (FEC) by itself and actively notifies the upstream LSR of the label information without waiting for the label feedback from the downstream LSR.

[0068] Ordered control mode (referred to as ordered mode): For the FEC label mapping on the LSR, the LSR can send the label mapping message of the FEC to its upstream node (upstream LSR) only when the LSR has received the label mapping message from the next-hop node (downstream LSR) of the FEC session, or confirms that it is the egress node (egress LSR) of the FEC.

[0069] The label distribution method and the label assignment control method can be combined to establish a label switching path, which can improve the establishment efficiency, resource utilization rate, and network reliability of the label switching path. As shown in Table 1, it can include the following four combination methods: independent mode + DU, independent mode + DoD, ordered mode + DU, and ordered mode + DoD.

[0070] Among them, in the independent mode + DU combination method, the downstream LSR can actively send the label mapping message to the upstream LSR, and each downstream LSR independently assigns labels (sends label mapping messages) without waiting for the downstream response.

[0071] For example, Figure 3 is an example diagram of the label distribution direction in the DU + independent mode combination method provided by the embodiment of the present application. As Figure 3 shown, the ingress LSR and the transit LSR are a pair of LDP peers, the transit LSR is the downstream LSR, and the ingress LSR is the upstream LSR. The transit LSR can actively assign labels (send label mapping messages) to its upstream LSR.

[0072] In the independent mode + DoD combination method, the upstream LSR sends a label request message to the downstream LSR on demand. After receiving the label request message, the downstream LSR can directly reply with a label mapping message to the upstream LSR without having to wait for the label mapping message from the final downstream LSR.

[0073] For example, Figure 4 is an example diagram of the label distribution direction in the DoD + independent mode combination method provided by the embodiment of the present application. As Figure 4 shown, the ingress LSR and the transit LSR are a pair of LDP peers. After receiving the label request message sent by the ingress LSR, the transit LSR can directly reply with a label mapping message to the ingress LSR.

[0074] In the ordered mode + DU combination method, the egress node LSR can actively send the label mapping message to the upstream LSR. After each hop of the downstream LSR receives the label mapping message, it sends the label mapping message to its upstream LSR.

[0075] For example, Figure 5 is an example diagram of the label distribution direction in the DU + ordered mode combination method provided by the embodiment of the present application. As Figure 5As shown, the egress LSR is the egress node LSR. The egress LSR can actively send label mapping messages to the transit LSR. Only after the transit LSR receives the label mapping messages sent by the egress LSR can it send label mapping messages to the ingress LSR.

[0076] In the ordered mode + DoD combination, the upstream LSR sends label request messages to the downstream LSR on demand. The directly connected downstream LSR of the LSR that sends the label request message will only send label mapping messages upstream after receiving the label mapping messages from the egress LSR.

[0077] For example, Figure 6 FIG. is an example diagram of the label distribution direction in the DoD + ordered mode combination provided by the embodiments of the present application. As Figure 6 shown, the ingress LSR and the transit LSR are a pair of LDP peers, and the transit LSR and the egress LSR are a pair of LDP peers. The ingress LSR can send label request messages to the transit LSR on demand. After the transit LSR receives the label request messages sent by the ingress LSR, it sends label request messages to the egress LSR. After the egress LSR receives the label request messages sent by the transit LSR, it sends label mapping messages to the transit LSR. Only after the transit LSR receives the label mapping messages sent by the egress LSR can it send label mapping messages to the ingress LSR.

[0078]

[0079] Table 1

[0080] In the independent mode, the label switching router can distribute labels in parallel, establish label switching paths in parallel, support fast topology adjustment, and even if some nodes have not completed label assignment, it can still perform local forwarding based on the existing labels, which is suitable for dynamic network environments. In the ordered mode, the label switching router waits for the labels of the downstream nodes to arrive before advertising upstream, which can ensure the integrity of the end-to-end path to avoid loop risks and is suitable for scenarios with extremely high stability requirements.

[0081] It can be understood that the label switching router in the independent mode and the label switching router in the ordered mode are respectively suitable for different network scenarios.

[0082] In addition, for a label switching router that supports switching between the independent mode and the ordered mode, when performing a control mode switch (switching from the ordered control mode to the independent control mode, or from the independent control mode to the ordered control mode), the control mode switch is carried out by disconnecting the current LDP session and re - establishing the LDP session. Exemplarily, the first LSR and the second LSR are a pair of LDP peers. If the LDP session between the first LSR and the second LSR is disconnected, and the first LSR is the upstream LSR and the second LSR is the downstream LSR, then all label - switched paths on the MPLS network with the second LSR as the next hop of the first LSR will be disconnected. If the first LSR is the downstream LSR and the second LSR is the upstream LSR, then all label - switched paths on the MPLS network with the first LSR as the next hop of the second LSR will be disconnected. This causes global LSP oscillation, resulting in service packet loss and even service interruption, affecting the reliability of the MPLS network.

[0083] For example, the method for the first LSR to switch from the independent mode to the ordered mode by disconnecting the current LDP session may include: First step, delete the LDP session. After deleting the LDP session, all label mappings from the second LSR locally will be deleted, and all label mappings published to the second LSR will be withdrawn, and the service forwarding between the first LSR and the second LSR is completely interrupted. Second step, allocate labels for local FECs according to the updated label distribution control configuration and re - establish the session; if it is currently in the DU mode, immediately send a label mapping message to the second LSR; if it is currently in the DoD mode, after receiving the label request message sent by the second LSR, send a label mapping message to the second LSR to generate the corresponding LDP LSP and resume the service forwarding between the first LSR and the second LSR.

[0084] In some embodiments, the label switching router can reduce the impact of disconnecting the LDP session on the global LSP oscillation by means of delayed deletion (LDP graceful deletion).

[0085] For example, the method for a first LSR to switch from the independent mode to the ordered mode by means of delayed deletion may include: First step, delete the LDP session with the second LSR. All label mappings from the second LSR locally are deleted, and all label mappings advertised to the second LSR are withdrawn. After the label mappings are deleted, the corresponding local LDP LSPs are not immediately deleted, and the forwarding between the two LSRs is not interrupted. Second step, allocate labels for the local FEC according to the updated label distribution control configuration and reconstruct the session; if it is currently in the DU mode, immediately send a label mapping message to the second LSR; if it is currently in the DoD mode, after receiving the label request message sent by the second LSR, send a label mapping message to the second LSR. During this process, the timer for deleting the LDP LSP may expire. If there are still LDP LSPs for which the corresponding label mappings have not been learned at this time, the forwarding will be interrupted.

[0086] When a label switching router performs a control mode switch by means of delayed deletion, it is necessary to configure the timer for delayed deletion according to factors such as the network status. If the timer time is too short, the LDP LSPs will be deleted before the label mappings are learned, and the forwarding is interrupted. Only when the correct label mappings are re-learned later can the forwarding be regenerated and restored. If the timer time is too long, the newly learned label bindings will be different from the existing label bindings, and there will be a situation where the LDP LSPs cannot be updated in time, which affects the service and the reliability of the network is relatively low.

[0087] In view of this, the embodiments of the present application provide a mode switching method, which can smoothly switch the label distribution control mode without interrupting the session between label switching routers, so as to facilitate the immediate update of the label switching path, avoid large-scale oscillations in the entire network, and improve the reliability of the network.

[0088] The mode switching method provided by the embodiments of the present application can be applied to a label distribution device. The label distribution device can be a device with label switching functions such as a label switching router, and the present application does not make any limitations here. Taking the label distribution device as a label switching router as an example, the embodiments of the present application provide an exemplary description of the mode switching method.

[0089] In the embodiments of the present application, before the label switching router performs a mode switch, the label switching router can add a label mapping identifier in the label forwarding information table to facilitate distinguishing whether there is a label mapping relationship between each forwarding equivalence class between the local label switching router and the downstream label switching router, that is, whether the local label switching router has learned the label mapping of the next-hop label switching router.

[0090] Exemplarily, when a label switching router first learns a forwarding equivalence class, the method for the label switching router to add a label mapping identifier in the label forwarding information table may include: in response to the received second forwarding equivalence class addition instruction, adding the second forwarding equivalence class in the label forwarding information table, and adding a label mapping identifier in the entry corresponding to the second forwarding equivalence class in the label forwarding information table.

[0091] For example, Figure 7 FIG. 5 is a schematic diagram of a method for generating a label mapping identifier in a DU+ independent mode combination provided by an embodiment of the present application. The local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. When the label distribution mode and the label assignment control mode are DU+ independent mode, the label switching router can actively send a label mapping message to the upstream label switching router. The label mapping message may include the correspondence between the forwarding equivalence class and the local label (in-label), and add the forwarding equivalence class and the label mapping identifier in the label forwarding information table. If the label switching router learns multiple forwarding equivalence classes simultaneously, the label mapping message may include the correspondences between multiple forwarding equivalence classes and multiple local labels (in-labels). The multiple forwarding equivalence classes may be FEC1, FEC2, and FEC3 respectively, and the multiple local labels may be label A, label B, and label C respectively. Then the label mapping message may be FEC1+label A, FEC2+label B, and FEC3+label C, and multiple forwarding equivalence classes all carry label mapping identifiers.

[0092] Again, for example, Figure 8 FIG. 6 is a schematic diagram of a method for generating a label mapping identifier in a DU+ ordered mode combination provided by an embodiment of the present application. When the label distribution mode and the label assignment control mode are DU+ ordered mode, the local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. If the local label switching router does not receive the label mapping message sent by the downstream label switching router, it will not actively send a label mapping message to the upstream label switching router, and multiple forwarding equivalence classes all carry label mapping identifiers.

[0093] In the embodiment of the present application, the label switching router may add a label mapping identifier to the second forwarding equivalence class to indicate that the local label switching router has not learned the label mapping of the downstream label switching router.

[0094] Optionally, the label switching router may also establish a correspondence between the label mapping identifier and the second forwarding equivalence class to indicate that the local label switching router has not learned the label mapping of the downstream label switching router.

[0095] In some embodiments, when a label switching router learns a label mapping of a forwarding equivalence class, if the label switching router that sends the label mapping message is a neighbor label switching router of the local label switching router, and this neighbor label switching router is the next hop of the local switching router in the local routing table, that is, the downstream label switching router. The method for the label switching router to change the label mapping identifier in the label forwarding information table may include:

[0096] In response to a second label mapping message sent by the downstream label switching router, delete the label mapping identifier corresponding to the third forwarding equivalence class. The second label mapping message is used to represent that there is a label mapping relationship between the third forwarding equivalence class and the first remote label.

[0097] For example, Figure 9 FIG. is a schematic diagram of a method for deleting a label mapping identifier in a DU+ independent mode combination provided by an embodiment of the present application. The local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. When the label distribution method and the label assignment control method are in the DU+ independent mode, if the local label switching router receives a label mapping message sent by the downstream label switching router, add a remote label (out label) to the label forwarding information table and delete the label mapping identifier. The label mapping message may include FEC1+ label X and FEC2+ label Y.

[0098] Again, for example, Figure 10 FIG. is a schematic diagram of a method for deleting a label mapping identifier in a DU+ ordered mode combination provided by an embodiment of the present application. When the label distribution method and the label assignment control method are in the DU+ ordered mode, the local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. If the local label switching router receives a label mapping message sent by the downstream label switching router, add a remote label to the label forwarding information table, send a label mapping message to the upstream label switching router, then add a local label to the label forwarding information table, and delete the label mapping identifier. The label mapping message sent by the downstream label switching router may be FEC1+ label X and FEC2+ label Y, and the remote labels corresponding to FEC1 and FEC2 are X and Y respectively. The label mapping message sent to the upstream label switching router may be FEC1+ label A and FEC2+ label B, and the local labels corresponding to FEC1 and FEC2 may be A and B.

[0099] In some embodiments, when the label switching router receives a label withdrawal message, if the label switching router that sends the label mapping message is the downstream label switching router. The method for the label switching router to change the label mapping identifier in the label forwarding information table may include:

[0100] In response to a second label withdrawal message sent by a downstream label switching router, add a label mapping identifier to the fourth forwarding equivalence class. The second label withdrawal message is used to indicate the release of the label mapping relationship between the fourth forwarding equivalence class and the second remote label.

[0101] For example, Figure 11 FIG. is a schematic diagram of another method for generating a label mapping identifier in the DU+ independent mode combination provided by the embodiments of the present application. The local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. When the label distribution method and the label assignment control method are in the DU+ independent mode, if the local label switching router receives a label withdrawal message sent by the downstream label switching router, and the label withdrawal message may include the correspondence between the second remote label and the fourth forwarding equivalence class, then delete the remote label corresponding to the label withdrawal message, and generate a label mapping identifier corresponding to the fourth forwarding equivalence class in the label forwarding information table. The label withdrawal message may be FEC2 + label Y, and the local label switching router then deletes the remote label Y and generates a label mapping identifier corresponding to FEC2.

[0102] Again, for example, Figure 12 FIG. is a schematic diagram of another method for generating a label mapping identifier in the DU+ ordered mode combination provided by the embodiments of the present application. The local label switching router is a transit LSR, the upstream label switching router is an ingress LSR, and the downstream label switching router is an egress LSR. When the label distribution method and the label assignment control method are in the DU+ ordered mode, if the local label switching router receives a label withdrawal message sent by the downstream label switching router, and the label withdrawal message may include the correspondence between the second remote label and the fourth forwarding equivalence class, then delete the remote label (the second remote label) corresponding to the label withdrawal message, and generate a label mapping identifier corresponding to the fourth forwarding equivalence class, and then send a label withdrawal message to the upstream label switching router. The label withdrawal message sent by the downstream label switching router may be FEC2 + label Y, and the label withdrawal message sent by the local label switching router to the upstream label switching router is FEC2 + label B.

[0103] In the technical solution provided by the embodiments of the present application, when the label switching router receives a mode switching instruction, the method for switching the mode may include Figure 13 the steps shown in

[0104] Step S1301: In response to the received mode switching instruction, determine one by one whether at least one forwarding equivalence class carries a label mapping identifier. The mode switching instruction is a first mode switching instruction or a second mode switching instruction. The first mode switching instruction is used to instruct the label distribution device to switch from the independent mode to the ordered mode, and the second mode switching instruction is used to instruct the label distribution device to switch from the ordered mode to the independent mode. The label mapping identifier is used to indicate that the first forwarding equivalence class has not established a mapping relationship with the label assigned by the downstream label distribution device. The first forwarding equivalence class is any one of the at least one forwarding equivalence class.

[0105] In the embodiments of the present application, the label distribution device may be a label switching router, and the label switching router may be provided with a label forwarding information table, which includes at least one forwarding equivalence class.

[0106] The label switching router may traverse each forwarding equivalence class in the label forwarding information table and determine one by one whether the forwarding equivalence class carries a label mapping identifier.

[0107] For any one forwarding equivalence class (the first forwarding equivalence class) in the label forwarding information table, if the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, the label switching router then executes step S1302. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, the label switching router then executes step S1303.

[0108] Step S1302: If the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, send a first label withdrawal message to the upstream label distribution device. The first label withdrawal message is used to instruct the upstream label distribution device to release the label mapping relationship of the first forwarding equivalence class published by the label distribution device.

[0109] In the embodiments of the present application, the upstream label distribution device may be an upstream label switching router. The method for the label switching router to send the first label withdrawal message to the upstream label distribution device may include:

[0110] Step S1302-1: Obtain the first local label corresponding to the first forwarding equivalence class.

[0111] In the embodiments of the present application, the first local label corresponding to the first forwarding equivalence class may be the local label corresponding to the first forwarding equivalence class in the label forwarding information table.

[0112] For example, Figure 14Schematic diagram of a switching method provided by an embodiment of the present application. The first label withdrawal message may include a label mapping relationship between a forwarding equivalence class and a local label, such as FEC2 + label B. The first label withdrawal message may also include label mapping relationships between multiple forwarding equivalence classes and multiple local labels, such as Figure 14 The FEC2 + label B and FEC3 + label C shown. The number of forwarding equivalence classes in the first label withdrawal message depends on the number of forwarding equivalence classes carrying label mapping identifiers in the label forwarding information table. The label withdrawal message includes all forwarding equivalence classes carrying label mapping identifiers in the label forwarding information table.

[0113] Step S1302 - 2: Send a first label withdrawal message to the upstream label assignment device. The first label withdrawal message is used to instruct the upstream label assignment device to release the label mapping relationship between the first forwarding equivalence class and the first local label.

[0114] It should be understood that in the label forwarding information table corresponding to the local label switching router, the first local label is the local label corresponding to the first forwarding equivalence class, while in the label forwarding information table corresponding to the upstream label switching router, the first local label is the remote label corresponding to the first forwarding equivalence class.

[0115] For example, continue to refer to Figure 14 , the first label withdrawal message may be FEC2 + label B and FEC3 + label C.

[0116] Step S1302 - 3: Release the label mapping relationship between the first forwarding equivalence class and the first local label.

[0117] After the label switching router sends the first label withdrawal message to the upstream label switching router, it deletes the label mapping relationship between the first forwarding equivalence class and the first local label in the label forwarding information table.

[0118] For example, continue to refer to Figure 14 , if the first label withdrawal message is FEC2 + label B and FEC3 + label C, then the first local labels are label B and label C, and the label switching router can delete label B and label C in the label forwarding information table.

[0119] Step S1303: If the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, then send a first label mapping message to the upstream label assignment device. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class.

[0120] In an embodiment of the present application, the upstream label distribution device may be an upstream label switching router. The method for the label switching router to send a first label mapping message to the upstream label distribution device may include:

[0121] Step S1303-1: Determine a first local label corresponding to a first forwarding equivalence class based on a preset label distribution protocol.

[0122] In an embodiment of the present application, the preset label distribution protocol may be the LDP protocol. The label switching router may, based on the LDP protocol, allocate a label for the first forwarding equivalence class to obtain the first local label.

[0123] For example, Figure 15 is a schematic diagram of another switching method for a mode switching method provided in an embodiment of the present application. The first label mapping message may include a label mapping relationship between a forwarding equivalence class and a local label, such as FEC2 + label B. The first label mapping message may also include label mapping relationships between multiple forwarding equivalence classes and multiple local labels, such as Figure 15 the shown FEC2 + label B and FEC3 + label C. The number of forwarding equivalence classes in the first label mapping message depends on the number of forwarding equivalence classes carrying label mapping identifiers in the label forwarding information table. The label withdrawal message includes all forwarding equivalence classes carrying label mapping identifiers in the label forwarding information table.

[0124] Step S1303-2: Determine whether the current label publishing method is the downstream autonomous method.

[0125] In an embodiment of the present application, the label switching router may directly obtain the current label publishing method. The current label publishing method may be the downstream autonomous method or the downstream on-demand method. If the current label publishing method is the downstream autonomous method, the label switching router executes Step S1303-3; if the current label publishing method is the downstream on-demand method, the label switching router executes Step S1303-4.

[0126] Step S1303-3: If the current label publishing method is the downstream autonomous method, send a first label mapping message to the upstream label distribution device. The first label mapping message is used to represent that there is a label mapping relationship between the first forwarding equivalence class and the first local label.

[0127] For example, continue to refer to Figure 15 , the first label mapping message may be FEC2 + label B and FEC3 + label C.

[0128] Step S1303-4: If the current label distribution mode is not the downstream independent mode, after receiving a label request message sent by the upstream label distribution device, send the first label mapping message to the upstream label distribution device. The label request message is used to obtain the first label mapping message, and the first label mapping message is used to represent the label mapping relationship between the first forwarding equivalence class and the first local label.

[0129] For example, after receiving a label request message sent by the ingress LSR, the transit LSR may send the first label mapping message FEC2 + label B and FEC3 + label C to the ingress LSR.

[0130] In the technical solution provided by the embodiments of the present application, the label distribution device can, after receiving a mode switching instruction, determine one by one whether at least one forwarding equivalence class carries a label mapping identifier. The mode switching instruction is a first mode switching instruction or a second mode switching instruction. The first mode switching instruction is used to instruct the label distribution device to switch from the independent mode to the ordered mode, and the second mode switching instruction instructs the label distribution device to switch from the ordered mode to the independent mode. The label mapping identifier is used to represent that the first forwarding equivalence class has not established a mapping relationship with the label assigned by the downstream label distribution device. The first forwarding equivalence class is any one of at least one forwarding equivalence class. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, then send a first label withdrawal message to the upstream label distribution device. The first label withdrawal message is used to instruct the upstream label distribution device to release the label mapping relationship of the first forwarding equivalence class published by the label distribution device. If the first forwarding equivalence class carries a label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, then send a first label mapping message to the upstream label distribution device. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class. The label distribution device can smoothly switch the label distribution control mode without interrupting the session between label switching routers, so as to update the label switching path in a timely manner, avoid large-scale oscillations in the entire network, and improve the reliability of the network.

[0131] In some embodiments, during the process of switching the label distribution device from the independent mode to the ordered mode, it can be determined one by one whether each forwarding equivalence class in the label forwarding information table carries a label mapping identifier to implement the mode switching. For any one forwarding equivalence class in the label mapping information table, the processing flow may include Figure 16 the steps shown as follows:

[0132] Step S1601: Obtain the first forwarding equivalence class.

[0133] The first forwarding equivalence class is any one of at least one forwarding equivalence class.

[0134] Step S1602: Determine whether the first forwarding equivalence class carries a label mapping identifier.

[0135] In the embodiments of the present application, the method for the label distribution device to determine whether the first forwarding equivalence class carries a label mapping identifier can refer to Figure 13 In the corresponding embodiments, the method for the label switching router to determine whether the first forwarding equivalence class carries a label mapping identifier will not be elaborated herein.

[0136] If the first forwarding equivalence class carries a label mapping identifier, then execute step S1603; if the first forwarding equivalence class does not carry a label mapping identifier, then end the processing of the first forwarding equivalence class.

[0137] Step S1603: Send a first label withdrawal message to the upstream label distribution device, and release the label mapping relationship between the first forwarding equivalence class and the first local label.

[0138] After the label distribution device sends the first label withdrawal message to the upstream label distribution device, it releases the label mapping relationship between the first forwarding equivalence class and the first local label, and ends the processing of the first forwarding equivalence class.

[0139] The method for the label distribution device to send the first label withdrawal message to the upstream label distribution device can refer to Figure 13 In the corresponding embodiments, the method for the label switching router to send the first label withdrawal message to the upstream label distribution device will not be elaborated herein.

[0140] In some embodiments, during the process of switching the ordered mode to the independent mode, the label distribution device can determine whether each forwarding equivalence class in the label forwarding information table carries a label mapping identifier one by one to implement the mode switching. For any one forwarding equivalence class in the label mapping information table, the processing flow may include Figure 17 the steps shown as follows:

[0141] Step S1701: Obtain the first forwarding equivalence class.

[0142] The first forwarding equivalence class is any one of at least one forwarding equivalence class.

[0143] Step S1702: Determine whether the first forwarding equivalence class carries a label mapping identifier.

[0144] In the embodiments of the present application, the method for the label distribution device to determine whether the first forwarding equivalence class carries a label mapping identifier can refer to Figure 13 In the corresponding embodiments, the method for the label switching router to determine whether the first forwarding equivalence class carries a label mapping identifier will not be elaborated herein.

[0145] If the first forwarding equivalence class carries the label mapping identifier, step S1703 is executed. If the first forwarding equivalence class does not carry the label mapping identifier, the processing of the first forwarding equivalence class is terminated.

[0146] Step S1703: Determine a first local label corresponding to the first forwarding equivalence class.

[0147] In the embodiment of the present application, the method for the label allocation device to determine the first local label corresponding to the first forwarding equivalence class can refer to Figure 13 In the corresponding embodiment, the method by which the label switching router determines the first local label corresponding to the first forwarding equivalence class is not described in detail in this application.

[0148] Step S1704: Determine whether the current label publishing mode is the downstream autonomous mode.

[0149] If the current label publishing mode is the downstream autonomous mode, step S1705 is executed; if the current label publishing mode is not the downstream autonomous mode, step S1706 is executed.

[0150] In the embodiment of the present application, the method for the label distribution device to determine whether the current label issuance mode is the downstream autonomous mode can refer to Figure 13 In the corresponding embodiment, the method by which the label switching router determines whether the current label publishing mode is the downstream autonomous mode is not described in detail in this application.

[0151] Step S1705: Send a first label mapping message to the upstream label distribution device.

[0152] The method for the label distribution device to send the first label mapping message to the upstream label distribution device can refer to Figure 13 In the corresponding embodiment, the method in which the label switching router sends the first label mapping message to the upstream label distribution device is not described in detail in this application.

[0153] Step S1706: After receiving the label request message sent by the upstream label allocation device, a first label mapping message is sent to the upstream label allocation device. The label request message is used to obtain the first label mapping message.

[0154] After receiving the label request message sent by the upstream label allocation device, the label allocation device sends the first label mapping message to the upstream label allocation device. Figure 13 In the corresponding embodiment, the method in which the label switching router sends the first label mapping message to the upstream label allocation device after receiving the label request message sent by the upstream label allocation device is not described in detail in this application.

[0155] It should be understood that, on the premise of no logical conflict, the above-mentioned application embodiments can be combined and implemented with each other to meet the actual application requirements. The specific embodiments or implementation schemes obtained after these combinations still fall within the protection scope of this application.

[0156] Corresponding to the mode switching method in the above embodiments, an embodiment of this application provides a mode switching device. The mode switching device can be a label allocation device. The label allocation device is provided with a label forwarding information table, and the label forwarding information table includes at least one forwarding equivalence class. This mode switching device can be implemented by software, hardware, or a combination of both to become part or all of a computer device, and is used to execute the steps in the mode switching method in the above embodiments.

[0157] Figure 18 FIG. shows a schematic structural diagram of a mode switching device 180 provided by an embodiment of this application. For the convenience of description, only the parts related to the embodiments of this application are shown.

[0158] Referring to Figure 18 , the device 180 includes a processing module 1810 and a sending module 1820.

[0159] The processing module 1810 is configured to, in response to a received mode switching instruction, determine one by one whether at least one forwarding equivalence class carries a label mapping identifier. The mode switching instruction is a first mode switching instruction or a second mode switching instruction. The first mode switching instruction is used to instruct the label allocation device to switch from an independent mode to an ordered mode, and the second mode switching instruction is used to instruct the label allocation device to switch from an ordered mode to an independent mode. The label mapping identifier is used to represent that the first forwarding equivalence class has not established a mapping relationship with the label allocated by the downstream label allocation device, and the first forwarding equivalence class is any one of the at least one forwarding equivalence class.

[0160] The sending module 1820 is configured to, when the first forwarding equivalence class carries a label mapping identifier, the current mode is an independent mode, and the mode switching instruction is a first mode switching instruction, send a first label withdrawal message to the upstream label allocation device. The first label withdrawal message is used to instruct the upstream label allocation device to release the label mapping relationship of the first forwarding equivalence class published by the label allocation device.

[0161] The sending module 1820 is further configured to, when the first forwarding equivalence class carries a label mapping identifier, the current mode is an ordered mode, and the mode switching instruction is a second mode switching instruction, send a first label mapping message to the upstream label allocation device. The first label mapping message includes the label mapping relationship of the first forwarding equivalence class.

[0162] In some embodiments, the sending module 1820 is specifically configured to: determine a first local label corresponding to a first forwarding equivalence class based on a preset label distribution protocol. Send a first label mapping message to an upstream label allocation device, where the first label mapping message is used to represent the label mapping relationship between the first forwarding equivalence class and the first local label.

[0163] In some embodiments, the sending module 1820 is specifically configured to: determine whether the current label distribution method is the downstream autonomous method. If the current label distribution method is the downstream autonomous method, send a first label mapping message to an upstream label allocation device.

[0164] In some embodiments, the sending module 1820 is further configured to: if the current label distribution method is not the downstream autonomous method, after receiving a label request message sent by an upstream label allocation device, send a first label mapping message to the upstream label allocation device, where the label request message is used to obtain the first label mapping message.

[0165] In some embodiments, 1820 is specifically configured to: obtain a first local label corresponding to a first forwarding equivalence class. Send a first label withdrawal message to an upstream label allocation device, where the first label withdrawal message is used to instruct the upstream label allocation device to release the label mapping relationship between the first forwarding equivalence class and the first local label. Release the label mapping relationship between the first forwarding equivalence class and the first local label.

[0166] In some embodiments, the processing module 1810 is further configured to: in response to receiving a second forwarding equivalence class addition instruction, add a second forwarding equivalence class to the label forwarding information table. Add a label mapping identifier to an entry corresponding to the second forwarding equivalence class in the label forwarding information table.

[0167] In some embodiments, the processing module 1810 is further configured to: in response to a second label mapping message sent by a downstream label allocation device, delete the label mapping identifier corresponding to a third forwarding equivalence class, where the second label mapping message is used to represent that there is a label mapping relationship between the third forwarding equivalence class and a first remote label.

[0168] In some embodiments, the processing module 1810 is further configured to: in response to a second label withdrawal message sent by a downstream label allocation device, add a label mapping identifier to a fourth forwarding equivalence class, where the second label withdrawal message is used to indicate the release of the label mapping relationship between the fourth forwarding equivalence class and a second remote label.

[0169] It should be noted that, for the information interaction, execution process, etc. between the above-mentioned devices / units, since they are based on the same concept as the method embodiments of the present application, their specific functions and the technical effects brought thereby can be specifically referred to the method embodiment part, and will not be elaborated here.

[0170] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0171] Based on the same inventive concept, an embodiment of the present application further provides an electronic device.

[0172] Figure 19 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 19 shown, the electronic device 19 of this embodiment includes: at least one processor 1910 ( Figure 19 only one is shown in the figure), a memory 1920, and a communication module 1940. A computer program 1930 that may run on the processor 1910 is stored in the memory 1920. When the processor 1910 executes the computer program 1930, it implements the steps in the embodiment of the above mode switching method, such as Figure 13 steps 1301 to 1303 shown. Alternatively, when the processor 1910 executes the computer program 1930, it implements the functions of each module / unit in the above device embodiments, such as Figure 18 the functions of the modules 1810 to 1820 shown. The communication module 1940 may be a separate communication unit for communicating with an external server or a terminal device.

[0173] The electronic device 19 may include, but is not limited to: a processor 1910 and a memory 1920. Those skilled in the art can understand that Figure 19 this is only an example of the electronic device 19, and does not constitute a limitation to the electronic device 19. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the electronic device 19 may further include an input and sending device, a network access device, a bus, etc.

[0174] The processor 1910 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0175] The memory 1920 can be an internal storage unit of the electronic device 19 in some embodiments, such as the hard disk or memory of the electronic device 19. The memory 1920 can also be an external storage device of the electronic device 19, such as a plug-in hard disk equipped on the electronic device 19, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. The memory 1920 can also include both the internal storage unit of the electronic device 19 and the external storage device. The memory 1920 is used to store an operating system, application programs, a BootLoader, data, and other programs, such as the program code of the computer program 1930. The memory 1920 can also be used to temporarily store data that has been sent or will be sent.

[0176] In addition, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example for illustration. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. In each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0177] The embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program runs on an electronic device, the electronic device is enabled to execute the steps in the above-mentioned method embodiments.

[0178] The embodiment of the present application provides a chip, the chip includes a processor and a memory, and a computer program is stored in the memory. When the computer program is executed by the processor, the steps in the above-mentioned method embodiments are implemented.

[0179] The embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device is enabled to execute the steps in the above-mentioned method embodiments.

[0180] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0181] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0182] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be assigned to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.

[0183] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0184] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0185] In the embodiments provided in this application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0186] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0188] If the integrated unit is implemented in the form of 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 present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to a large-screen device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0189] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A mode switching method, characterized in that, Applied to a label distribution device, the label distribution device is provided with a label forwarding information table, the label forwarding information table includes at least one forwarding equivalence class, and the method includes: In response to a received mode switching instruction, determining one by one whether the at least one forwarding equivalence class carries a label mapping identifier, the mode switching instruction being a first mode switching instruction or a second mode switching instruction, the first mode switching instruction being used to instruct the label distribution device to switch from an independent mode to an ordered mode, the second mode switching instruction being used to instruct the label distribution device to switch from an ordered mode to an independent mode, the label mapping identifier being used to characterize that a first forwarding equivalence class has not established a mapping relationship with a label assigned by a downstream label distribution device, and the first forwarding equivalence class being any one of the at least one forwarding equivalence class; If the first forwarding equivalence class carries the label mapping identifier, the current mode is the independent mode, and the mode switching instruction is the first mode switching instruction, then send a first label withdrawal message to the upstream label distribution device, the first label withdrawal message being used to instruct the upstream label distribution device to release the label mapping relationship of the first forwarding equivalence class published by the label distribution device; If the first forwarding equivalence class carries the label mapping identifier, the current mode is the ordered mode, and the mode switching instruction is the second mode switching instruction, then send a first label mapping message to the upstream label distribution device, the first label mapping message including the label mapping relationship of the first forwarding equivalence class.

2. The mode switching method according to claim 1, wherein The sending the first label mapping message to the upstream label distribution device includes: Based on a preset label distribution protocol, determine a first local label corresponding to the first forwarding equivalence class; Send the first label mapping message to the upstream label distribution device, the first label mapping message being used to characterize the label mapping relationship between the first forwarding equivalence class and the first local label.

3. The mode switching method according to claim 2, characterized in that, The sending the first label mapping message to the upstream label distribution device includes: Determine whether the current label publishing method is a downstream autonomous method; If the current label publishing method is the downstream autonomous method, then send the first label mapping message to the upstream label distribution device.

4. The mode switching method according to claim 3, characterized in that, The method further includes: If the current label publishing method is not the downstream autonomous method, then after receiving a label request message sent by the upstream label distribution device, send the first label mapping message to the upstream label distribution device, the label request message being used to obtain the first label mapping message.

5. The mode switching method according to claim 1, wherein The sending the first label withdrawal message to the upstream label distribution device includes: Obtain a first local label corresponding to the first forwarding equivalence class; Send the first label withdrawal message to the upstream label distribution device, the first label withdrawal message being used to instruct the upstream label distribution device to release the label mapping relationship between the first forwarding equivalence class and the first local label; Release the label mapping relationship between the first forwarding equivalence class and the first local label.

6. The mode switching method according to claim 1, wherein The method further includes: In response to the received second forwarding equivalence class addition instruction, add the second forwarding equivalence class to the label forwarding information table; Add a label mapping identifier to the entry corresponding to the second forwarding equivalence class in the label forwarding information table.

7. The mode switching method according to any one of claims 1 to 6, characterized in that, The method further includes: In response to the second label mapping message sent by the downstream label distribution device, delete the label mapping identifier corresponding to the third forwarding equivalence class, where the second label mapping message is used to represent that there is a label mapping relationship between the third forwarding equivalence class and the first remote label.

8. The mode switching method according to claim 7, wherein The method further includes: In response to the second label withdrawal message sent by the downstream label distribution device, add a label mapping identifier to the fourth forwarding equivalence class, where the second label withdrawal message is used to indicate the release of the label mapping relationship between the fourth forwarding equivalence class and the second remote label.

9. An electronic device, characterized in that, Comprising a processor and a memory, the processor is configured to execute a computer program stored in the memory to implement the mode switching method described in any one of claims 1-8 above.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the mode switching method described in any one of claims 1-8 above.