CN111726291B - Path switching method and network equipment - Google Patents

Path switching method and network equipment Download PDF

Info

Publication number
CN111726291B
CN111726291B CN201910817261.5A CN201910817261A CN111726291B CN 111726291 B CN111726291 B CN 111726291B CN 201910817261 A CN201910817261 A CN 201910817261A CN 111726291 B CN111726291 B CN 111726291B
Authority
CN
China
Prior art keywords
session
path
module
target
bfd
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910817261.5A
Other languages
Chinese (zh)
Other versions
CN111726291A (en
Inventor
郭道荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201910817261.5A priority Critical patent/CN111726291B/en
Publication of CN111726291A publication Critical patent/CN111726291A/en
Application granted granted Critical
Publication of CN111726291B publication Critical patent/CN111726291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/124Shortest path evaluation using a combination of metrics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The application provides a path switching method and network equipment, wherein the network equipment comprises a BFD module and a forwarding module, when the BFD module detects that a first path between the network equipment and opposite-end network equipment is in fault, the BFD module determines a session type of a target session for detecting whether the first path is in fault; if the session type of the target session is a first type, the BFD module sends a session identifier of the target session to the forwarding module; the forwarding module determines a flow selection table entry corresponding to the session identifier in a flow selection table for guiding flow forwarding, and updates a flow selection path recorded in the flow selection table entry to be a second path, where the second path is at least one path other than the first path, and the second path is used for carrying a service flow, so that when a communication path carrying the current service flow fails, a communication path can be quickly selected to recover flow forwarding between two network devices.

Description

Path switching method and network equipment
Technical Field
The present application relates to the field of network communications, and in particular, to a path switching method and a network device.
Background
In order to ensure reliable transmission of traffic between network devices, multiple communication paths are typically established between two network devices. When the communication path carrying the current traffic flow fails, the network device may select another communication path from the established multiple communication paths for traffic forwarding. The faster the communication path selection speed, the shorter the time for traffic disruption between the two network devices.
Therefore, when a communication path carrying the current traffic flow fails, how to quickly select the communication path to recover the traffic forwarding between the two network devices is very important.
Disclosure of Invention
In view of this, the present application provides a path switching method and a network device, so as to achieve that when a communication path carrying a current service flow fails, a communication path can be quickly selected to recover traffic forwarding between two network devices.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of the present application, a path switching method is provided, where the method is applied to a network device, the network device includes a Bidirectional Forwarding Detection (BFD) module and a forwarding module, and the method includes:
when the BFD module detects that a first path between the network equipment and opposite-end network equipment fails, the BFD module determines a session type of a target session for detecting whether the first path fails;
if the session type of the target session is a first type, the BFD module sends a session identifier of the target session to the forwarding module;
and the forwarding module determines a flow selection table entry corresponding to the session identifier in a flow selection table for guiding flow forwarding, and updates a flow selection path recorded in the flow selection table entry to be a second path, wherein the second path is at least one path other than the first path, and the second path is used for carrying service flows.
Optionally, the method further includes:
the forwarding module sends a session identifier of the target session to the BFD module;
and after receiving the session identifier of the target session, the BFD module transmits a Down event to a driving module of a control plane, wherein the Down event comprises the session identifier of the target session.
Optionally, the updating the stream selection path recorded in the stream selection table entry to be a second path includes:
if the flow selection path recorded in the flow selection entry is the first path, if there is another path between the network device and the opposite-end network device, updating the flow selection path to be the other path, where the other path is the second path, and if there are multiple other paths between the network device and the opposite-end network device, updating the flow selection path to be one of the multiple other paths, where one of the multiple other paths is the second path;
if the stream selection path recorded in the stream selection entry is multiple equal cost paths including the first path, deleting the first path, where the paths of the multiple equal cost paths except the first path are the second path.
Optionally, the sending, by the BFD module, the session identifier of the target session to the forwarding module includes:
the BFD module adds a session identifier of the target session to a first sending set;
the BFD module sends a notification message to the forwarding module when a first timer corresponding to the first sending set is overtime; the notification message includes a plurality of session identifications in the first transmission set.
Optionally, the sending module sends the session identifier of the target session to the BFD module, including:
the forwarding module sends the notification message to the BFD module;
the transmitting the Down event to the driving module of the control plane includes:
the BFD module receives the notification message, acquires the plurality of session identifiers from the notification message, and adds the Down events corresponding to the plurality of session identifiers to a second sending set;
and if the second timer corresponding to the second sending set is overtime, the BFD module selects a target Down event meeting the sending condition from the Down events in the second sending set, and transmits the target Down event to a driving module of a control plane.
Optionally, the sending condition includes at least one of:
the sending time corresponding to the Down event in the second sending set is reached;
the time for the Down event in the second transmission set to be added to the second transmission set is greater than a first threshold.
Optionally, the method further includes:
and the driving module receives the Down event transmitted by the BFD module, and transmits the Down event to a control module of a control plane when determining that the session type is a first type according to the session identifier of the session included by the Down event.
Optionally, the method further includes:
if the session type of the target session is a second type, the BFD module transmits a Down event to a driving module of a control plane; the Down event comprises a session identification of the target session;
after determining that the target session is a second type session based on the Down event, the driving module determines the second path corresponding to the session identifier of the target session, and transmits an update message to a forwarding module, wherein the update message includes the session identifier of the target session and the identifier of the second path;
and the forwarding module receives the update message and updates the flow selection path in the flow selection table entry to be the second path.
Optionally, the method further includes:
if the session type of the target session is a third type, the BFD module transmits a Down event to a driving module of a control plane; the Down event comprises a session identification of the target session;
after determining that the target session is a third type session based on the Down event, the driving module sends the Down event to a control module of the control plane;
the control module determines the second path corresponding to the target session and transmits the identifier of the second path to the driving module;
the driving module generates a first flow selection table item corresponding to the target session, and transmits the first flow selection table item to the forwarding module, wherein the first flow selection table item comprises a session identifier of the target session and an identifier of the second path;
and the forwarding module updates the flow selection path corresponding to the target session in the second flow selection table item corresponding to the target session to be the second path according to the first flow selection table item.
Optionally, the method further includes:
when the BFD module receives a target protocol message comprising a P mark or an F mark, determining a second target session corresponding to the target protocol message;
the BFD module detects whether the target protocol message corresponding to the second target session exists in a preset third sending set or not;
if the target protocol message exists in the third sending set, the BFD module adopts the received target protocol message to cover the target protocol message existing in the third sending set;
if the target protocol message does not exist, the BFD module adds the received target protocol message to the third sending set;
and when a third timer corresponding to a third sending set is overtime, the BFD module transmits a target protocol message corresponding to each session in the third sending set to a control plane.
According to a second aspect of the present application, there is provided a network device comprising a bidirectional forwarding detection, BFD, module and a forwarding module;
the BFD module is used for determining a session type of a target session for detecting whether a first path between the network device and an opposite terminal network device fails when the first path between the network device and the opposite terminal network device fails; if the session type of the target session is a first type, sending a session identifier of the target session to the forwarding module;
the forwarding module is configured to determine, in a flow selection table for guiding traffic forwarding, a flow selection entry corresponding to the session identifier, and update a flow selection path recorded in the flow selection entry to be a second path, where the second path is at least one path other than the first path, and the second path is used for carrying a service flow.
Optionally, the forwarding module is further configured to send a session identifier of the target session to the BFD module;
the BFD module is further configured to transmit a Down event to a driving module of a control plane after receiving the session identifier of the target session, where the Down event includes the session identifier of the target session.
Optionally, when the flow selection path recorded in the flow selection entry is updated to be the second path, the forwarding module is specifically configured to, if the flow selection path recorded in the flow selection entry is the first path, if there is another path between the network device and the opposite-end network device, update the flow selection path to be the other path, where the other path is the second path, and if there are multiple other paths between the network device and the opposite-end network device, update the flow selection path to be one of the multiple other paths, where one of the multiple other paths is the second path;
if the stream selection path recorded in the stream selection entry is multiple equal cost paths including the first path, deleting the first path, where the paths of the multiple equal cost paths except the first path are the second path.
Optionally, the BFD module is specifically configured to add the session identifier of the target session to a first sending set when sending the session identifier of the target session to the forwarding module; when a first timer corresponding to the first sending set is overtime, sending a notification message to the forwarding module; the notification message includes a plurality of session identifications in the first transmission set.
Optionally, the forwarding module is specifically configured to send the notification message to the BFD module when sending the session identifier of the target session to the BFD module;
the BFD module, when transmitting the Down event to the driver module of the control plane, is specifically configured to receive the notification message, obtain the plurality of session identifiers from the notification message, and add the Down event corresponding to the plurality of session identifiers to a second sending set; and if the second timer corresponding to the second sending set is overtime, selecting a target Down event meeting the sending condition from the Down events in the second sending set, and transmitting the target Down event to a driving module of a control plane.
Optionally, the sending condition includes at least one of:
the sending time corresponding to the Down event in the second sending set is reached;
the time for the Down event in the second transmission set to be added to the second transmission set is greater than a first threshold.
Optionally, the network device further includes: a driving module located on the control plane of the network device;
the driving module is configured to receive the Down event transmitted by the BFD module, and transmit the Down event to a control module of a control plane when determining that the session type is the first type according to a session identifier of a session included in the Down event.
Optionally, the BFD module is further configured to transmit a Down event to a driving module of a control plane if the session type of the target session is a second type; the Down event comprises a session identification of the target session;
the driving module is configured to determine the second path corresponding to the session identifier of the target session after determining that the target session is a second type session based on the Down event, and transmit an update message to the forwarding module, where the update message includes the session identifier of the target session and an identifier of the second path;
the forwarding module is configured to receive the update message, and update the flow selection path in the flow selection entry to the second path.
Optionally, the BFD module is further configured to transmit a Down event to a driving module of a control plane if the session type of the target session is a third type; the Down event comprises a session identification of the target session;
the driving module is configured to send the Down event to a control module of the control plane after determining that the target session is a third type session based on the Down event;
the control module is configured to determine the second path corresponding to the target session, and transmit an identifier of the second path to the driving module;
the driving module is configured to generate a first flow selection entry corresponding to the target session, and transmit the first flow selection entry to the forwarding module, where the first flow selection entry includes a session identifier of the target session and an identifier of the second path;
and the forwarding module is configured to update, according to the first flow selection entry, a flow selection path corresponding to the target session in a second flow selection entry corresponding to the target session to the second path.
Optionally, the BFD module is further configured to determine, when receiving a target protocol packet including a P tag or an F tag, a second target session corresponding to the target protocol packet; detecting whether the target protocol message corresponding to the second target session exists in a preset third sending set or not; if the third sending set exists, the received target protocol message is adopted to cover the target protocol message existing in the third sending set; if the target protocol message does not exist, adding the received target protocol message to the third sending set; and transmitting the target protocol message corresponding to each session in the third sending set to a control plane when a third timer corresponding to the third sending set is overtime.
As can be seen from the above description, since the first type of session has the highest priority and the requirement for packet loss delay is the smallest, the module in the hardware layer is used to complete the update of the flow selection entry first and then perform the path switching process, so that the time period from the failure of the first path to the update of the flow selection entry can be greatly reduced, the packet loss amount occurring in the time period from the failure of the first path to the update of the flow selection entry can be effectively reduced, and the requirements for the first type of session for small packet loss delay and the like can be better adapted.
Drawings
Fig. 1 is a networking schematic diagram of a backbone network according to an exemplary embodiment of the present application;
fig. 2 is a block diagram of an internal system of a forwarding device that implements switching between active and standby PWs based on BFD according to an exemplary embodiment of the present application;
fig. 3 is a flow chart of a path switching method according to an exemplary embodiment of the present application;
fig. 4 is a flowchart illustrating a first handover mode according to an exemplary embodiment of the present application;
fig. 5 is a flowchart illustrating a second handover method according to an exemplary embodiment of the present application;
fig. 6 is a flowchart illustrating a third handover mode according to an exemplary embodiment of the present application;
fig. 7 is a flowchart illustrating another handover mode one according to an exemplary embodiment of the present application;
fig. 8 is a schematic diagram of a network device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
It should be noted that the above network device refers to a device deployed in a network, for example, the network device may include a forwarding device, such as a switch, a router, and the like, and may also include other types of devices. The network device is only exemplified and not particularly limited herein.
The path switching method provided by the application can be applied to a scene that multiple paths exist between two network devices, and the application does not specifically limit networking suitable for the scene.
For example, the networking suitable for the scenario may be a backbone network, the two network devices may be PE devices, and the multiple paths may include a main path and at least one standby path, or may include multiple equivalent paths, where the main path may be a main PW (Pseudowire) and the standby path may be a standby PW. Of course, the networking for which the scenario applies may also be other types of networking.
The following describes a network to which this scenario applies as a backbone network.
Referring to fig. 1, fig. 1 is a schematic networking diagram of a backbone network according to an exemplary embodiment of the present application.
The backbone network may include: PE (Provider Edge) 101, PE102, PE103, and PE 104. The PE101 is connected to a Customer Edge (CE) 101, the PE104 is connected to the CE102, and the CE101 and the CE102 can implement message interaction with each other through the backbone network.
PE101 is connected to PE102, PE102 is connected to PE104, and a link between PE101 and PE102 and links between PE102 and PE104 together form a main PW.
PE101 is connected to PE103, PE103 is connected to PE104, and a link between PE101 and PE103 and a link between PE103 and PE104 together form a standby PW.
Under normal conditions, messages between the CE101 and the CE102 interact through a main PW in a backbone network, for example, the CE101 sends a message to the PE101, the PE101 sends a message to the PE102 through the main PW, the PE102 sends a message to the PE104 through the main PW, and the PE104 sends a message to the CE 102.
However, when PE101 detects that the primary PW of PE102 is unavailable, PE101 starts the backup PW, and forwards the packet sent by CE101 to PE103 through the backup PW, and then PE103 forwards the packet to PE104, and PE104 forwards the packet to PE 102.
Therefore, the inventor believes that it is important how to quickly select the backup PW to resume traffic forwarding and reduce traffic interruption when PE101 detects a failure of the primary PW of PE 102.
In view of this, the present application provides a path switching method, which is used to implement fast path switching for a session with a high requirement on packet loss and time delay. In addition, the path switching method provided by the application can also realize different path switching processing for sessions with different packet loss delays, and meet the packet loss delay of each session.
The session of the present application is a BFD (Bidirectional Forwarding Detection) session, which is not described in detail below.
Before introducing the method provided by the present application, a system block diagram of the network device and the table entries related to the present application are introduced.
Referring to fig. 2, fig. 2 is a block diagram illustrating an internal system of a network device implementing path switching based on BFD according to an exemplary embodiment of the present application.
The internal system of the network device includes: a forwarding plane and a control plane.
1. Forwarding plane
The forwarding plane is generally comprised of hardware and may therefore also be referred to as a hardware layer.
The hardware layer comprises: a BFD module and a forwarding module. Data can be exchanged between the BFD module and the forwarding module.
1) A BFD module: the BFD module may be implemented by an FPGA (Field-Programmable Gate Array) or a FIRMWARE hardware, and may of course be implemented by one or more cores of a CPU (Central Processing Unit), and the implementation manner of the BFD module is not specifically limited herein.
2) A forwarding module: the forwarding module may be implemented by a forwarding chip, such as an NP (Network Processor) chip, and the implementation of the forwarding module is not specifically limited herein.
2. Control plane
The control plane may include: the device comprises a driving module and a control module.
2.1 drive module
The driver module may also be referred to as a driver layer.
The driver module may include a plurality of driver sub-modules, such as a BFD management driver sub-module, a switching platform driver sub-module, a fast switching driver sub-module, and a platform adaptation sub-module. The driving module is only illustrated by way of example and is not particularly limited.
2.2 control Module
The control module may also be referred to as a platform software layer.
The platform software layer may include: the system comprises a platform software kernel mode module, a platform software user mode module and a routing protocol family.
1) A platform software kernel mode module:
the kernel mode module of the platform software comprises: a BFD kernel mode module and a switching protocol kernel mode module.
For example, when the Switching Protocol is an MPLS (Multi-Protocol Label Switching) Protocol, the Switching Protocol kernel module may be an MPLS kernel module.
2) Platform software user state module
The platform software user state module comprises: a BFD user mode module and an exchange protocol user mode module.
For example, when the switching protocol is an MPLS protocol, the switching protocol user mode module may be an MPLS user mode module.
The following describes the table entries related to the present application.
1. Session information table
The session information table records the session type, session information, and the like of each session.
For example, the session information table includes: session identification, validity, session type, storage address of session information, etc.
As shown in table 1, table 1 is an exemplary session information table.
Figure BDA0002186672280000111
Table 11) Sid (Session ID, Session identification): and the BFD session identifier is unique.
2) Valid: the validity of the session information table entry is shown, when the Valid value is 1, the session information table entry is shown to be Valid, and when the Valid value is 0, the session information table entry is shown to be invalid.
3) Type (session Type): indicating the session type of the session.
When the Type value is 1, the session Type of the session is the first Type. When the Type value is 2, the session Type of the session is indicated as a second Type. When the Type value is 3, the session Type of the session is indicated as a third Type.
Wherein the first type includes: the highest priority session. For example, a session with a packet loss delay less than or equal to 20ms, a packet sending time interval of 3.3ms, and a detection number of times of 3 is required. The detection times are times of detecting that no response is received every preset time after the packet is sent, and determining that the response is overtime if no response is received after the detection times are reached.
For example, assuming that the number of detections is 3, after a preset time period from the time of packet transmission, it is detected for the first time whether a response is received. If not, after the preset time from the first detection, whether the response is received is detected for the second time. And if the response is still received, detecting whether the response is received for the third time after the preset time length from the second detection. And if no response is received in the three detections, determining that the response is overtime.
The second type includes: the session with the next highest priority. For example, the packet loss delay is required to be greater than 20 ms.
The third type includes: the session with the lowest priority. For example, a session of path switching can only be performed by the platform software layer of the network device.
Of course, when the Type takes on other values, it indicates that the Type field is invalid.
4) Address (session information Address): indicating a storage address where the session information is stored. Through the session information address, complete information of the session can be acquired.
The session information entry shown in the second row of table 1 is taken as an example for explanation.
The session information entry shown in the second row of table 1 indicates: the session type of the session with the session identifier of 0 is the first type, the address of the session information is address 1, and the session table entry is an effective session table entry.
It should be noted that the session information table is only exemplarily described here. Of course, the session information table may also include other contents according to actual situations, and is not specifically limited herein.
The BFD module shown in fig. 2 stores the session information table, and the BFD management driver submodule, the platform software kernel mode module, and the platform software user mode module also store the session information table.
The following briefly describes the establishment procedure of the session information table.
After the two network devices successfully establish a session, each network device may acquire session information of the session, where the acquired session information includes: the session index parameters comprise packet loss delay, packet sending time interval, detection times, path number and application identification for initiating the session. The network device may determine the session type based on the session index parameter included in the session information. The session information table is then established based on the session information, and the session type.
The session index parameter may be obtained from configuration information of the device, and here, the session index parameter is only exemplarily described and is not specifically limited.
Of course, in further embodiments, after two network devices establish a session, a developer may determine the session type of the established session. Then, the network device generates the session information table based on the session information of the established session and the determined session type.
Here, the generation process of the session information table is merely exemplary and is not particularly limited.
It should be understood that the session information table may also be configured by a skilled person.
2. Flow selection table
The stream selection table includes: session identification and flow selection path.
As shown in table 2, table 2 is an exemplary flow selection table.
Session identification Stream selection path
TABLE 2
The flow selection path is used for recording the path identifier of the current flow forwarding.
The stream selection path may be one path or a plurality of equal cost paths. The content of the stream selection path record of the stream selection entry is not specifically limited herein.
For example, multiple paths established between two network devices include: path 1, path 2, and path 3.
If the path 1 is a path for which two network devices currently forward traffic, the path 2 and the path 3 are used as backup paths when the path 1 fails, and the path 1 carries a service flow, a flow selection entry corresponding to the session 1 is shown in table 3.
Session identification Stream selection path
Session 1 Route 1
TABLE 3
If the path 1, the path 2, and the path 3 are equivalent paths for two network devices to currently forward traffic, and the three paths jointly carry a service flow, the flow selection entry corresponding to the session 1 is shown in table 4.
Figure BDA0002186672280000131
TABLE 4
The following describes the path switching method provided in the present application in detail.
According to the method and the device, the session is divided into different session types according to the priority of the session, when a first path between the network device and the opposite-end network device fails, a BFD module of a hardware layer of the network device can determine the session type of a target session for detecting whether the first path fails, and a switching mode adaptive to the session type is adopted to instruct a forwarding module to update a stream forwarding path in a stream selection table entry corresponding to the target session into a second path.
In the embodiment of the present application, the session types may include: a session of a first type, a session of a second type, and a session of a third type.
For convenience of description, the path switching method corresponding to the first type session is referred to as a first switching method, the path switching method corresponding to the second type session is referred to as a second switching method, and the path switching method corresponding to the third type session is referred to as a third switching method.
1. The switching mode is as follows: the hardware layer module completes the updating of the flow selection list item first and then carries out the path switching process
Referring to fig. 3, fig. 3 is a flowchart illustrating a path switching method according to an exemplary embodiment of the present application, where the method may be applied to a network device, and the network device may include an internal system as shown in fig. 2.
Step 301: when the BFD module detects that a first path between the network device and the opposite-end network device fails, the BFD module determines a session type of a target session for detecting whether the first path fails.
Step 3011 to step 3012, step 301, and the like are explained in detail below.
Step 3011: the BFD module detects a first path fault between the network device and the opposite terminal network device.
When the method is realized, the BFD module transmits a keep-alive message to the opposite terminal network equipment, and if the BFD module does not receive the keep-alive message transmitted by the opposite terminal network equipment within a preset time length, the BFD module determines that a first path between the network equipment and the opposite terminal network equipment has a fault.
Alternatively, the first and second electrodes may be,
after the opposite-end network device detects a first path fault between the network device and the opposite-end network device, the opposite-end network device sends a Down message for indicating the first path fault to the network device.
Therefore, after receiving a Down message sent by the opposite terminal, the forwarding module of the network device can forward the Down message to the BFD module, and after receiving the Down message, the BFD module can determine the first path fault between the network device and the opposite terminal network device.
Of course, only step 3011 is exemplarily described here, and it may also be used to "detect the first path failure between the present network device and the peer network device" in other ways, which is not specifically limited herein.
Step 3012: when the BFD module detects that a first path between the network device and an opposite terminal network device fails, the BFD module determines a session type of a target session for detecting whether the first path fails.
The BFD module stores the session information table, which records the related information of each session for detecting whether the first path is failed. When the BFD module detects that the first path between the network device and the peer network device is failed, the BFD module may sequentially read each session information entry in the session information table, use the session indicated by the session identifier recorded in the session information entry as a target session, and use the session type recorded in the session information entry as the session type of the target session.
For example, as shown in table 1, the BFD module may read the session information entry shown in the second row of table 1, take the session with Sid of 0 as the target session, and take the session type (i.e. 1) of the session information entry shown in the second row as the session type of the target session.
The target session refers to a session indicated by any session information entry in the session information table.
In addition, the BFD module may further instruct the forwarding module to send a Down message for indicating the first path failure to the peer network device within a preset time after the first path failure is detected.
Step 302: and if the session type of the target session is the first type, the BFD module sends the session identification of the target session to the forwarding module.
Step 303: and the forwarding module determines a flow selection table entry corresponding to the session identifier in a flow selection table for guiding flow forwarding, and updates a flow selection path recorded in the flow selection table entry to be a second path, wherein the second path is at least one path other than the first path and is used for bearing the service flow.
Because the first type of session has the highest priority and the minimum requirement on packet loss delay, the updating of the flow selection table entry is completed by adopting a module of a hardware layer, and then the path switching process is carried out, so that the time from the first path fault to the updating of the flow selection table entry can be greatly reduced, the packet loss amount generated in the time from the first path fault to the updating of the flow selection table entry can be effectively reduced, and the requirements on the first type of session on small packet loss delay and the like can be better adapted.
An embodiment of the present application will be described in detail below with reference to fig. 4.
Referring to fig. 4, fig. 4 is a flowchart illustrating a path switching method for a first type session according to an exemplary embodiment of the present application, where the flowchart may include steps 401 to 405.
Step 401: and the BFD module sends the session identification of the target session to the forwarding module.
In order to reduce the interactive messages between the BFD module and the forwarding module and reduce the processing pressure of the forwarding module and the BFD module hardware system, the BFD module may send a plurality of session identifiers including a target session identifier to the forwarding module through one message.
Step 401 is explained in detail below through step 4011 to step 4012.
Step 4011: and the BFD module adds the session identification of the target session to a preset first sending set.
The embodiment of the application configures a corresponding first timer for the first sending set. The timeout duration of the first timer may be set according to parameters such as packet loss delay of the first type session. For example, when the first type of session requires a packet loss delay less than 20ms, the timeout duration of the timer is 1 ms.
Step 4012: and the BFD module constructs a notification message based on a plurality of session identifiers in the current first sending set when a first timer corresponding to the first sending set times out, and sends the notification message to the forwarding module.
During implementation, the BFD module may monitor whether a first timer corresponding to the first sending set is overtime, and wait for the timer to be overtime if the first timer is not overtime.
If the first timer is overtime, detecting whether the first sending set is empty, and if the sending set is empty, not sending the session identification to the forwarding module. And if the sending set is not empty, constructing a notification message based on the plurality of session identifications in the current sending set, and sending the notification message to a forwarding module.
It should be noted that the number of the selected session identifiers may be selected according to the carrying capability of the notification message.
For example, a notification message can carry 256 session ids at most, when the number of session ids in the sending set exceeds 256, the first 256 session ids in the sending set can be constructed as one notification message to be sent to the forwarding module, and the remaining sessions can be constructed as another notification message to be sent to the forwarding module. When the number of session identifiers of the transmission set is less than 256, all session identifiers of the transmission set can be constructed into a notification message to be sent to the forwarding module. The examples are illustrative only and not intended to be limiting.
The advantage of sending the session identifier to the forwarding module in the manner of steps 4011 to 4012 is that: because the BFD module constructs a plurality of session identifications into a notification message to be sent to the forwarding module, but not sends each session identification to the forwarding module respectively, the interactive information between the BFD module and the forwarding module is greatly reduced, so that the hardware resources of the BFD module and the forwarding module can be saved, and the working performance of the BFD module and the forwarding module can be improved.
Wherein the notification message may be based on a private protocol notification message. For example, the BFD module and the forwarding module may both agree on a message format, and may interact with each other in the message format. Of course, the notification message may also be based on some common protocol.
Step 402: and the forwarding module determines a flow selection table item corresponding to the session identifier in a flow selection table for guiding flow forwarding, and updates a flow selection path recorded in the flow selection table item to be a second path.
Step 402 is described in detail below through steps 4021 to 4022.
Step 4021: and the forwarding module determines a flow selection table item corresponding to the session identifier in a flow selection table for guiding flow forwarding.
In implementation, the forwarding module may extract a plurality of session identifiers from the notification message.
For each session identifier, the forwarding module may look up a flow selection table entry containing the session identifier in the flow selection table.
Step 4022: the forwarding module may update the flow forwarding path recorded in the searched flow selection entry to the second path.
The application scene one:
1) when the stream selection path recorded in the found stream selection entry is the first path, if there is another path between the network device and the opposite-end network device, the stream selection path is updated to be another path. This other path is now the second path.
For example, assume that the local network device and the peer network device establish two paths, path 11 and path 12. Assuming that the path 11 fails, a target session for detecting whether the path 11 fails is the session 11.
Assume that the looked-up flow selection entry is as shown in table 5.
Session identification Stream selection path
Session 11 Path 11
TABLE 5
The forwarding module of the present network device updates the flow selection path shown in table 5 from path 11 to path 12. In this case, the path 12 is the second path.
The updated stream forwarding table entry corresponding to session 11 is shown in table 6.
Session identification Stream selection path
Session 11 Path 12
TABLE 6
2) When the flow selection path recorded in the found flow selection table entry is the first path, if a plurality of other paths exist between the network device and the opposite-end network device, the flow selection path is updated to be one of the plurality of other paths. One of the other paths is a second path.
For example, assume that three paths, path 11, path 12, and path 13, are established by the present network device and the peer network device. Assuming that the path 11 fails, a target session for detecting whether the path 11 fails is the session 11.
Assume that the looked-up flow selection entry is as shown in table 5.
When the path 11 fails, the forwarding module of the present network device may select one path from the path 12 and the path 13.
Assuming that the selected path is path 13, the forwarding module then updates the flow selection path shown in table 5 from path 11 to path 13. Path 13 is now the second path described above.
The updated stream forwarding table entry corresponding to session 11 is shown in table 7.
Session identification Stream selection path
Session 11 Path 13
TABLE 7
Application scenario two:
and when the stream selection path recorded in the stream selection table entry is a plurality of equivalent paths including the first path, deleting the first path. At this time, the paths other than the first path among the plurality of equal cost paths are the second path.
For example, assume that three paths, path 11, path 12, and path 13, are established by the present network device and the peer network device. Assume that path 11, path 12, and path 13 are three equal cost paths that collectively forward traffic.
Assume that the flow selection entry looked up above is as shown in table 8.
Figure BDA0002186672280000181
TABLE 8
When the path 11 fails, the forwarding module of the network device may delete the path 11 in the multiple equivalent paths shown in table 8, thereby implementing the update of the stream forwarding path. The remaining paths 12 and 13 are the second path described above.
The updated stream forwarding table entry corresponding to session 11 is shown in table 9.
Figure BDA0002186672280000191
TABLE 9
Here, the "updating of the flow forwarding path recorded in the searched flow selection entry to the second path by the forwarding module" is merely exemplarily described, and is not particularly limited.
Step 403: and the forwarding module sends the session identification of the target session to the BFD module.
After the updating of the flow selection entries corresponding to the plurality of sessions is completed, the forwarding module may send the notification message to the BFD module.
After receiving the notification message, the BFD module may delete the session identifier in the first sending set that is the same as the session identifier carried in the notification message, in order to avoid repeatedly sending the sent session identifier.
Step 404: and the BFD module sends the Down event corresponding to the session identification to a driving module of the control plane.
Step 404 is explained in detail in steps 4041 to 4043.
Step 4041: the BFD module may obtain the plurality of session identifiers from the notification message sent by the forwarding module, and add a Down event corresponding to the plurality of session identifiers to a preset second sending set.
Step 4042: if the second timer corresponding to the second sending set is overtime, the BFD module selects a target Down event meeting the sending condition from the Down events in the second sending set, and transmits the target Down event to the driving module of the control plane.
Wherein, the sending condition may include: the sending time corresponding to the Down event in the second sending set is reached; or the time that the Down event in the second transmission set is added to the second set is greater than the first threshold.
As can be seen from the above description, when the BFD module detects the failure of the first path, the BFD module does not immediately report the Down event corresponding to the target session, but delays reporting the Down event by the above manner. The benefits of delaying the reporting of the Down event are: the load of the control plane of the network equipment can be reduced, and the working performance of the control plane is improved.
The following describes different reporting modes used by different sending conditions.
1. The transmission condition is that the transmission time corresponding to the Down event in the second transmission set is reached.
The step A, BFD module may obtain the multiple session identifiers from the notification message sent by the forwarding module, and set sending time for the Down events corresponding to the multiple session identifiers respectively.
Specifically, for a session identifier, the BFD module may add a preset duration to the acquiring time of the session identifier, as the sending time of the Down event corresponding to the session identifier.
For example, the time of acquiring the session identifier 1 from the notification message is 0 time, and assuming that the preset time duration is 30ms, the sending time of the Down event corresponding to the session identifier 1 is set to 0 time +30 ms.
It should be noted that the preset time period may be set by a developer according to an empirical value, for example, the preset time period may be set to any value between 30ms and 50ms, and the preset time period is not specifically limited herein.
The Down event includes a session identifier, which is used to indicate the session Down indicated by the session identifier.
The Down event corresponding to the session identifier may be generated after the BFD module determines the target session, or may be constructed based on the session identifier after the BFD module extracts the session identifier from the notification message. Generation of the Down event corresponding to the session identifier is not specifically limited herein.
The step B, BFD module adds a plurality of Down events to the pre-defined second send set.
The second transmission set is configured with a second timer. The timeout duration of the second timer may be set according to parameters such as packet loss delay of the first type session. For example, when the first type of session requires a packet loss delay less than 20ms, the timeout duration of the second timer is 5 ms.
And step C, the BFD module detects whether the sending time of each Down event in the second sending set exceeds the current detection time when the second timer is overtime, and sends the Down event of which the time exceeds the current detection time to a driving module of the control plane.
When implemented, the BFD module may detect whether the second timer has expired. And if the second timer is not overtime, waiting for the second timer to be overtime.
And traversing each Down event in the second set if the second timer times out.
And for each Down event, if the sending time of the Down event exceeds the current detection time, sending the Down event to a driving module of the control plane.
The advantage of using steps a to C to delay the sending of the Down event is that: due to the fact that the sending time is set for the Down event corresponding to each piece of session information, and the second timer is adopted to trigger the sending of the Down event of which the sending time exceeds the current detection time, the BFD module sends the Down event to the driving module of the control plane in batches. In a particular implementation, the BFD module transmits the Down event to a BFD management driver sub-module of the driver module.
Compared with the mode that the BFD module sends all the Down events to the driving module at one time, the mode of sending the Down events to the driving module in batches can effectively reduce the workload of the driving module, and meanwhile, the driving module can send the Down events to the control module of the control plane of the network equipment in batches, so that the control module can process the Down events in batches, and the working performance of the control module and the stability of the internal system of the whole network equipment are improved.
2. The sending condition is that the time for adding the Down event in the second sending set to the second sending set is larger than a first threshold value.
In implementation, the BFD module may obtain the plurality of session identifiers from the notification message sent by the forwarding module, add the Down events corresponding to the plurality of session identifiers in a preset second sending set, and record the adding time of each Down event added in the second sending set.
When a second timer corresponding to the second sending set times out, for each Down event, the BFD module may detect whether a time difference between a current time and an adding time of the Down event is greater than a first threshold, and if so, send the Down event to a driving module of the control plane.
It should be noted that reporting the Down event to the driving module of the control plane by the BFD module means: the BFD module sends the Down event to the BFD management driver submodule of the driver layer shown in fig. 2.
Step 405: and the driving module transmits the Down event to a control module of a control plane of the network equipment when determining that the target session corresponding to the Down event is the first type session.
When the method is implemented, the BFD management driving submodule can receive a Down event sent by the BFD module. And when determining that the target session corresponding to the Down event is the first type session, the BFD management driving sub-module sends the Down event to a platform software layer of the forwarding equipment for processing the Down event.
The BFD management driving submodule stores the session information table.
After receiving the Down event, the BFD management driver sub-module may obtain the session identifier carried by the Down event.
Then, the BFD management driver sub-module may search a session information entry including the session identifier in the session information table, and determine a session type corresponding to the Down event based on the session type recorded in the searched session information entry.
And if the session type is the first type and the third type, the BFD management driving submodule sends the Down event to a platform software layer.
If the session type is the second type, the BFD management driver submodule sends the Down event to the fast-switching driver submodule of fig. 2.
In this example, the session type is the first type, and the BFD management driver submodule sends the Down event to the platform software layer.
The platform software layer may perform Down event processing on the Down event. For example, the Down event processing may include: performing protocol processing, updating public network tunnel information of the network equipment, executing a path switching process and the like.
As can be seen from the above description, since the first type of session has the highest priority and the requirement for packet loss delay is the smallest, the module in the hardware layer is used to complete the update of the flow selection entry first and then perform the path switching process, so that the time period from the failure of the first path to the update of the flow selection entry can be greatly reduced, the packet loss amount occurring in the time period from the failure of the first path to the update of the flow selection entry can be effectively reduced, and the requirements for the first type of session for small packet loss delay and the like can be better adapted.
The application also provides a path switching mode (referred to as switching mode two for short) corresponding to the second type session. In the second switching mode, the module of the driving layer completes the update of the flow selection table entry, and then the path switching process is performed.
Because the second type of session has a high priority and the packet loss delay requirement is low, the module of the driving layer is adopted to complete the automatic update of the flow selection table entry, and then the path switching process is carried out. In addition, compared with the first switching mode, the Down event corresponding to the second type session is sent to the driving layer, and the driving layer completes the automatic updating of the flow selection table entry instead of the hardware layer updating the flow selection table entry, so that the resource consumption of each module of the hardware layer can be effectively reduced.
Referring to fig. 5, fig. 5 is a flowchart illustrating a second handover method according to an exemplary embodiment of the present application, where the flowchart may include steps 501 to 503.
Step 501: when the BFD module detects that a first path between the network device and an opposite terminal network device fails, the BFD module determines a session type of a target session for detecting whether the first path fails.
For a specific implementation, refer to step 301, which is not described herein again.
Step 502: if the session type of the target session is a second type, the BFD module transmits a Down event to a driving module of a control plane; the Down event includes a session identification of the target session.
When the method is implemented, when the BFD module determines that the session type of the target session is the second type, the BFD module sends a Down event aiming at the target session to the BFD management driving sub-module.
Step 503: and after determining that the target session is a second type session based on the Down event, the driving module determines the second path corresponding to the session identifier of the target session and transmits an update message carrying the identifier of the second path to a forwarding module. And the forwarding module receives the update message and updates the flow selection path in the flow selection table entry to be the second path.
Step 503 will be described in detail below with reference to steps 5031 to 5033.
Step 5031: and after determining that the target session is a second type session based on the Down event, the BFD management driving sub-module notifies the Down event to the fast switching driving sub-module.
In implementation, after receiving a Down event, the BFD management driver sub-module may obtain a session identifier carried by the Down event.
Then, the BFD management driver sub-module may search a session information entry containing the session identifier in the session information table, and determine the session type of the target session based on the session type recorded in the searched session information entry.
When the session type of the target session is determined to be the second type, the BFD management driver sub-module may send the Down event to the fast-switch driver sub-module shown in fig. 2.
Step 5032: and the fast switching driving sub-module determines the second path corresponding to the session identifier of the target session and transmits an update message comprising the session identifier of the target session and the identifier of the second path to the forwarding module. And the forwarding module receives the update message and updates the flow selection path in the flow selection table entry to be the second path.
When the implementation is realized, a fast switching information table is configured on the fast switching driving submodule, and the fast switching information table comprises: session identification, Failover value.
The table of the fast-switching information is shown in table 3.
Sid Failover
TABLE 3
1) Sid: and (4) session identification.
2) Failover value: the switch value is switched. It may be initially initialized and subsequently updated. However, regardless of how to update, in the embodiment of the present application, when the first path operates normally, the path indicated by the Failover value in the fast switch information entry matching the BFD session for detecting whether the first path fails is different from the flow selection path recorded in the flow selection entry corresponding to the BFD session, that is: the value of Failover in the fast switching information table entry matched with the BFD session of the first path represents the second path, and the flow selection path in the flow selection table entry is the first path. Just because the Failover value in the BFD session matching of the first path is different from the flow selection path recorded by the flow selection table entry, it is only possible to update the first path in the flow selection table entry matching with the BFD session for detecting whether the first path fails to the second path recorded by the Failover in the fast switching information table entry when the first path fails, which makes the subsequent packet switch directly from the first path to the second path.
Of course, other contents may also be included in the fast-switching information table, which is only illustrated by way of example and is not specifically limited.
The second path may be a single path or a plurality of paths.
For example, two paths exist between the network device and the opposite-end network device, such as path 1 and path 2, and assuming that the first path is path 1, the second path is path 2. Alternatively, the first and second electrodes may be,
if there are path 1, path 2 and path 3, the first path is assumed to be path 1, and the second path is any one of path 2 and path 3.
The network device and the opposite terminal network device have multiple equal-cost paths, for example, there are path 1, path 2 and path 3, and these three paths are equal-cost paths. Assuming that the first path is path 1, the second path is path 2 and path 3.
The second path is only exemplified and not particularly limited herein.
In this embodiment of the present application, when determining the second path, the fast-switching driver sub-module may search a fast-switching information table entry containing the target session identifier in the fast-switching information table shown in table 3. And then acquiring a path indicated by the value of the Failover information table entry as a second path.
And the fast switching driving submodule constructs an update message comprising a target session identifier and an identifier of a second path, and transmits the update message to the switching platform driving submodule, the switching platform driving submodule transmits the update message to the forwarding module, and the forwarding module updates the stream forwarding path in the stream forwarding table entry corresponding to the target session into the second path.
And when updating, the fast switching driving sub-module updates information to the switching platform driving sub-module, and the switching platform driving sub-module updates the flow forwarding path in the flow forwarding table entry corresponding to the target session, configured on the forwarding module, to be a second path based on the updating information.
Of course, the fast-switch driver sub-module may further send the update message to the switching platform driver sub-module, the switching platform driver sub-module sends the update message to the forwarding module, and the forwarding module may update the flow forwarding path in the flow forwarding table entry corresponding to the target session to the second path based on the update message.
Here, the "updating the flow forwarding path in the flow selection entry to the second path" is only exemplarily described, and of course, the updating may be performed in other manners, which is not specifically limited herein.
In addition, after the stream selection table item is updated, the fast switching driver submodule informs the BFD management driver submodule, the BFD management driver submodule sends a Down event corresponding to the target session to the platform software layer, and the platform software layer carries out Down processing (including executing a path switching process) on the Down event.
The application also provides a path switching mode (herein, referred to as switching mode three) corresponding to the third type session.
In the third switching mode, the platform software layer module completes the path switching process.
Since the third type of session is a session in which a path switch can only be performed by the platform software layer (i.e., the control module) of the network device. Therefore, the BFD module needs to send the Down event of the third type session to the platform software layer, and the platform software layer completes the path switching process.
Referring to fig. 6, fig. 6 is a flowchart illustrating a third handover method according to an exemplary embodiment of the present application, where the flowchart may include steps 601 to 606.
Step 601: when the BFD module detects that a first path between the network device and an opposite-end network device fails, the BFD module determines a session type of a target session for detecting whether the first path fails.
For a specific implementation, refer to step 301, which is not described herein again.
Step 602: if the session type of the target session is a third type, the BFD module transmits a Down event to a driving module of a control plane; the Down event includes a session identification of the target session.
When the method is implemented, when the BFD module determines that the session type of the target session is the third type, the BFD module sends a Down event aiming at the target session to the BFD management driving sub-module.
Step 603: and after determining that the target session is a third type session based on the Down event, the driving module sends the Down event to a control module of the control plane.
In implementation, after receiving a Down event, the BFD management driver sub-module may obtain a session identifier carried by the Down event.
Then, the BFD management driver sub-module may search a session information entry containing the session identifier in the session information table, and determine the session type of the target session based on the session type recorded in the searched session information entry.
When the session type of the target session is determined to be the third type, the BFD management driver sub-module transmits a Down event of the target session to the BFD platform adaptation sub-module shown in fig. 2, and the BFD platform adaptation sub-module transmits the Down event of the target session to the platform software layer (for example, transmits the Down event of the target session to a BFD kernel module in the platform software layer).
Step 604: and the control module determines the second path corresponding to the target session and transmits the identifier of the second path to the driving module.
During implementation, after receiving the Down event, the BFD kernel mode module performs various protocol adaptations and notifies the protocol kernel mode module, and the protocol kernel mode module performs corresponding Down processing (for example, updating a public network tunnel of the PW, and notifying the switching flat driver module to update the low-layer PW).
In addition, the protocol kernel module may also determine a second path for the target session and transmit an identification for the second path to the switching platform driver sub-module.
Step 605: and the driving module generates a first flow selection table item corresponding to the target session, and transmits the first flow selection table item to the forwarding module, wherein the first flow selection table item comprises a session identifier of the target session and an identifier of the second path.
Step 606: and the forwarding module updates the flow selection path corresponding to the target session in the second flow selection table item corresponding to the target session to be the second path according to the first flow selection table item.
When the method is implemented, the switching platform driving sub-module generates a first flow selection table item corresponding to the target session based on the identifier of the second path, where the first flow selection table item includes the session identifier of the target session and the identifier of the second path, and indicates that the flow selection path corresponding to the target session is the second path.
And the switching platform driving sub-module transmits the first flow selection table item to a forwarding module, and the forwarding module updates a flow selection path corresponding to the target session in a second flow selection table item corresponding to the target session to be the second path according to the first flow selection table item.
Here, the update method is merely exemplary and is not particularly limited.
In addition, BFD protocol messages can be interacted between the network equipment and the opposite terminal network equipment. For example, if the session parameter of the peer network device changes, the peer network device may periodically send a BFD protocol packet (P packet for short) with a P flag to the local network device to notify the local network device that the session parameter changes.
The network device can send a BFD protocol message (herein referred to as F message) with an F flag to the opposite-end network device after receiving the P message sent by the opposite-end network device, and the opposite-end network device can stop sending the P message after receiving the F message sent by the opposite-end network device.
As can be seen from the above description, before the F packet is sent to the peer network device, the BFD module of the network device receives a large number of P packets. Especially when the number of sessions is large, multiple P-messages per session may be received. If the BFD module sends all P messages to the control plane, a large amount of resources of the control plane are occupied, the working performance of the control plane is greatly reduced, and impact is caused to the control plane.
Based on this, in the application, the BFD module performs deduplication processing on a plurality of P packets or F packets of the same session, and then goes to the control plane. Because the duplicate removal processing is carried out on the P message or the F message, the quantity of the P message or the F message which is sent to the control plane is greatly reduced, the working performance of the control plane can be effectively improved, and the impact on the control plane is reduced.
In implementation, when the BFD module receives a target protocol packet (for convenience of description, the target protocol packet is referred to as a P packet or an F packet) including a P tag or an F tag, a second target session corresponding to the P packet or the F packet may be determined based on packet characteristics (for example, quintuple information, etc.) of the P packet or the F packet.
The BFD module may detect whether a P packet or an F packet corresponding to the second target session exists in a preset third sending set.
And if the P message or the F message corresponding to the second target session exists in the third sending set, covering the P message or the F message in the third sending set with the received P message or F message. In other words, if a P packet is received, the received P packet covers the P packet in the third transmission set. And if the F message is received, covering the F message in the third sending set by using the received F message.
And if the third sending set does not have the P message or the F message corresponding to the second target session, adding the received P message or the F message of the specified type to the third sending set.
In this embodiment, a third timer is configured for the third transmission set.
And when the third timer is overtime, the BFD module transmits the P message or the F message corresponding to each session in the third sending set to the control plane. In other words, the BFD module sends the P packet or the F packet to the BFD management driver sub-module, and the BFD management driver sub-module sends the P packet or the F packet to the platform software layer of the network device.
As can be seen from the above description, on the one hand, the session is divided into different session types according to the priority of the session, and a switching manner adapted to the session types is adopted to instruct the forwarding module to update the flow forwarding path in the flow selection entry corresponding to the target session to the second path. Therefore, the method and the device can meet the requirements of the priorities and packet loss time delays of different types of sessions on the premise of considering the stability of the internal system of the network equipment, and can be suitable for application scenes with large-scale sessions.
On the other hand, for the session with the highest priority and the smallest packet loss delay, the hardware layer module is adopted to complete the updating of the flow selection table item first, and then the path switching process is carried out, so that the updating time of the flow selection table item can be greatly reduced, the problem of message loss occurring in the period from the failure of the first path to the updating of the flow selection table item is reduced, and the requirements of the first type session on small packet loss delay and the like can be better adapted.
And in the third aspect, the BFD module performs duplicate removal processing on a plurality of P messages or F messages of the same session and then transmits the P messages or F messages to the platform software layer. Because the duplicate removal processing is carried out on the P message or the F message, the quantity of the P message or the F message which is sent to the platform software layer is greatly reduced, the working performance of the platform software layer can be effectively improved, and the impact on the platform software layer is reduced.
Referring to fig. 7, fig. 7 is a flowchart illustrating another path switching method according to an exemplary embodiment of the present application.
Step 701: and when the BFD module detects that a first path of the network equipment connected with the opposite terminal network equipment fails, the BFD module determines the session type of a target session for detecting whether the first path fails.
See step 301 for details, which are not described herein.
Step 702: and if the session type of the target session is the first type, the BFD module adds the session identifier of the target session to a preset first sending set.
The first transmission set corresponds to a first timer.
See step 4011 for details, which are not described herein.
Step 703: and the BFD module constructs a notification message based on a plurality of session identifiers in the current first sending set when a first timer corresponding to the first sending set is overtime, and transmits the notification message to a forwarding module.
See step 4012 specifically, and will not be described herein again.
Step 704: the forwarding module may retrieve a plurality of session identifications from the notification message. For each session identifier, the forwarding module may look up a flow selection table entry containing the session identifier in the flow selection table. The forwarding module may update the flow forwarding path recorded in the selected flow selection entry from the first path to the second path.
Step 705: and after the updating of the flow selection table items corresponding to the plurality of sessions is completed, the forwarding module transmits the notification message to the BFD module.
Step 706: the BFD module may obtain the plurality of session identifiers from the notification message returned by the forwarding module, set sending times for Down events corresponding to the plurality of session identifiers, and add at least one Down event to a preset second sending set. The BFD module may delete the session identifier in the first sending set that is the same as the session identifier carried in the notification message.
Step 707: and the BFD module determines that a second timer corresponding to the second sending set is overtime, detects whether the sending time of each Down event in the second sending set exceeds the current detection time, and sends the Down event of which the sending time exceeds the current detection time to the BFD management driving sub-module.
Step 708: and the BFD management driving sub-module transmits the Down event to a platform software layer of the network equipment when determining that the target session corresponding to the Down event is the first type session.
Referring to fig. 8, fig. 8 is a schematic diagram of a network device according to an exemplary embodiment of the present application. The network equipment comprises a Bidirectional Forwarding Detection (BFD) module 801 and a forwarding module 802;
the BFD module 801 is configured to, when detecting that a first path between the network device and an opposite-end network device fails, determine a session type of a target session for detecting whether the first path fails; if the session type of the target session is a first type, sending a session identifier of the target session to the forwarding module;
the forwarding module 802 is configured to determine, in a flow selection table for guiding traffic forwarding, a flow selection entry corresponding to the session identifier, and update a flow selection path recorded in the flow selection entry to be a second path, where the second path is at least one path other than the first path, and the second path is used for carrying a service flow.
Optionally, the forwarding module 802 is further configured to send a session identifier of the target session to the BFD module;
the BFD module 801 is further configured to transmit a Down event to a driving module of the control plane after receiving the session identifier of the target session, where the Down event includes the session identifier of the target session.
Optionally, when the flow selection path recorded in the flow selection entry is updated to be the second path, the forwarding module 802 is specifically configured to, if the flow selection path recorded in the flow selection entry is the first path, if there is another path between the network device and the opposite-end network device, update the flow selection path to be the other path, where the other path is the second path, and if there are multiple other paths between the network device and the opposite-end network device, update the flow selection path to be one of the multiple other paths, where one of the multiple other paths is the second path;
if the stream selection path recorded in the stream selection entry is multiple equal cost paths including the first path, deleting the first path, where the paths of the multiple equal cost paths except the first path are the second path.
Optionally, the BFD module 801, when sending the session identifier of the target session to the forwarding module, is specifically configured to add the session identifier of the target session to a first sending set; when a first timer corresponding to the first sending set is overtime, sending a notification message to the forwarding module; the notification message includes a plurality of session identifications in the first transmission set.
Optionally, the forwarding module 802 is specifically configured to send the notification message to the BFD module when sending the session identifier of the target session to the BFD module;
the BFD module 801, when transmitting a Down event to a driver module of a control plane, is specifically configured to receive the notification message, obtain the multiple session identifiers from the notification message, and add the Down event corresponding to the multiple session identifiers to a second sending set; and if the second timer corresponding to the second sending set is overtime, selecting a target Down event meeting the sending condition from the Down events in the second sending set, and transmitting the target Down event to a driving module of a control plane.
Optionally, the sending condition includes at least one of:
the sending time corresponding to the Down event in the second sending set is reached;
the time for the Down event in the second transmission set to be added to the second transmission set is greater than a first threshold.
Optionally, the network device further includes: a driving module located on the control plane of the network device;
the driving module 803 is configured to receive the Down event transmitted by the BFD module, and transmit the Down event to a control module of a control plane when it is determined that the session type is the first type according to the session identifier of the session included in the Down event.
Optionally, the BFD module 801 is further configured to transmit a Down event to a driving module of a control plane if the session type of the target session is a second type; the Down event comprises a session identification of the target session;
the driving module 803 is configured to determine, after determining that the target session is a second type session based on the Down event, the second path corresponding to the session identifier of the target session, and transmit an update message to a forwarding module, where the update message includes the session identifier of the target session and an identifier of the second path;
the forwarding module 802 is configured to receive the update message, and update the flow selection path in the flow selection entry to the second path.
Optionally, the BFD module 801 is further configured to transmit a Down event to a driving module of a control plane if the session type of the target session is a third type; the Down event comprises a session identification of the target session;
the driving module 803 is configured to send the Down event to a control module of the control plane after determining that the target session is a third type session based on the Down event;
the control module 804 is configured to determine the second path corresponding to the target session, and transmit an identifier of the second path to the driving module;
the driving module 803 is configured to generate a first flow selection entry corresponding to the target session, and transmit the first flow selection entry to the forwarding module, where the first flow selection entry includes a session identifier of the target session and an identifier of the second path;
the forwarding module 802 is configured to update, according to the first flow selection entry, a flow selection path corresponding to the target session in a second flow selection entry corresponding to the target session to be the second path.
Optionally, the BFD module 801 is further configured to, when receiving a target protocol packet including a P tag or an F tag, determine a second target session corresponding to the target protocol packet; detecting whether the target protocol message corresponding to the second target session exists in a preset third sending set or not; if the third sending set exists, the received target protocol message is adopted to cover the target protocol message existing in the third sending set; if the target protocol message does not exist, adding the received target protocol message to the third sending set; and transmitting the target protocol message corresponding to each session in the third sending set to a control plane when a third timer corresponding to the third sending set is overtime.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (20)

