Data packet distribution method and device

By constructing a load balancing model based on a hash function with a linear structure, the problem of poor load balancing performance in existing technologies is solved, and balanced distribution of data packets across multiple ports and effective utilization of bandwidth resources are achieved.

CN119276791AActive Publication Date: 2025-01-07RUIJIE NETWORKS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310813461.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-04
Publication Date
2025-01-07
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

Existing load balancing solutions are prone to polarization when splitting traffic across ports, resulting in poor load balancing performance.

Method used

A load balancing model is constructed using a hash function based on a linear structure. The port corresponding to the data packet is determined by the hash function, and the target matrix corresponding to the hash function is ensured to be full rank, thereby achieving load balancing.

Benefits of technology

It achieves balanced distribution of data packets across multiple ports, effectively utilizes bandwidth resources, maximizes network throughput, and solves the problem of poor load balancing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276791A_ABST
    Figure CN119276791A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data packet shunting method and device, and the method comprises the steps: inputting the quintuple information of a data packet to a load balancing model for any to-be-transmitted data packet, and determining 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 quintuple information is m; wherein the load balancing model is determined based on a hash function of a linear structure; the hash function enables a target matrix corresponding to the hash function to be in a full rank when the sequence flow is transmitted to the N ports in an analog manner; the sequence flow is composed of X data packets which change in sequence. As 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, so that port shunting is performed on the plurality of to-be-transmitted data packets, and load balancing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a data packet diversion method and device. Background Art

[0002] With the continuous development of communication technology, the requirements for data transmission services are getting higher and higher. It is necessary to perform port diversion on the transmitted data so as to evenly distribute the traffic on each port link as much as possible to meet the load balancing and enhance the reliability of the network, so as to better serve users.

[0003] However, existing load balancing solutions usually experience polarization during the process of achieving load balancing. This polarization phenomenon causes an imbalance when port traffic is split for data to be transmitted, resulting in poor load balancing effect when port traffic is split for data to be transmitted.

[0004] In summary, how to effectively improve load balancing is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiment of the present invention provides a data packet distribution method and device, which are used to solve the problem of poor load balancing effect in the prior art.

[0006] In a first aspect, an embodiment of the present invention provides a data packet diversion method, comprising: for any data packet to be transmitted, inputting the five-tuple information of the data packet into a load balancing model, and determining the port corresponding to the data packet from N ports; transmitting 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 of a linear structure; when the hash function simulates transmission on N ports in a sequential flow, the target matrix corresponding to the hash function is full rank; the sequential flow is composed of X data packets that change sequentially.

[0007] In the above technical scheme, 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 determines the port corresponding to the data packet, thereby realizing port diversion of multiple data packets to be transmitted to achieve load balancing.

[0008] Optionally, the load balancing model is determined based on a hash function of a linear structure, including: 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 based on a sequential flow; when the target matrix corresponding to the first matrix is ​​full rank, constructing a load balancing model based on the first hash function.

[0009] Optionally, it also includes: when the target matrix corresponding to the first matrix is ​​not full rank, constructing a second polynomial until a polynomial with full rank is obtained for the target matrix.

[0010] Optionally, building a load balancing model based on the first hash function includes:

[0011] If the first hash function has input inversion, a 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, a load balancing model is constructed based on the second inversion matrix and the first matrix.

[0012] Optionally, the hash function is obtained by a cyclic redundancy check CRC.

[0013] Optionally, the sequential stream is obtained by arranging in sequence according to identifiers of data packets, and the identifiers of data packets are continuous m bits in the data packets.

[0014] Optionally, if N is a non-quadratic value, the load balancing model is determined based on K ports; K is a square value greater than N.

[0015] In a second aspect, an embodiment of the present invention provides a data packet diversion device, comprising: an acquisition unit, for inputting the five-tuple information of a data packet into a load balancing model for any data packet to be transmitted, and determining the port corresponding to the data packet from N ports; a processing unit, for 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 by a hash function based on a linear structure; when the hash function simulates transmission on N ports in a sequential stream, the target matrix corresponding to the hash function is full rank; the sequential stream is composed of X data packets that change sequentially.

[0016] Optionally, the acquisition unit is specifically used to: construct a first polynomial; the first polynomial satisfies the 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 a load balancing model based on the first hash function.

