CN114679407A - Link aggregation method, device, equipment and storage medium - Google Patents
Link aggregation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114679407A CN114679407A CN202210485356.3A CN202210485356A CN114679407A CN 114679407 A CN114679407 A CN 114679407A CN 202210485356 A CN202210485356 A CN 202210485356A CN 114679407 A CN114679407 A CN 114679407A
- Authority
- CN
- China
- Prior art keywords
- data packets
- request data
- data
- request
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000002776 aggregation Effects 0.000 title claims abstract description 59
- 238000004220 aggregation Methods 0.000 title claims abstract description 59
- 230000004044 response Effects 0.000 claims abstract description 102
- 238000004891 communication Methods 0.000 claims abstract description 76
- 230000006854 communication Effects 0.000 claims abstract description 76
- 238000004590 computer program Methods 0.000 claims description 14
- 238000012216 screening Methods 0.000 claims description 4
- 230000003139 buffering effect Effects 0.000 claims description 2
- 230000006798 recombination Effects 0.000 claims description 2
- 238000005215 recombination Methods 0.000 claims description 2
- 230000005540 biological transmission Effects 0.000 description 21
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000007175 bidirectional communication Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/24—Multipath
- H04L45/245—Link aggregation, e.g. trunking
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/06—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
- H04W28/065—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a link aggregation method, a device, equipment and a storage medium, which relate to the technical field of communication and comprise the following steps: splitting the request data according to a first preset size to obtain a plurality of request data packets; sending the multiple request data packets to a server through multiple session channels of a preset communication session group, so that the server can analyze the request data packets, recombine the analyzed request data packets in sequence to obtain recombined request data, and split reply data obtained after responding to the recombined request data into multiple response data packets according to a second preset size and send the response data packets to a client; and the client receives a response data packet which is returned by the server based on the reply data and aims at the request data, analyzes the response data packet, and then recombines the analyzed response data packets according to the sequence to obtain the reply data. Through the technical scheme of the application, the configuration burden can be reduced, the implementation is easy, and the cost is low.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a link aggregation method, apparatus, device, and storage medium.
Background
With the development of mobile communication technology, more and more communication systems use Link Aggregation (Link Aggregation) for data communication. Link aggregation is a computer network term, and refers to the aggregation of multiple physical ports together to form a logical port, so as to realize the load sharing of the throughput of the ingress/egress traffic among the member ports. The Switch (Switch) determines which member port the network packet is sent to the Switch of the opposite end according to the port load sharing strategy configured by the user. It will be understood that a switch means a "switch", a network device for the forwarding of electrical (optical) signals. It may provide an exclusive electrical signal path for any two network nodes accessing the switch. The most common switches are ethernet switches, others are voice over telephone switches, fibre optic switches, etc. When the exchanger detects that the link of one member port has fault, it stops sending package on the port, and recalculates the sending port of message in the rest links according to the load sharing strategy, and the fault port is recovered and then acts as the receiving/sending port again. Link aggregation is an important technology in terms of increasing link bandwidth, implementing link transmission resilience, engineering redundancy, and the like. The current link aggregation is realized through hardware equipment such as a switch, complex configuration is needed to finish the link aggregation, and the hardware has high realization cost, complex configuration and larger use difficulty.
In summary, how to achieve the same effect of link aggregation under the condition of controlling cost is achieved, and meanwhile, the difficulty in use is smaller, and no complex configuration is needed, which is a problem to be solved at present.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a link aggregation method, apparatus, device, and storage medium, which can achieve the same effect of link aggregation under the condition of controlling cost, and at the same time, have less difficulty in use and do not require complex configuration. The specific scheme is as follows:
in a first aspect, the present application discloses a link aggregation method, applied to a client, including:
splitting the request data according to a first preset size to obtain a plurality of request data packets;
sending the request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client;
and receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data.
Optionally, the link aggregation method further includes:
and when the size of the request data does not exceed the first preset size, selecting any session channel in the communication session group to send the request data to a server.
Optionally, before splitting the request data according to the first preset size, the method further includes:
and when the client is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group.
Optionally, the reassembling the parsed response data packets according to a sequence includes:
screening out target data packets with legality in the analyzed response data packets;
classifying the target data packet based on the request type corresponding to the request data to obtain a classified data packet to be combined corresponding to the request data;
and recombining the classified data packets to be combined according to the sequence.
Optionally, before the reassembling the data packets to be assembled in sequence, the method further includes:
and buffering the data packets to be combined into a message buffer queue so as to take out the data packets to be combined from the message buffer queue and recombine the data packets in sequence.
In a second aspect, the present application discloses a link aggregation method, applied to a server, including:
acquiring a plurality of request data packets sent by a client through a plurality of session channels of a preset communication session group; the request data packet is obtained by splitting request data according to a first preset size by the client;
analyzing the request data packets, and recombining the analyzed request data packets according to a sequence to obtain recombined request data;
splitting reply data obtained after the recombined request data is responded into a plurality of response data packets according to a second preset size, and sending the response data packets to the client, so that the client receives the response data packets, which are returned by the server based on the reply data and aim at the request data, analyzes the response data packets, and then recombines the analyzed response data packets according to a sequence to obtain the reply data.
Optionally, before acquiring the plurality of request data packets sent by the client through the plurality of session channels of the preset communication session group, the method further includes:
and when the server side is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group.
In a third aspect, the present application discloses a link aggregation device, applied to a client, including:
the data splitting module is used for splitting the request data according to a first preset size to obtain a plurality of request data packets;
a data packet sending module, configured to send the multiple request data packets to a server through multiple session channels of a preset communication session group, so that the server analyzes the request data packets, reassembles the analyzed request data packets in sequence to obtain reassembled request data, and then splits reply data obtained after responding to the reassembled request data into multiple response data packets according to a second preset size and sends the multiple response data packets to the client;
a data packet receiving module, configured to receive a response data packet, which is returned by the server based on the reply data and is for the request data, and analyze the response data packet;
and the data packet recombination module is used for recombining the analyzed response data packets according to the sequence to obtain the reply data.
In a fourth aspect, the present application discloses an electronic device comprising a processor and a memory; wherein the memory is for storing a computer program that is loaded and executed by the processor to implement the link aggregation method as described above.
In a fifth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the link aggregation method as described above.
The method is applied to a client, and comprises the steps of splitting request data according to a first preset size to obtain a plurality of request data packets; secondly, sending a plurality of request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client; and finally, receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data. As can be seen, link aggregation is realized by combining a software algorithm with a customized communication protocol, request data is split into a plurality of request data packets at a client, and then the request data packets are sent to a target server at a server through a plurality of session channels of a preset communication session group; the server side reconstructs request data packets received by a plurality of session channels of a preset communication session group into complete data according to an agreed protocol, so as to obtain reply data, and then splits the reply data into a plurality of response data packets and returns the reply data packets to the client side for the same processing. The transmission efficiency of data can be improved through the transmission of a plurality of data packets, and meanwhile, the realization of a software algorithm can achieve the same effect of link aggregation under the condition of controlling the cost, so that the cost of the method is lower than that of hardware realization, the use difficulty is lower, the complex configuration is not needed, only a server and a client program need to be executed at a corresponding end, and the configuration burden is basically zero. In addition, the size of the split data packet can be customized according to the preset size, and the data does not need to be fragmented by using a network layer, so that the stability and the integrity of data transmission can be provided under the condition of poor network environment.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flow chart of a link aggregation method disclosed herein;
FIG. 2 is a diagram of a communication framework between a client and a server according to the present disclosure;
FIG. 3 is a flow chart of a specific link aggregation method disclosed herein;
FIG. 4 is a flow chart of a link aggregation method disclosed herein;
FIG. 5 is a schematic diagram illustrating interaction between a client and a server according to the present disclosure;
fig. 6 is a schematic structural diagram of a link aggregation device disclosed in the present application;
fig. 7 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, with the development of mobile communication technology, more and more communication systems adopt a link aggregation mode for data communication. The current link aggregation is realized through hardware equipment such as a switch, complex configuration is needed to complete the link aggregation, and the hardware realization cost is high and the configuration is complex.
Therefore, the link aggregation scheme is provided, the same effect of link aggregation can be achieved under the condition of controlling cost, meanwhile, the use difficulty is lower, and complex configuration is not needed.
The embodiment of the invention discloses a link aggregation method, which is applied to a client and shown in figure 1, and comprises the following steps:
step S11: and splitting the request data according to a first preset size to obtain a plurality of request data packets.
The embodiment of the application is applied to the client. It should be noted that, before splitting the request data according to the first preset size, the method further includes: and when the client is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group. It is understood that, in order to enable the client and the server to exchange data through a bidirectional communication connection, both the client and the server read the appointed communication port list at the time of starting, and create a communication session group through socket link. Fig. 2 is a communication framework diagram of the client and the server.
In the embodiment of the application, the client judges the size of the request data before sending the request data, and when the size of the request data exceeds a first preset size, the request data is split according to the first preset size to obtain a plurality of request data packets. It is to be understood that, if the size of the request data does not exceed the first preset size, any one of the session channels in the communication session group is selected to send the request data to the server. That is, if the size of the request data exceeds the agreed size, the request data is split into a plurality of data packets according to the agreed size, the data packets are sent to the server from a plurality of session channels through the socket communication session group, and if the size of the request data is smaller than or equal to the agreed size, the data packets do not need to be split and one channel is directly selected to be sent to the server. Therefore, the request data is divided into a plurality of request data packets through the customized protocol, and the data transmission efficiency is improved. In addition, the size of the data packet can be customized, so that the data packet can be controlled to be sent to a server in one MTU (Maximum Transmission Unit), and a network layer is not required to fragment the data, so that the data can be stably and completely transmitted under the condition of poor network environment.
Step S12: sending the plurality of request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client.
In the embodiment of the application, a plurality of request data packets obtained by splitting the request data are sent to the server, and the server can analyze and recombine the plurality of request data packets to obtain the complete request sent by the client. And then the server side processes the request data to obtain reply data, and the reply data is split into a plurality of response data packets according to the appointed size and is replied to the client side.
Step S13: and receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data.
In the embodiment of the application, after receiving a plurality of response data packets sent by the server, the client processes the response data packets according to the same process as the process of the server for receiving the request data packets and obtaining the reply data. That is, the response data packets are analyzed, and after the analysis is completed, the response data packets are recombined in sequence to obtain a complete server response result sent by the server.
The method is applied to a client, and comprises the steps of splitting request data according to a first preset size to obtain a plurality of request data packets; secondly, sending a plurality of request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client; and finally, receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data. As can be seen, link aggregation is realized by combining a software algorithm with a customized communication protocol, request data is split into a plurality of request data packets at a client, and then the request data packets are sent to a target server at a server through a plurality of session channels of a preset communication session group; the server side recombines the request data packets received through the plurality of session channels of the preset communication session group into complete data according to a protocol, so as to obtain reply data, and then splits the reply data into a plurality of response data packets and returns the reply data packets to the client side for the same processing. The transmission efficiency of data can be improved through the transmission of a plurality of data packets, and meanwhile, the realization of a software algorithm can achieve the same effect of link aggregation under the condition of controlling the cost, so that the cost of the method is lower than that of hardware realization, the use difficulty is lower, complex configuration is not needed, only a server and a client program need to be executed at a corresponding end, and the configuration burden is basically zero. In addition, the size of the split data packet can be customized according to the preset size, and the data does not need to be fragmented by using a network layer, so that the stability and the integrity of data transmission can be provided under the condition of poor network environment.
The embodiment of the present application discloses a specific link aggregation method, which is shown in fig. 3 and includes:
step S21: and splitting the request data according to a first preset size to obtain a plurality of request data packets.
Step S22: and sending the plurality of request data packets to a server through a plurality of session channels of a preset communication session group so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client.
For more specific processing procedures of the step S21 and the step S22, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S23: and receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and screening out a target data packet with legality in the analyzed response data packet.
In the embodiment of the application, after receiving a plurality of response data packets sent by a server, a client analyzes the response data packets. It can be understood that, in the data transmission process, there may be a message that is not a request data sent by the client to the server, and the message is illegal, so in order to ensure the security of data transmission, it is necessary to determine the validity of the message after the parsing is completed, and screen out a target data packet with validity.
Step S24: classifying the target data packets based on the request types corresponding to the request data to obtain classified data packets to be combined corresponding to the request data, and then recombining the classified data packets to be combined according to the sequence to obtain the reply data.
In the embodiment of the application, because a plurality of pieces of request data are sent when the client communicates with the server, after each piece of request data is split to obtain a plurality of corresponding request data packets, the server classifies target data packets after judging the validity of the request data packets based on the request types corresponding to the request data, and after classification is completed, data packets to be combined corresponding to the request data can be obtained.
In the embodiment of the present application, after the classification is completed, the data packets to be combined are cached in the data packet message cache queue, and it can be understood that the data packet message cache queue is a data structure capable of storing the data packets in a classified manner, so that the data packets to be combined can be taken out from the message cache queue and recombined in sequence to obtain complete reply data.
The method is applied to a client, and comprises the steps of splitting request data according to a first preset size to obtain a plurality of request data packets; secondly, sending a plurality of request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client; finally, receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and screening out a target data packet with legality in the analyzed response data packet; classifying the target data packets based on the request types corresponding to the request data to obtain classified data packets to be combined corresponding to the request data, and then recombining the classified data packets to be combined according to the sequence to obtain the reply data. As can be seen, link aggregation is realized by combining a software algorithm with a customized communication protocol, request data is split into a plurality of request data packets at a client, and then the request data packets are sent to a target server at a server through a plurality of session channels of a preset communication session group; the server side reconstructs request data packets received by a plurality of session channels of a preset communication session group into complete data according to an agreed protocol, so as to obtain reply data, and then splits the reply data into a plurality of response data packets and returns the reply data packets to the client side for the same processing. The transmission efficiency of data can be improved through the transmission of a plurality of data packets, and meanwhile, the realization of a software algorithm can achieve the same effect of link aggregation under the condition of controlling the cost, so that the cost of the method is lower than that of hardware realization, the use difficulty is lower, the complex configuration is not needed, only a server and a client program need to be executed at a corresponding end, and the configuration burden is basically zero. In addition, the size of the split data packet can be customized according to the preset size, and the data does not need to be fragmented by using a network layer, so that the stability and the integrity of data transmission can be provided under the condition of poor network environment.
The embodiment of the present application discloses a specific link aggregation method, which is shown in fig. 4 and applied to a server, and the method includes:
step S31: acquiring a plurality of request data packets sent by a client through a plurality of session channels of a preset communication session group; the request data packet is obtained by splitting the request data according to a first preset size by the client.
The embodiment of the application is applied to the server. It should be noted that, before acquiring the plurality of request data packets sent by the client through the plurality of session channels of the preset communication session group, the method further includes: and when the server side is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group. It will be appreciated that in order for the client and the server to exchange data via a two-way communication connection, both the client and the server read the agreed list of communication ports at startup and create a communication session group via socket links.
Step S32: and analyzing the request data packets, and recombining the analyzed request data packets according to the sequence to obtain recombined request data.
In the embodiment of the application, the server receives and analyzes the request data packet sent by the client, judges the legality of the request data packet after the analysis is completed, classifies the request data packet, and caches the request data packet in the message cache queue. And the server side takes out the data packets to be combined from the message buffer queue and recombines the messages according to a specified sequence to obtain complete request data. For more specific processing procedures of the above steps, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S33: splitting reply data obtained after the recombined request data is responded into a plurality of response data packets according to a second preset size, and sending the response data packets to the client, so that the client receives the response data packets, which are returned by the server based on the reply data and aim at the request data, analyzes the response data packets, and then recombines the analyzed response data packets according to a sequence to obtain the reply data.
In the embodiment of the application, after obtaining complete request data, the server processes the request data of the client to obtain reply data, then splits the reply data into a plurality of data packets according to a second preset size to reply to the client, so that the client receives the response data packets, which are returned by the server based on the reply data and are directed to the request data, analyzes the response data packets, and then recombines the analyzed response data packets in sequence to obtain the reply data.
As shown in fig. 5, which is an interaction diagram between a server and a client, the client and the server are started at the beginning, then a communication session group is established, the client splits request data into data packets and sends the data packets to a server of the server, the server receives and reassembles the data packets sent by the client, and finally sends response data packets corresponding to the obtained reply data to the client, and the client reassembles the response data packets after receiving the response data packets sent by the server to obtain complete reply data.
The method is applied to a server side, and comprises the steps of firstly, obtaining a plurality of request data packets sent by a client side through a plurality of session channels of a preset communication session group; the request data packet is obtained by splitting request data according to a first preset size by the client; secondly, analyzing the request data packets, and recombining the analyzed request data packets according to a sequence to obtain recombined request data; and finally, splitting reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size, sending the response data packets to the client, so that the client receives the response data packets, which are returned by the server based on the reply data and aim at the request data, analyzes the response data packets, and then recombining the analyzed response data packets according to a sequence to obtain the reply data. The link aggregation is realized by combining a software algorithm with a customized communication protocol, the request data is split into a plurality of request data packets at the client, and then the request data packets are sent to a target server of the server through a plurality of session channels of a preset communication session group; the server side reconstructs request data packets received by a plurality of session channels of a preset communication session group into complete data according to an agreed protocol, so as to obtain reply data, and then splits the reply data into a plurality of response data packets and returns the reply data packets to the client side for the same processing. The transmission efficiency of data can be improved through the transmission of a plurality of data packets, and meanwhile, the realization of a software algorithm can achieve the same effect of link aggregation under the condition of controlling the cost, so that the cost of the method is lower than that of hardware realization, the use difficulty is lower, the complex configuration is not needed, only a server and a client program need to be executed at a corresponding end, and the configuration burden is basically zero. In addition, the size of the split data packet can be customized according to the preset size, and the data does not need to be fragmented by using a network layer, so that the stability and the integrity of data transmission can be provided under the condition of poor network environment.
Correspondingly, an embodiment of the present application further discloses a link aggregation device, as shown in fig. 6, applied to a client, where the link aggregation device includes:
the data splitting module 11 is configured to split the request data according to a first preset size to obtain a plurality of request data packets;
a data packet sending module 12, configured to send a plurality of request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, reassembles the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client;
a data packet receiving module 13, configured to receive a response data packet, which is returned by the server based on the reply data and is for the request data, and analyze the response data packet;
and the data packet reassembly module 14 is configured to reassemble the analyzed response data packets in sequence to obtain the reply data.
For more specific working processes of the modules, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Therefore, the above scheme of this embodiment is applied to the client, and first, the request data is split according to a first preset size to obtain a plurality of request data packets; secondly, sending the plurality of request data packets to a server through a plurality of session channels of a preset communication session group so that the server can analyze the request data packets, recombine the analyzed request data packets according to a sequence to obtain recombined request data, and then split reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and send the reply data packets to the client; and finally, receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data. As can be seen, link aggregation is realized by combining a software algorithm with a customized communication protocol, request data is split into a plurality of request data packets at a client, and then the request data packets are sent to a target server at a server through a plurality of session channels of a preset communication session group; the server side reconstructs request data packets received by a plurality of session channels of a preset communication session group into complete data according to an agreed protocol, so as to obtain reply data, and then splits the reply data into a plurality of response data packets and returns the reply data packets to the client side for the same processing. The transmission efficiency of data can be improved through the transmission of a plurality of data packets, and meanwhile, the realization of a software algorithm can achieve the same effect of link aggregation under the condition of controlling the cost, so that the cost of the method is lower than that of hardware realization, the use difficulty is lower, the complex configuration is not needed, only a server and a client program need to be executed at a corresponding end, and the configuration burden is basically zero. In addition, the size of the split data packet can be customized according to the preset size, and the data does not need to be fragmented by using a network layer, so that the stability and the integrity of data transmission can be provided under the condition of poor network environment.
Further, an electronic device is disclosed in the embodiments of the present application, and fig. 7 is a block diagram of an electronic device 20 according to an exemplary embodiment, which should not be construed as limiting the scope of the application.
Fig. 7 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the link aggregation method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically a server.
In this embodiment, the power supply 23 is configured to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the memory 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, the resources stored thereon may include an operating system 221, a computer program 222, data 223, and the like, and the data 223 may include various data. The storage means may be a transient storage or a permanent storage.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20 and the computer program 222, and may be Windows Server, Netware, Unix, Linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the link aggregation method performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, embodiments of the present application disclose a computer-readable storage medium, where the computer-readable storage medium includes a Random Access Memory (RAM), a Memory, a Read-Only Memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk, or an optical disk or any other form of storage medium known in the art. Wherein the computer program when executed by a processor implements the aforementioned link aggregation method. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
The steps of a link aggregation or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a link aggregation method, apparatus, device, and storage medium, and the specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A link aggregation method applied to a client includes:
splitting the request data according to a first preset size to obtain a plurality of request data packets;
sending the request data packets to a server through a plurality of session channels of a preset communication session group, so that the server analyzes the request data packets, recombines the analyzed request data packets in sequence to obtain recombined request data, and then splits reply data obtained after responding to the recombined request data into a plurality of response data packets according to a second preset size and sends the response data packets to the client;
and receiving the response data packet which is returned by the server based on the reply data and aims at the request data, analyzing the response data packet, and then recombining the analyzed response data packets according to the sequence to obtain the reply data.
2. The link aggregation method according to claim 1, further comprising:
and when the size of the request data does not exceed the first preset size, selecting any session channel in the communication session group to send the request data to a server.
3. The link aggregation method according to claim 1, wherein before splitting the request data according to the first preset size, the method further includes:
and when the client is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group.
4. The link aggregation method according to any one of claims 1 to 3, wherein the recombining the parsed response packets in order comprises:
screening out target data packets with legality in the analyzed response data packets;
classifying the target data packet based on the request type corresponding to the request data to obtain a classified data packet to be combined corresponding to the request data;
and recombining the classified data packets to be combined according to the sequence.
5. The link aggregation method according to claim 4, wherein before the reassembling the packets to be assembled in order, the method further comprises:
and buffering the data packets to be combined into a message buffer queue so as to take out the data packets to be combined from the message buffer queue and recombine the data packets in sequence.
6. A link aggregation method is applied to a server side and comprises the following steps:
acquiring a plurality of request data packets sent by a client through a plurality of session channels of a preset communication session group; the request data packet is obtained by splitting request data according to a first preset size by the client;
analyzing the request data packets, and recombining the analyzed request data packets according to a sequence to obtain recombined request data;
splitting reply data obtained after the recombined request data is responded into a plurality of response data packets according to a second preset size, and sending the response data packets to the client, so that the client receives the response data packets, which are returned by the server based on the reply data and aim at the request data, analyzes the response data packets, and then recombines the analyzed response data packets according to a sequence to obtain the reply data.
7. The link aggregation method according to claim 6, wherein before obtaining the plurality of request packets sent by the client through the plurality of session channels of the preset communication session group, the method further comprises:
and when the server side is started, reading a preset communication port list, and linking with ports in the preset communication port list through a socket to create the communication session group.
8. A link aggregation device applied to a client includes:
the data splitting module is used for splitting the request data according to a first preset size to obtain a plurality of request data packets;
a data packet sending module, configured to send the multiple request data packets to a server through multiple session channels of a preset communication session group, so that the server analyzes the request data packets, reassembles the analyzed request data packets in sequence to obtain reassembled request data, and then splits reply data obtained after responding to the reassembled request data into multiple response data packets according to a second preset size and sends the multiple response data packets to the client;
a data packet receiving module, configured to receive a response data packet, which is returned by the server based on the reply data and is for the request data, and analyze the response data packet;
and the data packet recombination module is used for recombining the analyzed response data packets according to the sequence to obtain the reply data.
9. An electronic device, comprising a processor and a memory; wherein the memory is for storing a computer program that is loaded and executed by the processor to implement the link aggregation method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the link aggregation method as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210485356.3A CN114679407A (en) | 2022-05-06 | 2022-05-06 | Link aggregation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210485356.3A CN114679407A (en) | 2022-05-06 | 2022-05-06 | Link aggregation method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114679407A true CN114679407A (en) | 2022-06-28 |
Family
ID=82079268
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210485356.3A Withdrawn CN114679407A (en) | 2022-05-06 | 2022-05-06 | Link aggregation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114679407A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115242731A (en) * | 2022-07-21 | 2022-10-25 | 中国农业银行股份有限公司 | Message processing method, device, equipment and storage medium |
CN115334174A (en) * | 2022-08-22 | 2022-11-11 | 卡斯柯信号有限公司 | Multichannel matching method and communication method based on Subset-037 protocol |
CN116545919A (en) * | 2023-03-30 | 2023-08-04 | 中国舰船研究设计中心 | UDP (user datagram protocol) message ordered transmission system and method based on multiple transmission paths |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111263402A (en) * | 2020-01-17 | 2020-06-09 | 广东中兴新支点技术有限公司 | Data transmission method and device and electronic equipment |
CN114401277A (en) * | 2021-12-31 | 2022-04-26 | 格美安(北京)信息技术有限公司 | Data dynamic distribution method, storage medium and system based on hybrid network |
-
2022
- 2022-05-06 CN CN202210485356.3A patent/CN114679407A/en not_active Withdrawn
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111263402A (en) * | 2020-01-17 | 2020-06-09 | 广东中兴新支点技术有限公司 | Data transmission method and device and electronic equipment |
CN114401277A (en) * | 2021-12-31 | 2022-04-26 | 格美安(北京)信息技术有限公司 | Data dynamic distribution method, storage medium and system based on hybrid network |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115242731A (en) * | 2022-07-21 | 2022-10-25 | 中国农业银行股份有限公司 | Message processing method, device, equipment and storage medium |
CN115334174A (en) * | 2022-08-22 | 2022-11-11 | 卡斯柯信号有限公司 | Multichannel matching method and communication method based on Subset-037 protocol |
CN115334174B (en) * | 2022-08-22 | 2024-02-06 | 卡斯柯信号有限公司 | Multi-channel matching method and communication method based on Subset-037 protocol |
CN116545919A (en) * | 2023-03-30 | 2023-08-04 | 中国舰船研究设计中心 | UDP (user datagram protocol) message ordered transmission system and method based on multiple transmission paths |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11265218B2 (en) | Configuration management method and apparatus, and device | |
CN114679407A (en) | Link aggregation method, device, equipment and storage medium | |
US8447871B1 (en) | Simplified method for processing multiple connections from the same client | |
US20080256239A1 (en) | Method and system for optimizing a network by independently scaling control segments and data flow | |
KR101573122B1 (en) | Method, gateway, proxy and system for implementing mobile internet services | |
WO2021047515A1 (en) | Service routing method and apparatus | |
CN112968965B (en) | Metadata service method, server and storage medium for NFV network node | |
CN106464596A (en) | Openflow communication method, system, controller, and service gateway | |
CN111935017B (en) | Cross-network application calling method and device and routing equipment | |
CN111740847A (en) | High-speed network data transmission system and method based on FPGA | |
US8526470B2 (en) | Synchronized commands for network testing | |
Wang et al. | CDLB: a cross-domain load balancing mechanism for software defined networks in cloud data centre | |
US20120294307A1 (en) | Apparatus and Method for Identifier Management | |
JP2015537454A (en) | Queue scheduling method, apparatus and system | |
EP3107231B1 (en) | Data processing method and device | |
US8649285B2 (en) | Tracking packet sequence numbers | |
US8707100B2 (en) | Testing a network using randomly distributed commands | |
Feng et al. | Implementing ICN over P4 in HTTP Scenario | |
Johnsen et al. | WS-notification case study and experiment | |
CN113452754A (en) | CoAP protocol-based power distribution Internet of things network communication system | |
Lucero et al. | Routing in Fat Trees: a protocol analyzer for debugging and experimentation | |
CN113973086B (en) | Data transmission method, device and storage medium | |
Puchianu et al. | Comparative study of power consumption on Mikrotik and Fortigate routers | |
CN112055083B (en) | Request processing method and device, electronic equipment and medium | |
Nikitinskiy et al. | Analyzing the possibility of applying asymmetric transport protocols in terms of software defined networks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220628 |