1. A path switching method is applied to a network device, the network device comprises a Bidirectional Forwarding Detection (BFD) module and a forwarding module, and the method comprises the following steps:
when the BFD module detects that a first path between the network equipment and opposite-end network equipment fails, the BFD module determines a session type of a target session for detecting whether the first path fails;
if the session type of the target session is a first type, the BFD module sends a session identifier of the target session to the forwarding module; wherein the first type of session has the highest priority;
and the forwarding module determines a flow selection table entry corresponding to the session identifier in a flow selection table for guiding flow forwarding, and updates a flow selection path recorded in the flow selection table entry to be a second path, wherein the second path is at least one path other than the first path, and the second path is used for carrying service flows.
2. The method of claim 1, further comprising:
the forwarding module sends a session identifier of the target session to the BFD module;
and after receiving the session identifier of the target session, the BFD module transmits a Down event to a driving module of a control plane, wherein the Down event comprises the session identifier of the target session.
3. The method of claim 1, wherein updating the stream selection path recorded in the stream selection entry to be the second path comprises:
if the flow selection path recorded in the flow selection entry is the first path, if there is another path between the network device and the opposite-end network device, updating the flow selection path to be the other path, where the other path is the second path, and if there are multiple other paths between the network device and the opposite-end network device, updating the flow selection path to be one of the multiple other paths, where one of the multiple other paths is the second path;
if the stream selection path recorded in the stream selection entry is multiple equal cost paths including the first path, deleting the first path, where the paths of the multiple equal cost paths except the first path are the second path.
4. The method of claim 2, wherein the BFD module sending a session identification of the target session to the forwarding module comprises:
the BFD module adds a session identifier of the target session to a first sending set;
the BFD module sends a notification message to the forwarding module when a first timer corresponding to the first sending set is overtime; the notification message includes a plurality of session identifications in the first transmission set.
5. The method of claim 4, wherein the forwarding module sending a session identification of the target session to the BFD module comprises:
the forwarding module sends the notification message to the BFD module;
the transmitting the Down event to the driving module of the control plane includes:
the BFD module receives the notification message, acquires the plurality of session identifiers from the notification message, and adds the Down events corresponding to the plurality of session identifiers to a second sending set;
and if the second timer corresponding to the second sending set is overtime, the BFD module selects a target Down event meeting the sending condition from the Down events in the second sending set, and transmits the target Down event to a driving module of a control plane.
6. The method of claim 5, wherein the sending condition comprises at least one of:
the sending time corresponding to the Down event in the second sending set is reached;
the time for the Down event in the second transmission set to be added to the second transmission set is greater than a first threshold.
7. The method of claim 2, further comprising:
and the driving module receives the Down event transmitted by the BFD module, and transmits the Down event to a control module of a control plane when determining that the session type is a first type according to the session identifier of the session included by the Down event.
8. The method of claim 1, further comprising:
if the session type of the target session is a second type, the BFD module transmits a Down event to a driving module of a control plane; the Down event comprises a session identification of the target session;
after determining that the target session is a second type session based on the Down event, the driving module determines the second path corresponding to the session identifier of the target session, and transmits an update message to a forwarding module, wherein the update message includes the session identifier of the target session and the identifier of the second path;
and the forwarding module receives the update message and updates the flow selection path in the flow selection table entry to be the second path.
9. The method of claim 1, further comprising:
if the session type of the target session is a third type, the BFD module transmits a Down event to a driving module of a control plane; the Down event comprises a session identification of the target session;
after determining that the target session is a third type session based on the Down event, the driving module sends the Down event to a control module of the control plane;
the control module determines the second path corresponding to the target session and transmits the identifier of the second path to the driving module;
the driving module generates a first flow selection table item corresponding to the target session, and transmits the first flow selection table item to the forwarding module, wherein the first flow selection table item comprises a session identifier of the target session and an identifier of the second path;
and the forwarding module updates the flow selection path corresponding to the target session in the second flow selection table item corresponding to the target session to be the second path according to the first flow selection table item.
10. The method of claim 1, further comprising:
when the BFD module receives a target protocol message comprising a P mark or an F mark, determining a second target session corresponding to the target protocol message;
the BFD module detects whether the target protocol message corresponding to the second target session exists in a preset third sending set or not;
if the target protocol message exists in the third sending set, the BFD module adopts the received target protocol message to cover the target protocol message existing in the third sending set;
if the target protocol message does not exist, the BFD module adds the received target protocol message to the third sending set;
and when a third timer corresponding to a third sending set is overtime, the BFD module transmits a target protocol message corresponding to each session in the third sending set to a control plane.
11. A network device, characterized in that the network device comprises a bidirectional forwarding detection, BFD, module and a forwarding module;
the BFD module is used for determining a session type of a target session for detecting whether a first path between the network device and an opposite terminal network device fails when the first path between the network device and the opposite terminal network device fails; if the session type of the target session is a first type, sending a session identifier of the target session to the forwarding module; wherein the first type of session has the highest priority;
the forwarding module is configured to determine, in a flow selection table for guiding traffic forwarding, a flow selection entry corresponding to the session identifier, and update a flow selection path recorded in the flow selection entry to be a second path, where the second path is at least one path other than the first path, and the second path is used for carrying a service flow.
12. The network device of claim 11, wherein the forwarding module is further configured to send a session identifier of the target session to the BFD module;
the BFD module is further configured to transmit a Down event to a driving module of a control plane after receiving the session identifier of the target session, where the Down event includes the session identifier of the target session.
13. The network device according to claim 11, wherein the forwarding module, when updating that the flow selection path recorded in the flow selection entry is the second path, is specifically configured to, if the flow selection path recorded in the flow selection entry is the first path, if there is another path between the network device and the peer network device, update the flow selection path as the other path, where the other path is the second path, if there are multiple other paths between the network device and the peer network device, update the flow selection path as one of the multiple other paths, where one of the multiple other paths is the second path;
if the stream selection path recorded in the stream selection entry is multiple equal cost paths including the first path, deleting the first path, where the paths of the multiple equal cost paths except the first path are the second path.
14. The network device according to claim 12, wherein the BFD module, when sending the session identifier of the target session to the forwarding module, is specifically configured to add the session identifier of the target session to a first sending set; when a first timer corresponding to the first sending set is overtime, sending a notification message to the forwarding module; the notification message includes a plurality of session identifications in the first transmission set.
15. The network device according to claim 14, wherein the forwarding module, when sending the session identifier of the target session to the BFD module, is specifically configured to send the notification message to the BFD module;
the BFD module, when transmitting the Down event to the driver module of the control plane, is specifically configured to receive the notification message, obtain the plurality of session identifiers from the notification message, and add the Down event corresponding to the plurality of session identifiers to a second sending set; and if the second timer corresponding to the second sending set is overtime, selecting a target Down event meeting the sending condition from the Down events in the second sending set, and transmitting the target Down event to a driving module of a control plane.
16. The network device of claim 15, wherein the sending condition comprises at least one of:
the sending time corresponding to the Down event in the second sending set is reached;
the time for the Down event in the second transmission set to be added to the second transmission set is greater than a first threshold.
17. The network device of claim 12, wherein the network device further comprises: a driving module located on the control plane of the network device;
the driving module is configured to receive the Down event transmitted by the BFD module, and transmit the Down event to a control module of a control plane when determining that the session type is the first type according to a session identifier of a session included in the Down event.
18. The network device of claim 11, wherein the BFD module is further configured to transmit a Down event to a driver module of a control plane if the session type of the target session is a second type; the Down event comprises a session identification of the target session;
the driving module is configured to determine the second path corresponding to the session identifier of the target session after determining that the target session is a second type session based on the Down event, and transmit an update message to the forwarding module, where the update message includes the session identifier of the target session and an identifier of the second path;
the forwarding module is configured to receive the update message, and update the flow selection path in the flow selection entry to the second path.
19. The network device of claim 11, wherein the BFD module is further configured to transmit a Down event to a driver module of a control plane if the session type of the target session is a third type; the Down event comprises a session identification of the target session;
the driving module is configured to send the Down event to a control module of the control plane after determining that the target session is a third type session based on the Down event;
the control module is configured to determine the second path corresponding to the target session, and transmit an identifier of the second path to the driving module;
the driving module is configured to generate a first flow selection entry corresponding to the target session, and transmit the first flow selection entry to the forwarding module, where the first flow selection entry includes a session identifier of the target session and an identifier of the second path;
and the forwarding module is configured to update, according to the first flow selection entry, a flow selection path corresponding to the target session in a second flow selection entry corresponding to the target session to the second path.
20. The network device according to claim 11, wherein the BFD module is further configured to determine, when receiving a target protocol packet including a P tag or an F tag, a second target session corresponding to the target protocol packet; detecting whether the target protocol message corresponding to the second target session exists in a preset third sending set or not; if the third sending set exists, the received target protocol message is adopted to cover the target protocol message existing in the third sending set; if the target protocol message does not exist, adding the received target protocol message to the third sending set; and transmitting the target protocol message corresponding to each session in the third sending set to a control plane when a third timer corresponding to the third sending set is overtime.
CN201910817261.5A 2019-08-30 2019-08-30 Path switching method and network equipment Active CN111726291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910817261.5A CN111726291B (en) 2019-08-30 2019-08-30 Path switching method and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910817261.5A CN111726291B (en) 2019-08-30 2019-08-30 Path switching method and network equipment