[0017] Optionally, the acquisition unit is also used to: when a target matrix corresponding to the first matrix is ​​not full rank, adjust the first polynomial to a second polynomial, where the second polynomial is a polynomial that satisfies the requirement that the target matrix corresponding to the first matrix is ​​full rank.

[0018] Optionally, the acquisition unit is specifically used to: if the first hash function has input inversion, construct a load balancing model based on the first inversion matrix and the first matrix; and / or if the first hash function has output inversion, construct a load balancing model based on the second inversion matrix and the first matrix.

[0019] Optionally, the acquisition unit is specifically used for: the hash function is obtained through a cyclic redundancy check CRC.

[0020] Optionally, the acquisition unit is specifically used for: the sequential stream is obtained by arranging in sequence according to identifiers of the data packets, and the identifiers of the data packets are continuous m bits in the data packets.

[0021] Optionally, the acquisition unit is specifically used to: if N is a non-quadratic value, determine the load balancing model based on K ports; K is a value greater than N that is a quadratic power.

[0022] In a third aspect, an embodiment of the present invention further provides a network device, comprising a communication interface for receiving and sending data; and a processor for executing and calling computer program instructions and data so that the network device executes a data packet diversion method of the first aspect mentioned above.

[0023] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and when the program runs on a computer, the computer implements a data packet diversion method according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 A flow chart of a data packet splitting method provided by an embodiment of the present invention;

[0026] Figure 2 A flow chart of a method for constructing a load balancing model provided by an embodiment of the present invention;

[0027] Figure 3 A schematic diagram of the structure of a data packet splitting device provided by an embodiment of the present invention;

[0028] Figure 4 A schematic diagram of the structure of a network device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] To facilitate understanding of this solution, the following introduces load balancing.

[0031] Load balancing means balancing and distributing the load to multiple operating units, such as FTP servers, Web servers, enterprise core application servers, and other major task servers, so as to complete work tasks collaboratively.

[0032] In a possible scenario, when there are multiple ports and links corresponding to the ports, and the bandwidth of each link is the same, it is necessary to evenly distribute the data to be transmitted to each port link as much as possible to meet the load balancing, thereby achieving effective utilization of bandwidth resources and maximizing network throughput.

[0033] In one possible case, when the number of ports is a power of two, a polarization phenomenon usually occurs in the process of achieving load balancing through a load balancing solution, that is, either the load balancing effect is very good or the load balancing effect is very poor. This load balancing solution will have instability problems when the number of ports is a power of two. When the number of ports is not a power of two, since the data to be transmitted is transmitted in binary units, this load balancing solution cannot achieve load balancing when the number of ports is not a power of two.

[0034] In summary, a data packet diversion method is provided for an embodiment of the present invention to solve the problem of load balancing polarization and the inability to achieve load balancing.

[0035] like Figure 1 FIG. 1 is a flow chart of a method for packet diversion provided by an embodiment of the present invention, the method comprising the following steps:

[0036] Step 101: for any data packet to be transmitted, input the five-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 the embodiment of the present invention, the load balancing model is determined based on a hash function of a linear structure. Wherein, when the hash function is used to simulate the transmission of the sequential flow on N ports, the target matrix corresponding to the hash function is full rank, so that the load balancing model has good balance, so that the five-tuple information of any data packet is input into the load balancing model, and the port corresponding to the data packet can be determined from the N ports, thereby achieving a relatively even distribution of multiple data packets to each port, so that it satisfies the load balancing. Wherein, the data length of the five-tuple information is m; the sequential flow is composed of X data packets that change in sequence. Wherein the hash function is obtained by a cyclic redundancy check CRC algorithm. It should be noted that the CRC algorithm has linear characteristics. For example, if b1=h(a1), b2=h(a2), then (b1+b2)=h(a1+a2).

[0038] Step 102: Transmit the data packet through the link corresponding to the port.

[0039] In the embodiment of the present invention, the port corresponding to the data packet is determined through the above step 101, and the data packet is transmitted through the link corresponding to the port, thereby achieving effective utilization of bandwidth resources and maximizing network throughput.

[0040] It can be seen from the above steps 101 to 102 that 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 diversion of multiple data packets to be transmitted, achieving load balancing, and then achieving effective utilization of bandwidth resources and maximizing network throughput.

