Method and apparatus for updating version of routing service, electronic device, storage medium and program product
Patent Information
- Application Number
- CN202510307748.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2026-09-15
Smart Images

Figure CN122764818A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, storage medium, and program product for updating the version of a routing service. Background Technology
[0002] Bidirectional Forwarding Detection (BFD) is a protocol used to quickly detect the connectivity of links or IP routing in a network. BFD provides a universal, standardized, media- and protocol-independent fast fault detection mechanism capable of detecting network faults within milliseconds, thereby improving network reliability and rapid recovery capabilities. It can detect network faults with millisecond-level accuracy, far faster than traditional routing protocols such as OSPF and ISIS.
[0003] In related technologies, bidirectional forwarding detection is usually interrupted during the version update of routing services. After the update is completed, bidirectional forwarding detection is performed as needed. This results in the absence of bidirectional forwarding detection during the version upgrade of routing services, leading to poor stability of bidirectional forwarding detection. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating the version of a routing service, which can effectively improve the stability of bidirectional forwarding detection during the process of upgrading the version of a routing service.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a method for updating the version of a routing service, including:
[0007] In response to an update instruction for routing services in an access switch, an updated version of the routing services is initialized in the access switch.
[0008] Based on the original version of the routing service and the updated version of the routing service in the access switch, bidirectional forwarding detection messages are sent to the network device in parallel, and the original version of the routing service is controlled to stop receiving bidirectional forwarding detection messages sent by the network device.
[0009] Based on the updated version of the routing service, in response to receiving a bidirectional forwarding detection message returned by the network device, the original version of the routing service is shut down;
[0010] Based on the updated version of the routing service, data routing is performed for the network device.
[0011] This application provides a routing service version update device, including:
[0012] An initialization module is configured to initialize an updated version of the routing service in the access switch in response to an update command for the routing service in the access switch.
[0013] The control module is used to send bidirectional forwarding detection messages to the network device in parallel based on the original version of the routing service and the updated version of the routing service in the access switch, and to control the original version of the routing service to stop receiving the bidirectional forwarding detection messages sent by the network device.
[0014] The shutdown module is used to shut down the original version of the routing service in response to receiving a bidirectional forwarding detection message returned by the network device, based on the updated version of the routing service.
[0015] An execution module is used to perform data routing for the network device based on the updated version of the routing service.
[0016] In the above scheme, the routing service version update device further includes: a detection module, used to perform fault detection on the communication link between the access switch and the network device based on the original version of the routing service, and obtain a first detection result; the initialization module is also used to initialize the updated version of the routing service in the access switch in response to the update instruction for the routing service in the access switch, and the first detection result indicates that there is no fault in the communication link.
[0017] In the above scheme, the detection module is further configured to, in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within a preset time period, determine the first detection result as indicating that the communication link is not faulty; and in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period, determine the first detection result as indicating that the communication link is faulty.
[0018] In the above scheme, the routing service version update device further includes: a shutdown module, used to respond to the first detection result indicating that the communication link has a fault, control the original version of the routing service in the access switch to stop executing the routing service for the network device; control the original version of the routing service to stop receiving the bidirectional forwarding detection message sent by the network device, and control the original version of the routing service to stop sending the bidirectional forwarding detection message.
[0019] In the above scheme, the routing service version update device further includes: a storage module, used to determine the session state between the original version of the routing service and the network device in response to the first detection result indicating that the communication link has no fault, and to store the session state; the control module is further used to control the original version of the routing service and the updated version of the routing service to send the bidirectional forwarding detection message to the network device in parallel based on the session state.
[0020] In the above scheme, the session state includes the sending period of the original version of the routing service for the bidirectional forwarding detection packet. The control module is also used to control the original version of the routing service to send the bidirectional forwarding detection packet to the network device according to the sending period; and to control the updated version of the routing service to read the session state and send the bidirectional forwarding detection packet to the network device according to the sending period in the session state.
[0021] In the above scheme, the execution module is further configured to obtain the first moment when the original version of the routing service last received the bidirectional forwarding detection message sent by the network device, and the second moment when the updated version of the routing service first received the bidirectional forwarding detection message sent by the network device; based on the first moment and the second moment, perform fault detection on the communication link between the access switch and the network device to obtain a second detection result; in response to the second detection result indicating that there is no fault in the communication link, perform data routing for the network device through the updated version of the routing service.
[0022] In the above scheme, the execution module is further configured to: read the session state between the original version of the routing service and the network device based on the updated version of the routing service, wherein the session state includes a preset time period for fault detection; obtain the time difference between the first moment and the second moment, and compare the time difference with the preset time period to obtain a comparison result; in response to the comparison result indicating that the time difference is greater than the preset time period, determine the second detection result as indicating that the communication link has a fault; in response to the comparison result indicating that the time difference is less than or equal to the preset time period, determine the second detection result as indicating that the communication link does not have a fault.
[0023] In the above scheme, the shutdown module is also used to shut down the routing service of the access switch for the network device in response to the second detection result indicating that the communication link is faulty.
[0024] In the above scheme, the detection module is further configured to obtain the time when the updated version of the routing service last received the bidirectional forwarding detection message based on the updated version of the routing service; perform fault detection on the communication link between the access switch and the network device based on the time and a preset time period to obtain a third detection result; and, in response to the third detection result indicating that the communication link has a fault, shut down the routing service for the network device executed by the updated version of the routing service.
[0025] In the above scheme, the detection module is further configured to, in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, determine the third detection result as indicating that the communication link has a fault; and in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, determine the third detection result as indicating that the communication link does not have a fault.
[0026] In the above scheme, the storage module is further configured to, in response to the third detection result indicating that there is no fault in the communication link, receive the bidirectional forwarding detection message again based on the updated version of the routing service, determine the session state between the updated version of the routing service and the network device, and store the session state between the updated version of the routing service and the network device.
[0027] In the above scheme, the shutdown module is also used to control the original version of the routing service to stop sending the bidirectional forwarding detection message, and to control the original version of the routing service to stop executing data routing for the network device.
[0028] In the above scheme, the control module is further configured to send bidirectional forwarding detection messages to the network device based on the original version of the routing service during the process of the original version of the routing service performing data routing for the network device; in the above scheme, the control module is further configured to periodically send the bidirectional forwarding detection messages to the network device based on the original version of the routing service, and start the updated version of the routing service to send the bidirectional forwarding detection messages to the network device using the same sending period as the original version of the routing service.
[0029] This application provides an electronic device, including:
[0030] Memory is used to store executable instructions or computer programs.
[0031] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the version update method for the routing service provided in the embodiments of this application.
[0032] This application provides a computer-readable storage medium storing computer-executable instructions for inducing a processor to execute and implement the routing service version update method provided in this application.
[0033] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the routing service version update method described above in this application.
[0034] The embodiments of this application have the following beneficial effects:
[0035] When responding to an update command for the routing service in the access switch, the updated version of the routing service is initialized. Both the original and updated versions of the routing service are used in parallel to send bidirectional forwarding detection packets to network devices. Simultaneously, the original version of the service stops receiving bidirectional forwarding detection packets, ensuring that network devices can continuously receive these packets and maintain link state fault detection without interruption due to the routing service upgrade. When the updated version of the routing service receives the bidirectional forwarding detection packets returned by the network device, it shuts down the original version, achieving a smooth transition. Ultimately, the updated version of the routing service takes over the data routing tasks, ensuring the continuity and stability of network services. This allows the access switch to complete the routing service upgrade without interrupting bidirectional forwarding detection, effectively improving the stability of bidirectional forwarding detection during the upgrade process. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the architecture of the routing service version update system provided in the embodiments of this application;
[0037] Figure 2 This is a schematic diagram of the structure of an electronic device for version update of routing services provided in an embodiment of this application;
[0038] Figure 3 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 1 ;
[0039] Figure 4This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 2 ;
[0040] Figure 5 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 3 ;
[0041] Figure 6 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 4 ;
[0042] Figure 7 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 5 ;
[0043] Figure 8 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 1 ;
[0044] Figure 9 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 2 ;
[0045] Figure 10 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 3 . Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0048] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit the scope of this application.
[0050] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0051] 1) Border Gateway Protocol (BGP): BGP is a routing protocol used to exchange Network Layer Reachability Information (NLRI) between Autonomous Systems (AS). BGP is the most important external gateway protocol in the Internet, responsible for routing data packets between different ASs.
[0052] 2) Bidirectional Forwarding Detection (BFD): BFD is a protocol used to quickly detect the connectivity of links or IP routing in a network. BFD provides a universal, standardized, media- and protocol-independent fast fault detection mechanism capable of detecting network faults within milliseconds, thereby improving network reliability and rapid recovery capabilities. It can detect network faults with millisecond-level accuracy, far faster than traditional routing protocols such as OSPF and ISIS.
[0053] 3) Customer Edge Router (CER): A Customer Edge Router (CER) is a networking term, particularly relevant to Multiprotocol Label Switching (MPLS) and Virtual Private Network (VPN) environments. A CER is a router that connects a customer network (also known as a client network or enterprise network) to a service provider network. Located at the edge of the customer network, it is responsible for encapsulating and sending the customer's data traffic to the service provider's network, as well as receiving and decapsulating data traffic from the service provider's network before forwarding it to the customer network.
[0054] 4) Cloud Edge Switch (CES): A Cloud Edge Switch (CES) is a networking term, particularly relevant to service provider networks. A CES is a switch that connects a user network (also known as a customer network or enterprise network) to a service provider network. Located at the edge of the user network, it is responsible for routing user data traffic to the service provider network, and also for receiving data traffic from the service provider network and routing it back into the user network.
[0055] 5) Non-stop Routing (NSR): Non-stop Routing (NSR) is an advanced network reliability technology designed to ensure uninterrupted network routing and data forwarding when the router's main control board (usually called the routing processor or RP) fails or is under maintenance. NSR achieves this by rapidly synchronizing and switching states between the main control board and the backup board, allowing the backup board to quickly take over routing tasks without service interruption in the event of a main control board failure.
[0056] 6) Cloud Private Line Network Architecture: This refers to a network structure that connects an enterprise's internal network to the cloud service provider's cloud platform via a dedicated network. This architecture allows enterprises to securely transmit data and applications to the cloud while maintaining control over network performance and security. Implementing a cloud private line network architecture requires consideration of various factors, including network technology, equipment selection, network design, security strategies, and cost budgets. Enterprises need to collaborate with cloud service providers and network service providers to jointly design and implement a cloud private line network architecture tailored to their specific needs.
[0057] 7) Bidirectional Forwarding Detection Message (BFDM): This is a protocol message used to quickly detect the status of communication links between network devices. The main function of BFD messages is to provide a fast fault detection mechanism independent of routing protocols, capable of detecting link faults within milliseconds, thereby improving network reliability and stability.
[0058] During the implementation of the embodiments of this application, the applicant discovered the following problems with the related technology:
[0059] In related technologies, bidirectional forwarding detection is usually interrupted during the version update of routing services. After the update is completed, bidirectional forwarding detection is performed as needed. This results in the absence of bidirectional forwarding detection during the version upgrade of routing services, leading to poor stability of bidirectional forwarding detection.
[0060] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating the version of a routing service. These methods can effectively improve the stability of bidirectional forwarding detection during the process of upgrading the version of a routing service. The following describes an exemplary application of the routing service version update system provided in this application.
[0061] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the routing service version update system 100 provided in this application embodiment. The network device (network device 400 is shown as an example) is connected to the access switch 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0062] Network device 400 is used by a user client 410 to display routing data on a graphical interface 410-1 (graphical interface 410-1 is shown as an example). Network device 400 and access switch 200 are interconnected via wired or wireless network.
[0063] In some embodiments, the access switch 200 can be a standalone physical access switch, an access switch cluster or service system composed of multiple physical access switches, or a cloud access switch providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The network device 400 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart TV, smartwatch, vehicle network device, etc., but is not limited to these. The electronic devices provided in this application embodiment can be implemented as network devices or as access switches. The network devices and access switches can be directly or indirectly connected via wired or wireless communication methods, which is not limited in this application embodiment.
[0064] In some embodiments, in response to an update instruction for the routing service in the access switch, the access switch 200 initializes an updated version of the routing service in the access switch, and sends bidirectional forwarding detection packets to the network device in parallel based on the original version of the routing service and the updated version of the routing service in the access switch. It also controls the original version of the routing service to stop receiving bidirectional forwarding detection packets sent by the network device, and shuts down the original version of the routing service in response to receiving a bidirectional forwarding detection packet returned by the network device based on the updated version of the routing service. Based on the updated version of the routing service, it performs data routing for the network device.
[0065] In other embodiments, in response to an update instruction for the routing service in the access switch, the network device 400 initializes an updated version of the routing service in the access switch, and sends bidirectional forwarding detection messages to the network device in parallel based on the original version of the routing service in the access switch and the updated version of the routing service. It also controls the original version of the routing service to stop receiving bidirectional forwarding detection messages sent by the network device, and shuts down the original version of the routing service in response to receiving a bidirectional forwarding detection message returned by the network device based on the updated version of the routing service. Based on the updated version of the routing service, it performs data routing for the network device.
[0066] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the version update electronic device 500 for routing services provided in an embodiment of this application, wherein, Figure 2 The electronic device 500 shown can be Figure 1 The access switch 200 or network device 400 in the middle, Figure 2 The illustrated electronic device 500 includes at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.
[0067] Processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0068] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 430.
[0069] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.
[0070] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0071] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0072] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0073] In some embodiments, the routing service version update device provided in this application can be implemented in software. Figure 2 A version update device 455 for a routing service stored in memory 450 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: an initialization module 4551, a control module 4552, a shutdown module 4553, and an execution module 4554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.
[0074] In other embodiments, the routing service version update device provided in this application can be implemented in hardware. As an example, the routing service version update device provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the routing service version update method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0075] In some embodiments, network devices or access switches can implement the routing service version update method provided in this application by running a computer program or computer-executable instructions. For example, the computer program can be a native program in the operating system (e.g., a dedicated version update program) or a software module, such as a version update module that can be embedded in any program (e.g., an instant messaging client, a photo album program, an electronic map client, a navigation client); or it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run. In summary, the above-mentioned computer program can be any form of application, module, or plugin.
[0076] The method for updating the routing service provided in this application will be described by referring to exemplary applications and implementations of access switches or network devices provided in the embodiments of this application.
[0077] See Figure 3 , Figure 3 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 1 , will combine Figure 3 Steps 101 to 105 are described below. The method for updating the routing service provided in this application embodiment can be implemented by the access switch or network device alone, or by the access switch and network device working together. The following description will take the implementation by the access switch alone as an example.
[0078] In step 101, in response to an update instruction for the routing service in the access switch, an updated version of the routing service is initialized in the access switch.
[0079] In some embodiments, in BFD (Bidirectional Forwarding Detection) application scenarios, the access switch, as a key device at the network edge, is responsible for establishing and maintaining communication links with the user edge router (CER). When the access switch receives an update instruction for its routing service, it needs to perform a series of technical steps to ensure the stability and reliability of the network.
[0080] In some embodiments, the access switch receives an instruction to update the routing service via a management protocol (such as SNMP, CLI, NETCONF, etc.). Based on the instruction, the access switch loads the new routing protocol configuration file, updates the routing table, and initializes or re-initializes the updated version of the routing service (such as OSPF, BGP, etc.).
[0081] As an example, suppose an access switch is currently running the OSPFv2 routing protocol and uses BFD for link failure detection with the Center for Router (CER). Now, the network administrator decides to upgrade the access switch's OSPF protocol to OSPFv3. The network administrator sends an update command to the access switch via the CLI, instructing it to upgrade the OSPF protocol from v2 to v3. Upon receiving the command, the access switch loads the new OSPFv3 configuration file, updates the routing table, and initializes the OSPFv3 service. During OSPFv3 service initialization, the access switch continues to use the existing OSPFv2 service, maintaining link detection with the CER via BFD. The access switch and the CER periodically exchange BFD control messages at agreed-upon intervals. If, during OSPFv3 service initialization, BFD detects a link failure with the CER (e.g., due to a physical link interruption or CER device failure), the access switch will immediately identify the failure. The access switch can then take appropriate measures, such as switching to a backup link or triggering OSPFv3 protocol reconvergence, to ensure network connectivity and service continuity.
[0082] In some embodiments, an access switch is a device at the network edge responsible for connecting network devices and user equipment (such as computers, access switches, printers, etc.) to the network. It typically resides in the network's access layer, providing direct connectivity to user equipment and forwarding data to the network's core or distribution layer.
[0083] In some embodiments, routing services refer to the routing protocols and functions performed by network devices (such as routers and switches) to determine the transmission path of data packets from source to destination. Common routing protocols include OSPF (Open Shortest Path First), BGP (Border Gateway Protocol), and RIP (Routing Information Protocol). BFD is a network protocol used to quickly detect whether the forwarding path between two devices in a network is normal. By periodically exchanging control messages, BFD can detect link failures within milliseconds, thereby improving network reliability and availability.
[0084] In some embodiments, prior to step 101 above, the following process may also be performed: based on the original version of the routing service, fault detection is performed on the communication link between the access switch and the network device to obtain a first detection result.
[0085] In some embodiments, the access switch and network devices establish a session via the BFD protocol to negotiate parameters such as the detection time interval and the reception time interval. The access switch and network devices periodically exchange BFD control messages, which contain session status, diagnostic information, etc. The access switch detects the reception of bidirectional forwarding detection messages. If it does not receive a bidirectional forwarding detection message from the network device within the specified detection time interval, it considers the link to have failed. The access switch uses the BFD detection results to identify whether the communication link with the network device is normal. If a link failure is detected, the access switch can take measures, such as switching to a backup link or triggering routing protocol reconvergence, to restore network connectivity.
[0086] As an example, suppose an access switch is currently running the OSPFv2 routing protocol and uses BFD for link failure detection with network devices. Now, the network administrator decides to upgrade the access switch's OSPF protocol to OSPFv3. During OSPFv3 service initialization, the access switch continues to use the existing OSPFv2 service, maintaining link detection with network devices via BFD. The access switch and network devices periodically exchange BFD control messages at agreed-upon intervals. If, during OSPFv3 service initialization, BFD detects a link failure with a network device (e.g., due to a physical link interruption or network device malfunction), the access switch will immediately identify the failure. The access switch can then take appropriate measures, such as switching to a backup link or triggering OSPFv3 protocol reconvergence, to ensure network connectivity and service continuity.
[0087] In some embodiments, the above-mentioned fault detection of the communication link between the access switch and the network device based on the original version of the routing service to obtain a first detection result can be achieved in the following manner: in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within a preset time period, the first detection result is determined to indicate that the communication link is not faulty; in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period, the first detection result is determined to indicate that the communication link is faulty.
[0088] In some embodiments, after receiving an instruction to update the routing service, the access switch first initializes the updated version of the routing service. This includes loading the new routing protocol configuration, updating the routing table, and starting the new routing protocol process. During the routing service update process, the access switch and network devices (such as CERs) establish a session via the BFD protocol. The establishment of the bidirectional forwarding detection session involves negotiating parameters such as the detection time interval and the reception time interval. Once the bidirectional forwarding detection session is established, the access switch and network devices begin periodically exchanging BFD control messages. These messages contain key data such as session status and diagnostic information. The access switch detects the reception of bidirectional forwarding detection messages. If it receives bidirectional forwarding detection messages from network devices within a preset time period, the access switch considers the communication link to be fault-free. If it does not receive bidirectional forwarding detection messages within the preset time period, the access switch considers the communication link to be faulty. Based on the first detection result, the access switch takes corresponding fault response measures. If a link fault is detected, the access switch can switch to a backup link, trigger routing protocol re-convergence, or notify the network management system.
[0089] In some embodiments, the network device may be a Customer Edge Router (CER), a boundary device connecting the user network and the service provider network. It is responsible for routing traffic from the user network to the service provider network and processing traffic from the service provider network. Routing Service refers to the routing protocols and functions performed by the network device to determine the transmission path of data packets from source to destination. Fault Detection Network Devices use various mechanisms to detect the health of network links and devices so that faults can be quickly identified.
[0090] As an example, assume the access switch is currently running OSPFv2 and uses BFD for link fault detection with the CER. Now, the network administrator decides to upgrade the access switch's OSPF protocol to OSPFv3. The network administrator sends an update command to the access switch via CLI, instructing it to upgrade from v2 to v3. Upon receiving the command, the access switch loads the new OSPFv3 configuration file, updates the routing table, and starts the OSPFv3 service. During OSPFv3 service initialization, the access switch and CER establish a session via BFD, negotiating parameters such as the detection interval and reception interval. The access switch and CER periodically exchange BFD control messages according to the negotiated intervals. The access switch checks the reception of bidirectional forwarding detection messages. If it receives a bidirectional forwarding detection message from the CER within a preset time period, the access switch considers the communication link to be fault-free. If it does not receive a bidirectional forwarding detection message within the preset time period, the access switch considers the communication link to be faulty. If a link failure is detected, the access switch can take measures such as switching to a backup link or triggering OSPFv3 protocol reconvergence to ensure network connectivity and service continuity.
[0091] Thus, by leveraging the rapid detection capabilities of the Bidirectional Forwarding Detection (BFD) protocol, link faults can be identified within milliseconds. Link connectivity is detected by periodically exchanging BFD messages. When the access switch receives a BFD message from a network device within a preset time period, it indicates that the link is normal, and therefore the initial detection result is determined to be fault-free. Conversely, if no BFD message is received within the preset time period, the access switch will determine that the communication link is faulty and quickly take corresponding fault response measures, such as switching to a backup link or triggering routing protocol reconvergence. This not only improves network reliability and availability but also reduces network downtime, ensuring service continuity and user experience.
[0092] In some embodiments, after performing fault detection on the communication link between the access switch and the network device based on the original version of the routing service and obtaining a first detection result, the following can also be implemented: in response to the first detection result indicating that the communication link is faulty, the original version of the routing service in the access switch is controlled to stop executing the routing service for the network device; the original version of the routing service is controlled to stop receiving bidirectional forwarding detection messages sent by the network device, and the original version of the routing service is controlled to stop sending the bidirectional forwarding detection messages.
[0093] In some embodiments, after fault detection of the communication link based on the original version of the routing service and obtaining a first detection result, if the first detection result indicates that the communication link is faulty, the access switch will perform the following steps: The original version of the routing service in the access switch will stop executing the routing service for the network device, meaning that the access switch will no longer participate in the routing calculation and data forwarding with the network device. The access switch will control the original version of the routing service to stop receiving Bidirectional Forwarding Detection (BFD) messages sent by the network device, and simultaneously stop sending BFD messages, in order to prevent the continued sending of unnecessary BFD messages and release related network resources.
[0094] In some embodiments, once a link failure is detected, continuing to perform routing services for that network device would result in invalid route calculations and data forwarding, wasting network resources and potentially causing packet loss or delay. The access switch will then cease all activities related to that network device in its original version of the routing service, including routing table updates and Hello message transmissions for the routing protocol.
[0095] In some embodiments, continuing to receive and send bidirectional forwarding detection (BOT) messages after a link failure is unnecessary because the link is no longer available. This not only wastes bandwidth but may also mislead network administrators about the link status. The access switch will instruct its original version of routing service to stop receiving BOT messages from the network device and to stop sending BOT messages to the network device. This will close the BOT session with the network device and release associated resources.
[0096] As an example, suppose the access switch currently has a communication link with the CER via the OSPFv2 routing protocol and uses BFD for fault detection. If BFD detects a fault in the link with the CER, the access switch will perform the following actions: The access switch will stop performing OSPFv2 routing services for the CER and will no longer participate in route calculation and data forwarding with the CER. The access switch will stop receiving bidirectional forwarding detection messages from the CER and will stop sending bidirectional forwarding detection messages to the CER. This will release network resources associated with the bidirectional forwarding detection session and avoid continuing to send unnecessary messages.
[0097] Thus, after performing fault detection on the communication link based on the original version of the routing service and obtaining the first detection result, if the first detection result indicates that the communication link is faulty, the access switch can optimize resource utilization and achieve rapid network convergence by stopping the execution of routing services for network devices and stopping the reception and transmission of Bidirectional Forwarding Detection (BFD) messages. This is based on the rapid fault detection capability of the BFD protocol and the dynamic adaptability of the routing protocol. When BFD detects a link fault, the access switch immediately stops the routing services related to the faulty link, avoiding invalid route calculations and data forwarding, saving network bandwidth and processing resources. Simultaneously, stopping the exchange of Bidirectional Forwarding Detection messages avoids the continued transmission of useless detection messages, further releasing network resources. This rapid response mechanism not only improves network reliability and availability but also reduces network downtime, ensuring service continuity and user experience. The access switch can quickly isolate the fault after detecting a link fault, preventing fault propagation and accelerating network convergence, thereby maintaining network stability and efficiency.
[0098] In some embodiments, after the above-mentioned fault detection of the communication link between the access switch and the network device based on the original version of the routing service and obtaining the first detection result, the following processing can also be performed: in response to the first detection result indicating that there is no fault in the communication link, the session state between the original version of the routing service and the network device is determined and the session state is stored.
[0099] In some embodiments, after fault detection of the communication link based on the original version of the routing service and obtaining a first detection result, if the first detection result indicates that there is no fault in the communication link, the access switch will perform the following processing steps: The access switch will determine the bidirectional forwarding detection session state with the network device (such as CER). This involves checking the current state of the bidirectional forwarding detection session, including whether the session has been established, the health status of the session, the detection time interval, etc. The bidirectional forwarding detection session state may include states such as down, init, and up, which reflect the connectivity of the link and the operation of the BFD protocol. Once the bidirectional forwarding detection session state is determined, the access switch will store this state information. This may be for subsequent reference and troubleshooting. The stored bidirectional forwarding detection session state may include timestamps, a history of session state changes, any error or warning messages, etc.
[0100] In some embodiments, session state refers to the bidirectional forwarding detection session state (BFD Session State), which describes the current state of the bidirectional forwarding detection session between two network devices, including whether the session has been established, the health status of the session, the detection time interval, etc.
[0101] In some embodiments, session state refers to the current state of a communication session established between a network device and an access switch. It reflects information such as the health of the connection between the devices, the operational status of the communication protocol, and the duration of the session. In the context of Bidirectional Forwarding Detection (BFD), session states specifically include the following: Down State: Indicates that the session has not yet been established, or that the session has been closed for some reason (such as link failure, configuration error, etc.). Init State: Indicates that the session is in the process of initialization. In this state, the device has started sending BFD control messages but has not yet received a response from the peer device. Up State: Indicates that the session has been successfully established, and the devices are exchanging BFD control messages normally. This is the normal operating state of the session, indicating that the link is connected and the communication between the devices is healthy. Admin Down State: Indicates that the session has been manually closed due to management commands or configuration changes. Poll State: In some cases, a device may enter the Poll state, indicating that the device is waiting for a response from the peer device or is performing some form of session check. Changes in session state are usually triggered by the operating mechanism of the BFD protocol. For example, when a device detects a link failure, the session state changes from Up to Down; when the link is restored, the session state changes back from Down to Up. These state changes are crucial for network fault detection and rapid convergence, helping network devices quickly identify and respond to link failures, thereby maintaining network stability and reliability.
[0102] As an example, suppose the access switch establishes a communication link with CER via OSPFv2 and uses BFD for fault detection. If BFD detects no fault in the link, the access switch will perform the following operations: The access switch will check the status of the BFD forwarding detection session to confirm whether BFD packet exchange is proceeding normally and whether the session is in the up state. The access switch will also check the parameters of the BFD forwarding detection session, such as the detection interval and receive interval, to ensure that these parameters are configured as expected. The access switch will store the current BFD forwarding detection session state information, including session state, up time, and timestamp of the last state change. This information can be used for future reference, such as during network auditing or troubleshooting, to help network administrators understand the historical status and performance of the link.
[0103] Thus, after performing fault detection on the communication link using the original version of the routing service and obtaining the first detection result, if the first detection result indicates that there is no fault in the communication link, the access switch performs the process of determining and storing the bidirectional forwarding detection session state. This leverages the rapid fault detection capability of the BFD protocol and the dynamic adaptability of the routing protocol. When BFD detects that there is no fault in the link, the access switch can understand the connection health status and communication protocol operation status with network devices in real time by determining the session state. Storing this session state information not only provides network administrators with valuable detection data, facilitating real-time monitoring of network operation, but also provides historical reference for subsequent troubleshooting and network optimization. Furthermore, this mechanism helps improve network reliability and availability because network devices can quickly respond to changes in link state, ensuring the continuity and stability of data transmission. The access switch can maintain efficient communication when the link is normal, while providing rapid response and recovery capabilities for potential faults, thereby maintaining network stability and efficiency.
[0104] In some embodiments, step 101 above can also be implemented as follows: in response to an update instruction for the routing service in the access switch, and the first detection result indicating that there is no fault in the communication link, the updated version of the routing service is initialized in the access switch.
[0105] In some embodiments, after performing fault detection on the communication link based on the original version of the routing service and obtaining a first detection result, if the first detection result indicates that the communication link is not faulty, and an update instruction for the routing service in the access switch is received, the access switch will perform the following processing steps: The access switch receives the update instruction, which may come from the network administrator, an automation system, or a software update mechanism. Before performing the update, the access switch needs to confirm that the communication link is not faulty, which is achieved through BFD or other fault detection mechanisms. After confirming that the communication link is normal, the access switch will begin initializing the updated version of the routing service, including loading the new routing protocol software, updating configuration parameters, and re-establishing neighbor relationships. The access switch will migrate the previously stored session state information to the updated version of the routing service. After initialization is complete, the access switch will subsequently start the updated version of the routing service as appropriate and begin communicating with network devices.
[0106] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. If the network administrator decides to upgrade the routing protocol to OSPFv3 and receives the corresponding update instruction, and BFD detects no link faults, the access switch will perform the following operations: The access switch receives the instruction to upgrade from OSPFv2 to OSPFv3. The access switch verifies the link with the network devices is normal using BFD. The access switch begins loading the OSPFv3 software and updates the relevant configuration parameters. The access switch migrates the previously stored OSPFv2 session state information (such as neighbor relationships, link state database, etc.) to OSPFv3. After initialization, the access switch starts OSPFv3 and begins communicating with network devices, establishing new neighbor relationships, and updating the routing table.
[0107] Thus, in response to update commands for routing services in the access switch, and with the initial detection result indicating no fault in the communication link, the access switch can smoothly upgrade the routing protocol by initializing the updated version of the routing service, ensuring the continuity and stability of network services. Based on real-time detection of network link status and dynamic management of routing services, the access switch can orderly load and configure new routing protocol software, and update relevant routing tables and neighbor relationships, provided the link is confirmed to be normal. Through this mechanism, the access switch can not only improve network performance and security but also adapt to constantly changing network needs, providing more efficient and reliable data transmission services. This helps reduce network administrator intervention, improves network automation and management efficiency, thereby reducing network operating costs and enhancing the overall competitiveness of the network. The access switch can upgrade and optimize routing services while ensuring stable network operation, providing users with a better network experience.
[0108] In some embodiments, prior to step 101 above, the following process may also be performed: during the process of the original version of the routing service performing data routing for the network device, a bidirectional forwarding detection message is sent to the network device based on the original version of the routing service.
[0109] In some embodiments, after fault detection of the communication link based on the original version of the routing service and obtaining a first detection result, if the first detection result indicates that there is no fault in the communication link, and an update instruction for the routing service in the access switch is received, the access switch will perform the following processing steps before executing the initialization of the updated version of the routing service: The access switch confirms that the link with the network device is normal through BFD or other fault detection mechanisms. If the link is confirmed to be normal, the access switch continues to perform data routing for the network device using the original version of the routing service. During the data routing process, the access switch sends bidirectional forwarding detection messages to the network device based on the original version of the routing service to continuously detect the connectivity and health status of the link. The access switch receives bidirectional forwarding detection messages from the network device to confirm the bidirectional connectivity of the link. The access switch detects the exchange of bidirectional forwarding detection messages to promptly detect link faults. While the link status is normal and continuous detection is in progress, the access switch prepares to execute the initialization of the updated version of the routing service.
[0110] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. If the network administrator decides to upgrade the routing protocol to OSPFv3 and receives the corresponding update instruction, and BFD detects no link faults, the access switch will perform the following operations: The access switch verifies the link with the network device is normal via BFD. The access switch continues to perform data routing using OSPFv2, ensuring that packets can be forwarded normally. During data routing, the access switch sends bidirectional forwarding detection messages to the network device to continuously monitor the link status. The access switch receives bidirectional forwarding detection messages from the network device, confirming bidirectional connectivity of the link. The access switch monitors the exchange of bidirectional forwarding detection messages to ensure the link status is normal. While the link status is normal and continuous monitoring is in progress, the access switch prepares to perform OSPFv3 initialization, preparing for the routing protocol upgrade.
[0111] Thus, when executing an update command for the routing service in the access switch, and the first detection result indicates that there is no fault in the communication link, the access switch continues to perform data routing using the original version of the routing service before initializing the updated version, and sends Bidirectional Forwarding Detection (BFD) messages to network devices based on this version. This ensures network stability and data transmission continuity during routing service updates. By continuously sending BFD messages, the access switch can detect the health status of the link in real time, quickly detect any potential faults, and thus respond rapidly when a fault occurs, avoiding service interruption. Simultaneously, this mechanism also ensures smooth upgrades of the routing service, because the access switch can update the routing protocol in an orderly manner after confirming that the link is normal, ensuring that the new version of the routing service can seamlessly take over data routing tasks. This helps reduce network administrator intervention and improves network automation and management efficiency. The access switch not only maintains efficient network operation but also ensures that the network can quickly adapt and recover in the face of routing service updates and link failures, thereby providing more reliable and stable services.
[0112] In step 102, bidirectional forwarding detection messages are sent to the network device in parallel based on the original version of the routing service and the updated version of the routing service in the access switch.
[0113] In some embodiments, within an access switch, the original and updated versions of the routing service run in parallel, simultaneously sending Bidirectional Forwarding Detection (BFD) messages to network devices. When initializing the updated version of the routing service, the access switch does not immediately stop the original version; instead, it allows both versions to run in parallel. This ensures uninterrupted network service during the update process. The original and updated versions of the routing service establish separate BFD sessions with the network devices. Each session runs independently, sending and receiving BFD messages independently. Both versions of the routing service simultaneously send BFD messages to the network devices to detect link connectivity and health. The access switch receives the BFD messages from the network devices and processes them using the updated version of the routing service. After confirming that the updated version of the routing service is running stably and the link status is normal, the access switch can gradually transfer data routing tasks from the original version to the updated version.
[0114] In some embodiments, step 102 above can be implemented as follows: based on the session state, control the original version of the routing service and the updated version of the routing service to send the bidirectional forwarding detection message to the network device in parallel.
[0115] In some embodiments, in an access switch, the process of sending Bidirectional Forwarding Detection (BFD) messages in parallel to network devices using both the original and updated versions of the routing service based on session state control is as follows: After detecting that the communication link is normal, the access switch stores session state information with the network device. This information includes parameters of the BFD session, neighbor information, etc. Based on the stored session state, the original and updated versions of the routing service simultaneously send BFD messages to the network device. These two versions of the service operate independently, each maintaining its own BFD session. The access switch ensures that the BFD session states of the two versions of the routing service remain synchronized. This may involve sharing session state information or synchronizing states between the two services. The two versions of the service independently detect link states to ensure link connectivity and health. If either version of the BFD session detects a link failure, the access switch will trigger the corresponding fault handling mechanism to ensure the continuity of network services. After confirming that the updated version of the routing service is operating stably and the link state is normal, the access switch will gradually transfer data routing tasks from the original version to the updated version of the service.
[0116] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. If the network administrator decides to upgrade the routing protocol to OSPFv3 and receives the corresponding update instruction, and BFD detects no link faults, the access switch will perform the following actions: The access switch stores the bidirectional forwarding detection session state information between itself and the network devices. Both OSPFv2 and OSPFv3 send BFD packets to the network devices simultaneously. The access switch ensures that the bidirectional forwarding detection session states of OSPFv2 and OSPFv3 remain synchronized. The two versions of the service independently detect link states. If either version of the bidirectional forwarding detection session detects a link fault, the access switch will trigger a fault handling mechanism. After confirming that OSPFv3 is running stably and the link state is normal, the access switch will transfer the data routing task from OSPFv2 to OSPFv3.
[0117] In this way, based on session state control, both the original and updated versions of the routing service send Bidirectional Forwarding Detection (BFD) messages to network devices in parallel. This ensures that during routing service upgrades, network devices can continuously receive BFD messages, maintaining link state detection without interrupting the BFD session due to routing service switching. In this manner, the network device's awareness of BFD remains unchanged, ensuring network stability and service continuity. Simultaneously, this mechanism of sending BFD messages in parallel guarantees a smooth transition of routing services, enabling access switches to complete routing protocol upgrades without interrupting network services. This helps reduce network administrator intervention and improves the automation and efficiency of network management. Through this rigorous technical approach, access switches can achieve uninterrupted bidirectional forwarding detection during routing service upgrades, providing users with more stable and efficient data transmission services.
[0118] In some embodiments, the session state includes the sending period of the original version of the routing service for the bidirectional forwarding detection packet. The above-mentioned control of the original version of the routing service and the updated version of the routing service to send the bidirectional forwarding detection packet to the network device in parallel based on the session state can be implemented as follows: The original version of the routing service is controlled to send the bidirectional forwarding detection packet to the network device according to the sending period; and the updated version of the routing service is controlled to read the session state and send the bidirectional forwarding detection packet to the network device according to the sending period in the session state.
[0119] In some embodiments, within the access switch, the session state includes the sending cycle of the original version of the routing service for Bidirectional Forwarding Detection (BFD) packets. Based on this session state, the access switch controls both the original and updated versions of the routing service to send BFD packets to network devices in parallel. After detecting a normal communication link, the access switch initializes the session state, which includes the sending cycle of the BFD packets. This sending cycle is typically configured by the network administrator or automatically determined by the BFD protocol. The access switch controls the original version of the routing service to send BFD packets to network devices according to the sending cycle defined in the session state. These packets are used to periodically check the connectivity and health of the link. After the updated version of the routing service starts, it reads the sending cycle information from the session state, ensuring that the updated version of the service maintains a consistent BFD packet sending rhythm with the original version. The access switch controls the updated version of the routing service to send BFD packets to network devices according to the sending cycle read from the session state. This allows both versions of the service to send BFD packets in parallel, maintaining continuous monitoring of the link status. The two versions of the service independently monitor the link status, ensuring the connectivity and health of the link. After confirming that the updated version of the routing service is running stably and that the link status is normal, the access switch will gradually transfer the data routing tasks from the original version to the updated version of the service.
[0120] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. If the network administrator decides to upgrade the routing protocol to OSPFv3 and receives the corresponding update instruction, and BFD detects no link faults, the access switch will perform the following operations: The access switch initializes the bidirectional forwarding detection session state, including a 1-second transmission period for bidirectional forwarding detection messages. The access switch controls OSPFv2 to send bidirectional forwarding detection messages to network devices at a 1-second transmission period. After OSPFv3 starts, it reads the transmission period information in the session state and learns that the transmission period is 1 second. The access switch controls OSPFv3 to send bidirectional forwarding detection messages to network devices at a 1-second transmission period. OSPFv2 and OSPFv3 independently detect link states. After confirming that OSPFv3 is running stably and the link states are normal, the access switch transfers the data routing task from OSPFv2 to OSPFv3. OSPF is an interior gateway protocol used to exchange routing information within a single autonomous system, using a link-state algorithm to calculate the optimal path.
[0121] In this way, by including the original version of the routing service's sending cycle for Bidirectional Forwarding Detection (BFD) packets in the session state, and controlling the original and updated versions of the routing service to send BFD packets to network devices in parallel based on this session state, the sending cycle of BFD packets is ensured to remain consistent during the routing service upgrade process, thus maintaining continuous link state detection. Specifically, the access switch instructs the original version of the routing service to send BFD packets according to a predefined sending cycle. Simultaneously, the updated version of the routing service, upon startup, reads the same session state and sends BFD packets according to the same sending cycle. This parallel sending mechanism ensures that network devices can continuously receive BFD packets without interruption of the BFD session due to routing service switching, thereby ensuring network stability and service continuity. The access switch can achieve uninterrupted BFD during routing service upgrades, providing users with more stable and efficient data transmission services.
[0122] In some embodiments, see Figure 4 , Figure 4 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 2 , Figure 3 Step 102 shown can be achieved through Figure 4 Steps 1021 to 1022 shown are implemented.
[0123] In step 1021, based on the original version of the routing service, the bidirectional forwarding detection message is periodically sent to the network device.
[0124] In some embodiments, the original version of the routing service of the access switch establishes a bidirectional forwarding detection session with the network device. This typically involves negotiating parameters such as the sending period and detection time of bidirectional forwarding detection messages. Based on the negotiation results or pre-configured parameters, the access switch configures the sending period of bidirectional forwarding detection messages. This period determines the frequency at which the routing service sends bidirectional forwarding detection messages to the network device. The access switch periodically sends bidirectional forwarding detection messages to the network device according to the configured sending period. These messages are used to detect the connectivity and health status of the link. The access switch receives and processes the bidirectional forwarding detection messages from the network device. This includes verifying the integrity of the messages and updating the link status. Based on the received bidirectional forwarding detection messages, the access switch detects the link status. If no bidirectional forwarding detection message is received within a specified time, the access switch assumes a link failure and triggers the corresponding fault handling mechanism. If a link failure is detected, the access switch executes fault handling procedures, such as switching to an alternative path or notifying the network administrator, to ensure the continuity of network services.
[0125] In step 1022, the updated version of the routing service is started, and the bidirectional forwarding detection message is sent to the network device using the same sending cycle as the original version of the routing service.
[0126] In some embodiments, within an access switch, the original version of the routing service periodically sends Bidirectional Forwarding Detection (BFD) packets to network devices, and initiates an updated version of the routing service, sending BFD sessions at the same frequency as the original version. The original version of the routing service on the access switch establishes a BFD session with the network devices, negotiating and determining the sending frequency of the BFD session. The original version of the routing service periodically sends BFD sessions to the network devices according to the negotiated sending frequency. The access switch initiates the updated version of the routing service, which needs to work in conjunction with the original version to ensure the continuity of the BFD session. The updated version of the routing service reads the BFD session state from the original version, including parameters such as the sending frequency. The updated version of the routing service sends BFD sessions to the network devices at the same sending frequency as the original version. The two versions of the routing service maintain synchronization of the BFD session state, ensuring consistent link state detection. The two versions of the service independently detect link state; if a link failure is detected, a corresponding fault handling mechanism is triggered. After confirming that the updated version of the routing service is running stably and the link state is normal, the access switch will gradually transfer data routing tasks from the original version to the updated version of the service.
[0127] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3, and the bidirectional forwarding detection session sending period is configured to 1 second. The access switch will perform the following operations: OSPFv2 establishes a BFD call with the network device, negotiating and determining the bidirectional forwarding detection session sending period to be 1 second. OSPFv2 sends bidirectional forwarding detection sessions to the network device at a 1-second interval. The access switch starts the OSPFv3 routing service. OSPFv3 reads the OSPFv2 bidirectional forwarding detection sessions and learns that the sending period is 1 second. OSPFv3 sends bidirectional forwarding detection sessions to the network device at a 1-second interval. OSPFv2 and OSPFv3 maintain synchronization of the bidirectional forwarding detection session states. The two versions of the service independently detect link status, and if a link failure is detected, a fault handling mechanism will be triggered. After confirming that OSPFv3 is running stably and the link status is normal, the access switch will transfer the data routing task from OSPFv2 to OSPFv3.
[0128] In this way, by maintaining the same bidirectional forwarding detection session transmission cycle for both versions of the routing service, the access switch enables network devices to continuously receive bidirectional forwarding detection sessions and maintain link state monitoring without interrupting the bidirectional forwarding detection sessions during routing service switching. This parallel transmission mechanism of bidirectional forwarding detection sessions ensures a smooth transition of routing services, allowing the access switch to complete routing protocol upgrades without interrupting network services. The access switch can maintain uninterrupted bidirectional forwarding detection during routing service upgrades, providing users with more stable and efficient data transmission services.
[0129] In step 103, the original version of the routing service is controlled to stop receiving bidirectional forwarding detection messages sent by the network device.
[0130] In some embodiments, controlling the original version of the routing service to stop receiving Bidirectional Forwarding Detection (BFD) messages from network devices is a critical step in the access switch, especially during routing service upgrades or migrations. This is to ensure that the original version of the service can orderly terminate communication with network devices before switching to a newer version, without affecting normal link detection and network service continuity. Before starting the updated version of the routing service, the access switch needs to ensure that the session state between the original and updated versions of the routing service is synchronized. This includes parameters such as the BFD session sending period and detection time. The updated version of the routing service establishes a new BFD session with the network device, using the same sending period and detection time parameters as the original version. The updated version of the routing service begins sending BFD sessions to the network device at the same sending period, ensuring that both versions of the service perform link state detection simultaneously. After confirming that the updated version of the routing service is running stably and that the link state is normal, the access switch controls the original version of the routing service to stop receiving BFD sessions from the network device. The access switch formally terminates the BFD session between the original version of the routing service and the network device by sending a BFD session termination message. After the bidirectional forwarding detection session terminates, the access switch will completely switch the data routing task from the original version of the routing service to the updated version.
[0131] In step 104, based on the updated version of the routing service, in response to receiving a bidirectional forwarding detection message returned by the network device, the original version of the routing service is shut down.
[0132] In some embodiments, in an access switch, shutting down the original version of the routing service in response to a Bidirectional Forwarding Detection (BFD) message returned by a network device is a crucial step, ensuring a smooth upgrade of the routing service and stable network operation. The updated routing service establishes a new BFD session with the network device, using the same sending period and detection time parameters as the original version. The updated routing service begins sending BFD sessions to the network device at the same sending period, ensuring that both versions of the service perform link state detection simultaneously. The updated routing service receives BFD sessions from the network device, confirming the normal operation of the BFD session and the stability of the link state. The access switch verifies the link state through the updated routing service, ensuring that the link is normal and can carry network traffic. After confirming that the updated routing service is operating stably and the link state is normal, the access switch shuts down the original version of the routing service based on the BFD sessions received by the updated routing service. The access switch formally terminates the BFD session between the original version of the routing service and the network device by sending a BFD session termination message. After the BFD session terminates, the access switch completely switches the data routing task from the original version of the routing service to the updated version. The updated routing service continues to be responsible for link status detection, ensuring the continuity and stability of network services. Access switches can safely and systematically shut down the original version of the routing service based on the bidirectional forwarding detection sessions received from the updated routing service, ensuring a smooth upgrade of the routing service and stable network operation.
[0133] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 3 , Figure 3 Step 104 shown can be achieved through Figure 5 Steps 1041 to 1042 shown are implemented.
[0134] In step 1041, the original version of the routing service is controlled to stop sending the bidirectional forwarding detection message.
[0135] In some embodiments, controlling the original version of the routing service to stop sending Bidirectional Forwarding Detection (BFD) messages is a critical step in the access switch, especially during routing service upgrades or migrations. This process needs to ensure that the original version of the service can orderly terminate communication with network devices before switching to the updated version, without affecting normal link detection and network service continuity. Before starting the updated version of the routing service, the access switch needs to ensure that the session state between the original and updated versions of the routing service is synchronized. This includes parameters such as the BFD message sending period and detection time. The updated version of the routing service establishes a new BFD session with the network devices, using the same sending period and detection time parameters as the original version. The updated version of the routing service begins sending BFD messages to the network devices at the same sending period, ensuring that both versions of the service perform link state detection simultaneously. After confirming that the updated version of the routing service is running stably and that the link state is normal, the access switch controls the original version of the routing service to stop sending BFD messages. The access switch formally terminates the BFD session between the original version of the routing service and the network devices by sending a BFD session termination message. After the bidirectional forwarding detection session terminates, the access switch completely switches the data routing task from the original version of the routing service to the updated version. The updated version of the routing service continues to be responsible for link state detection, ensuring the continuity and stability of network services.
[0136] In step 1042, the original version of the routing service is controlled to stop executing data routing for the network device.
[0137] In some embodiments, controlling the original version of the routing service to stop sending Bidirectional Forwarding Detection (BFD) messages and cease data routing for the device is an ordered process within the access switch, ensuring network stability and service continuity during routing service upgrades or migrations. The access switch starts an updated version of the routing service and configures its BFD session parameters with the network device to be identical to the original version. The updated routing service begins sending BFD messages to the network device according to the configured sending period, performing link state detection in parallel with the original version. The access switch receives BFD messages returned by the network device through the updated routing service, verifying the normality of the link state. After confirming that the updated routing service is running stably and the link state is normal, the access switch controls the original routing service to stop sending BFD messages. The access switch formally terminates the BFD session between the original routing service and the network device by sending a BFD session termination message. The access switch controls the original routing service to stop executing data routing tasks for the network device, switching data traffic to the updated routing service. The updated routing service continues to be responsible for link state detection, ensuring network service continuity and stability.
[0138] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3. The access switch will perform the following operations: The access switch starts the OSPFv3 routing service and configures its bidirectional forwarding detection session parameters with network devices, sending messages every 1 second. OSPFv3 sends bidirectional forwarding detection messages to network devices every 1 second. The access switch receives bidirectional forwarding detection messages returned by network devices through OSPFv3, verifying the normality of the link status. After confirming that OSPFv3 is running stably and the link status is normal, the access switch controls OSPFv2 to stop sending bidirectional forwarding detection messages. The access switch formally terminates the bidirectional forwarding detection session between OSPFv2 and network devices by sending a bidirectional forwarding detection session termination message. The access switch controls OSPFv2 to stop performing data routing tasks for the network devices and switches data traffic to OSPFv3. OSPFv3 continues to be responsible for link status detection, ensuring the continuity and stability of network services. How can access switches control the original version of the routing service to stop sending bidirectional forwarding detection packets and cease executing data routing tasks, thereby ensuring network stability and service continuity during routing service upgrades? This ensures network stability and service continuity during routing service upgrades while reducing network administrator intervention and improving the automation and efficiency of network management.
[0139] In this way, by controlling the original version of the routing service to stop sending Bidirectional Forwarding Detection (BFD) messages and ceasing data routing for the network devices in the access switch, network stability and service continuity are ensured during routing service upgrades or migrations. Specifically, the access switch first starts the updated version of the routing service and synchronously sends BFD messages to verify the normality of the link status, and then orderly stops sending BFD messages and performing data routing tasks in the original version, thus achieving a smooth transition of the routing service. This method not only reduces network administrator intervention and improves the automation and efficiency of network management, but also ensures that network devices can continuously receive BFD messages and maintain link status detection during routing service switching, without interrupting the BFD session due to the routing service switch. The access switch can achieve uninterrupted BFD during routing service upgrades, providing users with more stable and efficient data transmission services.
[0140] In step 105, data routing for the network device is performed based on the updated version of the routing service.
[0141] In some embodiments, performing data routing for network devices based on an updated version of the routing service is a critical process that ensures network service upgrades and optimizations. The access switch initiates the updated version of the routing service, for example, upgrading from OSPFv2 to OSPFv3. The updated routing protocol parameters are configured, including network topology, neighbor relationships, and link-state database. The updated routing service establishes a bidirectional forwarding detection session with the network device, negotiating and determining the sending period and detection time for bidirectional forwarding detection messages. The updated routing service monitors the link status with the network device in real time by sending and receiving bidirectional forwarding detection messages. Based on the link-state database, the updated routing service calculates the optimal path and updates the routing table. The access switch, based on the updated routing table, performs data routing tasks for the network device, forwarding packets to the correct path. After confirming that the updated routing service is running stably and the link status is normal, the access switch switches data traffic from the original version of the routing service to the updated version. The updated routing service may offer better performance and functionality, such as support for more network features and higher convergence speed. Continuous monitoring of the updated routing service's operational status ensures the stability and reliability of the network service.
[0142] In some embodiments, see Figure 6 , Figure 6 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 4 , Figure 3Step 105 shown can be achieved through Figure 6 Steps 1051 to 1053 shown are implemented.
[0143] In step 1051, the first moment when the original version of the routing service last received the bidirectional forwarding detection message sent by the network device, and the second moment when the updated version of the routing service first received the bidirectional forwarding detection message sent by the network device are obtained.
[0144] In some embodiments, obtaining the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device, is a crucial process to ensure the continuity of the BFD session and network stability during routing service handover. The original version of the routing service establishes a BFD session with the network device and begins periodically exchanging BFD messages. After the updated version of the routing service starts, it establishes a new BFD session with the network device, using the same sending period and detection time parameters as the original version. The original version of the routing service records the moment when it last received a BFD message from the network device, i.e., the first moment. The updated version of the routing service records the moment when it first received a BFD message from the network device, i.e., the second moment. Analyzing the time interval between the first and second moments ensures that the BFD session does not experience prolonged interruptions during handover. If the time interval is too long, it may indicate a problem during handover, requiring troubleshooting. After confirming that the updated version of the routing service is running stably and the link status is normal, the access switch switches the data routing task from the original version of the routing service to the updated version. Simultaneously, the original version of the routing service stops sending bidirectional forwarding detection messages and terminates the bidirectional forwarding detection session with network devices. The updated version of the routing service continues to be responsible for link state detection, ensuring the continuity and stability of network services.
[0145] In step 1052, based on the first time and the second time, fault detection is performed on the communication link between the access switch and the network device to obtain a second detection result.
[0146] In some embodiments, the access switch obtains the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device. The access switch then starts the updated version of the routing service and configures its BFD session parameters with the network device to ensure they are identical to the original version. The original version of the routing service records the last moment when it received a BFD message from the network device, i.e., the first moment. The updated version of the routing service begins receiving BFD messages and records the first moment when it receives a BFD message, i.e., the second moment. The access switch calculates the time interval between the first and second moments to assess whether the communication link was interrupted during the routing service handover. Based on the calculated time interval, the access switch performs fault detection on the communication link. If the time interval exceeds a preset threshold, it may indicate that the link failed during the handover. The access switch generates a second detection result based on the fault detection result, indicating the health status of the communication link. If the second detection result indicates a link failure, the access switch will take corresponding fault handling measures, such as restarting the BFD session or switching to a backup link. The updated routing service continues to be responsible for link status detection, ensuring the continuity and stability of network services.
[0147] As an example, assume the access switch is currently running the OSPFv2 routing protocol and uses BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3. The access switch will perform the following operations: The access switch starts the OSPFv3 routing service and configures its BFD session parameters with network devices, sending packets every 1 second. OSPFv2 records the last time it received a BFD packet from a network device, i.e., the first moment. OSPFv3 starts receiving BFD packets and records the first time it received a BFD packet, i.e., the second moment. The access switch calculates the time interval between the first and second moments, for example, 0.5 seconds. Based on the calculated time interval, the access switch performs fault detection on the communication link. If the time interval exceeds a preset threshold (e.g., 1 second), it may indicate a link failure during handover. The access switch generates a second detection result based on the fault detection result, indicating the health status of the communication link. For example, if the time interval is 0.5 seconds, less than the threshold, the link is healthy; if the time interval is 2 seconds, greater than the threshold, the link may have failed. If the second detection result indicates a link failure, the access switch will take corresponding fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link. OSPFv3 continues to be responsible for link status detection to ensure the continuity and stability of network services.
[0148] Thus, by obtaining the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device, and performing fault detection on the communication link based on these two moments, the access switch can determine whether an interruption or delay occurred in the communication link during the routing service switchover by using the time interval between the first and second moments. If the time interval exceeds a preset threshold, it may indicate that a link failure occurred during the switchover, requiring corresponding fault handling measures, such as restarting the BFD session or switching to a backup link. This not only ensures network stability and service continuity during routing service upgrades but also enables timely detection and handling of communication link failures, improving network reliability and stability.
[0149] In some embodiments, step 1052 above can be implemented as follows: based on the updated version of the routing service, read the session state between the original version of the routing service and the network device, the session state including a preset time period for fault detection; obtain the time difference between the first moment and the second moment, and compare the time difference with the preset time period to obtain a comparison result; in response to the comparison result indicating that the time difference is greater than the preset time period, determine the second detection result as indicating that the communication link has a fault; in response to the comparison result indicating that the time difference is less than or equal to the preset time period, determine the second detection result as indicating that the communication link does not have a fault.
[0150] In some embodiments, in an access switch, based on an updated version of the routing service, the session state between the original version of the routing service and the network device is read, the time difference between a first moment and a second moment is obtained, and this time difference is compared with a preset time period to determine whether a communication link is faulty. The access switch starts the updated version of the routing service and configures its bidirectional forwarding detection session parameters with the network device to ensure that they are the same as the original version of the routing service. The updated version of the routing service reads the session state between the original version of the routing service and the network device, including a preset time period for fault detection. The access switch calculates the time difference between the first moment and the second moment. The calculated time difference is compared with the preset time period to obtain a comparison result. If the comparison result indicates that the time difference is greater than the preset time period, the access switch determines the second detection result as a communication link fault. If the comparison result indicates that the time difference is less than or equal to the preset time period, the access switch determines the second detection result as no communication link fault. If the second detection result indicates a communication link failure, the access switch will take corresponding fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link. The updated version of the routing service continues to be responsible for link status detection to ensure the continuity and stability of network services.
[0151] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3. The access switch starts the OSPFv3 routing service and configures its bidirectional forwarding detection session parameters with network devices, sending data every second. OSPFv3 reads the session state between OSPFv2 and network devices, including a preset time period of 1 second for fault detection. The access switch calculates the time difference between the first and second moments, for example, 0.5 seconds. It compares the calculated time difference (0.5 seconds) with the preset time period (1 second) to obtain the comparison result. If the comparison result indicates that the time difference is less than or equal to the preset time period, the access switch determines that the communication link is not faulty. If the second detection result indicates that the communication link is faulty, the access switch will take appropriate fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link. OSPFv3 continues to be responsible for link status detection, ensuring the continuity and stability of network services.
[0152] Thus, by reading the session state between the original routing service and network devices based on the updated version of the routing service in the access switch, including a preset time period for fault detection, and then obtaining the time difference between the first and second moments and comparing it with the preset time period, the access switch can determine whether the communication link has been interrupted or delayed during the routing service switchover. If the time difference exceeds a preset threshold, it may indicate a link failure during the switchover, requiring corresponding fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link. This not only ensures network stability and service continuity during routing service upgrades but also enables timely detection and handling of communication link failures, improving network reliability and stability.
[0153] In some embodiments, after step 1052 above, the following process may also be performed: in response to the second detection result indicating that the communication link is faulty, the routing service of the access switch for the network device is shut down.
[0154] In some embodiments, in an access switch, in response to a second detection result indicating a communication link failure, the access switch shuts down its routing service for the network device to ensure network stability and service continuity. The access switch receives a second detection result indicating a communication link failure. Based on the second detection result, the access switch decides to shut down its routing service for the network device. The access switch performs the shutdown operation, stopping the routing service for the network device, including stopping the sending of bidirectional forwarding detection messages and stopping the execution of data routing tasks. The access switch takes appropriate fault-handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link, to restore the stability of the communication link. The access switch continues to be responsible for detecting the link status to ensure the continuity and stability of network services.
[0155] As an example, assume the access switch is currently running the OSPFv2 routing protocol and uses BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3. The access switch will perform the following operations: The access switch receives a second detection result indicating a fault in the communication link. Based on the second detection result, the access switch decides to shut down the OSPFv2 routing service for the network device. The access switch performs the shutdown operation, stopping the OSPFv2 routing service for the network device, including stopping the sending of bidirectional forwarding detection messages and stopping the execution of data routing tasks. The access switch takes appropriate fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link, to restore the stability of the communication link.
[0156] Thus, in response to the second detection result indicating a communication link failure, the access switch immediately shuts down the routing service for the network device. When the access switch detects a communication link failure, it prevents the continued forwarding of data packets through the faulty link, thereby avoiding data loss and network congestion. Furthermore, shutting down the routing service for the faulty link prompts the network device to reselect other available links for communication, improving network reliability and stability. Simultaneously, this rapid response mechanism helps shorten fault recovery time, ensuring the continuity and availability of network services. The access switch's ability to promptly detect and handle communication link failures guarantees normal network operation and a positive user experience.
[0157] In step 1053, in response to the second detection result indicating that there is no fault in the communication link, data routing for the network device is performed through the updated version of the routing service.
[0158] In some embodiments, in the access switch, the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device, are obtained; based on these two moments, fault detection is performed on the communication link to obtain a second detection result; in response to the second detection result indicating that there is no fault in the communication link, data routing for the network device is performed through the updated version of the routing service to ensure network stability and service continuity during the routing service upgrade process.
[0159] In some embodiments, the access switch initiates an updated version of the routing service and configures its bidirectional forwarding detection session parameters with the network device to ensure they are identical to the original version. The original version of the routing service records the last time a bidirectional forwarding detection packet sent by the network device was received, i.e., the first moment. The updated version of the routing service begins receiving bidirectional forwarding detection packets and records the first time a bidirectional forwarding detection packet is received, i.e., the second moment. The access switch calculates the time difference between the first and second moments and compares it with a preset time period. If the time difference is less than or equal to the preset time period, the access switch determines the second detection result as indicating that the communication link is not faulty. The updated version of the routing service begins executing data routing tasks for the network device to ensure the continuity and stability of the network service. The updated version of the routing service continues to be responsible for link status detection to ensure the continuity and stability of the network service.
[0160] As an example, assume the access switch is currently running the OSPFv2 routing protocol and using BFD for fault detection. The network administrator plans to upgrade the routing protocol to OSPFv3. The access switch will perform the following operations: The access switch starts the OSPFv3 routing service and configures its BFD session parameters with the network devices, with a sending period of 1 second. OSPFv2 records the last time it received a BFD message from the network device, i.e., the first moment. OSPFv3 starts receiving BFD messages and records the first time it receives a BFD message, i.e., the second moment. The access switch calculates the time difference between the first and second moments, for example, 0.5 seconds. The calculated time difference (0.5 seconds) is compared with a preset time period (1 second). If the comparison result indicates that the time difference is less than or equal to the preset time period, the access switch determines the second detection result as indicating that there is no fault in the communication link. In response to the second detection result indicating that there is no fault in the communication link, the access switch switches the data routing task from OSPFv2 to OSPFv3. OSPFv3 begins executing data routing tasks for the network devices, ensuring the continuity and stability of network services. OSPFv3 continues to be responsible for link state detection, ensuring the continuity and stability of network services.
[0161] Thus, by obtaining the moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the moment when the updated version of the routing service first received the same message, the time difference between the two moments can be accurately calculated. The time difference calculation is based on the BFD protocol's timer mechanism, typically including a detection time (e.g., 1 second) and a timeout time (e.g., 3 seconds). By comparing the time difference between these two moments with a preset time period (e.g., 3 times the detection time), the health status of the communication link can be effectively determined. If the time difference is less than or equal to the preset time period, it indicates that the link remains active after the updated version of the routing service is started, and no failure has occurred. Therefore, data routing for network devices can be safely performed through the updated version of the routing service, ensuring the continuity and stability of network services. This not only improves the accuracy of fault detection for network devices but also shortens fault recovery time, thereby enhancing the reliability and performance of the entire network.
[0162] In some embodiments, when performing step 105 above, the following processing may also be performed: based on the updated version of the routing service, obtain the time when the updated version of the routing service last received the bidirectional forwarding detection message; based on the time and a preset time period, perform fault detection on the communication link between the access switch and the network device to obtain a third detection result; in response to the third detection result indicating that the communication link has a fault, shut down the routing service for the network device performed by the updated version of the routing service.
[0163] In some embodiments, in an access switch, the time when it last received a Bidirectional Forwarding Detection (BFD) message is obtained based on an updated version of the routing service; based on this time and a preset time period, a fault detection is performed on the communication link to obtain a third detection result; in response to the third detection result indicating that there is a fault in the communication link, the routing service for the network device executed by the updated version of the routing service is shut down to ensure the stability of the network and the continuity of services during the routing service upgrade process.
[0164] In some embodiments, the access switch initiates an updated version of the routing service and configures its bidirectional forwarding detection session parameters with the network device to ensure they are identical to the original version of the routing service. The updated routing service records the last time it received a bidirectional forwarding detection packet from the network device. Based on the recorded time and a preset time period, the access switch performs fault detection on the communication link, calculating the time difference between the current time and the time when the bidirectional forwarding detection packet was last received. If the time difference exceeds the preset time period, the access switch determines that the communication link is faulty based on the third detection result. In response to the third detection result indicating a communication link fault, the access switch decides to shut down the routing service for the network device performed by the updated routing service. The access switch performs the shutdown operation, stopping the updated routing service for the network device, including stopping the sending of bidirectional forwarding detection packets and stopping the execution of data routing tasks. The access switch takes appropriate fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link, to restore the stability of the communication link. The access switch continues to be responsible for detecting the link status to ensure the continuity and stability of network services.
[0165] As an example, assume the access switch is currently running the OSPFv3 routing protocol and using BFD for fault detection. The network administrator plans to ensure the stable operation of OSPFv3. The access switch starts the OSPFv3 routing service and configures its BFD session parameters with network devices, with a sending period of 1 second. OSPFv3 records the last time it received a BFD message from a network device. The access switch calculates the time difference between the current time and the last time it received a BFD message, for example, 2 seconds. The calculated time difference (2 seconds) is compared with a preset time period (1 second). If the comparison result indicates that the time difference exceeds the preset time period, the access switch determines that the communication link is faulty. In response to the third detection result indicating a communication link fault, the access switch decides to shut down the OSPFv3 routing service for the network device. The access switch takes appropriate fault handling measures, such as restarting the BFD session or switching to a backup link, to restore the stability of the communication link. The access switch continues to be responsible for link status detection to ensure the continuity and stability of network services.
[0166] Thus, by comparing this moment with a preset time period, it is possible to accurately determine whether a communication link has failed. If the updated version of the routing service does not receive bidirectional forwarding detection messages from the network device within the preset time period, it indicates a potential problem with the link. In this case, by disabling the routing service executed by the updated version of the routing service for the network device, data packets can be prevented from continuing to be transmitted on the faulty link, thereby avoiding data loss and network congestion. This not only improves the accuracy of fault detection for network devices but also shortens fault recovery time, thereby enhancing the reliability and performance of the entire network.
[0167] In some embodiments, the above-mentioned fault detection of the communication link between the access switch and the network device based on the time and the preset time period to obtain a third detection result can be implemented in the following ways: in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, the third detection result is determined to indicate that the communication link is faulty; in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, the third detection result is determined to indicate that the communication link is not faulty.
[0168] In some embodiments, within an access switch, based on the stated time and the preset time period, fault detection is performed on the communication link between the access switch and the network device to obtain a third detection result. The access switch then initiates an updated version of the routing service and configures its bidirectional forwarding detection session parameters with the network device to ensure they are identical to the original version of the routing service. The updated version of the routing service records the time when it last received a bidirectional forwarding detection packet from the network device. Based on the recorded time and the preset time period, the access switch performs fault detection on the communication link. If, within the preset time period, the original version of the routing service does not receive a bidirectional forwarding detection packet from the network device, the access switch determines the third detection result as indicating a communication link fault. If, within the preset time period, the original version of the routing service receives a bidirectional forwarding detection packet from the network device, the access switch determines the third detection result as indicating no communication link fault. In response to the third detection result indicating a communication link fault, the access switch decides to shut down the routing service for the network device executed by the updated version of the routing service. The access switch performs a shutdown operation, stopping the routing service for the network device by the updated version of the routing service, including stopping the sending of bidirectional forwarding detection packets and stopping the execution of data routing tasks. The access switch takes appropriate fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link, to restore the stability of the communication link. The access switch continues to be responsible for detecting the link status to ensure the continuity and stability of network services.
[0169] As an example, assume the access switch is currently running the OSPFv3 routing protocol and using BFD for fault detection. The network administrator plans to ensure the stable operation of OSPFv3. The access switch starts the OSPFv3 routing service and configures its BFD session parameters with the network device, with a sending period of 1 second. OSPFv3 last received a BFD message from the network device. The access switch calculates the time difference between the current time and the last time a BFD message was received, for example, 2 seconds. If, within a preset time period (e.g., 1 second), the original version of the routing service does not receive a BFD message from the network device, the access switch determines that the communication link is faulty based on the third detection result. If, within the preset time period, the original version of the routing service receives a BFD message from the network device, the access switch determines that the communication link is not faulty based on the third detection result. In response to the third detection result indicating a communication link fault, the access switch decides to disable the OSPFv3 routing service for the network device. The access switch performs a shutdown operation, ceasing OSPFv3 routing services for the network devices, including stopping the sending of bidirectional forwarding detection messages and ceasing data routing tasks. The access switch takes appropriate fault-handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link, to restore the stability of the communication link. The access switch continues to be responsible for link status monitoring to ensure the continuity and stability of network services.
[0170] Thus, the communication link fault detection method based on time and preset time period determines the third detection result—that is, whether the communication link is faulty—by responding to whether the original version of the routing service receives Bidirectional Forwarding Detection (BFD) messages from network devices within the preset time period. Utilizing the fast fault detection characteristic of the BFD protocol, it can identify link faults within milliseconds. When the original version of the routing service does not receive BFD messages within the preset time period, it indicates a possible link fault. In this case, the third detection result confirms a communication link fault, and corresponding fault recovery measures are taken, such as switching to a backup link or restarting the BFD session. Conversely, if BFD messages are received within the preset time period, it indicates the link is normal, and the third detection result confirms no communication link fault. Data routing continues through the updated version of the routing service. This not only improves the accuracy of network device fault detection but also shortens fault recovery time, thereby enhancing the reliability and performance of the entire network.
[0171] In some embodiments, after performing fault detection on the communication link between the access switch and the network device and obtaining a third detection result, the following processing may also be performed: in response to the third detection result indicating that the communication link is not faulty, based on the updated version of the routing service, the bidirectional forwarding detection message is received again based on the updated version of the routing service, the session state between the updated version of the routing service and the network device is determined, and the session state between the updated version of the routing service and the network device is stored.
[0172] In some embodiments, within the access switch, based on the stated time and the preset time period, fault detection is performed on the communication link between the access switch and the network device. After obtaining a third detection result, the access switch evaluates the third detection result. If it indicates that there is no fault in the communication link, subsequent processing continues. Based on the updated version of the routing service, the access switch receives a Bidirectional Forwarding Detection (BFD) message again. Based on the received BFD message, the access switch determines the session state between the updated version of the routing service and the network device. This may include whether the session is active, the health status of the session, etc. The access switch stores the determined session state for later reference and use. This helps the access switch understand the current network state and make adjustments when necessary. The access switch continues to be responsible for link state detection to ensure the continuity and stability of network services.
[0173] As an example, assume the access switch is currently running the OSPFv3 routing protocol and using BFD for fault detection. The network administrator plans to ensure the stable operation of OSPFv3. The access switch evaluates the third detection result; if it indicates that there is no fault in the communication link, it continues with subsequent processing. Based on the OSPFv3 routing service, the access switch receives another bidirectional forwarding detection message. Based on the received bidirectional forwarding detection message, the access switch determines the session state between the OSPFv3 routing service and the network device, such as session activity and session health. The access switch stores the determined session state for later reference and use. This helps the access switch understand the current network state and make adjustments as necessary. The access switch continues to be responsible for link state detection, ensuring the continuity and stability of network services.
[0174] Thus, after fault detection of the communication link between the access switch and network devices and obtaining the third detection result, if the result indicates that the communication link is not faulty, the session state between the updated version of the routing service and the network devices can be determined by receiving Bidirectional Forwarding Detection (BFD) messages again through the updated version of the routing service. The session state management mechanism based on the BFD protocol, by analyzing the state information in the received Bidirectional Forwarding Detection messages, can understand key information such as session activity and health status in real time. Storing the determined session state not only helps the access switch detect the current network status but also provides an important basis for subsequent network management and troubleshooting. This not only improves the accuracy of fault detection for network devices but also enhances the network's self-healing capabilities and management efficiency, thereby improving the overall reliability and performance of the network.
[0175] As an example, see Figure 8 , Figure 8 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 1 The original version of the routing service is marked as "stop receiving," meaning it no longer processes bidirectional forwarding detection messages sent by network devices. Only uplink packets are allowed to pass through the original version service, ensuring the normal transmission of data on established connections. The database and storage components maintain records of the original version service but enter a degraded state. The updated version of the routing service is activated, marked as "start receiving," and begins processing bidirectional forwarding detection messages. It supports uplink packet forwarding only and runs in parallel with the original version service. The updated version of the routing service is initialized and sends bidirectional forwarding detection messages to network devices by sending new data. The storage and database synchronize the status of the updated version. The original and updated versions of the routing service send bidirectional forwarding detection messages to network devices in parallel, but the original version is controlled to stop receiving response messages. When the updated version service confirms receipt of the bidirectional forwarding detection message returned by the network device (i.e., link health verification is successful), it immediately shuts down the original version service. Finally, the updated version of the routing service takes over and performs full data routing to network devices. Access switch: As the control center, it coordinates the initialization, detection message sending, and switching actions of the old and new versions of the service. Storage and Database: Records service status to ensure data consistency during degradation and upgrade processes. Bidirectional Forwarding Detection: Verifies the reliability of links between old and new services and network devices, serving as a core basis for switching decisions.
[0176] Thus, in response to the routing service update command in the access switch, the updated version of the routing service is initialized. Both the original and updated versions of the routing service are used in parallel to send bidirectional forwarding detection packets to the network device. Simultaneously, the original version of the service is controlled to stop receiving bidirectional forwarding detection packets. This allows the network device to continuously receive bidirectional forwarding detection packets, maintaining link state fault detection without interrupting bidirectional forwarding detection due to the routing service upgrade. When the updated version of the routing service receives the bidirectional forwarding detection packets returned by the network device, it shuts down the original version of the service, achieving a smooth transition of the routing service. Ultimately, the updated version of the routing service takes over the data routing task, ensuring the continuity and stability of the network service. This allows the access switch to complete the routing service upgrade without interrupting bidirectional forwarding detection, effectively improving the stability of bidirectional forwarding detection during the routing service version upgrade process.
[0177] In some embodiments, see Figure 7 , Figure 7 This is a flowchart illustrating the method for updating the routing service version provided in this application embodiment. Figure 5 , will combine Figure 7 Steps 201 to 203 are described below. The method for updating the routing service provided in this application embodiment can be implemented by the access switch or network device alone, or by the access switch and network device working together. The following description will take the implementation by the network device alone as an example.
[0178] In step 201, during the data routing process through the routing service in the access switch, the network device receives a first bidirectional forwarding detection message sent by the access switch and sends a second bidirectional forwarding detection message to the access switch.
[0179] In some embodiments, the second bidirectional forwarding detection message is used by the access switch to perform fault detection on the communication link between the access switch and the network device.
[0180] In some embodiments, the network device receives a first bidirectional forwarding detection (BOT) message sent by the access switch, which is sent by the access switch to establish and maintain a BOT session. After receiving the first BOT message, the network device sends a second BOT message to the access switch in response. The second BOT message not only confirms that the network device has received the first BOT message but also contains the network device's own status information, such as session status and detection timers. Upon receiving the second BOT message, the access switch performs fault detection on the communication link based on the information contained in the message. Specifically, the access switch records the reception time of the second BOT message and compares it with a preset time period. If the access switch does not receive a BOT message from the network device within the preset time period, it considers the communication link faulty and takes corresponding fault recovery measures. Conversely, if the access switch receives a BOT message from the network device within the preset time period, it considers the communication link normal and continues data routing through the routing service.
[0181] In step 202, the network device performs fault detection on the communication link based on the first bidirectional forwarding detection message to obtain a fourth detection result.
[0182] In some embodiments, during data routing via the routing service in an access switch, a network device receives a first Bidirectional Forwarding Detection (BFD) message from the access switch. This first BFD message is sent by the access switch to establish and maintain a BFD session and contains information such as the access switch's session state and detection timer. Upon receiving the first BFD message, the network device performs fault detection on the communication link based on this message. Specifically, the network device records the reception time of the first BFD message and compares it with a preset time period. This preset time period is typically set based on the BFD protocol's detection time (e.g., 1 second) and timeout time (e.g., 3 seconds). If the network device does not receive a BFD message from the access switch within the preset time period, it considers the communication link faulty and determines the fourth detection result as indicating a communication link failure. In this case, the network device will take appropriate fault recovery measures, such as switching to a backup link or restarting the BFD session. Conversely, if the network device receives a BFD message from the access switch within the preset time period, it considers the communication link normal and determines the fourth detection result as indicating no communication link failure. At this point, the network device will continue to route data through the routing service.
[0183] In step 203, in response to the fourth detection result indicating a fault in the communication link, a handover is performed for the access switch.
[0184] In some embodiments, the network device receives a first Bidirectional Forwarding Detection (BFD) message sent by the access switch, which is sent by the access switch to establish and maintain a BFD session. The network device sends a second BFD message to the access switch in response to the first BFD message. The second BFD message contains the network device's own state information, such as session state and detection timer. Based on the received first BFD message, the network device performs fault detection on the communication link. Specifically, the network device records the reception time of the first BFD message and compares it with a preset time period. If the network device does not receive a BFD message from the access switch within the preset time period, it considers the communication link to be faulty and determines the fourth detection result as indicating a communication link fault. If the network device receives a BFD message from the access switch within the preset time period, it considers the communication link to be normal and determines the fourth detection result as indicating no communication link fault. In response to the fourth detection result indicating a communication link fault, the network device performs a handover to the access switch. This may include switching to a backup access switch, restarting the BFD session, etc. Network devices continue to be responsible for detecting link status to ensure the continuity and stability of network services.
[0185] As an example, suppose a network device is currently routing data through access switch A and using BFD for fault detection. The network device will perform the following operations: The network device receives a first bidirectional forwarding detection (BFD) message from access switch A. The network device sends a second BFD message to access switch A, acknowledging receipt of the first BFD message and including its own status information. The network device records the moment the first BFD message is received and compares it to a preset time period (e.g., 3 seconds). If the network device does not receive a BFD message from access switch A within 3 seconds, it assumes a communication link failure and determines the fourth detection result as indicating a communication link failure. If the network device receives a BFD message from access switch A within 3 seconds, it assumes the communication link is normal and determines the fourth detection result as indicating no communication link failure. In response to the fourth detection result indicating a communication link failure, the network device performs a handover to access switch A. For example, the network device may switch to a backup access switch B or restart the BFD session to attempt to restore communication with access switch A. The network device continues to be responsible for link status detection to ensure the continuity and stability of network services.
[0186] Thus, during data routing via the routing service in the access switch, the network device receives a first Bidirectional Forwarding Detection (BFD) message from the access switch and sends a second BFD message to the access switch. Based on the first BFD message, the network device performs fault detection, enabling it to quickly identify link failures and restore network service continuity by performing a switchover to the access switch, such as switching to a backup link or restarting the BFD session. This not only improves the accuracy of fault detection but also shortens fault recovery time, thereby enhancing the reliability and performance of the entire network. The network device can respond quickly and take measures when a link failure occurs, ensuring the stability and availability of network services.
[0187] The following will describe an exemplary application of the embodiments of this application in a real-world cloud private line network architecture application scenario.
[0188] A cloud private line network architecture refers to a network structure that connects an enterprise's internal network to a cloud service provider's cloud platform via a dedicated network. This architecture allows enterprises to securely transmit data and applications to the cloud while maintaining control over network performance and security. Implementing a cloud private line network architecture requires consideration of various factors, including network technology, equipment selection, network design, security strategies, and cost budgets. Enterprises need to collaborate with cloud service providers and network service providers to jointly design and implement a cloud private line network architecture tailored to their specific needs.
[0189] In a cloud private line network architecture, enterprises connect to the cloud private line via dedicated lines to obtain more stable and faster network services. These dedicated line connections typically require the user's CPE device to interface with Tencent Cloud's switches. With technological advancements, network equipment requires regular software upgrades to add new features or fix faults. However, since these switches support access from multiple customers, directly shutting down for upgrades would disrupt services and impact customer experience.
[0190] In some embodiments, see Figure 9 , Figure 9 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 2 The embodiments of this application can be applied to, for example, Figure 9 The leased line access scenario shown is applicable to leased line architectures, i.e., customer CER (user edge router). Figure 9The user CPE shown refers to network equipment installed in a user's residence or business premises. These devices typically include routers, switches, modems, and other network interface devices. They are used to connect users' network devices (such as computers, smartphones, etc.) to external networks (such as the network of an Internet service provider) and interfacing with Layer 3 switches. Since access switches carry multiple customer accesses, if the switch has new features or malfunctions requiring software upgrades, and upgrades cannot be performed while the switch is powered down, the switch needs to support hot upgrade capabilities to ensure that the upgrade process has no impact on services (BFD fault detection logic) and is imperceptible to customers. Therefore, in this embodiment, after modifying the switch, the switch software version is upgraded to a new version using the switch's hot upgrade capability. Dedicated gateway 1 communicates with the Layer 3 switch through a dedicated channel VLAN 1, and dedicated gateway 2 communicates with the Layer 3 switch through a dedicated channel VLAN 2. Dedicated gateway 1 corresponds to VPC1, and dedicated gateway 2 corresponds to VPC2. Cloud access switches and routing tables are deployed in VPC1 and VPC2.
[0191] In some embodiments, specific technical solutions, such as Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the principle of the routing service version update method provided in the embodiments of this application. Figure 3 The core of this application's embodiment is the addition of a DB storage module to back up the state information of the bidirectional forwarding detection session during software upgrades, ensuring rapid restoration of the bidirectional forwarding detection session state during upgrades. By sending BFD up messages to both the old and new software services, the bidirectional forwarding detection session at both ends is maintained, ensuring uninterrupted bidirectional forwarding detection sessions during upgrades and downgrades, independent of upgrade time. This allows for seamless upgrades of BFD and its associated protocols on a single device.
[0192] In some embodiments, a DB database is added locally to store BFD state information, and the currently running routing service saves the BFD state information to the DB in real time.
[0193] In some embodiments, see Figure 10 When a new service starts up, before the routing service is upgraded, the new version of the routing service is started and put into standby mode. In this mode, the listening port for the bidirectional forwarding detection session is not started, and no packet receiving or sending is performed.
[0194] In some embodiments, see Figure 10When upgrading the old service, the old version of the service is downgraded first. The receiving port of the bidirectional forwarding detection session is closed, and bidirectional forwarding detection packets are no longer received (while bidirectional forwarding detection packets are received through the new version of the service). The state machine changes of the bidirectional forwarding detection session are stopped, but the ability to send BFD up packets is still preserved. The sending capability of the old and new versions coexists, ensuring that the user side is unaware of it.
[0195] In some embodiments, the new service upgrades the routing, the new version of the service is upgraded, and it switches to the master state (dominant state). First, it restores the bidirectional forwarding detection session data in the UP state from the DB, starts listening ports for these bidirectional forwarding detection sessions to receive packets, and starts the state machine of the bidirectional forwarding detection sessions to send packets (the packet sending and receiving capabilities of the new version of the service are fully activated).
[0196] In some embodiments, after the old service deletes routes and the new version service is upgraded, the old version service stops forwarding packets for the bidirectional detection session and then exits completely, completing the service version upgrade.
[0197] In some embodiments, if a link failure occurs during the upgrade process, the peer (CRE) bidirectional forwarding detection session will detect the disconnection, ensuring that the protocol of the linked bidirectional forwarding detection session can detect the fault in a timely manner and perform fault convergence.
[0198] Thus, using the solution provided in this application embodiment, BFD upgrades can be seamlessly performed on a single device, with no awareness of the bidirectional forwarding detection session at the peer end. During the upgrade process, the bidirectional forwarding detection session is detected normally, avoiding service traffic loss in fault-free scenarios during the upgrade process, and enabling timely detection and fault convergence in fault scenarios, thereby reducing traffic loss.
[0199] It is understood that in the embodiments of this application, data related to bidirectional forwarding detection messages is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0200] The following description continues to illustrate the exemplary structure of the routing service version update device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2As shown, the software modules in the routing service version update device 455 stored in the memory 450 may include: an initialization module 4551, configured to initialize an updated version of the routing service in the access switch in response to an update command for the routing service in the access switch; a control module 4552, configured to send bidirectional forwarding detection messages to the network device in parallel based on the original version of the routing service in the access switch and the updated version of the routing service, and control the original version of the routing service to stop receiving bidirectional forwarding detection messages sent by the network device; a shutdown module 4553, configured to shut down the original version of the routing service in response to receiving a bidirectional forwarding detection message returned by the network device based on the updated version of the routing service; and an execution module 4554, configured to execute data routing for the network device based on the updated version of the routing service.
[0201] In some embodiments, the above-described routing service version update apparatus further includes: a detection module, configured to perform fault detection on the communication link between the access switch and the network device based on the original version of the routing service, and obtain a first detection result; the above-described initialization module is further configured to initialize the updated version of the routing service in the access switch in response to an update instruction for the routing service in the access switch, and the first detection result indicating that there is no fault in the communication link.
[0202] In some embodiments, the detection module is further configured to, in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within a preset time period, determine the first detection result as indicating that the communication link is not faulty; and in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period, determine the first detection result as indicating that the communication link is faulty.
[0203] In some embodiments, the above-described routing service version update apparatus further includes: a shutdown module, configured to, in response to the first detection result indicating a fault in the communication link, control the original version of the routing service in the access switch to stop executing the routing service for the network device; control the original version of the routing service to stop receiving bidirectional forwarding detection messages sent by the network device; and control the original version of the routing service to stop sending the bidirectional forwarding detection messages.
[0204] In some embodiments, the above-mentioned routing service version update device further includes: a storage module, configured to determine the session state between the original version of the routing service and the network device in response to the first detection result indicating that the communication link has no fault, and to store the session state; the above-mentioned control module is further configured to control the original version of the routing service and the updated version of the routing service to send the bidirectional forwarding detection message to the network device in parallel based on the session state.
[0205] In some embodiments, the session state includes the sending period of the original version of the routing service for the bidirectional forwarding detection packet. The control module is further configured to control the original version of the routing service to send the bidirectional forwarding detection packet to the network device according to the sending period; and to control the updated version of the routing service to read the session state and send the bidirectional forwarding detection packet to the network device according to the sending period in the session state.
[0206] In some embodiments, the execution module is further configured to obtain the first moment when the original version of the routing service last received the bidirectional forwarding detection message sent by the network device, and the second moment when the updated version of the routing service first received the bidirectional forwarding detection message sent by the network device; based on the first moment and the second moment, perform fault detection on the communication link between the access switch and the network device to obtain a second detection result; and in response to the second detection result indicating that there is no fault in the communication link, perform data routing for the network device through the updated version of the routing service.
[0207] In some embodiments, the execution module is further configured to: read the session state between the original version of the routing service and the network device based on the updated version of the routing service, wherein the session state includes a preset time period for fault detection; obtain the time difference between the first moment and the second moment, and compare the time difference with the preset time period to obtain a comparison result; determine the second detection result as a fault in the communication link in response to the comparison result indicating that the time difference is greater than the preset time period; and determine the second detection result as a fault-free communication link in response to the comparison result indicating that the time difference is less than or equal to the preset time period.
[0208] In some embodiments, the shutdown module is further configured to shut down the routing service of the access switch for the network device in response to the second detection result indicating a fault in the communication link.
[0209] In some embodiments, the detection module is further configured to: obtain the time when the updated version of the routing service last received the bidirectional forwarding detection message based on the updated version of the routing service; perform fault detection on the communication link between the access switch and the network device based on the time and a preset time period to obtain a third detection result; and, in response to the third detection result indicating that the communication link is faulty, shut down the routing service for the network device executed by the updated version of the routing service.
[0210] In some embodiments, the detection module is further configured to, in response to the original version of the routing service not receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, determine the third detection result as indicating a fault in the communication link; and in response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time, determine the third detection result as indicating no fault in the communication link.
[0211] In some embodiments, the storage module is further configured to, in response to the third detection result indicating that the communication link is not faulty, receive the bidirectional forwarding detection message again based on the updated version of the routing service, determine the session state between the updated version of the routing service and the network device, and store the session state between the updated version of the routing service and the network device.
[0212] In some embodiments, the shutdown module described above is further configured to control the original version of the routing service to stop sending the bidirectional forwarding detection message, and to control the original version of the routing service to stop performing data routing for the network device.
[0213] In some embodiments, the control module is further configured to send bidirectional forwarding detection messages to the network device based on the original version of the routing service during the process of the original version of the routing service performing data routing for the network device; in some embodiments, the control module is further configured to periodically send the bidirectional forwarding detection messages to the network device based on the original version of the routing service, and start the updated version of the routing service to send the bidirectional forwarding detection messages to the network device using the same sending period as the original version of the routing service.
[0214] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the routing service version update method described above in this application.
[0215] This application provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are executed by a processor, they cause the processor to execute a routing service version update method provided in this application. For example, ... Figure 3 The method for updating the version of the routing service is shown.
[0216] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of electronic devices including one or any combination of the above-mentioned memories.
[0217] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0218] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0219] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0220] In summary, the embodiments of this application have the following beneficial effects:
[0221] (1) When responding to the update command of the routing service in the access switch, the updated version of the routing service is initialized, and the original version and the updated version of the routing service are used in parallel to send bidirectional forwarding detection messages to the network device. At the same time, the original version of the service is controlled to stop receiving bidirectional forwarding detection messages, so that the network device can continuously receive bidirectional forwarding detection messages and maintain the fault detection of the link state without interrupting bidirectional forwarding detection due to the upgrade of the routing service. When the updated version of the routing service receives the bidirectional forwarding detection message returned by the network device, it will shut down the original version of the service, thereby realizing a smooth transition of the routing service. Finally, the updated version of the routing service will take over the data routing task, ensuring the continuity and stability of the network service. This allows the access switch to complete the upgrade of the routing service without interrupting bidirectional forwarding detection, thereby effectively improving the stability of bidirectional forwarding detection during the version upgrade of the routing service.
[0222] (2) By leveraging the rapid detection capabilities of the Bidirectional Forwarding Detection (BFD) protocol, link faults can be identified within milliseconds. Link connectivity is detected by periodically exchanging BFD messages. When the access switch receives a BFD message from a network device within a preset time period, it indicates that the link is normal, and the first detection result is determined to be that the communication link is not faulty. Conversely, if no BFD message is received within the preset time period, the access switch will determine that the communication link is faulty and quickly take corresponding fault response measures, such as switching to a backup link or triggering routing protocol reconvergence. This not only improves network reliability and availability but also reduces network downtime, ensuring service continuity and user experience.
[0223] (3) After performing fault detection on the communication link based on the original version of the routing service and obtaining the first detection result, if the first detection result indicates that the communication link is faulty, the access switch can optimize resource utilization and achieve rapid network convergence by stopping the execution of routing services for network devices and stopping the reception and transmission of bidirectional forwarding detection (BFD) messages. This is based on the rapid fault detection capability of the BFD protocol and the dynamic adaptability of the routing protocol. When BFD detects a link fault, the access switch immediately stops the routing services related to the faulty link, avoiding invalid route calculations and data forwarding, saving network bandwidth and processing resources. Simultaneously, stopping the exchange of bidirectional forwarding detection messages avoids the continued transmission of useless detection messages, further releasing network resources. This rapid response mechanism not only improves network reliability and availability but also reduces network downtime, ensuring service continuity and user experience. The access switch can quickly isolate the fault after detecting a link fault, preventing fault propagation and accelerating network convergence, thereby maintaining network stability and efficiency.
[0224] (4) After performing fault detection on the communication link using the original version of the routing service and obtaining the first detection result, if the first detection result indicates that there is no fault in the communication link, the access switch performs the process of determining and storing the bidirectional forwarding detection session state. This is based on the rapid fault detection capability of the BFD protocol and the dynamic adaptability of the routing protocol. When BFD detects that there is no fault in the link, the access switch can understand the connection health status and communication protocol operation status with network devices in real time by determining the session state. Storing this session state information not only provides network administrators with valuable detection data, facilitating real-time monitoring of network operation, but also provides historical reference for subsequent troubleshooting and network optimization. In addition, this mechanism helps improve network reliability and availability because network devices can quickly respond to changes in link state, ensuring the continuity and stability of data transmission. The access switch can maintain efficient communication when the link is normal, while providing the ability to quickly respond to and recover from possible faults, thereby maintaining the stability and efficiency of the network.
[0225] (5) In response to an update command for the routing service in the access switch, and if the first detection result indicates that there is no fault in the communication link, the access switch can smoothly upgrade the routing protocol by initializing the updated version of the routing service, ensuring the continuity and stability of network services. Based on real-time detection of network link status and dynamic management of routing services, the access switch can orderly load and configure new routing protocol software and update relevant routing tables and neighbor relationships when the link is confirmed to be normal. Through this mechanism, the access switch can not only improve network performance and security, but also adapt to constantly changing network needs and provide more efficient and reliable data transmission services. This helps reduce network administrator intervention, improve the automation level and management efficiency of the network, thereby reducing network operating costs and enhancing the overall competitiveness of the network. The access switch can upgrade and optimize routing services while ensuring stable network operation, providing users with a better network experience.
[0226] (6) When executing an update command for the routing service in the access switch, and the first detection result indicates that there is no fault in the communication link, the access switch continues to perform data routing using the original version of the routing service before initializing the updated version of the routing service, and sends bidirectional forwarding detection (BFD) messages to network devices based on this version. This ensures network stability and data transmission continuity during routing service updates. By continuously sending BFD messages, the access switch can detect the health status of the link in real time, quickly detect any potential faults, and thus respond rapidly when a fault occurs, avoiding service interruption. At the same time, this mechanism also provides a guarantee for the smooth upgrade of the routing service, because the access switch can update the routing protocol in an orderly manner after confirming that the link is normal, ensuring that the new version of the routing service can seamlessly take over the data routing task. This helps reduce the intervention of network administrators and improve the automation level and management efficiency of the network. The access switch can not only maintain the efficient operation of the network, but also ensure that the network can quickly adapt and recover in the face of routing service updates and link failures, thereby providing more reliable and stable services.
[0227] (7) Using the solution provided in the embodiments of this application, BFD can be seamlessly upgraded on a single device. The peer bidirectional forwarding detection session is unaware of the upgrade process. The bidirectional forwarding detection session is detected normally during the upgrade process, avoiding the loss of service traffic in fault-free scenarios during the upgrade process. In fault scenarios, fault convergence can be detected in time, reducing traffic loss.
[0228] (8) Based on session state control, the original and updated versions of the routing service send Bidirectional Forwarding Detection (BFD) messages to network devices in parallel. This ensures that network devices can continuously receive BFD messages and maintain link state detection during routing service upgrades, without interrupting the BFD session due to routing service switching. In this way, the network device's awareness of BFD remains unchanged, ensuring network stability and service continuity. Simultaneously, this mechanism of sending BFD messages in parallel guarantees a smooth transition of routing services, enabling access switches to complete routing protocol upgrades without interrupting network services. This helps reduce network administrator intervention and improves the automation and efficiency of network management. Through this rigorous technical approach, access switches can achieve uninterrupted bidirectional forwarding detection during routing service upgrades, providing users with more stable and efficient data transmission services.
[0229] (9) By including the original version of the routing service's sending cycle for Bidirectional Forwarding Detection (BFD) packets in the session state, and controlling the original and updated versions of the routing service to send BFD packets to network devices in parallel based on this session state, the sending cycle of BFD packets is kept consistent during the routing service upgrade process, thus maintaining continuous link state detection. Specifically, the access switch instructs the original version of the routing service to send BFD packets according to a predefined sending cycle. Simultaneously, the updated version of the routing service reads the same session state after startup and sends BFD packets according to the same sending cycle. This parallel sending mechanism ensures that network devices can continuously receive BFD packets without interruption of the BFD session due to routing service switching, thereby ensuring network stability and service continuity. The access switch can achieve uninterrupted BFD during the routing service upgrade process, providing users with more stable and efficient data transmission services.
[0230] (10) By maintaining the same bidirectional forwarding detection session sending cycle for both versions of the routing service, the access switch enables network devices to continuously receive bidirectional forwarding detection sessions and maintain link state detection without interrupting the bidirectional forwarding detection sessions due to routing service switching. This mechanism of sending bidirectional forwarding detection sessions in parallel ensures a smooth transition of routing services, allowing the access switch to complete the routing protocol upgrade without interrupting network services. The access switch can achieve uninterrupted bidirectional forwarding detection during the routing service upgrade process, providing users with more stable and efficient data transmission services.
[0231] (11) By controlling the original version of the routing service to stop sending Bidirectional Forwarding Detection (BFD) messages and stopping data routing for the network devices in the access switch, network stability and service continuity are ensured during routing service upgrades or migrations. Specifically, the access switch first starts the updated version of the routing service and synchronously sends BFD messages to verify the normality of the link status, and then orderly stops the original version of BFD message sending and data routing tasks, thereby achieving a smooth transition of the routing service. This method not only reduces the intervention of network administrators and improves the automation level and efficiency of network management, but also ensures that network devices can continuously receive BFD messages and maintain link status detection during the routing service switchover process, without interrupting the BFD session due to the routing service switchover. The access switch can achieve uninterrupted BFD during the routing service upgrade process, providing users with more stable and efficient data transmission services.
[0232] (12) By obtaining the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device, and performing fault detection on the communication link based on these two moments, a second detection result is obtained. The access switch can determine whether the communication link was interrupted or delayed during the routing service switchover by using the time interval between the first and second moments. If the time interval exceeds a preset threshold, it may indicate that the link failed during the switchover, thus requiring corresponding fault handling measures, such as restarting the BFD session or switching to a backup link. This not only ensures the stability of the network and the continuity of services during the routing service upgrade process, but also enables timely detection and handling of communication link faults, improving the reliability and stability of the network.
[0233] (13) By reading the session state between the original version of the routing service and network devices based on the updated version of the routing service in the access switch, including the preset time period for fault detection, and then obtaining the time difference between the first and second moments and comparing it with the preset time period, the access switch can determine whether the communication link has been interrupted or delayed during the routing service switchover process. If the time difference exceeds the preset threshold, it may indicate that the link has failed during the switchover process, thus requiring corresponding fault handling measures, such as restarting the bidirectional forwarding detection session or switching to a backup link. This not only ensures the stability of the network and the continuity of services during the routing service upgrade process, but also enables timely detection and handling of communication link faults, improving the reliability and stability of the network.
[0234] (14) In response to the second detection result indicating a communication link failure, the access switch immediately shuts down the routing service for the network device. When the access switch detects a communication link failure, it immediately shuts down the routing service for that network device, preventing the continued forwarding of data packets through the faulty link and thus avoiding data loss and network congestion. Furthermore, shutting down the routing service for the faulty link prompts the network device to reselect other available links for communication, improving network reliability and stability. Simultaneously, this rapid response mechanism helps shorten fault recovery time, ensuring the continuity and availability of network services. The access switch can promptly detect and handle communication link failures, ensuring normal network operation and user experience.
[0235] (15) By obtaining the first moment when the original version of the routing service last received a Bidirectional Forwarding Detection (BFD) message from the network device, and the second moment when the updated version of the routing service first received a BFD message from the network device, the time difference between the two moments can be accurately calculated. The calculation of the time difference is based on the timer mechanism of the BFD protocol, which typically includes a detection time (e.g., 1 second) and a timeout time (e.g., 3 seconds). By comparing the time difference between these two moments with a preset time period (e.g., 3 times the detection time), the health status of the communication link can be effectively determined. If the time difference is less than or equal to the preset time period, it indicates that the link remains active after the updated version of the routing service is started and no failure has occurred. Therefore, data routing for network devices can be safely performed through the updated version of the routing service, ensuring the continuity and stability of network services. This not only improves the accuracy of fault detection for network devices but also shortens the fault recovery time, thereby improving the reliability and performance of the entire network.
[0236] (16) By comparing this moment with a preset time period, it is possible to accurately determine whether a communication link has failed. If the updated version of the routing service does not receive bidirectional forwarding detection messages sent by the network device within the preset time period, it indicates that the link may have a problem. In this case, by shutting down the routing service executed by the updated version of the routing service for the network device, data packets can be prevented from continuing to be transmitted on the faulty link, thereby avoiding data loss and network congestion. This not only improves the accuracy of fault detection for network devices but also shortens the fault recovery time, thereby improving the reliability and performance of the entire network.
[0237] (17) A communication link fault detection method based on time and preset time period determines the third detection result, i.e., whether the communication link is faulty, by responding to whether the original version of the routing service receives a bidirectional forwarding detection (BFD) message sent by the network device within the preset time period. Utilizing the fast fault detection feature of the BFD protocol, it can identify link faults within milliseconds. When the original version of the routing service does not receive a bidirectional forwarding detection message within the preset time period, it indicates that the link may be faulty. In this case, the third detection result is determined to be a communication link fault, and corresponding fault recovery measures are taken, such as switching to a backup link or restarting the bidirectional forwarding detection session. Conversely, if a bidirectional forwarding detection message is received within the preset time period, it indicates that the link is normal. The third detection result is determined to be that the communication link is not faulty, and data routing continues to be performed through the updated version of the routing service. This not only improves the accuracy of network device fault detection but also shortens the fault recovery time, thereby improving the reliability and performance of the entire network.
[0238] (18) After fault detection of the communication link between the access switch and network devices and obtaining the third detection result, if the result indicates that there is no fault in the communication link, the session state between the updated version of the routing service and the network devices can be determined by receiving the bidirectional forwarding detection (BFD) message again through the updated version of the routing service. The session state management mechanism based on the BFD protocol can understand the session activity, health status and other key information in real time by analyzing the state information in the received bidirectional forwarding detection message. Storing the determined session state not only helps the access switch detect the current network state, but also provides an important basis for subsequent network management and troubleshooting. This not only improves the accuracy of fault detection of network devices, but also enhances the network's self-healing ability and management efficiency, thereby improving the reliability and performance of the entire network.
[0239] (19) During the data routing process of a network device through the routing service in an access switch, the device receives a first Bidirectional Forwarding Detection (BFD) message from the access switch and sends a second BFD message to the access switch. Based on the first BFD message, the device performs fault detection, enabling it to quickly identify link failures and restore network service continuity by performing a switchover to the access switch, such as switching to a backup link or restarting the BFD session. This not only improves the accuracy of fault detection in network devices but also shortens fault recovery time, thereby enhancing the reliability and performance of the entire network. The network device can respond quickly and take measures when a link failure occurs, ensuring the stability and availability of network services.
[0240] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for updating a version of a routing service, characterized by, The method includes: In response to an update instruction for routing services in an access switch, an updated version of the routing services is initialized in the access switch. Based on the original version of the routing service and the updated version of the routing service in the access switch, bidirectional forwarding detection messages are sent to the network device in parallel, and the original version of the routing service is controlled to stop receiving bidirectional forwarding detection messages sent by the network device. Based on the updated version of the routing service, in response to receiving a bidirectional forwarding detection message returned by the network device, the original version of the routing service is shut down; Based on the updated version of the routing service, data routing is performed for the network device.
2. The method of claim 1, wherein, In response to an update instruction for routing services in an access switch, before initializing the updated version of the routing services in the access switch, the method further includes: Based on the original version of the routing service, fault detection is performed on the communication link between the access switch and the network device to obtain a first detection result; The step of initializing an updated version of the routing service in the access switch in response to an update command for the routing service in the access switch includes: In response to an update instruction for the routing service in the access switch, and given that the first detection result indicates that there is no fault in the communication link, the updated version of the routing service is initialized in the access switch.
3. The method of claim 2, wherein, The routing service based on the original version performs fault detection on the communication link between the access switch and the network device to obtain a first detection result, including: In response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within a preset time period, the first detection result is determined to indicate that there is no fault in the communication link; If the original version of the routing service does not receive a bidirectional forwarding detection message from the network device within the preset time period, the first detection result is determined to indicate that the communication link is faulty.
4. The method of claim 2, wherein, After performing fault detection on the communication link between the access switch and the network device based on the original version of the routing service and obtaining a first detection result, the method further includes: In response to the first detection result indicating a fault in the communication link, the original version of the routing service in the access switch is controlled to stop executing the routing service for the network device. Control the original version of the routing service to stop receiving bidirectional forwarding detection packets sent by the network device, and control the original version of the routing service to stop sending the bidirectional forwarding detection packets.
5. The method according to claim 2, characterized in that, After performing fault detection on the communication link between the access switch and the network device based on the original version of the routing service and obtaining a first detection result, the method further includes: In response to the first detection result indicating that there is no fault in the communication link, the session state between the original version of the routing service and the network device is determined and the session state is stored. The method of sending bidirectional forwarding detection packets to network devices in parallel, based on the original version of the routing service in the access switch and the updated version of the routing service, includes: Based on the session state, the original version of the routing service and the updated version of the routing service are controlled to send the bidirectional forwarding detection message to the network device in parallel.
6. The method according to claim 5, characterized in that, The session state includes the sending period of the original version of the routing service for the bidirectional forwarding detection packet. Based on the session state, controlling the original version of the routing service and the updated version of the routing service to send the bidirectional forwarding detection packet to the network device in parallel includes: According to the aforementioned sending period, the original version of the routing service is controlled to send the bidirectional forwarding detection message to the network device. It also controls the updated routing service, reads the session state, and sends the bidirectional forwarding detection message to the network device according to the sending period in the session state.
7. The method according to claim 1, characterized in that, The routing service based on the updated version performs data routing for the network device, including: The first moment when the original version of the routing service last received the bidirectional forwarding detection message sent by the network device, and the second moment when the updated version of the routing service first received the bidirectional forwarding detection message sent by the network device; Based on the first time point and the second time point, fault detection is performed on the communication link between the access switch and the network device to obtain a second detection result; In response to the second detection result indicating that there is no fault in the communication link, data routing for the network device is performed through the updated version of the routing service.
8. The method according to claim 7, characterized in that, The step of performing fault detection on the communication link based on the first time point and the second time point to obtain a second detection result includes: Based on the updated version of the routing service, the session state between the original version of the routing service and the network device is read, and the session state includes a preset time period for fault detection. The time difference between the first moment and the second moment is obtained, and the time difference is compared with the preset time period to obtain a comparison result; In response to the comparison result indicating that the time difference is greater than the preset time period, the second detection result is determined to indicate that there is a fault in the communication link; In response to the comparison result indicating that the time difference is less than or equal to the preset time period, the second detection result is determined to indicate that there is no fault in the communication link.
9. The method according to claim 7, characterized in that, After performing fault detection on the communication link based on the first time point and the second time point to obtain a second detection result, the method further includes: In response to the second detection result indicating a fault in the communication link, the routing service of the access switch for the network device is shut down.
10. The method according to claim 1, characterized in that, When performing data routing for the network device based on the updated version of the routing service, the method further includes: Based on the updated version of the routing service, obtain the time when the updated version of the routing service last received the bidirectional forwarding detection message; Based on the time and the preset time period, fault detection is performed on the communication link between the access switch and the network device to obtain a third detection result. In response to the third detection result indicating a fault in the communication link, the routing service for the network device executed by the updated version of the routing service is shut down.
11. The method according to claim 10, characterized in that, The method of performing fault detection on the communication link between the access switch and the network device based on the time and the preset time period to obtain a third detection result includes: If the original version of the routing service does not receive a bidirectional forwarding detection message from the network device within the preset time period starting from the time mentioned above, the third detection result is determined to indicate that the communication link is faulty. In response to the original version of the routing service receiving a bidirectional forwarding detection message sent by the network device within the preset time period starting from the time mentioned, the third detection result is determined to indicate that there is no fault in the communication link.
12. The method according to claim 10, characterized in that, After performing fault detection on the communication link between the access switch and the network device and obtaining a third detection result, the method further includes: In response to the third detection result indicating that there is no fault in the communication link, the bidirectional forwarding detection message is received again based on the updated version of the routing service, and the session state between the updated version of the routing service and the network device is determined. It also stores the session state between the updated version of the routing service and the network device.
13. The method according to claim 1, characterized in that, The shutdown of the original version of the routing service includes: Control the original version of the routing service to stop sending the bidirectional forwarding detection message, and control the original version of the routing service to stop performing data routing for the network device.
14. The method according to claim 1, characterized in that, In response to an update instruction for routing services in an access switch, before initializing the updated version of the routing services in the access switch, the method further includes: During the process of the original version of the routing service performing data routing for the network device, a bidirectional forwarding detection message is sent to the network device based on the original version of the routing service; The routing service based on the original version and the updated version sends bidirectional forwarding detection packets to the network device in parallel, including: Based on the original version of the routing service, the bidirectional forwarding detection message is periodically sent to the network device, and the updated version of the routing service is started, sending the bidirectional forwarding detection message to the network device at the same sending period as the original version of the routing service.
15. A version update device for a routing service, characterized in that, The device includes: An initialization module is configured to initialize an updated version of the routing service in the access switch in response to an update command for the routing service in the access switch. The control module is used to send bidirectional forwarding detection messages to the network device in parallel based on the original version of the routing service and the updated version of the routing service in the access switch, and to control the original version of the routing service to stop receiving the bidirectional forwarding detection messages sent by the network device. The shutdown module is used to shut down the original version of the routing service in response to receiving a bidirectional forwarding detection message returned by the network device, based on the updated version of the routing service. An execution module is used to perform data routing for the network device based on the updated version of the routing service.
16. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the version update method for the routing service as described in any one of claims 1 to 14.
17. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the method for updating the version of the routing service as described in any one of claims 1 to 14.
18. A computer program product comprising a computer program or computer-executable instructions, characterized in that, When the computer program or computer-executable instructions are executed by a processor, they implement the method for updating the version of the routing service as described in any one of claims 1 to 14.