Network device, UDP message processing method and nonvolatile storage medium

By setting up a network filtering queue and an automatic repair module in the backup main control board, UDP packets are processed directly in user space, which solves the problem of service interruption during the switchover between the primary and backup main control boards. This achieves business data synchronization between the primary and backup main control boards without interruption, improves the system's high reliability and stability, and is suitable for high-traffic and high-volume scenarios.

CN119520655BActive Publication Date: 2025-11-18CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411638974.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-11-18
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

In a primary/backup architecture, asynchronous UDP protocol messages can cause service interruptions when switching between primary and backup control boards, a problem that existing technologies struggle to solve effectively.

Method used

By setting up a network filtering queue module and an automatic repair module in the backup main control board, UDP packets are processed directly in user space. Synchronization and repair are performed using packet quadtuples and offset information, avoiding kernel protocol stack processing and realizing business data synchronization between the main and backup main control boards.

Benefits of technology

It ensures uninterrupted service data during the switching of primary and backup main control boards, improves the system's high reliability and stability, is suitable for high traffic and high service volume scenarios, shortens the development cycle, reduces development costs, and supports disaster recovery applications in 5G bearer networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520655B_ABST
    Figure CN119520655B_ABST
Patent Text Reader

Abstract

The application discloses a network device, a UDP message processing method and a nonvolatile storage medium. The device comprises a main control board and a standby control board. The main control board and the standby control board are used for receiving a first UDP message. The standby control board calls the first UDP message through a network filtering queue module arranged in the standby control board, and sends the first UDP message to an automatic repair module in the standby control board without passing through a standby kernel protocol stack in the standby control board during the calling. The main control board is further used for generating and sending a second UDP message. The standby control board is further used for generating a third UDP message when the main control board generates the second UDP message. The application solves the technical problem of service interruption during switching of the main control board and the standby control board caused by asynchronization of UDP protocol messages in the main control board and the standby control board.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technology and security, and more specifically, to a network device, a UDP packet processing method, and a non-volatile storage medium. Background Technology

[0002] A primary-backup architecture is a way to ensure high system availability. In a primary-backup architecture, the backup device needs to take over the services of the primary device in real time when the primary device fails. For UDP (User Datagram Protocol), when the primary device fails, it needs to be able to take over the services of the primary device from the backup device and ensure uninterrupted data transmission. Considering the packet loss and reliability requirements of the UDP protocol itself, existing transmission technologies face problems such as high development difficulty, long implementation cycle, and difficulty in unified maintenance.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a network device, a UDP packet processing method, and a non-volatile storage medium to at least solve the technical problem of service interruption during the switching of primary and backup primary control boards due to the asynchrony of UDP protocol packets in the primary and backup control boards.

[0005] According to one aspect of the embodiments of this application, a network device is provided, including: a primary main control board and a backup main control board, wherein the primary main control board and the backup main control board are used to receive a first UDP packet, and the primary main control board uploads the first UDP packet to the primary kernel protocol stack of the primary main control board, and synchronizes the first packet information of the first UDP packet to the backup main control board; the backup main control board retrieves the first UDP packet through a network filtering queue module set in the backup main control board, and sends the first UDP packet to an automatic repair module in the backup main control board without the first UDP packet passing through the backup kernel protocol stack in the backup main control board during retrieval, wherein the automatic repair module... The block is used to determine the processing method for the first UDP packet based on the first message information; the primary main control board is also used to generate and send the second UDP packet, and the backup main control board is also used to generate the third UDP packet when the primary main control board generates the second UDP packet. The primary main control board is also used to synchronize the second message information of the second UDP packet to the backup main control board. The line card module in the backup main control board is used to intercept the third UDP packet, and the network filtering queue module is used to send the third UDP packet to the automatic repair module. The automatic repair module is used to determine the processing method for the second UDP packet and the third UDP packet based on the second message information and the third message information of the third UDP packet.

[0006] Optionally, the first message information includes the first message offset information of the first UDP message; determining the processing method for the first UDP message based on the first message information includes: the automatic repair module determining the backup message offset information of the first UDP message received by the backup master control board; comparing the backup message offset information and the first message offset information; if the comparison result shows that the offset indicated by the first message offset information is greater than the offset indicated by the backup message offset information, determining the processing method to synchronize the first UDP message received by the backup master control board to the primary master control board until the first message offset information is... The indicated offset is equal to the offset indicated by the backup message offset information; if the comparison result shows that the offset indicated by the first message offset information is less than the offset indicated by the backup message offset information, the processing method is determined to synchronize the first UDP message received by the primary main control board to the backup main control board until the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information; if the comparison result shows that the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information, the processing method is determined not to perform synchronization processing on the first UDP message.

[0007] Optionally, the automatic repair module that sends the first UDP packet to the backup main control board includes: the network filtering queue module sending the first UDP packet to the user-space automatic repair module, and the automatic repair module recording the quadruple information and packet offset information of the first UDP packet.

