A data packet offloading method and apparatus
By constructing a hash function model based on a linear structure, the target matrix is ensured to be full rank, thus solving the polarization problem in load balancing and achieving balanced packet distribution and maximizing network throughput.
Patent Information
- Application Number
- CN202310813461.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-07-04
AI Technical Summary
Existing load balancing solutions are prone to polarization when splitting traffic across ports, resulting in poor load balancing performance.
A load balancing model is constructed using a hash function based on a linear structure, ensuring that the target matrix corresponding to the hash function is full rank. This allows the hash function to determine the port corresponding to the data packet, thereby achieving balanced distribution of data packets.
It achieves balanced distribution of data packets, effectively utilizes bandwidth resources, maximizes network throughput, and solves the problem of poor load balancing performance.
Smart Images

Figure CN119276791B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication, and in particular to a data packet shunting method and device. BACKGROUND
[0002] With the continuous development of communication technology, the requirements for data transmission services are also increasing, and it is necessary to perform port shunting on the to-be-transmitted data to make the traffic on each port link as evenly distributed as possible to meet load balancing, enhance the reliability of the network, and thus better serve users.
[0003] However, the existing load balancing scheme usually has polarization phenomenon in the process of implementing load balancing, which will cause uneven distribution of to-be-transmitted data in port shunting, resulting in poor load balancing effect in port shunting of to-be-transmitted data.
[0004] In summary, how to effectively improve load balancing is a technical problem that needs to be solved at present. SUMMARY
[0005] The embodiments of the present application provide a data packet shunting method and device to solve the problem of poor load balancing effect in the prior art.
[0006] In a first aspect, the embodiments of the present application provide a data packet shunting method, comprising: inputting five-tuple information of any to-be-transmitted data packet into a load balancing model to determine a port corresponding to the data packet from N ports; transmitting the data packet through a link corresponding to the port; the data length of the five-tuple information is m; wherein the load balancing model is determined based on a hash function of a linear structure; the hash function makes the target matrix corresponding to the hash function full rank when simulating transmission of a sequential flow on the N ports; the sequential flow is composed of X data packets that change in sequence.
[0007] In the above technical solution, since the target matrix corresponding to the hash function is full rank, the load balancing model determined by the hash function has good balance, and the load balancing model determines the port corresponding to the data packet, thereby realizing port shunting of multiple to-be-transmitted data packets and load balancing.
[0008] Optionally, the load balancing model is determined based on a hash function of a linear structure, comprising: constructing a first polynomial; the first polynomial satisfies the linear structure and the constant term is 1; constructing a first hash function based on the first polynomial; determining a first matrix corresponding to the first hash function; determining a target matrix corresponding to the first matrix according to the sequential flow; when the target matrix corresponding to the first matrix is full rank, constructing the load balancing model based on the first hash function.
[0009] Optionally, further comprising: when the target matrix corresponding to the first matrix is not full rank, constructing a second polynomial until a polynomial is obtained in which the target matrix is full rank.
[0010] Optionally, the load balancing model is constructed based on the first hash function, comprising:
[0011] If the first hash function has input inversion, the load balancing model is constructed based on the first inversion matrix and the first matrix; and / or if the first hash function has output inversion, the load balancing model is constructed based on the second inversion matrix and the first matrix.
[0012] Optionally, the hash function is obtained through cyclic redundancy check (CRC).
[0013] Optionally, the sequential flow is obtained by sequentially arranging the data packet identifiers, and the data packet identifier is a continuous m-bit in the data packet.
[0014] Optionally, if N is a non-power-of-two value, the load balancing model is determined based on K ports; K is a power-of-two value greater than N.
[0015] In a second aspect, an embodiment of the present application provides a data packet distribution device, comprising: an acquisition unit configured to input five-tuple information of any data packet to be transmitted into a load balancing model to determine a port corresponding to the data packet from N ports; a processing unit configured to transmit the data packet through a link corresponding to the port; the data length of the five-tuple information is M; wherein the load balancing model is determined based on a hash function of a linear structure; the hash function makes the target matrix corresponding to the hash function full rank when a sequential flow is simulated to be transmitted on the N ports; and the sequential flow is composed of X data packets that change sequentially.
[0016] Optionally, the acquisition unit is specifically configured to: construct a first polynomial; the first polynomial satisfies a linear structure and has a constant term of 1; construct a first hash function based on the first polynomial; determine a first matrix corresponding to the first hash function; determine a target matrix corresponding to the first matrix according to the sequential flow; and construct a load balancing model based on the first hash function when the target matrix corresponding to the first matrix is full rank.
[0017] Optionally, the acquisition unit is further configured to: when the target matrix corresponding to the first matrix is not full rank, adjust the first polynomial to a second polynomial, and the second polynomial is a polynomial in which the target matrix corresponding to the first matrix is full rank.
[0018] Optionally, the acquisition unit is specifically configured to: if the first hash function has input inversion, construct a load balancing model based on a first inversion matrix and the first matrix; and / or if the first hash function has output inversion, construct a load balancing model based on a second inversion matrix and the first matrix.
[0019] Optionally, the acquisition unit is specifically used for: the hash function is obtained through cyclic redundancy check (CRC).
[0020] Optionally, the acquisition unit is specifically used for: the sequential stream is obtained by arranging the data packets in order according to their identifiers, wherein the identifier of the data packet is m consecutive bits in the data packet.
[0021] Optionally, the acquisition unit is specifically used to: determine the load balancing model based on K ports if N is a non-power of two values; where K is a power of two values greater than N.
[0022] Thirdly, embodiments of the present invention also provide a network device, including a communication interface for receiving and sending data; and a processor for executing instructions and data to invoke a computer program, so that the network device performs the packet splitting method described in the first aspect above.
[0023] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a program that, when run on a computer, causes the computer to execute the data packet splitting method described in the first aspect. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A flowchart of a data packet splitting method provided in an embodiment of the present invention;
[0026] Figure 2 A flowchart illustrating a method for constructing a load balancing model according to an embodiment of the present invention;
[0027] Figure 3 This is a schematic diagram of a data packet splitting device provided in an embodiment of the present invention;
[0028] Figure 4 This is a schematic diagram of the structure of a network device provided in an embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0030] To facilitate understanding of this solution, load balancing will be explained below.
[0031] Load balancing means distributing the load across multiple operating units, such as FTP servers, web servers, core enterprise application servers, and other major task servers, to collaboratively complete tasks.
[0032] In one possible scenario, when there are multiple ports and their corresponding links, and each link has the same bandwidth, it is necessary to distribute the data to be transmitted as evenly as possible across the various port links to achieve load balancing, thereby effectively utilizing bandwidth resources and maximizing network throughput.
[0033] In one possible scenario, when the number of ports is a power of two, load balancing schemes often exhibit polarization during the load balancing process. This means that the load balancing effect is either extremely good or extremely poor, leading to instability when the number of ports is a power of two. When the number of ports is not a power of two, since the data is transmitted in binary units, this load balancing scheme cannot achieve load balancing.
[0034] In summary, this invention provides a data packet splitting method to address the problems of load balancing polarization and the inability to achieve load balancing.
[0035] like Figure 1 The diagram shows a flowchart of a data packet splitting method provided by an embodiment of the present invention. The method includes the following steps:
[0036] Step 101: For any data packet to be transmitted, input the 5-tuple information of the data packet into the load balancing model, and determine the port corresponding to the data packet from N ports.
[0037] In this embodiment of the invention, the load balancing model is determined based on a hash function with a linear structure. Specifically, when the hash function simulates sequential transmission across N ports, the target matrix corresponding to the hash function is made to have full rank, thus achieving good load balancing. This allows the model to determine the corresponding port from the N ports by inputting the 5-tuple information of any data packet into the load balancing model, thereby distributing multiple data packets relatively evenly across the ports to achieve load balancing. The data length of the 5-tuple information is m; the sequential flow consists of X data packets in a sequentially varying order. The hash function is obtained using the Cyclic Redundancy Check (CRC) algorithm. It should be noted that the CRC algorithm has linear characteristics. For example, if b1 = h(a1) and b2 = h(a2), then (b1 + b2) = h(a1 + a2).
[0038] Step 102: Transmit data packets through the link corresponding to the port.
[0039] In this embodiment of the invention, the port corresponding to the data packet is determined through step 101 above, and the data packet is transmitted through the link corresponding to the port, thereby effectively utilizing bandwidth resources and maximizing network throughput.
[0040] As can be seen from steps 101 to 102 above, since the target matrix corresponding to the hash function is full rank, the load balancing model determined by the hash function has good balance. The load balancing model with good balance determines the port corresponding to the data packet, thereby realizing port-based traffic distribution of multiple data packets to be transmitted, achieving load balancing, and thus effectively utilizing bandwidth resources and maximizing network throughput.
[0041] Load balancing is achieved because the load balancing model has good balance. Therefore, the following section introduces how the load balancing model is constructed.
[0042] like Figure 2 The diagram shown is a flowchart of a method for constructing a load balancing model according to an embodiment of the present invention. The method includes the following steps:
[0043] Step 201: Construct the first polynomial.
[0044] In this embodiment of the invention, when constructing the first polynomial, there are two constraints: the first constraint is that the first polynomial satisfies a linear structure; the second constraint is that the constant term of the first polynomial is 1.
[0045] Step 202: Construct the first hash function based on the first polynomial.
[0046] In this embodiment of the invention, firstly, the quintuple information of the input data packet is vector a. Then, vector a is converted into a modulo-2 polynomial Q. Specifically, according to a first correspondence, vector a is converted into a modulo-2 polynomial Q. The first correspondence is: if the number of bits in the vector from right to left corresponds to x^0, x^1, x^2, then the expression for the modulo-2 polynomial Q can be found in Formula 1.
[0047] Q = x^n + c n-1 x^(n-1)+...+c1x+c0=[1,c n-1 ,c n-2 ,...,c0] Formula 1
[0048] Calculate the modulo 2 polynomial Q using division with remainder, and then convert the result into a vector b, where vector b = a * x^n. Construct the first hash function h(a) based on vector b and the first polynomial P, where the expression for the first hash function h(a) can be found in Formula 2:
[0049] h(a)=a*x^n%P Formula 2
[0050] Step 203: Determine the first matrix corresponding to the first hash function.
[0051] In this embodiment of the invention, since the first hash function can be represented in matrix form, another expression for the first hash function can be found in Formula 3:
[0052] h(a)=aT Formula 3
[0053] The following describes how to convert the first hash function into the first matrix.
[0054] In one possible implementation, if the input bits are n, the first polynomial P = x^n + c n-1 x^(n-1)+...+c1x+c0, the transformation matrix of the mapping a→a*x%P with n-bit input is S, where the expression of S can be found in Formula 4:
[0055]
[0056] Since a → a*x % P = aS, then a*x^n % P = aS^n, i.e., T = S^n. When the number of bits in the quintuple information of the input data packet is l, where l is greater than m, a = (a l-1 ,a l-2 When a, ..., a1, a0), let the 1×l vector e = (0, 0, ..., 1). Then we have That is, T(li,:)=e S^(n+i).
[0057] In another possible implementation, the first hash function can be transformed into the first matrix recursively. Specifically, suppose a i The vector at the corresponding position is e i , remember h i =h(e i ), then we have h0=eS^n=[c n-1 ,c n-2 ,...,c0];h i+1 =eS^(n+i+1)=h i S. At this time, T = [h] l-1 h l-2 ;...;h1;h0].
[0058] Step 204: Determine the target matrix corresponding to the first matrix based on the sequential flow.
[0059] In this embodiment of the invention, the sequential stream consists of X data packets arranged in a sequential manner. Specifically, the sequential stream is obtained by arranging the data packets in order according to their identifiers, where each data packet is identified by m consecutive bits within the data packet.
[0060] In one possible scenario, the sequential stream contains X data packets, and the sequence numbering starts from the identifier of the i-th data packet and increments upwards. For example: *000**, *001**, *010**, ..., *111**. For instance, suppose the sequence changes from right to left at the (i+1)-th bit, i.e., e. i The change begins, and since it is linear, it is determined when the identifier of the data packet changes from the (i+1)th bit to the (i+M)th bit (i.e., e). i to e i+M-1 The value is linearly increasing, thus ensuring good balance in the load balancing model. Therefore, to guarantee good balance in the load balancing model, it is necessary to determine whether there is a change in the identifier of the data packet from the (i+1)th bit to the (i+M)th bit in the sequential flow (i.e., e). i to e i+M-1The order is linearly increasing. Optionally, it can be determined whether the target matrix corresponding to the (i+1)th to (i+M)th bits in the first matrix is full rank. If it is, the load balancing model has good balance; if not, the load balancing model does not have good balance and needs to be adjusted. In one possible implementation, if M is a high-order bit, the target matrix corresponding to the (i+1)th to (i+M)th bits in the first matrix is [li-M+1:li,1:M]. In another possible implementation, if M is a low-order bit, the target matrix corresponding to the (i+1)th to (i+m)th bits in the first matrix is [li-M+1:li,n-M+1:M]. In yet another possible implementation, if M is a middle bit, the target matrix corresponding to the (i+1)th to (i+M)th bits in the first matrix is {li-M+1:li,[i1,i2,...,iM}].
[0061] Step 205: Determine whether the target matrix corresponding to the first matrix is full rank. If yes, proceed to step 206; otherwise, proceed to step 207.
[0062] In one possible implementation of this invention, if M is a high-order byte, it is necessary to determine whether gfrank(T(li-M+1:li,1:M)) is M. If yes, the target matrix corresponding to the first matrix is determined to be full rank, and the first matrix is the target matrix. If no, the target matrix corresponding to the first matrix is determined to be non-full rank. It should be noted that gfrank is the rank over the binary modulo domain. In another possible implementation, if M is a low-order byte, it is necessary to determine whether gfrank(T(li-M+1:li,n-M+1:M)) is M. If yes, the target matrix corresponding to the first matrix is determined to be full rank, and the first matrix is the target matrix. If no, the target matrix corresponding to the first matrix is determined to be non-full rank. In yet another possible implementation, if M is a middle-order byte, it is necessary to determine whether gfrank(T(li-M+1:li,[i1,i2,...,iM])) is M. If yes, the target matrix corresponding to the first matrix is determined to be full rank, and the first matrix is the target matrix. If not, then the target matrix corresponding to the first matrix is determined to be not full rank.
[0063] Step 206: Construct a load balancing model based on the first hash function.
[0064] In this embodiment of the invention, since the target matrix corresponding to the first matrix is full rank, the load balancing model constructed based on the first hash function has good balance.
[0065] Step 207: Construct the second polynomial until a polynomial with full rank is obtained for the target matrix.
[0066] In this embodiment of the invention, since the target matrix corresponding to the first matrix is not full rank, in order to achieve better balance in the load balancing model constructed subsequently, it is necessary to adjust the first polynomial to the second polynomial, wherein the second polynomial is a polynomial that satisfies that the target matrix corresponding to the first matrix is full rank.
[0067] Step 208: Construct a second hash function based on the second polynomial.
[0068] In this embodiment of the invention, the specific content of this step is the same as that of step 202, and will not be repeated here.
[0069] Step 209: Construct a load balancing model based on the second hash function.
[0070] In this embodiment of the invention, since the second polynomial is a polynomial that satisfies the condition that the target matrix corresponding to the first matrix is full rank, and the second hash function is constructed using the second polynomial, the load balancing model constructed based on the second hash function has better balance.
[0071] Steps 201 to 209 show that by determining whether the target matrix corresponding to the first matrix is full rank, the load balancing model's balance can be determined more accurately. If the target matrix corresponding to the first matrix is full rank, it indicates that the load balancing model has good balance, which makes it easier to input the quintuple information of the data packet into the load balancing model. The port corresponding to the data packet can be determined from N ports, so that the data packet is distributed more evenly to each port, thereby achieving load balancing.
[0072] Optionally, if the first hash function has an input inversion, the load balancing model is constructed based on the first inverted matrix and the first matrix. For example, if the first hash function has an input inversion, each field of the input is inverted, where the first inverted matrix is an 8x8 matrix, and the expression for the first inverted matrix can be found in Formula 5:
[0073]
[0074] The corresponding l*l matrix R i =diag(Inv8,Inv8,...,Inv8), the target matrix T corresponding to the load balancing model can be determined based on the first inverted matrix and the first matrix, where the expression of T can be found in Formula 6.
[0075] T=RiTo Formula 6
[0076] Optionally, if the first hash function has an output reversal, then a load balancing model is constructed based on the first reverse matrix and the first matrix. For example, if the first hash function has an output reversal, then each field of the output is reversed, where the first reverse matrix is an n×n matrix, and the expression for the first reverse matrix can be found in Formula 7:
[0077]
[0078] The target matrix T corresponding to the load balancing model can be determined based on the first inversion matrix and the first matrix, where the expression for T can be found in Formula 8.
[0079] T=ToRo Formula 8
[0080] Optionally, if the first hash function has input-output reversal, the load balancing model is constructed based on the first reverse matrix and the first matrix. For example, if the first hash function has input-output reversal, each field of the output is reversed, and the target matrix T corresponding to the load balancing model can be determined based on the first reverse matrix and the first matrix, where the expression for T can be found in Formula 9.
[0081] T=RiToRo Formula 9
[0082] Optionally, assume there are p ports, labeled 0, 1, ..., p-1, and x flows. Assume that after splitting, the flow on port i is X. i We denote the equilibrium deviation as max(|X i p / x-1|). In perfect balance, the balance deviation = 0. Since the target matrix corresponding to the hash function in the load balancing model is full rank, the corresponding balance deviation is <2 / X, thus confirming that the load balancing model has good balance.
[0083] Optionally, if N is a power of two, the selected m digits are N = 2^m.
[0084] Optionally, if N is a non - power - of - two value, the load - balancing model is determined based on K ports; K is a power - of - two value greater than N. Since N is a non - power - of - two value, in order to improve the load - balancing effect, first, when N is a power - of - two value and the target matrix in the load - balancing model is full - rank, g(a)=h(a) % 2^m has good balance. Since g(a) is balanced, its hash values from 0 to 2^m - 1 are uniformly distributed. The selected m bits satisfy p < 2^m << min(2^n,X). By selecting the largest multiple g0 of p less than 2^m, g0 = floor(2^m / p)*p. There are g0 numbers from 0 to g0 - 1 that can be divided by p, and at most p - 1 numbers between g0 and 2^m - 1. When g(a)=h(a) % 2^m < g0, let f0(a)=g(a) % p, otherwise f0(a)=h(a) % p. When g(a) < g0, the load - balancing model has good balance.
[0085] For example, if the number of sequential data streams X = 10k, the number of ports p = 7, and crc16 is used, that is, n = 16, the deviation during random testing is δ. If we select m = 6, at this time 2^m = 64, g0 = floor[64 / 7]*7 = 63. When we use the f0 algorithm, the deviation is δ / 64, greatly improving the balance of the load - balancing model. The deviation δ0 of f0=(2^m - g0) / 2^m*δ < (p - 1) / 2^m*δ.
[0086] Based on the same technical concept as above, an embodiment of the present invention provides a data - packet shunting device, as shown in Figure 3 , the device 300 includes: an obtaining unit 301, configured to input the five - tuple information of any data packet to be transmitted into the load - balancing model, and determine the port corresponding to the data packet from N ports; a processing unit 302, configured to transmit the data packet through the link corresponding to the port; the data length of the five - tuple information is m; wherein, the load - balancing model is determined based on a hash function with a linear structure; when the sequential flow is simulated and transmitted on the N ports, the target matrix corresponding to the hash function is full - rank; the sequential flow consists of X data packets that change sequentially.
[0087] Optionally, the obtaining unit 301 is specifically configured to: construct a first polynomial; the first polynomial satisfies a linear structure and the constant term is 1; construct a first hash function based on the first polynomial; determine a first matrix corresponding to the first hash function; determine a target matrix corresponding to the first matrix according to the sequential flow; when the target matrix corresponding to the first matrix is full rank, construct the load - balancing model based on the first hash function.
[0088] Optionally, the acquisition unit 301 is further configured to: when the target matrix corresponding to the first matrix is not full rank, adjust the first polynomial to a second polynomial, wherein the second polynomial is a polynomial that satisfies that the target matrix corresponding to the first matrix is full rank.
[0089] Optionally, the acquisition unit 301 is specifically used to: if the first hash function has an input inversion, then construct the load balancing model based on the first inversion matrix and the first matrix; and / or if the first hash function has an output inversion, then construct the load balancing model based on the second inversion matrix and the first matrix.
[0090] Optionally, the hash function is obtained through Cyclic Redundancy Check (CRC).
[0091] Optionally, the sequential stream is obtained by arranging the data packets in order according to their identifiers, where the identifier of a data packet is a consecutive m bits in the data packet.
[0092] Optionally, the acquisition unit 301 is specifically used to: if N is a non-power of two values, then determine the load balancing model based on K ports; where K is a power of two values greater than N.
[0093] Based on the same technical concept, this application also provides a network device for implementing the data packet splitting method provided in the above embodiments, thus achieving the beneficial effects of the above method embodiments. See also Figure 4 As shown, the network device 400 includes a bus 401, a processor 402, a memory 403, and a communication interface 404. The processor 402, memory 403, and communication interface 404 communicate with each other via the bus 401. The network device 400 can be a switch, a router, or a forwarding chip. It should be understood that this application does not limit the number of processors and memories in the network device 400. The memory 403 is optional.
[0094] Bus 401 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus 401 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 401 may include a path for transmitting information between various components of the network device 400 (e.g., memory 403, processor 402, communication interface 404).
[0095] Processor 402 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0096] The memory 403 may include volatile memory, such as random access memory (RAM). The processor 402 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD). The memory 403 stores executable program code, and the processor 402 executes the aforementioned packet splitting method. That is, the memory 403 stores computer program instructions for the network device 400 to execute the packet splitting method provided in this application.
[0097] The communication interface 404 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the network device 400 and other devices or communication networks.
[0098] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing a computer program executable by a network device, which, when run on the network device, causes the network device to perform the steps of the above-described packet splitting method.
[0099] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0100] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0101] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0102] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0103] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0104] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data packet splitting method, characterized in that, include: For any data packet to be transmitted, the 5-tuple information of the data packet is input into the load balancing model to determine the port corresponding to the data packet from N ports; the data packet is transmitted through the link corresponding to the port; the data length of the 5-tuple information is m; The load balancing model is determined based on a hash function with a linear structure; when the sequential stream is simulated to be transmitted on the N ports, the target matrix corresponding to the hash function is full rank; the sequential stream consists of X data packets that change sequentially.
2. The method as described in claim 1, characterized in that, The load balancing model is determined based on a hash function with a linear structure, including: Construct a first polynomial; the first polynomial satisfies a linear structure and the constant term is 1; Construct a first hash function based on the first polynomial; Determine the first matrix corresponding to the first hash function; Based on the sequential flow, determine the target matrix corresponding to the first matrix; When the target matrix corresponding to the first matrix is full rank, the load balancing model is constructed based on the first hash function.
3. The method as described in claim 2, characterized in that, Also includes: When the target matrix corresponding to the first matrix is not of full rank, the first polynomial is adjusted to a second polynomial, which is a polynomial that satisfies that the target matrix corresponding to the first matrix is of full rank.
4. The method as described in claim 2, characterized in that, The load balancing model is constructed based on the first hash function, including: If the first hash function has an input reversal, then the load balancing model is constructed based on the first reverse matrix and the first matrix; and / or If the first hash function has an output reversal, then the load balancing model is constructed based on the second reversal matrix and the first matrix.
5. The method according to any one of claims 1 to 4, characterized in that, The hash function is obtained through Cyclic Redundancy Check (CRC).
6. The method as described in claim 5, characterized in that, The sequential stream is obtained by arranging the data packets in order according to their identifiers, where each data packet is identified by m consecutive bits within the data packet.
7. The method as described in claim 5, characterized in that, If N is a non-power of two, the load balancing model is determined based on K ports; K is a power of two greater than N.
8. A data packet splitting device, characterized in that, include: The acquisition unit is used to input the five-tuple information of any data packet to be transmitted into the load balancing model, and determine the port corresponding to the data packet from N ports; wherein, the load balancing model is determined based on a hash function with a linear structure; the hash function, when simulating sequential flow transmission to the N ports, makes the target matrix corresponding to the hash function full rank; the sequential flow consists of X data packets that change in sequence; The processing unit is used to transmit the data packet through the link corresponding to the port; the data length of the quintuple information is m.
9. A network device, characterized in that, include: A communication interface used to receive and send data; A processor for executing computer program instructions and data to cause the network device to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of any of the methods described in claims 1-7.
Citation Information
Patent Citations
Network offloading method, device and system, and computer equipment
CN108282412A
Data processing method and device and electronic equipment
CN114666011A