[0041] Since load balancing is achieved because the load balancing model has good balance, the following describes how the load balancing model is constructed.

[0042] like Figure 2 FIG. 1 is a flow chart of a method for constructing a load balancing model provided by an embodiment of the present invention, and the method comprises the following steps:

[0043] Step 201, construct a first polynomial.

[0044] In the embodiment of the present invention, when constructing the first polynomial, two constraints are corresponding, the first constraint is that the first polynomial satisfies a linear structure, and the second constraint is that the constant term of the first polynomial is 1.

[0045] Step 202: construct a first hash function based on the first polynomial.

[0046] In the embodiment of the present invention, first, the five-tuple information of the input data packet is vector a, and then the vector a is converted into a modulo-2 polynomial Q. Specifically, according to the first corresponding relationship, the vector a is converted into the modulo-2 polynomial Q. The first corresponding relationship is: if the vector bit number corresponds to x^0, x^1, x^2 from right to left, then the expression of the modulo-2 polynomial Q can be seen 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 remainder division of the modulo 2 polynomial Q, and then convert the result into a vector b, where vector b = a*x^n. Construct a first hash function h(a) based on vector b and the first polynomial P. The expression of 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 a first matrix corresponding to the first hash function.

[0051] In the embodiment of the present invention, since the first Hash function can be expressed in the form of a matrix, another expression of the first Hash function can be referred to 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 bit is n, the first polynomial P = x^n+, c n-1 x^(n-1)+...+c1x+c0, the mapping a→a*x%P transforms the matrix S when the input is n bits, 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, that is, T=S^n. When the number of bits of the five-tuple information of the input data packet is l, where l is greater than m, a=(a l-1 ,a l-2 ,...,a1,a0), let 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 converted into the first matrix in a recursive manner. Specifically, assuming a i The vector corresponding to the position is e i , remember h i =h(e i ), then 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 a target matrix corresponding to the first matrix according to the sequence flow.

[0059] In the embodiment of the present invention, the sequential stream is composed of X data packets that change in sequence. Specifically, the sequential stream is obtained by arranging the data packets in sequence according to their identifiers, and the data packet identifiers are continuous m bits in the data packets.