[0008] Optionally, the second message information includes the second message offset information of the second UDP message, and the third message information includes the third message offset information of the third UDP message. Determining the processing method for the second and third UDP messages based on the second message information and the third message information of the third UDP message includes: comparing the second message offset information and the third message offset information; if the comparison result shows that the offset indicated by the second message offset information is greater than the offset indicated by the third message offset information, the processing method is determined to be to synchronize the third UDP message to the primary control board until the second message offset is greater than the offset indicated by the third message offset information. If the offset indicated by the displacement information is equal to the offset indicated by the third message offset information, and the comparison result shows that the offset indicated by the second message offset information is less than the offset indicated by the third message offset information, the processing method is determined to synchronize the second UDP message to the backup master control board until the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information; if the comparison result shows that the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information, the processing method is determined not to perform synchronization processing on the second UDP message and the third UDP message.

[0009] Optionally, after generating the third UDP packet, the backup main control board is also used to: encapsulate the third UDP packet and start a timeout timer; send the encapsulated third UDP packet to the backup kernel protocol stack; intercept the third UDP packet processed by the backup kernel protocol stack through the line card module, and upload the intercepted third UDP packet to user space.

[0010] Optionally, after the intercepted third UDP packet is uploaded to user space, the automatic repair module is also used to record the quadruple information and packet offset information of the third UDP packet in user space.

[0011] Optionally, when the primary main control board receives a primary-to-standby switchover signal, the primary main control board executes a primary-to-standby demotion process to switch to the standby main control board; when the standby main control board receives a primary-to-standby switchover signal, the standby main control board executes a standby-to-primary promotion process to switch to the primary main control board. During the standby main control board's standby-to-primary promotion process, the automatic repair module in the standby main control board is used to maintain the deviation between the corresponding message offsets of the standby main control board and the primary main control board within a preset range.

[0012] Optionally, during the primary control board's primary-to-standby process, the primary control board shuts down the protocol module and enables the network filtering queue module and automatic repair module, thereby switching to the standby control board.

[0013] According to another aspect of the embodiments of this application, a network device is also provided, including a primary main control board and a backup main control board. The primary and backup main control boards are used to receive a first UDP packet. The primary main control board uploads the first UDP packet to its primary kernel protocol stack and synchronizes the first packet information of the first UDP packet to the backup main control board. The backup main control board retrieves the first UDP packet through a network filtering queue module configured in the backup main control board. If the first UDP packet does not pass through the backup kernel protocol stack in the backup main control board during retrieval, the backup main control board determines the processing method for the first UDP packet based on the first packet information. The primary main control board is also used to generate a second UDP packet and synchronize the second packet information of the second UDP packet to the backup main control board. The backup main control board is further used to generate a third UDP packet when the primary main control board generates the second UDP packet, and to intercept the third UDP packet. The backup main control board determines the processing method for the second and third UDP packets based on the second packet information and the intercepted third UDP packet.

[0014] According to another aspect of the embodiments of this application, a UDP packet processing method is also provided, including: receiving and uploading a first UDP packet to the primary kernel protocol stack of the primary main control board for processing, and simultaneously synchronizing the first packet information of the first UDP packet to the backup main control board, wherein the first packet information quadruple information includes the quadruple and the packet offset; after generating a second UDP packet, synchronizing the second packet information of the second UDP packet to the backup main control board, so that the backup main control board can synchronously repair the UDP packet during the primary / backup switchover process.

[0015] According to another aspect of the embodiments of this application, a UDP packet processing method is also provided, comprising: intercepting a first UDP packet from the network interface of a backup master control board, and sending the first UDP packet directly to a target application process without passing through the backup kernel protocol stack of the backup master control board; in response to the execution of the target application process, determining whether it is necessary to synchronize a missing UDP packet from the primary master control board based on the first packet information of the first packet synchronized from the primary master control board, so that the UDP packet state on the backup master control board is consistent with the UDP packet state on the primary master control board; before the master-slave switchover, when the backup master control board generates a third UDP packet, intercepting the third UDP packet, and determining whether it is necessary to synchronize or send redundant UDP packets to the primary master control board based on the second packet information of the second UDP packet synchronized from the primary master control board.

[0016] According to another aspect of the embodiments of this application, a UDP packet receiving method is also provided, comprising: a primary main control board in a communication device receiving a first UDP packet and synchronizing the first packet information of the first UDP packet to a backup main control board in the communication device; when the primary main control board receives the first UDP packet, the backup main control board receives the first UDP packet, wherein the backup main control board is further configured to maintain the deviation value between the packet offsets corresponding to the backup main control board and the primary main control board within a preset range based on the first packet information and the first UDP packet.

[0017] According to another aspect of the embodiments of this application, a UDP packet sending method is also provided, including: a primary main control board in a communication device generating and sending a second UDP packet, and synchronizing the second packet information of the second UDP packet to a backup main control board in the communication device; when the primary main control board generates the second UDP packet, the backup main control board generating and intercepting a third UDP packet, and maintaining the deviation value between the packet offsets corresponding to the backup main control board and the primary main control board within a preset range based on the third packet information and the second packet information of the third UDP packet.

[0018] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, and the program controls the device where the non-volatile storage medium is located to execute a UDP packet sending method when it runs.

[0019] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements a UDP packet sending method.