Publications (2)

Publication Number Publication Date
CN111726291A CN111726291A (en) 2020-09-29
CN111726291B true CN111726291B (en) 2022-03-01

Family

ID=72564210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910817261.5A Active CN111726291B (en) 2019-08-30 2019-08-30 Path switching method and network equipment

Country Status (1)

Country Link
CN (1) CN111726291B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114374643B (en) * 2021-12-22 2024-02-09 新华三技术有限公司合肥分公司 Communication method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030966A (en) * 2006-02-28 2007-09-05 华为技术有限公司 Method for establishing two-way transmitted inspecting session

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170459B (en) * 2007-11-28 2010-07-14 中兴通讯股份有限公司 Failure detection and link recovery method based on bidirectional forward link
CN101645812A (en) * 2009-08-31 2010-02-10 武汉烽火网络有限责任公司 Protection switching method of Ethernet intersecting ring
CN101800676A (en) * 2010-02-20 2010-08-11 中兴通讯股份有限公司 Link detection method, device and system
CN102195861B (en) * 2010-03-19 2015-04-08 杭州华三通信技术有限公司 Method and device for establishing BFD (bidirectional forwarding detection) session in route switching process
CN103036716B (en) * 2012-12-12 2018-06-22 中兴通讯股份有限公司 Link switch-over method and system
US9960958B2 (en) * 2014-09-16 2018-05-01 CloudGenix, Inc. Methods and systems for controller-based network topology identification, simulation and load testing
CN105592490B (en) * 2015-08-31 2019-04-09 新华三技术有限公司 A kind of route switching method and equipment
CN107846356B (en) * 2016-09-19 2020-02-11 新华三技术有限公司 Method and device for fast switching between main pseudo wire and standby pseudo wire
CN107547383B (en) * 2017-07-26 2020-04-03 新华三技术有限公司 Path detection method and device
CN108737183B (en) * 2018-05-22 2021-06-22 华为技术有限公司 Method and device for monitoring forwarding table item
CN109787839A (en) * 2019-02-28 2019-05-21 新华三技术有限公司 A kind of message forwarding method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030966A (en) * 2006-02-28 2007-09-05 华为技术有限公司 Method for establishing two-way transmitted inspecting session

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于OSPF路由协议的IP快速路径切换技术的研究与实现";商荣亮;《国防科技大学工程硕士学位论文》;20120415;全文 *

