A method for fast traffic forwarding

Through the update mechanism of binary numerical definition of module bits and default scheduling codes, flexible scheduling of network forwarding equipment is realized, traffic forwarding rate is improved, and performance degradation caused by the numerous functional modules is solved.

CN115801424BActive Publication Date: 2025-08-26北京威努特技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211503977.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2025-08-26
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

The numerous functional modules of network forwarding equipment lead to a degradation of forwarding performance, lack of flexible scheduling methods, and affects system performance.

Method used

Use binary numerical values ​​to define module bits, calculate possible combination methods, set default scheduling codes, update scheduling codes according to the return value of the module, and realize flexible scheduling and fast forwarding of the module.

Benefits of technology

It improves the forwarding rate of network traffic, solves the problems of system bloat and performance degradation caused by the numerous functional modules, and realizes that different functional modules only deal with network sessions that are concerned.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115801424B_ABST
    Figure CN115801424B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for fast traffic forwarding, comprising: defining all modules of a firewall system using integer values, with each module occupying one bit; calculating a combination method based on the maximum scheduling code, with each combination representing a combined scheduling method for a different module, and each scheduling code corresponding to a scheduling combination; setting a default scheduling code for each module; receiving network traffic, scheduling a newly created network session using the default scheduling code, and updating the scheduling code based on the module return value; and when the network session has traffic again, calling the module registered for the session based on the updated scheduling code. The present invention aims to provide a flexible scheduling software design method to address the problem of system bloat and performance degradation caused by the multitude of functions in a network firewall system. Compared with traditional functional module scheduling methods, this method allows different functional modules to only process the network sessions they are concerned with, eliminating the need for the modules themselves to filter traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a method for fast traffic forwarding. Background Art

[0002] With the development of networks and practical needs, network forwarding devices now support an increasing number of functional modules, ranging from a dozen to dozens. Without a flexible scheduling method, network forwarding capabilities will only degrade as the number of functions increases. Based on this, the present invention proposes a method and system for fast traffic forwarding, which can improve traffic forwarding rates. Summary of the Invention

[0003] The present invention provides a method for fast traffic forwarding, comprising:

[0004] Use an integer value to define all modules of a firewall system. Define module positions based on the number and function of modules. Each module occupies one bit.

[0005] Based on the largest scheduling code, calculate the possible combinations. Each possible combination represents a combined scheduling method for different modules. Each scheduling code corresponds to a scheduling combination, and the scheduling code is the unique ID of the scheduling combination.

[0006] Set a default dispatch code for each module in the system, and each module subscribes to network traffic;

[0007] Receive network traffic. For newly created network sessions, use the default scheduling code to schedule each module, and then update the scheduling code based on the module's return value. When the network session has traffic again, only the module that registered the session needs to be called according to the updated scheduling code.

[0008] In the method for fast traffic forwarding as described above, each bit of a binary value that is 1 represents a module of the system.

[0009] The method for fast forwarding of traffic as described above may include the following combinations: Types, n represents the number of modules contained in the system, and each possible combination represents a combination scheduling method of different modules.

[0010] In the method for fast traffic forwarding described above, the traffic processing method specifically includes:

[0011] Step 1: Receive network traffic and determine whether it is the first packet. If it is the first packet, execute Step 2; otherwise, execute Step 3.

[0012] Step 2: Create a new network session, obtain the default dispatch code, send network traffic to the corresponding module according to the default dispatch code to perform the dispatch operation, and then execute Step 4;

[0013] Step 3: Find the network session corresponding to the network traffic, obtain the corresponding scheduling code, send the network traffic to the corresponding module according to the scheduling code to perform the scheduling operation, and then execute Step 4.

[0014] Step 4. Receive the return value of the model. If the return value indicates that the module has not subscribed to the session, update the scheduling code. If the return value indicates that the module has subscribed to the session, keep the scheduling code and return to continue receiving network traffic.

[0015] In the method for fast traffic forwarding described above, performing a scheduling operation specifically includes:

[0016] S1. Obtain the scheduling combination through the scheduling code;