[0020] In this embodiment, a network device is employed, including a primary main control board and a backup main control board. The primary and backup main control boards receive a first UDP packet. The primary main control board uploads the first UDP packet to its primary kernel protocol stack and synchronizes the first packet information to the backup main control board. The backup main control board retrieves the first UDP packet through a network filtering queue module and sends it to an automatic repair module on the backup main control board without the first UDP packet passing through the backup kernel protocol stack. The automatic repair module determines the processing method for the first UDP packet based on the first packet information. The primary main control board also generates and sends a second UDP packet, and the backup main control board generates the second UDP packet on the primary main control board. In the case of a second UDP packet being generated, the primary main control board also synchronizes the second UDP packet information to the backup main control board. The line card module in the backup main control board intercepts the third UDP packet, and the network filtering queue module sends the third UDP packet to the automatic repair module. The automatic repair module determines the processing method for the second and third UDP packets based on the second and third UDP packet information. The UDP packet is sent to the automatic repair module through the network filtering queue module, and the automatic repair module repairs the UDP packet, thus achieving the purpose of UDP synchronization. This realizes the technical effect of synchronizing and uninterrupted business data based on the UDP protocol between the primary and backup main control boards, thereby solving the technical problem of service interruption during the switchover of the primary and backup main control boards due to the asynchrony of UDP protocol packets in the primary and backup main control boards. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0022] Figure 1 This is a schematic diagram of a UDP protocol connection scheme provided according to an embodiment of this application;

[0023] Figure 2This is a schematic diagram of a UDP protocol connection scheme provided according to an embodiment of this application;

[0024] Figure 3 This is a schematic diagram of the structure of a network device according to an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of the interaction structure of various modules in a network device according to an embodiment of the present invention;

[0026] Figure 5 This is a schematic diagram of a network device receiving packets according to an embodiment of this application;

[0027] Figure 6 This is a schematic diagram of a network device packet sending process according to an embodiment of this application;

[0028] Figure 7 This is a schematic diagram of a network device primary / backup board switching process provided according to an embodiment of this application;

[0029] Figure 8 This is a schematic diagram of the structure of a computer terminal (mobile device) according to an embodiment of this application;

[0030] Figure 9 This is a flowchart illustrating a UDP packet processing method according to an embodiment of this application;

[0031] Figure 10 This is a flowchart illustrating a UDP packet processing method according to an embodiment of this application;

[0032] Figure 11 This is a flowchart illustrating a UDP packet receiving method according to an embodiment of this application;

[0033] Figure 12 This is a flowchart illustrating a UDP packet sending method according to an embodiment of this application. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0036] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:

[0037] NSR (No-Stopping Route): A reliability technology that ensures uninterrupted data transmission during primary / standby switchover.

[0038] In related technologies, there are two main connection schemes for handling NSR UDP. Figure 1 An example of a UDP protocol connection scheme is shown, such as Figure 1 As shown, this scheme fragments the message and adds an interaction protocol to reduce UDP packet loss. However, due to the need for message fragmentation and the requirement to customize a private protocol, the interoperability between vendors is low and it cannot be universally applied. Figure 2 Another UDP protocol connection scheme is shown, such as Figure 2 As shown, data correctness is ensured by re-encoding UDP protocol messages. However, this solution is affected by the size of UDP protocol messages in the primary and backup processes. Each message needs to be encoded and decoded, which cannot adapt to high-traffic scenarios.

[0039] In summary, to achieve uninterrupted service based on the UDP protocol under NSR (No-Stopping Route), existing technologies either extend the UDP protocol, require customizing a new protocol and fragmenting UDP packets, or even use TCP channels. Considering the packet loss and reliability requirements of the UDP protocol itself, existing technologies face challenges such as high development difficulty, long implementation cycles, and difficulties in unified maintenance.

[0040] To address the above issues, this application provides relevant solutions, which are detailed below.

[0041] This application provides a network device, such as... Figure 3As shown, the network device includes a primary main control board 01 and a backup main control board 03. The primary and backup main control boards 01 and 03 receive a first UDP packet. The primary main control board 01 uploads the first UDP packet to its primary kernel protocol stack 02 and synchronizes the first packet information to the backup main control board 03. The backup main control board 03 retrieves the first UDP packet through a network filtering queue module 05 and sends it to an automatic repair module 06 without the first UDP packet passing through the backup kernel protocol stack 04. The automatic repair module 06 is used to... The processing method for the first UDP packet is determined based on the first message information. The primary main control board 01 is also used to generate and send the second UDP packet, and the backup main control board 03 is also used to generate the third UDP packet when the primary main control board 01 generates the second UDP packet. The primary main control board 01 is also used to synchronize the second message information of the second UDP packet to the backup main control board 03. The line card module 07 in the backup main control board 03 is used to intercept the third UDP packet, and the network filtering queue module 05 is used to send the third UDP packet to the automatic repair module 06. The automatic repair module 06 is used to determine the processing method for the second UDP packet and the third UDP packet based on the second message information and the third message information of the third UDP packet.

[0042] Optionally, Figure 4 A schematic diagram illustrating the interaction between various modules in a network device is shown, such as... Figure 4 As shown, the main interaction flow includes:

[0043] (1) Use the dual-receiver single-transmit user datagram protocol messages of the main and backup boards to synchronize the user datagram protocol messages and service data of the main and backup boards in real time. The main board (main control board 01) receives the first UDP message, and the backup board (backup control board 03) receives the second UDP message.

[0044] (2) The nf_queue mechanism (i.e., network filtering queue module 05) based on the four-tuple of User Datagram Protocol (UDP) packets is used to ensure that the User Datagram Protocol packets of the backup board (backup main control board 03) are sent directly to the automatic repair module 06 in user space without passing through the kernel protocol stack (backup kernel protocol stack 04).