[0060] In one possible case, there are X packets in the sequence flow, and the sequence flow starts from the identifier of the i-th packet and increases upward. For example: *000*, *001*, *010**, ..., *111**. For example, suppose the sequence flow changes from the right to the left at the i+1th position, that is, e i Since it is linear, it is determined when the identifier of the data packet from the i+1th bit to the i+Mth bit changes (i.e., e i To e i+M-1 ) is linearly increasing, so that the load balancing model can be guaranteed to have good balance. Therefore, in order to ensure that the load balancing model has good balance, it is necessary to determine whether there is a change in the identifier of the data packet from the i+1th to the i+Mth bit in the sequence flow (i.e., e i To e i+M-1) is linearly increasing. Optionally, it can be determined whether the target matrix corresponding to the i+1th to i+Mth positions in the first matrix is ​​full rank. If so, it is determined that the load balancing model has good balance. If not, it is determined that the load balancing model does not have good balance, and the load balancing model needs to be adjusted later. In one possible implementation, if M is a high position, the target matrix corresponding to the first matrix corresponding to the i+1th to i+Mth positions is [li-M+1:li,1:M]. In another possible implementation, if M is a low position, the target matrix corresponding to the first matrix corresponding to the i+1th to i+mth positions is [li-M+1:li,n-M+1:M]. In another possible implementation, if M is a middle position, the target matrix corresponding to the first matrix corresponding to the i+1th to i+Mth positions is {li-M+1:li,[i1,i2,...,iM}.

[0061] Step 205 , determining whether the target matrix corresponding to the first matrix is ​​full rank, if so, executing step 206 , if not, executing step 207 .

[0062] In an embodiment of the present invention, in one possible implementation, if M is a high position, it is necessary to determine whether gfrank(T(li-M+1:li,1:M)) is M. If so, it is determined that the target matrix corresponding to the first matrix is ​​full rank, and the first matrix is ​​the target matrix. If not, it is determined that the target matrix corresponding to the first matrix is ​​not full rank. It should be noted that gfrank is the rank on the two-mode domain. In another possible implementation, if M is a low position, it is necessary to determine whether gfrank(T(li-M+1:li,n-M+1:M)) is M. If so, it is determined that the target matrix corresponding to the first matrix is ​​full rank, and the first matrix is ​​the target matrix. If not, it is determined that the target matrix corresponding to the first matrix is ​​not full rank. In another possible implementation, if M is a middle position, whether gfrank(T(li-M+1:li,[i1,i2,...,iM])) is M. If so, it is determined that the target matrix corresponding to the first matrix is ​​full rank, and the first matrix is ​​the target matrix. If not, it is determined that the target matrix corresponding to the first matrix is ​​not full rank.

[0063] Step 206: construct a load balancing model based on the first hash function.

[0064] In the embodiment of the present 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 better balance.

[0065] Step 207, construct a second polynomial until a target matrix is ​​obtained that is a full-rank polynomial.

[0066] In an embodiment of the present invention, since the target matrix corresponding to the first matrix is ​​not full rank, in order to achieve better balance in the subsequently constructed load balancing model, it is necessary to adjust the first polynomial, and adjust the first polynomial to a second polynomial, wherein the second polynomial is a polynomial that satisfies the target matrix corresponding to the first matrix to be full rank.

[0067] Step 208: construct a second Hash function based on the second polynomial.

[0068] In the embodiment of the present invention, the specific content of this step is the same as step 202 and will not be described in detail here.

[0069] Step 209: construct a load balancing model based on the second hash function.

[0070] In the embodiment of the present invention, since the second polynomial is a polynomial that satisfies the full rank of the target matrix corresponding to the first matrix, the second hash function is constructed by the second polynomial. Therefore, the load balancing model constructed based on the second hash function has better balance.

[0071] It can be seen from steps 201 to 209 that by determining whether the target matrix corresponding to the first matrix is ​​full rank, the balance of the load balancing model can be determined more accurately. If the target matrix corresponding to the first matrix is ​​full rank, it means that the balance of the load balancing model is better, which is convenient for the subsequent input of the five-tuple information of the data packet into the load balancing model. The port corresponding to the data packet can be determined from the N ports, so that the data packet is more evenly distributed to each port, thereby achieving load balancing.

[0072] Optionally, if the first hash function has input inversion, the load balancing model is constructed based on the first inversion matrix and the first matrix. For example, if the first hash function has input inversion, each field of the input is inverted, where the first inversion matrix is ​​an 8*8 matrix, and the expression of the first inversion matrix can be found in Formula 5:

[0073]

[0074] The corresponding l*l matrix R i =diag(Inv8, Inv8, ..., Inv8), based on the first inversion matrix and the first matrix, the target matrix T corresponding to the load balancing model can be determined, where the expression of T can be found in Formula 6.

[0075] T=RiTo Formula 6

[0076] Optionally, if the first hash function has output inversion, a load balancing model is constructed based on the first inversion matrix and the first matrix. For example, if the first hash function has output inversion, each field of the output is inverted, where the first inversion matrix is ​​an n×n matrix, and the expression of the first inversion matrix can be found in Formula 7:

[0077]

[0078] Based on the first inversion matrix and the first matrix, the target matrix T corresponding to the load balancing model can be determined, where the expression of T can be found in Formula 8.

[0079] T=ToRo Formula 8

[0080] Optionally, if the first hash function has input and output inversion, the load balancing model is constructed based on the first inversion matrix and the first matrix. For example, if the first hash function has input and output inversion, each field of the output is inverted, and 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 of T can be found in Formula 9.

[0081] T=RiToRo Formula 9

[0082] Optionally, assume that there are p ports, with port numbers 0, 1, ..., p-1, and x flows. Assume that after splitting, the flow on port i is X i , we record equilibrium deviation = 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 < 2 / X, so it can be determined that the load balancing model has good balance.

[0083] Optionally, if N is a value of a second power, the selected m bits 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 = floor(2^m / p)*p of p less than 2^m. There are g0 numbers from 0 to g0 - 1 that are divisible by p, and there are 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, which greatly improves the balance of the load - balancing model. Among them, 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 splitting device, which can be seen 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 in sequence.

[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; according to the sequential flow, determine a target matrix corresponding to the first matrix; 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 used to: when a target matrix corresponding to the first matrix is ​​not full rank, adjust the first polynomial to a second polynomial, where the second polynomial is a polynomial that satisfies the requirement 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 input inversion, construct the load balancing model based on the first inversion matrix and the first matrix; and / or if the first hash function has output inversion, construct the load balancing model based on the second inversion matrix and the first matrix.

[0090] Optionally, the hash function is obtained through a cyclic redundancy check CRC.

[0091] Optionally, the sequential stream is obtained by arranging in sequence according to identifiers of data packets, and the identifiers of data packets are continuous m bits in the data packets.

[0092] Optionally, the acquisition unit 301 is specifically used to: if N is a non-quadratic value, determine the load balancing model based on K ports; K is a value greater than N raised to a power of two.

[0093] Based on the same technical concept, the embodiment of the present application also provides a network device, which is used to implement the data packet splitting method provided in the above embodiment, and thus can also achieve the beneficial effects of the above method embodiment. 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, the memory 403 and the communication interface 404 communicate through the bus 401. The network device 400 can be a switch, a router or a forwarding chip. It should be understood that the present application does not limit the number of processors and memories in the network device 400. The memory 403 is optional.

[0094] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus 401 is represented by only one line, but it 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 (for example, the memory 403, the processor 402, and the communication interface 404).

[0095] The processor 402 may include any one or more of 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 a volatile memory, such as a random access memory (RAM). The processor 402 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD). The memory 403 stores executable program code, and the processor 402 executes the above-mentioned data packet diversion method, that is, the memory 403 stores computer program instructions for the network device 400 to execute the data packet diversion method provided in the present application.

[0097] The communication interface 404 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the network device 400 and other devices or communication networks.

[0098] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program that can be executed by a network device. When the program runs on the network device, the network device executes the steps of the above-mentioned data packet diversion method.

[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0103] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0104] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data packet diversion method, characterized in that: include: For any data packet to be transmitted, the five-tuple information of the data packet is input into the load balancing model, and the port corresponding to the data packet is determined from N ports; the data packet is transmitted through the link corresponding to the port; the data length of the five-tuple information is m; The load balancing model is determined based on a hash function of a linear structure; when a sequential flow is simulated and transmitted on the N ports, a target matrix corresponding to the hash function is full rank; and the sequential flow is composed of X data packets that change sequentially.

2. The method according to claim 1, characterized in that The load balancing model is determined based on a hash function of a linear structure, including: Constructing a first polynomial; wherein the first polynomial satisfies a linear structure and the constant term is 1; constructing a first hash function based on the first polynomial; Determine a first matrix corresponding to the first hash function; Determine, according to the sequence flow, a target matrix corresponding to the first matrix; When a 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 according to claim 2, characterized in that Also includes: When the target matrix corresponding to the first matrix is ​​not full rank, the first polynomial is adjusted to a second polynomial, where the second polynomial is a polynomial that satisfies the requirement that the target matrix corresponding to the first matrix is ​​full rank.

4. The method according to claim 2, characterized in that Constructing the load balancing model based on the first hash function includes: If the first hash function has input inversion, constructing the load balancing model 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.

5. The method according to any one of claims 1 to 4, characterized in that: The hash function is obtained through a cyclic redundancy check CRC.

6. The method according to claim 5, characterized in that The sequential stream is obtained by arranging in sequence according to the identifiers of the data packets, and the identifiers of the data packets are continuous m bits in the data packets.

7. The method according to claim 5, characterized in that If N is a non-quadratic value, the load balancing model is determined based on K ports; K is a square value greater than N.

8. A data packet splitting device, characterized in that: include: An acquisition unit is used for inputting the five-tuple information of any data packet to be transmitted into a load balancing model, and determining the port corresponding to the data packet from N ports; wherein the load balancing model is determined based on a hash function of a linear structure; when the hash function simulates the transmission of a sequential flow on the N ports, the target matrix corresponding to the hash function is full rank; and the sequential flow is composed of X data packets that change in sequence; A 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: Communication interface, used to receive and send data; A processor is used to execute and call computer program instructions and data so that the network device executes 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, and when the program is run on the computer device, the computer device executes the steps of any method 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

  • Information processing apparatus, information processing method, and storage medium

    CN1716851A

  • Systems and Methods for Rapidly Generating Suitable Pairs of Hash Functions

    US20150169467A1