[0017] S2. Traverse the scheduling combination, obtain the module processing entry in turn and execute the call, and record the unsubscribed module.

[0018] S3. After the traversal is completed, check whether there is an unsubscribe module. If so, set the bit position of the unsubscribe module to 0 in the current scheduling code, obtain a new scheduling code and update the current scheduling code.

[0019] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium contains one or more program instructions, and the one or more program instructions are used by a processor to execute any of the above-mentioned methods for fast forwarding of traffic.

[0020] The present invention achieves the following beneficial effects: It aims to provide a flexible scheduling software design method to address the issue of network firewall systems becoming overloaded and experiencing performance degradation due to their numerous functions. Compared to traditional functional module scheduling methods, this method enables different functional modules to process only the network sessions they are interested in, eliminating the need for the modules themselves to filter traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0022] Figure 1 This is a flow chart of a method for fast traffic forwarding provided by the first embodiment of the present invention;

[0023] Figure 2 It is a flow chart of the traffic processing method;

[0024] Figure 3 It is a flowchart for executing scheduling operations. DETAILED DESCRIPTION

[0025] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. 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.

[0026] Example 1

[0027] See also Figure 1 A first embodiment of the present invention provides a method for fast traffic forwarding, which is a design method for fast scheduling switching of network traffic into different combination function modules for processing according to different situations due to the need for multiple functions. The method includes:

[0028] Step 110: Use an integer value to define all modules of a firewall system. Define module positions according to the number of modules and their functions. Each module occupies one bit.

[0029] For example, a software system has five modules. The default scheduling value for this system is 0x1F, which is represented by 11111 in binary. Each bit that is 1 in the binary system represents a module. This value indicates that the system has five modules. Each module occupies one bit. Typically, a 32-bit value defines a system with a maximum of 32 modules, while a 64-bit value defines a system with a maximum of 64 modules.

[0030] Step 120: Calculate the possible combinations based on the largest dispatch code. Each possible combination represents a combined dispatch method of different modules. Each dispatch code corresponds to a dispatch combination, and the dispatch code is the unique ID of the dispatch combination.

[0031] Specifically, the possible combinations are Types, n represents the number of modules contained in the system, and each possible combination represents a combination scheduling method of different modules.

[0032] Step 130: Set a default dispatch code for each module in the system, and each module subscribes to network traffic;

[0033] Specifically, there's a one-to-one mapping between dispatch codes and dispatch combinations; each dispatch combination has a unique dispatch code. Dispatch codes have two operations: execution, which retrieves the dispatch combination based on the dispatch code and then executes it, completing the module call—meaning each module completes network traffic processing. The second operation is updating the dispatch code. Because the dispatch code indicates that the bit corresponding to the module subscribing to the network session is set to 1, when the module is called, the module's return value indicates that the dispatch code needs to be updated to cancel the subscription, which means that the bit is set to 0.

[0034] Step 140: Receive network traffic. For a newly created network session, schedule each module using the default scheduling code. Then, update the scheduling code based on the module's return value. When the network session has traffic again, only the module that registered the session needs to be called based on the updated scheduling code.

[0035] like Figure 2 As shown, the traffic processing method specifically includes the following sub-steps:

[0036] Step 210: Receive network traffic;

[0037] Step 220: Determine whether the network traffic is the first packet. If yes, execute step 230; otherwise, execute step 240.

[0038] Step 230: Create a new network session, obtain a default scheduling code, send network traffic to the corresponding module according to the default scheduling code to perform scheduling operations, and then execute step 250;

[0039] Step 240 , search for the network session corresponding to the network traffic, obtain the corresponding scheduling code, send the network traffic to the corresponding module according to the scheduling code to perform the scheduling operation, and then execute step 250 .

[0040] Step 250, receive the return value of the model, and determine whether the return value indicates that the module subscribes to the session. If so, keep the scheduling code and return to step 210 to continue receiving network traffic. Otherwise, update the scheduling code and return to step 210 to continue receiving network traffic.

[0041] Among them, such as Figure 3 As shown, the scheduling operation is performed, including:

[0042] Step 310: Obtain a scheduling combination through a scheduling code;

[0043] Step 320: traverse the scheduling combination, obtain the module processing entry in sequence and execute the call, and record the unsubscribed module.

[0044] Step 330: After the traversal is completed, check whether there is a cancellation module. If so, set the bit position of the cancellation module to 0 in the current scheduling code, obtain a new scheduling code and update the current scheduling code, and end this scheduling. Otherwise, end this scheduling directly.

[0045] Corresponding to the above embodiment, an embodiment of the present invention provides a device for fast traffic forwarding, the system comprising: at least one memory and at least one processor;

[0046] The memory is used to store one or more program instructions;

[0047] The processor is configured to run one or more program instructions to execute a method for fast traffic forwarding.

[0048] Corresponding to the above embodiment, an embodiment of the present invention provides a computer-readable storage medium, which contains one or more program instructions, and the one or more program instructions are used by a processor to execute a method for fast traffic forwarding.

[0049] The embodiments disclosed in the present invention provide a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed on a computer, the computer executes the above-mentioned method for fast traffic forwarding.

[0050] In the embodiments of the present invention, the processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0051] The methods, steps, and logic diagrams disclosed in the embodiments of the present invention can be implemented or executed. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software modules can be located in a storage medium well-established in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The processor reads the information from the storage medium and, in conjunction with its hardware, completes the steps of the aforementioned methods.

[0052] The storage medium may be a memory and may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0053] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0054] Volatile memory may be random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).

[0055] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0056] Those skilled in the art will appreciate that in one or more of the above examples, the functions described herein can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media includes any medium that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0057] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for fast traffic forwarding, characterized in that: include: Use an integer value to define all modules of a firewall system. Define module positions based on the number and function of modules. Each module occupies one bit. Based on the largest scheduling code, calculate the possible combinations. Each possible combination represents a combined scheduling method for different modules. Each scheduling code corresponds to a scheduling combination, and the scheduling code is the unique ID of the scheduling combination. Set a default dispatch code for each module in the system, and each module subscribes to network traffic; Receive network traffic. For newly created network sessions, use the default scheduling code to schedule each module, and then update the scheduling code based on the module's return value. When the network session has traffic again, only the module that registered the session needs to be called according to the updated scheduling code.

2. A method for fast traffic forwarding according to claim 1, characterized in that: Each bit position of the binary value that is 1 represents a module of the system.

3. A method for fast traffic forwarding according to claim 1, characterized in that: Possible combinations include Types, n represents the number of modules contained in the system, and each possible combination represents a combination scheduling method of different modules.

4. A method for fast traffic forwarding according to claim 1, characterized in that: Traffic processing methods include: Step 1: Receive network traffic and determine whether it is the first packet. If it is the first packet, execute Step 2; otherwise, execute Step 3. Step 2: Create a new network session, obtain the default dispatch code, send network traffic to the corresponding module according to the default dispatch code to perform the dispatch operation, and then execute Step 4; Step 3: Find the network session corresponding to the network traffic, obtain the corresponding scheduling code, send the network traffic to the corresponding module according to the scheduling code to perform the scheduling operation, and then execute Step 4; Step 4. Receive the return value of the model. If the return value indicates that the module has not subscribed to the session, update the scheduling code. If the return value indicates that the module has subscribed to the session, keep the scheduling code and return to continue receiving network traffic.

5. A method for fast traffic forwarding according to claim 4, characterized in that: Perform scheduling operations, including: S1. Obtain the scheduling combination through the scheduling code; S2. Traverse the scheduling combination, obtain the module processing entry in sequence and execute the call, and record the unsubscribed module; S3. After the traversal is completed, check whether there is an unsubscribe module. If so, set the bit position of the unsubscribe module to 0 in the current scheduling code, obtain a new scheduling code and update the current scheduling code.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium includes one or more program instructions, and the one or more program instructions are used by a processor to execute a method for fast traffic forwarding as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Unified task scheduling system

    CN112685161A

  • Service selection method and device based on programmable data plane, and switch

    CN113132236A