[0045] (3) An automatic repair mechanism for User Datagram Protocol (UDP) is used to dynamically repair the packet loss status of UDP (second UDP packet) on the backup board (backup main control board 03), thereby ensuring the synchronization and uninterrupted service data of the main and backup boards based on UDP. The main use is the parameters such as the quadruple of UDP packets.

[0046] Optionally, the nf_queue module (network filtering queue module 05) will only run on the backup board and will only handle user datagram protocol packets. Other packets will still go through the kernel protocol stack. This allows user datagram protocol packets to be sent directly to user-space applications (including automatic repair module 06) for flexible processing.

[0047] Optionally, the auto-repair module (automatic repair module 06) will only run on the backup board. It will parse the received User Datagram Protocol (UDP) messages and record the UDP parameters such as the quadruple, message offset, and UDP payload of each UDP message. When a new UDP message is received, the quadruple parameters will be compared to determine whether the UDP message is ahead or behind the motherboard, thereby notifying the application module to perform the corresponding processing.

[0048] Specifically, when the backup board's auto-repair module receives a new UDP packet, it first parses the packet's four-tuple parameters, which include: source IP address, destination IP address, source port number, and destination port number. It then checks if these four-tuple parameters match those of a previously recorded session. Each session is identified by a unique set of four-tuple parameters; therefore, this comparison determines which established session the new packet belongs to. Once the session is determined, the auto-repair module checks the packet offset for that session. The packet offset is an indicator used to track the sequence of packets and identify where packets are interrupted or lost.

[0049] It should be noted that the modules in the above network devices can be program modules (such as a set of program instructions to implement a specific function) or hardware modules. For the latter, they can be represented in the following forms, but are not limited to these: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0050] In some embodiments of this application, the first message information includes first message offset information of the first UDP message; determining the processing method for the first UDP message based on the first message information includes: an automatic repair module determining the backup message offset information of the first UDP message received by the backup master control board; comparing the backup message offset information and the first message offset information; if the comparison result is that the offset indicated by the first message offset information is greater than the offset indicated by the backup message offset information, determining the processing method to synchronize the first UDP message received by the backup master control board to the primary master control board until the first message offset is greater than the offset indicated by the backup message offset information. The offset indicated by the displacement information is equal to the offset indicated by the backup message offset information. If the comparison result shows that the offset indicated by the first message offset information is less than the offset indicated by the backup message offset information, the processing method is determined to synchronize the first UDP message received by the primary main control board to the backup main control board until the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information. If the comparison result shows that the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information, the processing method is determined not to perform synchronization processing on the first UDP message.

[0051] Optionally, the processing continues, with the network device continuously receiving the next first UDP packet and constantly updating the backup packet offset information based on the first packet information in the newly received first UDP packet.

[0052] Optionally, Figure 5 A flowchart of a network device receiving packets is shown, such as... Figure 5 As shown, the packet receiving process of the motherboard (main control board 01) is as follows:

[0053] 1. The motherboard receives the user datagram (first UDP packet) sent by DeviceA and uploads it to the kernel protocol stack (primary kernel protocol stack 02).

[0054] 2. When the kernel protocol stack receives a user datagram, it resets the timeout timer and processes the user datagram.

[0055] 3. Synchronize the message offset of the main board to the backup board (backup main control board 03).

[0056] The process for receiving spare boards is as follows:

[0057] 1. After the backup board receives the user data packet, it bypasses the kernel protocol stack (backup kernel protocol stack 04) and sends the packet directly to the repair module (automatic repair module 06). The user mode parses the user data packet and puts the packet into the buffer queue.

[0058] 2. Perform automatic repair of user datagrams, record the user datagram quaternion, synchronously update the packet offset, and compare the primary and backup packet offsets for the same quaternion in the user datagrams:

[0059] If the current backup board message offset equals the primary board message offset, then no action is taken.

[0060] If the current backup board message offset is less than the primary message offset, then synchronize user datagrams from the primary until the current offset equals the primary message offset.

[0061] If the current backup board message offset is greater than the primary board message offset, then synchronize the user datagram message to the primary board. After receiving it, the primary board performs the same operation, that is, synchronizes the user datagram message from the backup board until the primary board message offset equals the backup board offset.

[0062] 3. Perform protocol processing and update user datagram configuration and status.

[0063] In some embodiments of this application, the automatic repair module that sends the first UDP packet to the backup main control board includes: the network filtering queue module sending the first UDP packet to the user-space automatic repair module, and the automatic repair module recording the quadruple information and packet offset information of the first UDP packet.

[0064] Optionally, updating user datagram configuration and status includes recording and updating the quadruple information and message offset information corresponding to the user datagram.

[0065] In some embodiments of this application, the second message information includes the second message offset information of the second UDP message, and the third message information includes the third message offset information of the third UDP message. Determining the processing method for the second UDP message and the third UDP message based on the second message information and the third message offset information of the third UDP message includes: comparing the second message offset information and the third message offset information; if the comparison result shows that the offset indicated by the second message offset information is greater than the offset indicated by the third message offset information, determining the processing method is to synchronize the third UDP message to the primary control board until the... If the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information, and the comparison result shows that the offset indicated by the second message offset information is less than the offset indicated by the third message offset information, the processing method is to synchronize the second UDP message to the backup main control board until the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information; if the comparison result shows that the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information, the processing method is to not perform synchronization processing on the second UDP message and the third UDP message.