Also Published As

Publication number Publication date
CN111726291A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
US8699358B2 (en) Troubleshooting method and apparatus
CN108243111B (en) Method and device for determining transmission path
KR101523457B1 (en) System and method for session restoration at geo-redundant gateways
EP2536066A1 (en) Link detecting method, apparatus and system
KR101887581B1 (en) Flow-based packet transport device and packet management method thereof
CN102347905B (en) Network equipment and forwarded information updating method
US20140016456A1 (en) Mobile gateways in pool for session resilience
WO2017092400A1 (en) Failure recovery method and device, controller, and software defined network
CN101340351A (en) Data transmission method, apparatus and system in VPLS network
US20120163163A1 (en) Apparatus and method for protection switching of multiple protection group
US10122618B2 (en) Path switching method and device
CN102833108A (en) Processing method and equipment of location information of fault point
US20230015960A1 (en) Method and Apparatus for Establishing Forwarding Path, and Computer-Readable Storage Medium
EP3879778A1 (en) Static route deployment method, device and system
US8477655B2 (en) Method, device, and system for establishing label switching path in fast rerouting switching
CN110557342A (en) Apparatus for analyzing and mitigating dropped packets
CN103840976A (en) Communication method, optical module and network device
CN101909006B (en) BFD (Bidirectional Forwarding Detection) message sending and receiving methods as well as device and communication system thereof
US20150281063A1 (en) Method and system for network traffic steering based on dynamic routing
CN111726291B (en) Path switching method and network equipment
CN104717143A (en) Method and equipment for many-one reducibility scene multicast data transmission
CN110138656B (en) Service processing method and device
US11916783B2 (en) Information reporting method, information processing method, apparatus, and device
CN113824595B (en) Link switching control method and device and gateway equipment
WO2018040809A1 (en) Method, apparatus, system and device for p2mp multicast tunnel protection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant