BFD (Bidirectional Forwarding Detection) hardware acceleration device, method, equipment, medium and program product
By introducing hardware acceleration devices into the BFD function, using hardware processing capabilities to accelerate fault detection, the problem of software maintenance of BFD function consumes CPU capabilities, and achieving more efficient CPU utilization and network stability.
Patent Information
- Application Number
- CN202411546600.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
In current technology, maintaining BFD functions based on software will consume greatly the CPU capacity, especially in large-scale application scenarios, the computing power of the CPU is greatly consumed.
It provides a BFD hardware acceleration device, including a flexible flowmeter engine and a BFD engine. Through hardware-based BFD functions, it uses the high-speed processing capabilities of the hardware to accelerate the fault detection process and reduce the use of CPU resources.
Through hardware acceleration, the computing burden of the CPU when maintaining BFD sessions is reduced, the CPU utilization is greatly improved, large-scale BFD sessions are supported, and the network stability and reliability are improved.
Smart Images

Figure CN119420671A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a BFD hardware acceleration device, method, equipment, medium and program product. Background Art
[0002] In order to reduce the impact of equipment failures on services and improve network reliability, network devices need to be able to detect communication failures with adjacent devices as quickly as possible so that timely measures can be taken to ensure continued service. BFD provides a general, standardized, media-independent and protocol-independent fast fault detection mechanism. BFD (Bidirectional Forwarding Detection) is a high-speed fault detection mechanism based on the RFC 5880 standard. After the upper-layer protocol detects a link failure through BFD, it can take timely measures to recover from the failure.
[0003] However, under the current technical background, the BFD function is usually executed and maintained, but the disadvantages are also obvious, that is, software maintenance of the BFD function will greatly consume CPU power. When there are large specifications, such as the number of sessions is in the thousands or even tens of thousands of entries, the application scenario of BFD session requirements will consume the CPU computing power greatly. Summary of the invention
[0004] In view of this, the present invention provides a BFD hardware acceleration device, method, equipment, medium and program product to solve the problem that software-based maintenance of BFD functions will greatly consume CPU capabilities under the current technical background.
[0005] In a first aspect, the present invention provides a BFD hardware acceleration device, the device comprising a flexible flow table engine and a BFD engine:
[0006] Flexible flow table engine, including matching module, lookup table module and action module;
[0007] A matching module is used to extract or reassemble flow table keywords from network packets; flow table keywords are used to identify target data packets; a lookup table module is used to find a target flow table entry that matches the target data packet; an action module is used to execute a target service according to the target flow table entry and extract BFD session information corresponding to the target flow table entry;
[0008] The BFD engine includes a protocol processing module, a message editing and encapsulation module, and a BFD session status reporting module; the protocol processing module is used to maintain the session status of the established BFD session, send BFD messages, and detect the reception status of BFD messages; the message editing and encapsulation module is used to ensure that the BFD message has the correct format and content before sending; the BFD session status reporting module is used to report to the CPU when an abnormal BFD session is detected.
[0009] The BFD hardware acceleration device provided in the embodiment of the present invention, by hardwareizing the BFD function, can utilize the high-speed processing capability of the hardware to accelerate the fault detection process, thereby reducing the occupation of resources such as the CPU and significantly unloading the computing power consumed by the CPU in maintaining the BFD session.
[0010] In an optional implementation, the protocol processing module further includes a sending timer for periodically sending BFD packets.
[0011] The BFD hardware acceleration device provided in the embodiment of the present invention ensures that the connection between the communicating parties is active by sending and receiving BFD messages. Therefore, a sending timer is set to periodically trigger the sending of BFD messages, so that the receiving party can continue to receive BFD messages, thereby confirming that the connection is normal.
[0012] In an optional implementation, the protocol processing module further includes a receiving timer for periodically detecting the reception status of the BFD message.
[0013] The BFD hardware acceleration device provided by the embodiment of the present invention can periodically detect the reception of BFD messages by setting a receiving timer to ensure that both parties of the BFD session are sending and receiving messages normally. If one party fails to send a message on time, the setting of the receiving timer can timely discover and trigger the corresponding abnormal processing process, thereby enhancing the reliability and stability of the BFD session.
[0014] In an optional implementation, the message editing and encapsulation module performs editing based on a minimalist instruction set, which includes addition, left shift, right shift, and replacement.
[0015] The BFD hardware acceleration device provided by the embodiment of the present invention uses a minimalist instruction set, and the message editing and encapsulation module can process and edit BFD messages more efficiently, reducing delays and overhead in the processing process. At the same time, the design of the minimalist instruction set also means that the message editing and encapsulation module does not need to support complex instruction sets and operations, thereby reducing the complexity and cost of hardware design, making the BFD hardware acceleration device easier to implement and deploy while maintaining high performance.
[0016] In an optional implementation, the message editing and encapsulation module is also used for message editing based on templates and user-defined content.
[0017] The BFD hardware acceleration device provided in the embodiment of the present invention introduces templates and user-defined content, so that users can edit BFD messages more conveniently without having to have an in-depth understanding of the underlying message structure and format. At the same time, the standardized message editing method reduces the errors that may occur when users manually edit messages, thereby improving the accuracy and efficiency of editing.
[0018] In a second aspect, the present invention provides a BFD hardware acceleration method, which is applied to the above-mentioned BFD hardware acceleration device, and the method includes:
[0019] Extract a preset number of flow table keywords from network packets;
[0020] When a BFD message matching the flow table keyword is detected, the original text of the BFD message and the session ID corresponding to the BFD message are obtained;
[0021] Read the session state table based on the session ID and the original text of the BFD message, and update the session state corresponding to the BFD message; the session state is used to indicate whether there is a fault on the link;
[0022] When the session status indicates that a link fault exists, the link fault status is reported to the CPU.
[0023] The BFD hardware acceleration method provided in the embodiment of the present invention can utilize the high-speed processing capability of the hardware to quickly extract flow table keywords from network messages and efficiently detect BFD messages matching these keywords through a hardware-based BFD acceleration device. This greatly shortens the time for fault detection and improves the stability and reliability of the network. Compared with the traditional BFD session maintenance which is usually completed by the CPU and results in a high CPU resource occupancy rate, through the BFD hardware acceleration method, most of the BFD message processing work is completed by the hardware device, thereby greatly reducing the CPU's computing burden when maintaining the BFD session.
[0024] In an optional implementation manner, when the session state indicates that a link fault exists, reporting the link fault state to the CPU further includes:
[0025] When there is interrupt content in the message queue and the software does not perform a read operation within the preset time, an active interrupt request is initiated to the CPU.
[0026] Compared with the traditional BFD fault detection mechanism, the BFD hardware acceleration method provided by the embodiment of the present invention needs the CPU to periodically poll or check the BFD session status. By introducing an active interrupt mechanism, when a link failure occurs, the hardware acceleration device can immediately trigger an interrupt without the need for the CPU to perform frequent polling, which not only reduces the CPU resource usage but also improves the overall efficiency of the system.
[0027] In an optional embodiment, the method further includes:
[0028] When the sending timer expires, the session state and target message template corresponding to the BFD message are read, and the BFD message is sent.
[0029] The BFD hardware acceleration method provided in an embodiment of the present invention detects the bidirectional connectivity of a network link by periodically sending BFD messages. That is, when the sending timer expires, the hardware acceleration device actively reads the session status and target message template corresponding to the BFD message and sends the BFD message, which helps to ensure the activity of the BFD session and can also detect the status of the network link more accurately.
[0030] In an optional embodiment, the method further includes:
[0031] Edit BFD packets based on the target packet template and user-defined content, and send BFD packets.
[0032] The BFD hardware acceleration method provided by the embodiment of the present invention makes the editing and sending of BFD messages more flexible by introducing target message templates and user-defined content. Users can customize the content of BFD messages according to actual needs to meet specific network fault detection or management needs. At the same time, it also greatly shortens the sending time of BFD messages and improves the real-time performance of fault detection.
[0033] In an optional implementation, extracting a preset number of flow table keywords from the network message further includes:
[0034] Extract the flow definition element from the payload of the BFD packet.
[0035] The BFD hardware acceleration method provided in the embodiment of the present invention can more accurately match and identify BFD messages by extracting flow definition elements from the payload of the BFD message as part of the flow table keyword. This accurate matching helps reduce false positives and false negatives, thereby improving the accuracy of fault detection.
[0036] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the BFD hardware acceleration method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the BFD hardware acceleration method of the second aspect or any corresponding embodiment thereof.
[0038] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the BFD hardware acceleration method of the above-mentioned second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a schematic diagram of the structure of a BFD hardware acceleration device according to an embodiment of the present invention;
[0041] Figure 2 is a flowchart of a BFD hardware acceleration method according to an embodiment of the present invention;
[0042] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0044] BFD (Bidirectional Forwarding Detection) is a high-speed fault detection mechanism based on the RFC5880 standard. After the upper-layer protocol detects a link failure through BFD, it can take timely measures to recover from the failure.
[0045] Under the current technical background, BFD functions are usually executed and maintained, but the disadvantages are also obvious. Software maintenance of BFD functions will greatly consume CPU power. When there are large specifications, such as the number of sessions is in the thousands or even tens of thousands, and the application scenario of BFD session requirements, the CPU computing power will be greatly consumed.
[0046] The embodiment of the present invention provides a BFD hardware acceleration method. By introducing a hardware BFD engine, functions that consume CPU performance, such as sending messages, receiving messages, and fault detection, are transferred to the hardware chip for processing, thereby improving CPU utilization and being able to support large-scale BFD sessions, so that the BFD hardware engine also has good flexibility.
[0047] According to an embodiment of the present invention, an embodiment of a BFD hardware acceleration device is provided, the device comprising a flexible flow table engine and a BFD engine:
[0048] Flexible flow table engine, including matching module, lookup table module and action module;
[0049] A matching module is used to extract or reassemble flow table keywords from network packets; flow table keywords are used to identify target data packets; a lookup table module is used to find a target flow table entry that matches the target data packet; an action module is used to execute a target service according to the target flow table entry and extract BFD session information corresponding to the target flow table entry;
[0050] The BFD engine includes a protocol processing module, a message editing and encapsulation module, and a BFD session status reporting module; the protocol processing module is used to maintain the session status of the established BFD session, send BFD messages, and detect the reception status of BFD messages; the message editing and encapsulation module is used to ensure that the BFD message has the correct format and content before sending; the BFD session status reporting module is used to report to the CPU when an abnormal BFD session is detected.
[0051] In such Figure 1 In the device shown, the BFD hardware accelerator is divided into two core functional blocks: Flexible FlowEngine and BFD Engine. Specifically, the Flexible FlowEngine is based on the Match-Action structure, which includes: a matching module (Match), a lookup table module (Lookup Tables) and an action module (Action).
[0052] Match module (Match): Responsible for extracting or reorganizing flow table keywords (Key) from incoming data packets. These keywords may include source / destination IP addresses, port numbers, protocol types, etc., and support flexible configuration and combination according to actual needs. Through flexible key combination, the system can efficiently identify and process different data flows.
[0053] Lookup Tables: used to find the target flow table entry that matches the target data packet.
[0054] Optionally, the engine uses a hash algorithm to quickly search for the extracted flow table keywords. By maintaining one or more hash tables, the system can find the flow table entries that match the data packet in a very short time. This design not only improves the search efficiency, but also reduces the CPU resource usage.
[0055] Action module: Once the flow table search is successful, the Action module will perform corresponding business processing according to the flow table hit result and flow table configuration. This includes extracting the hit BFD session information, such as session ID, session status, etc., for subsequent processing.
[0056] The BFD Engine includes a protocol processing module (Engine Pipeline), a packet editing and encapsulation module (Packet Package), and a BFD session status reporting module (Status Reporter).
[0057] Protocol processing module (Engine Pipeline): Based on the RFC 5880 protocol, it is used to maintain the status of the established BFD session.
[0058] Packet editing and encapsulation module (Packet Package): used for editing and encapsulating sent packets, including templated packet extraction based on the Ethernet protocol and a flexible packet editor (Flexible Packet Editor) based on session content.
[0059] BFD session status reporting module (Status Reporter): When the BFD engine detects an abnormal session status, such as a link failure or timeout, the BFD session status reporting module will promptly report the relevant information to the CPU. The CPU can respond quickly based on the reported session status changes, such as switching the session path or triggering an alarm. This design ensures that the BFD hard acceleration system can accurately reflect the network status in real time, improving the reliability and stability of the network.
[0060] In summary, the BFD hardware acceleration design based on flexible flow tables achieves efficient and reliable BFD session detection and state maintenance functions by optimizing flow table processing and BFD protocol processing. This design not only improves the system processing performance, but also reduces the CPU resource usage, providing a strong guarantee for the stable operation of network equipment.
[0061] In some optional implementations, the protocol processing module further includes a sending timer for periodically sending BFD packets.
[0062] The BFD engine has a built-in send timer: TX Scan Timer, which is used to periodically scan and initiate BFD packets to the other end of the session.
[0063] Optionally, the timer allows users to adjust it according to actual needs. For example, users can set different BFD message sending intervals according to network latency and stability requirements.
[0064] In some optional implementations, the protocol processing module further includes a receiving timer for periodically detecting the reception status of the BFD message.
[0065] The BFD engine has a built-in receiving-side timer: RX Scan Engine, which is used to periodically scan and check whether the session receiver has regularly received the messages sent by the session peer.
[0066] In some optional implementations, the message editing and encapsulation module performs editing based on a minimalist instruction set, which includes addition, left shift, right shift, and replacement.
[0067] The BFD engine has a built-in flexible packet editor. After receiving a template-based message, the flexible and programmable packet editor will edit the message template based on a minimalist instruction set, which includes commonly used add, left shift, right shift, replace and other instructions. The editing content includes: Session-based message information such as the MAC, IP, and session discriminator of the local and remote ends.
[0068] In some optional implementations, the message editing and encapsulation module is also used for message editing based on templates and user-defined content.
[0069] In addition to editing content, the message editing and encapsulation module can also perform message editing based on flexible user-defined content based on templates according to user needs. Specifically, through the flexible message editor, the message data to be edited can be extracted from the flow table / session state table and the user-defined table (User Defined Table) and edited into the message.
[0070] The BFD protocol message can flexibly define the Ethernet protocol that carries the BFD message according to user needs. After the message editing and encapsulation module completes the message editing, it sends the message to the message scheduling / forwarding module for transmission.
[0071] The BFD hardware acceleration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0072] According to an embodiment of the present invention, an embodiment of a BFD hardware acceleration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0073] In this embodiment, a BFD hardware acceleration method is provided. Figure 2 FIG. 4 is a flowchart of a BFD hardware acceleration method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0074] Step S201: extract a preset number of flow table keywords from a network message.
[0075] Specifically, Flexible Flow Engine supports extracting any number of words from network messages as flow table matching keywords (Key). The number and position of these words are pre-configured according to the flow table definition and user needs. According to the configuration information, the Match module of Flexible Flow Engine will parse the network message and extract the corresponding word as the flow table keyword according to the specified position and length.
[0076] Furthermore, these keywords may include conventional network forwarding elements such as the source / destination MAC address, source / destination IP address, port number, and protocol type of the message.
[0077] Furthermore, in network forwarding, the number of extracted keywords is usually less than or equal to 40.
[0078] Optionally, the Flexible Flow Engine adopts a HASH-based flexible flow table design.
[0079] In some optional implementations, the above step S201 includes:
[0080] Extract the flow definition element from the payload of the BFD packet.
[0081] In the application of BFD, the definition of the flow table not only supports the flow definition elements of conventional network forwarding such as MAC / IP, but also supports the extraction of flow definition elements from the payload of the BFD message, such as the extraction of the Control field in BFD (refer to RFC 5880).
[0082] Step S202: When a BFD message matching the flow table keyword is detected, the original text of the BFD message and the session ID corresponding to the BFD message are obtained.
[0083] Specifically, a match is performed between a key field in the message and an entry in the flow table. If a matching flow table entry is found, it means that the message meets the matching rule of a specific BFD session.
[0084] Furthermore, after identifying a BFD message, the Flexible Flow Engine saves or caches the original text of the message to ensure that the complete message information can be accessed during subsequent processing.
[0085] Furthermore, the entry that successfully matches the flow table also contains the session ID (SessionID) corresponding to the BFD message. This session ID is a unique identifier used by the BFD Engine to identify and manage the BFD session. Then, the FlexibleFlow Engine will pass the session ID and the original BFD message to the BFD Engine for subsequent processing.
[0086] Step S203: read the session state table based on the session ID and the original text of the BFD message, and update the session state corresponding to the BFD message.
[0087] Specifically, when the session ID is verified to be valid, the BFD Engine reads the local Session Status Table according to the session ID. The Session Status Table is a data structure used to store the current status information of each BFD session, such as the UP / DOWN status of the session. The session status is used to indicate whether there is a fault in the link.
[0088] Furthermore, according to the BFD protocol of RFC5880, the BFD Engine will update the session status corresponding to the BFD message based on the parsed original BFD message and the status information of the current session. At the same time, the status information of the corresponding session in the Session Status Table will also be updated synchronously.
[0089] Step S204: When the session status indicates that a link failure exists, the link failure status is reported to the CPU.
[0090] Specifically, the BFD Engine checks the updated session status and pays attention to whether the session has changed from the UP state to the DOWN state. If the session state is DOWN at this time, it means that there is a link fault.
[0091] Furthermore, once a link failure is detected, the BFD Engine prepares a report of the fault information and reports the fault information to the CPU through the StatusReporter module.
[0092] In some optional implementations, the above step S204 includes:
[0093] When there is interrupt content in the message queue and the software does not perform a read operation within the preset time, an active interrupt request is initiated to the CPU.
[0094] To prevent interrupt message loss, the BFD Engine also sets a timeout mechanism for the message queue. When there is interrupt content in the message queue and the software does not read it within the preset time, it will initiate an active interrupt request to the CPU again.
[0095] In summary, the BFD hardware acceleration method provided in the embodiment of the present invention introduces a hardware BFD engine, and transfers the functions that consume CPU performance, such as sending messages, receiving messages, and fault detection, to the hardware chip for processing, thereby improving the CPU utilization and being able to support large-scale BFD sessions, so that the BFD hardware engine also has good flexibility.
[0096] Flexible Flow Engine adopts a HASH-based flexible flow table design, which can extract any number of words from network packets as flow table matching keywords. In BFD applications, the flow table not only supports conventional network forwarding elements such as MAC / IP, but also can extract specific fields from the payload of BFD packets, such as the Control field, as flow definition elements.
[0097] When a network packet matches the flow table and hits the BFD detection flow, the flow table engine extracts the session ID and the original message, and then passes this information to the BFD Engine. The BFD Engine searches the local SessionStatus Table based on the session ID, processes the message and updates the session status according to the BFD protocol of RFC5880. The session status can be UP / DOWN, and the session status is used to indicate whether there is a link failure.
[0098] When the session status indicates that the link is faulty, for example, when a message indicating the link is in the "DOWN" state is received, BFDEngine will switch the session status to "DOWN" according to the RFC5880 protocol and report the link fault status to the CPU through the Status Reporter. To prevent the loss of interrupt messages, the BFD Engine also sets a timeout mechanism for the message queue. When there is interrupt content in the message queue and the software does not read it within the preset time, it will initiate an active interrupt to the CPU again.
[0099] In some optional embodiments, the method further comprises:
[0100] When the sending timer expires, the session state and target message template corresponding to the BFD message are read, and the BFD message is sent.
[0101] The BFD Engine has built-in sending timer and receiving timer. The TX Scan Timer is used to periodically scan and initiate BFD messages to the other end of the session; the RX Scan Engine is used to periodically scan and check whether the session receiving end has regularly received the messages sent by the session peer.
[0102] When the TX Scan Timer expires and a TX message needs to be sent, the status of the current session and the corresponding message template to be sent are read from the Session Status Table and the message is sent.
[0103] When the RX Scan Timer expires, that is, no BFD message is received from the opposite host within the preset time, or the link "DOWN" status is received from the opposite host of the session, the local needs to switch the session status to "DOWN" according to the RFC5880 protocol. At the same time, the local will report the session identifier of the "DOWN" status through the Status Reporter and send it to the CPU through the interrupt message queue. At the same time, in order to prevent the interrupt reported to the host from being abnormally lost or other situations causing the host to fail to read the information in the message queue in time, the hardware BFD engine sets a message queue timeout mechanism. When there is interrupt content in the message queue and the software does not perform a reading operation within the preset time, it will initiate an active interrupt to the CPU again.
[0104] In some optional embodiments, the method further comprises:
[0105] Edit BFD packets based on the target packet template and user-defined content, and send BFD packets.
[0106] The BFD engine has a built-in flexible message editor. After receiving a template-based message, the flexible and programmable message editor will edit the message template based on a minimalist instruction set, which includes commonly used add, left shift, right shift, replace and other instructions. The editing content includes: Session-based message information such as the MAC, IP, and session discriminator of the local and remote ends.
[0107] In addition to the editing content defined above, you can also edit messages based on flexible user-defined content based on templates according to user needs, so that the BFD protocol message can be flexibly defined according to user needs. The Ethernet protocol that carries the BFD message, finally, the BFD Engine completes the message editing and sends the message to the message scheduling / forwarding module for transmission.
[0108] The embodiment of the present invention also provides a computer device, see Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.
[0109] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0110] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0111] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0112] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0113] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0114] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0115] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0116] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0117] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A BFD hardware acceleration device, characterized in that: The device includes a flexible flow table engine and a BFD engine; The flexible flow table engine includes a matching module, a lookup table module and an action module; The matching module is used to extract or reorganize flow table keywords from network messages; the flow table keywords are used to identify target data packets; The table lookup module is used to find a target flow table entry that matches the target data packet; the action module is used to execute the target service according to the target flow table entry and extract the BFD session information corresponding to the target flow table entry; The BFD engine includes a protocol processing module, a message editing and encapsulation module, and a BFD session status reporting module; The protocol processing module is used to maintain the session state of the established BFD session, send BFD messages, and detect the reception status of the BFD messages; the message editing and encapsulation module is used to ensure that the BFD messages have the correct format and content before sending; the BFD session status reporting module is used to report to the CPU when an abnormal BFD session is detected.
2. The device according to claim 1, characterized in that The protocol processing module also includes a sending timer, which is used to periodically send BFD messages.
3. The device according to claim 2, characterized in that The protocol processing module also includes a receiving timer, which is used to periodically detect the reception status of the BFD message.
4. The device according to any one of claims 1 to 3, characterized in that The message editing and encapsulation module performs editing based on a minimalist instruction set, which includes addition, left shift, right shift and replacement.
5. The device according to claim 4, characterized in that The message editing and encapsulation module is also used for message editing based on templates and user-defined content.
6. A BFD hardware acceleration method, characterized in that: Applied to the device according to any one of claims 1 to 5, the method comprising: Extract a preset number of flow table keywords from network packets; When a BFD message matching the flow table keyword is detected, obtaining the original text of the BFD message and the session ID corresponding to the BFD message; Reading a session state table based on the session ID and the original text of the BFD message, and updating a session state corresponding to the BFD message; the session state is used to indicate whether a link is faulty; When the session status indicates that a link failure exists, the link failure status is reported to the CPU.
7. The method according to claim 6, characterized in that When the session status indicates that a link fault exists, reporting the link fault status to the CPU also includes: When there is interrupt content in the message queue and the software does not perform a read operation within the preset time, an active interrupt request is initiated to the CPU.
8. The method according to claim 7, characterized in that The method further comprises: When the sending timer expires, the session state and the target message template corresponding to the BFD message are read, and the BFD message is sent.
9. The method according to claim 8, characterized in that The method further comprises: Based on the target message template and user-defined content, the BFD message is edited and sent.
10. The method according to any one of claims 6 to 9, characterized in that The step of extracting a preset number of flow table keywords from the network message further includes: Extract the flow definition element from the payload of the BFD packet.
11. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the BFD hardware acceleration method according to any one of claims 6 to 10 by executing the computer instructions.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the BFD hardware acceleration method according to any one of claims 6 to 10.
13. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the BFD hardware acceleration method according to any one of claims 6 to 10.
Citation Information
Patent Citations
System and method for implementing bidirectional forwarding detection
CN101247270A
BFD realization method and device based on chip lookup table
CN101860483A
Hardware network switching engine and network fault processing system and method
CN110661705A
Chip implementation method and device for point-to-multipoint bidirectional forwarding detection
CN110830485A