[0066] In some embodiments of this application, after generating the third UDP packet, the backup main control board is also used to: encapsulate the third UDP packet and start a timeout timer; send the encapsulated third UDP packet to the backup kernel protocol stack; intercept the third UDP packet processed by the backup kernel protocol stack through the line card module, and upload the intercepted third UDP packet to user space.

[0067] In some embodiments of this application, after the intercepted third UDP packet is uploaded to user space, the automatic repair module is also used to record the quadruple information and packet offset information of the third UDP packet in user space.

[0068] Optionally, Figure 6 A flowchart of packet transmission by a network device is shown, such as... Figure 6 As shown, the packet sending process of the motherboard (main control board 01) is as follows:

[0069] 1. The motherboard sends protocol messages and encapsulates user datagram messages.

[0070] 2. Start the timeout timer, send it to the kernel protocol stack, and then send it to the neighboring device through the interface.

[0071] The process for sending out backup boards is as follows:

[0072] 1. The user datagram is encapsulated and a timeout timer is started. The user datagram is then sent to the kernel protocol stack.

[0073] 2. Protocol stack processing: Line card prohibits message transmission; sent messages are sent to user space.

[0074] 3. The user space receives and parses the user datagram message and puts the message into the buffer queue.

[0075] 4. The auto-repair module records the user datagram packet quadruple and packet offset, and compares the primary and backup packet offsets for the same quadruple in the user datagrams:

[0076] If the current backup board message offset equals the primary board message offset, then no action is taken.

[0077] If the current backup board message offset is less than the primary message offset, then synchronize user datagrams from the primary until the current offset equals the primary message offset.

[0078] If the current standby board message offset is greater than the primary board message offset, then synchronize the user datagram message to the primary board. After receiving it, the primary board performs the same operation, that is, synchronizes the user datagram message from the standby board until the primary board message offset equals the standby board offset.

[0079] 5. Update user datagram configuration and status.

[0080] In some embodiments of this application, when the primary main control board receives a primary-to-standby switchover signal, the primary main control board executes a primary-to-standby demotion process to switch to the standby main control board; when the standby main control board receives a primary-to-standby switchover signal, the standby main control board executes a standby-to-primary promotion process to switch to the primary main control board. During the standby main control board's execution of the standby-to-primary promotion process, the automatic repair module in the standby main control board is used to maintain the deviation between the corresponding message offsets of the standby main control board and the primary main control board within a preset range.

[0081] In some embodiments of this application, during the primary main control board's primary-to-standby process, the primary main control board shuts down the protocol module and enables the network filtering queue module and automatic repair module, thereby switching to the standby main control board.

[0082] Optionally, Figure 7 The flowchart of the network device primary / backup board switchover is shown, such as... Figure 7 As shown, the motherboard switching process is as follows:

[0083] 1. When the motherboard receives the primary / standby switchover signal, it executes the primary-to-standby demotion process, and the hardware switches to standby mode.

[0084] 2. Stop the protocol module and start the nf_queue module and uto-repair module.

[0085] 3. After the switchover is complete, execute the automatic repair process of the new standby board to dynamically keep the primary and standby user data packets synchronized.

[0086] The backup board switching process is as follows:

[0087] 1. When the standby board receives the primary / standby switchover signal, it executes the standby-to-primary upgrade process, switches the hardware to primary mode, and the protocol module operates normally.

[0088] 2. Wait for a specified period and continue automatic repair. This is used to handle transient asynchrony during the switching process and ensure stable switching. Transient asynchrony means that there is a deviation between the corresponding message offsets of the primary and backup main control boards during the switching process. The automatic repair module in the backup main control board runs continuously during the switching period to determine whether there is transient asynchrony and repair it to ensure that the deviation value is within the preset range.

[0089] 3. After the timer expires, stop the nf_queue module and the auto-repair module. The new motherboard will then run stably.

[0090] According to an embodiment of this application, a network device is provided, including a primary main control board and a backup main control board. The primary and backup main control boards are used to receive a first UDP packet. The primary main control board uploads the first UDP packet to its primary kernel protocol stack and synchronizes the first packet information of the first UDP packet to the backup main control board. The backup main control board retrieves the first UDP packet through a network filtering queue module configured in the backup main control board. Without the first UDP packet passing through the backup kernel protocol stack in the backup main control board during retrieval, the backup main control board determines the processing method for the first UDP packet based on the first packet information. The primary main control board is also used to generate a second UDP packet and synchronize the second packet information of the second UDP packet to the backup main control board. The backup main control board is further used to generate a third UDP packet when the primary main control board generates the second UDP packet, and to intercept the third UDP packet. The backup main control board determines the processing method for the second and third UDP packets based on the second packet information and the intercepted third UDP packet.

[0091] Through the aforementioned network equipment, automatic recovery from User Datagram Protocol (UDP) packet loss can be achieved in user space, achieving uninterrupted UDP-based service operation in NSR scenarios without manual intervention. This ensures stable service and traffic operation, improves the high reliability and stability of UDP-based services, requires no kernel modification, and operates purely in user space. It significantly shortens the development cycle of NSR functions and reduces development costs; it is highly versatile, allowing for independent module development; and it boasts high performance, capable of meeting the needs of high-traffic and high-volume scenarios, with a maximum packet loss of less than 50ms during primary / standby failover. It supports effective disaster recovery in large-scale 5G bearer networks, achieving effective disaster recovery scenarios through highly stable and uninterrupted routing technology that ensures consistency of service data before and after handover. Specifically, the embodiments of this application have the following advantages:

[0092] 1. It can support scenarios with high traffic and high business volume.

[0093] 2. The primary and backup systems support real-time synchronization and batch backup.

[0094] 3. The primary and backup processes are completely asynchronous, and there will be no waiting or blocking between the primary and backup.

[0095] 4. User datagram protocol connection is automatically repaired without manual intervention.

[0096] 5. Ensured the stability and reliability of services and systems before and after the switchover.

[0097] 6. No need to fragment user datagram protocol messages, and no need to expand new protocol modules. The main and backup boards reduce unnecessary encapsulation and decapsulation, and the main and backup boards implement asynchronous processing, effectively improving performance.

[0098] According to an embodiment of this application, a method embodiment for UDP packet processing is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0099] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 8 A hardware block diagram of a computer terminal (or mobile device) for implementing a UDP packet processing method is shown. Figure 8 As shown, a computer terminal 80 (or mobile device 80) may include one or more processors 802 (shown as 802a, 802b, ..., 802n in the figure) 802 (processor 802 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 804 for storing data, and a transmission device 806 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 8 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, the computer terminal 80 may also include... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.

[0100] It should be noted that the aforementioned one or more processors 802 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 80 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0101] The memory 804 can be used to store application software programs and modules, such as the UDP packet processing method in the embodiments of this application.

[0102] The corresponding program instruction / data storage device, processor 802, executes various functional applications and data processing by running software programs and modules stored in memory 804, thereby implementing the aforementioned UDP packet processing method. Memory 804 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, memory 804 may further include memory remotely located relative to processor 802, and these remote memories can be connected to computer terminal 80 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0103] The transmission device 806 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 80. In one example, the transmission device 806 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 806 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0104] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of a computer terminal 80 (or a mobile device).

[0105] Under the above operating environment, this application provides a UDP packet processing method, such as... Figure 9 As shown, the method includes the following steps:

[0106] Step S902: Receive and upload the first UDP packet to the primary kernel protocol stack of the primary control board for processing, and simultaneously synchronize the first packet information of the first UDP packet to the backup control board. The first packet information quadruple information includes the quadruple and the packet offset.

[0107] Step S904: After generating the second UDP packet, synchronize the second packet information of the second UDP packet to the backup main control board so that the backup main control board can synchronize and repair the UDP packet during the main / backup switchover process.

[0108] Optionally, after generating the second UDP packet, the primary control board encapsulates key information carried in the packet, such as the source IP address, destination IP address, source port number, destination port number, and packet offset, and synchronizes the second packet information to the backup control board. This synchronization process utilizes the tight connection between the primary and backup control boards to ensure low latency and high success rate in information transmission. After the second packet information reaches the backup control board, it is received and parsed by the automatic repair module. The module compares the UDP packet sequence status on the current backup control board, especially the backup packet offset information, with the second packet offset information synchronized from the primary control board. If the offset indicated by the backup packet offset information on the backup control board is less than the offset in the second packet information on the primary control board, the automatic repair module triggers the synchronization repair process, requesting and receiving the missing UDP packets from the primary control board until the UDP packet sequence on the backup control board is completely synchronized with the primary control board and the packet offsets are consistent, thereby eliminating the data asynchrony problem that may occur during primary / backup switchover.

[0109] The key advantage of this embodiment lies in its ability to achieve real-time synchronization and automatic repair of UDP packets on the standby main control board before and after the main control board switchover by synchronizing the second message information, without relying on the kernel protocol stack or complex hardware customization. As a user-space component, the automatic repair module can flexibly handle and repair any interruptions or inconsistencies in the UDP packet sequence, ensuring the continuity of UDP-based service data during the main / standby switchover process. This avoids service interruptions caused by the switchover, improves the overall stability and reliability of the system, and is particularly suitable for 5G bearer network scenarios requiring high reliability and high-volume processing.

[0110] Under the above operating environment, this application provides a UDP packet processing method, such as... Figure 10 As shown, the method includes the following steps:

[0111] Step S1002: Intercept the first UDP packet from the network interface of the backup main control board, and send the first UDP packet directly to the target application process without passing through the backup kernel protocol stack of the backup main control board.

[0112] Step S1004: In response to the execution of the target application process, determine whether it is necessary to synchronize the missing UDP packets from the primary main control board based on the first packet information of the first packet synchronized from the primary main control board, so that the UDP packet status on the standby main control board is consistent with the UDP packet status on the primary main control board.

[0113] Step S1006: Before the primary / standby switchover, when the standby main control board generates a third UDP packet, the third UDP packet is intercepted, and based on the second packet information of the second UDP packet synchronized from the primary main control board, it is determined whether to synchronize or send redundant UDP packets to the primary main control board.

[0114] Under the above operating environment, this application embodiment provides a UDP packet receiving method, such as... Figure 11 As shown, the method includes the following steps:

[0115] In step S1102, the primary control board in the communication device receives the first UDP packet and synchronizes the first packet information of the first UDP packet to the backup control board in the communication device.

[0116] In step S1104, when the primary main control board receives the first UDP packet, the backup main control board also receives the first UDP packet. The backup main control board is further configured to maintain the deviation between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range based on the first packet information and the first UDP packet.

[0117] Under the above operating environment, this application embodiment provides a UDP packet sending method, such as... Figure 12 As shown, the method includes the following steps:

[0118] In step S1202, the primary main control board in the communication device generates and sends a second UDP packet, and synchronizes the second packet information of the second UDP packet to the backup main control board in the communication device.

[0119] In step S1204, when the primary main control board generates a second UDP packet, the backup main control board generates and intercepts a third UDP packet, and based on the third packet information and the second packet information of the third UDP packet, maintains the deviation between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range.

[0120] This application provides a non-volatile storage medium storing a program, wherein the program controls the device where the non-volatile storage medium is located to execute the above-described method when it runs.

[0121] This application provides a computer program product, including a computer program that implements the above-described method when executed by a processor.

[0122] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0123] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0124] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

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

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

[0127] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A network device, characterized in that, This includes a primary control board and a backup control board, among which... The primary main control board and the backup main control board are used to receive the first UDP packet. The primary main control board uploads the first UDP packet to the primary kernel protocol stack of the primary main control board and synchronizes the first packet information of the first UDP packet to the backup main control board. The first packet information includes the first packet offset information of the first UDP packet. The backup main control board retrieves the first UDP packet through a network filtering queue module located in the backup main control board. Without the first UDP packet passing through the backup kernel protocol stack in the backup main control board during retrieval, the backup main control board sends the first UDP packet to an automatic repair module in the backup main control board. The automatic repair module determines the processing method for the first UDP packet based on the first packet information. This includes determining the backup packet offset information of the first UDP packet received by the backup main control board, comparing the backup packet offset information with the first packet offset information, and determining the processing method based on the comparison result. This maintains the deviation between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range. The primary control board is further configured to generate and send a second UDP packet, and the backup control board is further configured to generate a third UDP packet when the primary control board generates the second UDP packet. The primary control board is also configured to synchronize the second packet information of the second UDP packet to the backup control board. The line card module in the backup control board is configured to intercept the third UDP packet. The network filtering queue module is configured to send the third UDP packet to the automatic repair module. The automatic repair module is configured to determine the processing method for the second UDP packet and the third UDP packet based on the second packet information and the third packet information of the third UDP packet. This includes comparing the second packet offset information and the third packet offset information, and determining the processing method for the second UDP packet and the third UDP packet based on the comparison result, thereby maintaining the deviation between the corresponding packet offsets of the backup control board and the primary control board within a preset range. The second packet information includes the second packet offset information of the second UDP packet, and the third packet information includes the third packet offset information of the third UDP packet.

2. The network device according to claim 1, characterized in that, Determining the processing method for the first UDP packet based on the first message information includes: The automatic repair module determines the backup packet offset information of the first UDP packet received by the backup main control board; Compare the backup message offset information with the first message offset information; If the comparison result shows that the offset indicated by the first message offset information is greater than the offset indicated by the backup message offset information, the processing method is determined to be to synchronize the first UDP message received by the backup main control board to the primary main control board until the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information. If the comparison result shows that the offset indicated by the first message offset information is less than the offset indicated by the backup message offset information, the processing method is determined to be to synchronize the first UDP message received by the primary main control board to the backup main control board until the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information. If the comparison result shows that the offset indicated by the first message offset information is equal to the offset indicated by the backup message offset information, then the processing method is determined to be not to perform synchronization processing on the first UDP message.

3. The network device according to claim 1, characterized in that, The automatic repair module that sends the first UDP packet to the backup main control board includes: The network filtering queue module sends the first UDP packet to the user-space automatic repair module, and the automatic repair module records the quadruple information and packet offset information of the first UDP packet.

4. The network device according to claim 1, characterized in that, The processing method for the second UDP packet and the third UDP packet, determined based on the second packet information and the third packet information, includes: Compare the second message offset information with the third message offset information; If the comparison result shows that the offset indicated by the second message offset information is greater than the offset indicated by the third message offset information, the processing method is determined to be to synchronize the third UDP message to the main control board until the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information. If the comparison result shows that the offset indicated by the second message offset information is less than the offset indicated by the third message offset information, the processing method is determined to be to synchronize the second UDP message to the backup main control board until the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information. If the comparison result shows that the offset indicated by the second message offset information is equal to the offset indicated by the third message offset information, then the processing method is determined to be not to perform synchronization processing on the second UDP message and the third UDP message.

5. The network device according to claim 1, characterized in that, After generating the third UDP packet, the backup main control board is also used for: Encapsulate the third UDP packet and start the timeout timer; The encapsulated third UDP packet is sent to the backup kernel protocol stack; The line card module intercepts the third UDP packet after it has been processed by the backup kernel protocol stack, and uploads the intercepted third UDP packet to user space.

6. The network device according to claim 5, characterized in that, After the intercepted third UDP packet is uploaded to user space, the automatic repair module is also used to record the quadruple information and packet offset information of the third UDP packet in user space.

7. The network device according to claim 1, characterized in that, When the primary main control board receives a primary / standby switchover signal, the primary main control board executes a primary-to-standby decommissioning process, thereby switching to become the standby main control board. When the backup main control board receives the primary / backup switchover signal, the backup main control board executes the backup-to-primary process to switch to the primary main control board. During the execution of the backup-to-primary process, the automatic repair module in the backup main control board is used to maintain the deviation between the corresponding message offsets of the backup main control board and the primary main control board within a preset range.

8. The network device according to claim 7, characterized in that, During the primary control board's primary-to-standby process, the primary control board shuts down the protocol module and enables the network filtering queue module and automatic repair module, thereby switching to the standby control board.

9. A network device, characterized in that, This includes a primary control board and a backup control board, among which... The primary main control board and the backup main control board are used to receive the first UDP packet. The primary main control board uploads the first UDP packet to the primary kernel protocol stack of the primary main control board and synchronizes the first packet information of the first UDP packet to the backup main control board. The first packet information includes the first packet offset information of the first UDP packet. The backup main control board retrieves the first UDP packet through a network filtering queue module located in the backup main control board. If the first UDP packet does not pass through the backup kernel protocol stack in the backup main control board during retrieval, the processing method for the first UDP packet is determined based on the first packet information. Specifically, the backup packet offset information of the first UDP packet received by the backup main control board is determined, the backup packet offset information and the first packet offset information are compared, and the processing method is determined based on the comparison result. This maintains the deviation between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range. The primary control board is also used to generate a second UDP packet and synchronize the second packet information of the second UDP packet to the backup control board. The backup main control board is further configured to generate a third UDP packet and intercept the third UDP packet when the primary main control board generates the second UDP packet; determine the processing method for the second UDP packet and the third UDP packet based on the second packet information and the intercepted third UDP packet, wherein the second packet offset information and the third packet offset information are compared, and the processing method for the second UDP packet and the third UDP packet is determined based on the comparison result, thereby maintaining the deviation value between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range; the second packet information includes the second packet offset information of the second UDP packet, and the third packet information includes the third packet offset information of the third UDP packet.

10. A UDP packet processing method, characterized in that, include: The first UDP packet is received and uploaded to the primary kernel protocol stack of the primary main control board for processing. At the same time, the first packet information of the first UDP packet is synchronized to the backup main control board. The first packet information includes a quadruple and a packet offset. After generating the second UDP packet, the second packet information of the second UDP packet is synchronized to the backup master control board, so that the backup master control board can synchronize and repair the UDP packet during the master-slave switchover. The second packet information includes the second packet offset information of the second UDP packet. The backup master control board is used to maintain the deviation between the offset indicated by the backup packet offset information of the backup master control board and the offset in the second packet information of the master control board within a preset range.

11. A UDP packet processing method, characterized in that, include: The first UDP packet is intercepted from the network interface of the backup main control board, and the first UDP packet is sent directly to the target application process without going through the backup kernel protocol stack of the backup main control board. In response to the execution of the target application process, a determination is made based on the first message information of the first message synchronized from the primary main control board to determine whether it is necessary to synchronize missing UDP messages from the primary main control board, so that the UDP message state on the backup main control board is consistent with the UDP message state on the primary main control board. Specifically, the backup message offset information of the first UDP message received by the backup main control board is determined, the backup message offset information and the first message offset information are compared, and a determination is made based on the comparison result to determine whether it is necessary to synchronize missing UDP messages from the primary main control board, thereby maintaining the deviation between the corresponding message offsets of the backup main control board and the primary main control board within a preset range; the first message information includes the first message offset information of the first UDP message. Before the primary / standby switchover, when the standby main control board generates a third UDP packet, it intercepts the third UDP packet and determines whether to synchronize or send redundant UDP packets to the primary main control board based on the second packet information of the second UDP packet synchronized from the primary main control board. Specifically, it compares the second packet offset information and the third packet offset information, and determines whether to synchronize or send redundant UDP packets to the primary main control board based on the comparison result, thereby maintaining the deviation between the corresponding packet offsets of the standby main control board and the primary main control board within a preset range. The second packet information includes the second packet offset information of the second UDP packet, and the third packet information includes the third packet offset information of the third UDP packet.

12. A method for receiving UDP packets, characterized in that, include: The primary control board in the communication device receives the first UDP packet and synchronizes the first packet information of the first UDP packet to the backup control board in the communication device. When the primary main control board receives the first UDP packet, the backup main control board also receives the first UDP packet. The backup main control board is further configured to maintain the deviation between the corresponding packet offsets of the backup main control board and the primary main control board within a preset range based on the first packet information and the first UDP packet. The first packet information includes the first packet offset information of the first UDP packet.

13. A method for sending UDP packets, characterized in that, include: The primary control board in the communication device generates and sends a second UDP packet, and synchronizes the second packet information of the second UDP packet to the backup control board in the communication device. When the primary control board generates the second UDP packet, the backup control board generates and intercepts the third UDP packet, and maintains the deviation between the corresponding packet offsets of the backup control board and the primary control board within a preset range based on the third packet information of the third UDP packet and the second packet information. The second packet information includes the second packet offset information of the second UDP packet, and the third packet information includes the third packet offset information of the third UDP packet.

14. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute the UDP packet processing method of claim 10, the UDP packet processing method of claim 11, the UDP packet receiving method of claim 12, or the UDP packet sending method of claim 13.

15. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the steps of performing the UDP packet processing method of claim 10, the UDP packet processing method of claim 11, the UDP packet receiving method of claim 12, or the UDP packet sending method of claim 13.

Citation Information

Patent Citations

  • Data synchronization method between the main board and spare board in the communication system

    CN101056195A

  • Message synchronization method and device

    CN117082081A