CN116366535A - TCP-based data link aggregation method and device, readable storage medium and terminal - Google Patents

TCP-based data link aggregation method and device, readable storage medium and terminal Download PDF

Info

Publication number
CN116366535A
CN116366535A CN202310311274.1A CN202310311274A CN116366535A CN 116366535 A CN116366535 A CN 116366535A CN 202310311274 A CN202310311274 A CN 202310311274A CN 116366535 A CN116366535 A CN 116366535A
Authority
CN
China
Prior art keywords
data
physical link
tcp
link
sent
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.)
Pending
Application number
CN202310311274.1A
Other languages
Chinese (zh)
Inventor
梁秀娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202310311274.1A priority Critical patent/CN116366535A/en
Publication of CN116366535A publication Critical patent/CN116366535A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A data link aggregation method and device based on TCP, a readable storage medium and a terminal, wherein the method comprises the following steps: binding a virtual network port with a plurality of physical links, wherein the physical links are used for carrying out data transmission with an aggregation server; for each physical link, establishing a plurality of TCP connections based on the physical link between the virtual portal and the aggregation server; detecting whether data to be transmitted exist currently or not; determining a physical link for transmitting data to be transmitted in response to the current existence of the data to be transmitted; the data to be sent is sent to the aggregation server via the determined plurality of TCP connections of the physical link. The scheme is beneficial to improving the reliability of data transmission between the aggregation terminal and the aggregation server and reducing the resource and traffic overhead.

Description

TCP-based data link aggregation method and device, readable storage medium and terminal
Technical Field
The invention relates to the technical field of link aggregation, in particular to a data link aggregation method and device based on TCP, a readable storage medium and a terminal.
Background
Currently, the multi-path IP packet aggregation schemes are basically based on a user data packet protocol (User Datagram Protocol, UDP) or based on a UDP extension protocol, for example, a secure and reliable transport (Secure Reliable Transport, SRT) protocol, to establish a data communication connection between an aggregation terminal and an aggregation server for intermediate data transmission.
However, due to the limitation of the characteristics of the UDP protocol, there is no flow control characteristic in the process of transmitting data between the aggregation terminal and the aggregation server, and as long as there is an IP packet to be transmitted, the transmitting end will transmit the data in full force, regardless of whether the current bandwidth can carry the data amount, and also does not detect whether the data has been successfully received by the receiving end, there are a plurality of invalid data transmission actions. Thus, the existing data link aggregation scheme has the defects of low data transmission reliability, high resource overhead (for example, high CPU occupancy rate) and the like, so that the equipment cost is increased and a great amount of network traffic is wasted.
Disclosure of Invention
The technical problem solved by the embodiment of the invention is how to improve the reliability of data transmission between the aggregation terminal and the aggregation server and reduce the resource and traffic overhead.
In order to solve the above technical problems, an embodiment of the present invention provides a data link aggregation method based on TCP, including the following steps: binding a virtual network port with a plurality of physical links, wherein the physical links are used for carrying out data transmission with an aggregation server; for each physical link, establishing a plurality of TCP connections based on the physical link between the virtual portal and the aggregation server; detecting whether data to be transmitted exist currently or not; determining a physical link for transmitting data to be transmitted in response to the current existence of the data to be transmitted; the data to be sent is sent to the aggregation server via the determined plurality of TCP connections of the physical link.
Optionally, the determining the physical link for transmitting the data to be transmitted includes: determining the application program of the data source to be sent; determining a physical link for transmitting the data to be transmitted based on the determined application program; the application program and the physical link have a preset one-to-one correspondence.
Optionally, determining the application program from which the data to be sent is sourced includes: extracting a port identifier in the data to be sent, and determining an application program from which the data to be sent is sourced based on the port identifier; the port identification and the application program have a preset corresponding relation.
Optionally, each physical link is provided with a corresponding transmission buffer area, and the transmission buffer area is used for caching a part of data to be transmitted; the determining the physical link for transmitting the data to be transmitted includes: determining the data size of the current cache data of a sending buffer area of each physical link; and taking the physical link with the smallest data quantity of the current cache data of the sending buffer area as the physical link for sending the data to be sent.
Optionally, the method further comprises: in response to receiving the TCP connection anomaly feedback information, closing the anomalous TCP connection indicated by the TCP connection anomaly feedback information, and then repeating a plurality of attempts to reestablish the TCP connection in a non-blocking mode.
Optionally, in each process of reestablishing the TCP connection, in response to waiting for the response of the aggregation server to the current request for establishing the TCP connection to exceed a preset waiting duration, confirming that the current attempt fails, and continuing to perform the next attempt.
Optionally, before sending the data to be sent to the aggregation server via the determined multiple TCP connections of the physical link, the method further includes: and carrying out relay processing on the data to be sent.
Optionally, each TCP connection between the virtual portal and the aggregation server has a separate working thread.
Optionally, the worker thread is implemented based on an atomic variable.
Optionally, before binding the virtual portal with the plurality of physical links, the method further includes: and creating the virtual network port.
The embodiment of the invention also provides a data link aggregation device based on TCP, which comprises: the link binding module is used for binding the virtual network port with a plurality of physical links, and the physical links are used for carrying out data transmission with the aggregation server; the TCP connection establishment module is used for establishing a plurality of TCP connections based on each physical link between the virtual network port and the aggregation server; the data detection module is used for detecting whether data to be transmitted exist currently or not; a sending link determining module, configured to determine, in response to the presence of data to be sent currently, a physical link that sends the data to be sent; and the data sending module is used for sending the data to be sent to the aggregation server through a plurality of TCP connections of the determined physical link.
The embodiment of the invention also provides a readable storage medium, on which a computer program is stored, which when being executed by a processor, performs the steps of the above-mentioned TCP-based data link aggregation method.
The embodiment of the invention also provides a terminal, which comprises a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor executes the steps of the TCP-based data link aggregation method when running the computer program.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the TCP connection is established between the aggregation terminal and the aggregation server, and the TCP has a safe and reliable transmission mechanism and a flow control mechanism, so that reliable data transmission and response can be performed between the aggregation terminal and the aggregation server, and the aggregation terminal can continuously transmit data only on the premise that the aggregation server is confirmed to be capable of normally receiving the data to be transmitted under the condition that the link bandwidth can bear the data to be transmitted, thereby avoiding invalid transmission of the data, greatly reducing resource overhead, reducing unnecessary waste of flow and reducing cost. Further, since the data transmission based on the TCP connection often has a slow-start characteristic of bandwidth, the bandwidth is limited at the initial stage of data transmission, and then the bandwidth is gradually enlarged, in order to solve the foregoing problem, in this embodiment, for each physical link, multiple TCP connections based on the physical link are established between the virtual portal and the aggregation server, and after determining the physical link corresponding to the data to be transmitted, the data is transmitted to the aggregation server via multiple TCP connections of the physical link. By creating multiple TCP connections on a single physical link, the bandwidths of multiple initial windows can be superimposed during the data transmission process, thereby expanding the transmission bandwidth to a certain extent and improving the data transmission efficiency.
Further, the determining a physical link for transmitting the data to be transmitted includes: determining the application program of the data source to be sent; determining a physical link for transmitting the data to be transmitted based on the determined application program; the application program and the physical link have a preset one-to-one correspondence.
In the embodiment of the invention, the data from different application programs, the data types, the formats, the occupied space sizes and the like are generally different, and the data transmission is performed by setting the one-to-one correspondence between the application program from which the data to be transmitted is derived and the physical link, namely, binding the unique corresponding physical link to the data to be transmitted from the specific application program. Compared with the prior art that a single physical link is adopted to transmit data from different application programs, the embodiment is beneficial to improving the stability and reliability of data transmission; on the other hand, the aggregation server is facilitated to more efficiently complete data analysis and aggregation processing.
Further, each physical link is provided with a corresponding transmission buffer zone, and the transmission buffer zone is used for buffering a part of data to be transmitted; the determining the physical link for transmitting the data to be transmitted includes: determining the data size of the current cache data of a sending buffer area of each physical link; and taking the physical link with the smallest data quantity of the current cache data of the sending buffer area as the physical link for sending the data to be sent. Compared with the random selection of the physical link to send data, the scheme is beneficial to avoiding selecting an improper physical link (for example, a physical link with larger current bearing data quantity), so that the stability and reliability of data transmission can be further improved. Furthermore, the physical link with the smallest data quantity of the current cache data is adopted as the physical link for transmitting the data, so that the data can be transmitted more timely, and the timeliness of data transmission is improved.
Further, the method further comprises: in response to receiving the TCP connection anomaly feedback information, closing the anomalous TCP connection indicated by the TCP connection anomaly feedback information, and then repeating a plurality of attempts to reestablish the TCP connection in a non-blocking mode. Compared with the existing TCP connection which uses the blocking mode for reconnection, in some abnormal situations (for example, connection abnormality caused by network abnormality), the connection action is caused to continuously wait, and in the embodiment, the non-blocking mode is adopted in each attempt of connection, so that invalid waiting can be avoided under the condition of TCP connection abnormality, and more efficient reconnection is realized.
Drawings
FIG. 1 is a flow chart of a TCP-based data link aggregation method in an embodiment of the invention;
FIG. 2 is a flow chart of a first embodiment of step S14 of FIG. 1;
FIG. 3 is a flow chart of a second embodiment of step S14 of FIG. 1;
fig. 4 is a schematic diagram of a TCP-based data link aggregation application scenario in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a TCP-based data link aggregation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the above objects, features and advantages of the present invention more comprehensible, embodiments accompanied with figures are described in detail below.
Referring to fig. 1, fig. 1 is a flowchart of a data link aggregation method based on TCP according to an embodiment of the present invention. The method can be applied to various terminal devices with data processing and transmission functions, such as computers, mobile phones, tablet computers, intelligent wearable devices (e.g. intelligent watches), vehicle-mounted terminals, servers, cloud platforms and the like. In this embodiment, the terminal device performing the TCP-based data link aggregation method may be collectively referred to as an aggregation terminal, and the aggregation terminal mainly performs data communication with an aggregation server.
The method may include steps S11 to S15:
step S11: binding a virtual network port with a plurality of physical links, wherein the physical links are used for carrying out data transmission with an aggregation server;
step S12: for each physical link, establishing a plurality of TCP connections based on the physical link between the virtual portal and the aggregation server;
step S13: detecting whether data to be transmitted exist currently or not;
step S14: determining a physical link for transmitting data to be transmitted in response to the current existence of the data to be transmitted;
step S15: the data to be sent is sent to the aggregation server via the determined plurality of TCP connections of the physical link.
In the implementation of step S11, the physical links correspond to physical network cards (or physical network ports), and generally speaking, one physical network card corresponds to one physical link. The physical network cards can be configured on aggregation terminals, each aggregation terminal can be configured with one or more physical network cards, and the aggregation terminals can conduct data communication with the outside through the physical network cards. Common physical network cards include a subscriber identity card (Subscriber Identity Module, SIM), which is an IC card held by a mobile subscriber of the global system for mobile communications (Global System for Mobile Communications, GSM), supporting voice, short messages, internet access, and the like.
The virtual portal may be newly created. By binding the virtual portal with multiple physical links, it is possible to implement virtualization of multiple physical links into a single virtual link. For the application layer, the user program does not need to pay attention to the actual transmission mode of the data on the physical links, and the data can be actually transmitted to a plurality of physical links like a single network port. The method is simple to realize, the user program does not need to be modified, and the flexibility and the controllability of the expansion channel are stronger.
The virtual portal may also be a virtual portal created by multiplexing history, that is, the operation of creating the virtual portal is not required to be performed every time the TCP-based data link aggregation method described in the embodiment is performed. In specific implementation, after a new virtual network port is created under the condition of starting a proper time node, a trigger condition or an application scene, the virtual network port can be directly multiplexed under the same trigger condition or application scene, so that convenience and execution efficiency are improved.
In a specific implementation of step S12, the TCP connection may specifically be referred to as a TCP protocol based connection. The TCP protocol, collectively referred to as the transmission control protocol (Transmission Control Protocol, TCP), is a connection-oriented, reliable, byte-stream based transport layer communication protocol.
Specifically, for each TCP connection established between the virtual portal and the aggregation server, it may be partitioned by a different network namespace, each of which may correspond to one TCP connection. The established TCP connection is used for data communication between the aggregation terminal and the aggregation server.
Specifically, a TCP connection has the following characteristics: (1) When the TCP protocol is used, the TCP connection is established firstly, and after the data transmission is finished, the established TCP connection is released; (2) Reliable transmission, after transmitting data, the sender can know whether the data receiver successfully receives the data or not, and if the data receiver fails, the sender tries to transmit again; (3) For byte stream, the application layer gives a message to the TCP, and the whole message may be split into TCP messages for transmission, for example, if 100 bytes of data are sent based on the TCP connection, and if the sender sends 100 bytes at a time, the receiver may receive 10 times in a loop, and receive 10 bytes each time; (4) Full duplex, TCP allows both communicating parties' application processes to send data at any time.
In comparison, the reliability of data transmission of connections based on the user datagram protocol (User Datagram Protocol, UDP) is lower. Specifically, the UDP connection does not have any secure and reliable transmission mechanism, and after the sender sends the datagram, it does not return any error information if it cannot be successfully sent to the receiver because of a network failure. Furthermore, UDP does not have a flow control characteristic, and if there is data to be transmitted, the sender will send the data fully, and regardless of whether the current link bandwidth can be received, there is a considerable portion of invalid data transmission actions, resulting in unnecessary waste of resource overhead and traffic.
In the embodiment of the invention, the TCP connection is established between the aggregation terminal and the aggregation server, and the TCP has a safe and reliable transmission mechanism and a flow control mechanism, so that reliable data transmission and response can be performed between the aggregation terminal and the aggregation server, and the aggregation terminal can continue to transmit data only when the aggregation server is confirmed to be capable of normally receiving and the link bandwidth can be carried, thereby avoiding invalid transmission of the data. Therefore, the link aggregation is carried out by adopting the embodiment, so that the resource overhead can be reduced to a great extent, the unnecessary waste of the flow can be reduced, and the cost can be reduced.
Further, since the data transmission based on the TCP connection often has a slow-start characteristic of bandwidth, the bandwidth is limited at the initial stage of data transmission, and then the bandwidth is gradually enlarged, in order to solve this problem, in this embodiment, for each physical link, multiple TCP connections based on the physical link are established between the virtual portal and the aggregation server, and after determining the physical link corresponding to the data to be transmitted, the data is transmitted to the aggregation server via multiple TCP connections of the physical link. By creating multiple TCP connections on a single physical link, the bandwidths of multiple initial windows can be superimposed during the data transmission process, thereby expanding the transmission bandwidth to a certain extent and improving the data transmission efficiency.
Further, each TCP connection between the virtual portal and the aggregation server has a respective independent worker thread.
In the embodiment of the invention, by setting a special working thread for each TCP link, the data transmission of each TCP link is independent of each other and complementarily interferes, thereby being beneficial to avoiding the problem of bandwidth reduction caused by mutual blocking among a plurality of TCP links.
Still further, the worker thread is implemented based on an atomic variable.
In specific implementation, the atomic operation of the atomic variable implemented by the loop call "Compare And Swap" (CAS) operation in the Java language can be used in combination with the actual scene requirement, or the atomic operation can be implemented by the xadd instruction provided by the GNU compiler suite (GNU Compiler Collection, GCC) in the C language.
It should be noted that, in the prior art, a thread lock mode is generally adopted to implement a mutual exclusion state between different working threads, so that the overhead is too large, and the bandwidth is reduced, mainly because the lock conflict can cause the working threads to wait for unlocking, thereby causing thread switching, and the context switching overhead is very large. In contrast, the present embodiment implements worker threads for each TCP connection based on atomic variables, which has at least the following advantages: (1) The atomic variable can provide a simple way of ensuring that individual states are consistent, one thread modifies the atomic variable, and the other thread can learn immediately, which is more efficient than by way of thread locking; (2) Atomic variables are finer granularity, lighter in magnitude, than locks, and are critical to achieving high performance concurrent code on multiprocessor systems; (3) If a conflict occurs, the atomic operation simply loops over and retries without switching threads, thus the overhead is significantly reduced.
Further, the method further comprises: in response to receiving the TCP connection anomaly feedback information, closing the anomalous TCP connection indicated by the TCP connection anomaly feedback information, and then repeating a plurality of attempts to reestablish the TCP connection in a non-blocking mode.
Specifically, a common TCP connection mode is a congestion mode, and after a sender sends a connection request to a receiver, the sender waits (does not do other things any more) until the receiver returns a result or a problem occurs. Similarly, when a receiver is processing a request from a sender a, a request from another sender B waits until the processing thread of the receiver completes the previous processing.
For the non-blocking mode in the embodiment of the present application, the connection is continuously performed, for example, the thread is used for polling multiple times until the TCP connection is successfully established.
And in the process of reestablishing the TCP connection each time, responding to the response of the aggregation server to the current TCP connection establishment request exceeding the preset waiting time, confirming that the current attempt fails, and continuing the next attempt.
In the embodiment of the present invention, compared with the existing TCP connection that uses the blocking mode to reconnect, in some abnormal situations (for example, connection abnormality caused by network abnormality), the connection action is caused to wait continuously, and the embodiment uses the non-blocking mode to reconnect and try, so that the state of the current TCP connection can be detected, and the situation that the connection is not continuously and invalidily waited in the case of TCP connection attempt failure is avoided. Further, by properly setting the waiting time, the current attempt failure is confirmed after the timeout, and the next reconnection is performed, which is helpful for realizing more efficient reconnection.
In a specific implementation of step S13, the detecting whether there is data to be sent currently may specifically include: detecting whether data to be transmitted exist currently or not in real time; or detecting whether the data to be transmitted exist at present or not every interval preset period; or, in response to receiving the data transmission trigger instruction, detecting whether data to be transmitted currently exists.
In a specific implementation of step S14, in response to the presence of data to be transmitted currently, a physical link to transmit the data to be transmitted is determined.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of step S14 in fig. 1, where step S14 determines a physical link for transmitting the data to be transmitted, and may specifically include steps S21 to S22.
In step S21, the application from which the data is to be sent is determined.
Further, the step S21 may include: extracting a port identifier in the data to be sent, and determining an application program from which the data to be sent is sourced based on the port identifier; the port identification and the application program have a preset corresponding relation.
In particular, the port identification (e.g., port number) may be used as an identification of a network communication to identify different applications or services so that the network device can more effectively identify the destination and source of the communication. The port number may be a 16-bit integer ranging from 0 to 65535, for example, a port number between 0 and 1023 may be reserved by the system and used only by the system processes, and the remaining port numbers may be used to identify user programs and services.
On the internet, each application or service may have a unique port number. When a network device connects to a certain application or service on the internet, it will add a port number to the network communication packet. Therefore, by extracting the port number in the communication data packet, the application program or service from which the data to be sent is to be sent can be quickly and accurately positioned, and the destination and the source of the network communication can be determined, so that the data packet can be timely and accurately transmitted to the expected position.
In step S22, a physical link for transmitting the data to be transmitted is determined based on the determined application program.
The application program and the physical link have a preset one-to-one correspondence.
In the embodiment of the invention, for the data to be transmitted from a specific application program, the data is transmitted by binding the unique corresponding physical link, and compared with the prior art that the data from different application programs is transmitted by adopting a single physical link, the embodiment is favorable for improving the stability and the reliability of data transmission on one hand; on the other hand, the aggregation server is facilitated to more efficiently complete data analysis and aggregation processing.
Referring to fig. 3, fig. 3 is a flowchart of a second embodiment of step S14 in fig. 1. The step S14 of determining a physical link for transmitting the data to be transmitted may specifically include steps S31 to S32.
In step S31, the data size of the current buffer data of the transmission buffer of each physical link is determined.
In step S32, the physical link with the smallest data size of the current buffered data of the transmission buffer is used as the physical link for transmitting the data to be transmitted.
In the embodiment of the present invention, the physical link with the smallest data amount of the current buffered data of the transmitting buffer is used as the physical link for transmitting the data to be transmitted, and compared with the prior art that the physical link is selected randomly to transmit the data, the present embodiment is helpful to avoid selecting an inappropriate physical link (for example, a physical link with a larger current bearing data amount), so that stability and reliability of data transmission can be further improved. Furthermore, the physical link with the smallest data quantity of the current cache data is adopted as the physical link for transmitting the data, so that the data can be transmitted more timely, and the timeliness of data transmission is improved.
With continued reference to fig. 1, in step S15, the data to be transmitted is transmitted to the aggregation server via the determined plurality of TCP connections of the physical link.
Further, before the data to be sent is sent to the aggregation server via the determined multiple TCP connections of the physical link in the step S15, the method further includes: and carrying out relay processing on the data to be sent.
In implementations, the relay process may be performed using a TCP relay component or relay program. In the data transmission based on the TCP connection, once the slow start situation occurs, the bandwidth detection is restarted, the congestion window is increased by 0 from a very low value according to the ACK feedback, in this case, the addition of the TCP relay can promote the rapid convergence of the whole process, the slow start process can be accelerated, the state of full bandwidth can be reached as soon as possible, the total bandwidth utilization rate is improved, and the overall performance of the link is further improved.
Further, before sending the data to be sent to the aggregation server via the plurality of TCP connections of the physical link, the method further includes: and caching the data to be sent by adopting a cache queue. In this way, the problem of data loss due to network bandwidth floating can be avoided.
Further, a system call function such as read, write, select can be adopted to return to the current TCP connection state, so that the operations of correspondingly closing the TCP connection and attempting reconnection until the program exits from restarting can be performed, and the reliability of communication connection between the aggregation terminal and the aggregation server can be improved.
Referring to fig. 4, fig. 4 is a schematic diagram of a data link aggregation application scenario based on TCP in an embodiment of the present invention.
The application programs 1 to n can be from the same user terminal or from different user terminals, and data interaction is performed between each application program and the aggregation terminal A. The aggregation terminal A comprises an aggregation program for realizing link aggregation according to the embodiment of the invention, and can also comprise a TCP relay program. The aggregation terminal a and the aggregation server B communicate data through a plurality of physical links (as shown by double-headed arrows between the aggregation terminal a and the aggregation server B in the figure), and a plurality of TCP connections are created on each physical link.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a TCP-based data link aggregation apparatus according to an embodiment of the present invention. The apparatus may include:
a link binding module 51, configured to bind a virtual portal with a plurality of physical links, where the plurality of physical links are used for data transmission with an aggregation server;
a TCP connection establishment module 52, configured to, for each physical link, establish a plurality of TCP connections based on the physical link between the virtual portal and the aggregation server;
a data detection module 53, configured to detect whether there is data to be sent currently;
a transmit link determination module 54, configured to determine, in response to the presence of data to be transmitted, a physical link for transmitting the data to be transmitted;
a data sending module 55, configured to send the data to be sent to the aggregation server via the multiple TCP connections of the determined physical link.
Regarding the principle, implementation and advantageous effects of the TCP-based data link aggregation device, reference is made to the foregoing and the related descriptions of the TCP-based data link aggregation method shown in fig. 1 to 3, which are not repeated herein.
The embodiments of the present invention also provide a readable storage medium, for example a computer readable storage medium, having stored thereon a computer program which, when executed by a processor, performs the steps of the TCP-based data link aggregation method shown in fig. 1 to 3 described above. The computer readable storage medium may include non-volatile memory (non-volatile) or non-transitory memory, and may also include optical disks, mechanical hard disks, solid state disks, and the like.
Specifically, in the embodiment of the present invention, the processor may be a central processing unit (central processing unit, abbreviated as CPU), and the processor may also be other general purpose processors, digital signal processors (digital signal processor, abbreviated as DSP), application specific integrated circuits (application specific integrated circuit, abbreviated as ASIC), off-the-shelf programmable gate arrays (field programmable gate array, abbreviated as FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be appreciated that the memory in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically erasable ROM (electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (random access memory, RAM for short) which acts as an external cache. By way of example but not limitation, many forms of random access memory (random access memory, abbreviated as RAM) are available, such as static random access memory (static RAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, abbreviated as DDR SDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), synchronous Link DRAM (SLDRAM), and direct memory bus random access memory (direct rambus RAM, abbreviated as DR RAM).
The embodiment of the invention also provides a terminal, which comprises a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor executes the steps of the TCP-based data link aggregation method shown in the figures 1 to 3 when running the computer program. The terminal can include, but is not limited to, terminal equipment such as a mobile phone, a computer, a tablet computer, a server, a cloud platform, and the like.
It should be understood that the term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, the character "/" indicates that the front and rear associated objects are an "or" relationship.
The term "plurality" as used in the embodiments herein refers to two or more.
The first, second, etc. descriptions in the embodiments of the present application are only used for illustrating and distinguishing the description objects, and no order division is used, nor does it indicate that the number of the devices in the embodiments of the present application is particularly limited, and no limitation on the embodiments of the present application should be construed.
It should be noted that the serial numbers of the steps in the present embodiment do not represent a limitation on the execution sequence of the steps.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the invention, and the scope of the invention should be assessed accordingly to that of the appended claims.

Claims (13)

1. A TCP-based data link aggregation method, comprising:
binding a virtual network port with a plurality of physical links, wherein the physical links are used for carrying out data transmission with an aggregation server;
for each physical link, establishing a plurality of TCP connections based on the physical link between the virtual portal and the aggregation server;
detecting whether data to be transmitted exist currently or not;
determining a physical link for transmitting data to be transmitted in response to the current existence of the data to be transmitted;
the data to be sent is sent to the aggregation server via the determined plurality of TCP connections of the physical link.
2. The method of claim 1, wherein the determining a physical link to transmit the data to be transmitted comprises:
determining the application program of the data source to be sent;
determining a physical link for transmitting the data to be transmitted based on the determined application program;
the application program and the physical link have a preset one-to-one correspondence.
3. The method of claim 2, wherein determining the application from which the data is to be sent comprises:
extracting a port identifier in the data to be sent, and determining an application program from which the data to be sent is sourced based on the port identifier;
the port identification and the application program have a preset corresponding relation.
4. The method according to claim 1, wherein each physical link is provided with a respective transmission buffer for buffering a portion of the data to be transmitted;
the determining the physical link for transmitting the data to be transmitted includes:
determining the data size of the current cache data of a sending buffer area of each physical link;
and taking the physical link with the smallest data quantity of the current cache data of the sending buffer area as the physical link for sending the data to be sent.
5. The method according to claim 1, wherein the method further comprises:
in response to receiving the TCP connection anomaly feedback information, closing the anomalous TCP connection indicated by the TCP connection anomaly feedback information, and then repeating a plurality of attempts to reestablish the TCP connection in a non-blocking mode.
6. The method of claim 5, wherein in each re-establishment of a TCP connection, in response to waiting for the response of the aggregation server to the current request to establish a TCP connection to exceed a preset waiting period, confirming that the current attempt failed and continuing the next attempt.
7. The method of claim 1, wherein prior to sending the data to be sent to the aggregation server via the determined plurality of TCP connections of the physical link, the method further comprises: and carrying out relay processing on the data to be sent.
8. The method of claim 1, wherein each TCP connection between the virtual portal and the aggregation server has a respective independent worker thread.
9. The method of claim 8, wherein the worker thread is implemented based on an atomic variable.
10. The method of claim 1, wherein prior to binding the virtual portal with the plurality of physical links, the method further comprises:
and creating the virtual network port.
11. A TCP-based data link aggregation apparatus, comprising:
the link binding module is used for binding the virtual network port with a plurality of physical links, and the physical links are used for carrying out data transmission with the aggregation server;
the TCP connection establishment module is used for establishing a plurality of TCP connections based on each physical link between the virtual network port and the aggregation server;
the data detection module is used for detecting whether data to be transmitted exist currently or not;
a sending link determining module, configured to determine, in response to the presence of data to be sent currently, a physical link that sends the data to be sent;
and the data sending module is used for sending the data to be sent to the aggregation server through a plurality of TCP connections of the determined physical link.
12. A readable storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the TCP-based data link aggregation method of any one of claims 1 to 10.
13. A terminal comprising a memory and a processor, the memory having stored thereon a computer program executable on the processor, characterized in that the processor executes the steps of the TCP-based data link aggregation method according to any one of claims 1 to 10 when the computer program is executed.
CN202310311274.1A 2023-03-24 2023-03-24 TCP-based data link aggregation method and device, readable storage medium and terminal Pending CN116366535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310311274.1A CN116366535A (en) 2023-03-24 2023-03-24 TCP-based data link aggregation method and device, readable storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310311274.1A CN116366535A (en) 2023-03-24 2023-03-24 TCP-based data link aggregation method and device, readable storage medium and terminal

Publications (1)

Publication Number Publication Date
CN116366535A true CN116366535A (en) 2023-06-30

Family

ID=86935846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310311274.1A Pending CN116366535A (en) 2023-03-24 2023-03-24 TCP-based data link aggregation method and device, readable storage medium and terminal

Country Status (1)

Country Link
CN (1) CN116366535A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217528A (en) * 2008-01-18 2008-07-09 杭州华三通信技术有限公司 A link aggregation method and device
CN102404156A (en) * 2011-12-12 2012-04-04 杭州华三通信技术有限公司 Data transmission method and device based on aggregation link
CN102811172A (en) * 2012-07-25 2012-12-05 中兴通讯股份有限公司 Virtual port mapping-based aggregated link scheduling method and data forwarding device
CN104852988A (en) * 2015-05-29 2015-08-19 杭州华三通信技术有限公司 A message forwarding method and device
US20150282005A1 (en) * 2014-03-28 2015-10-01 Qualcomm Incorporated Link aggregation in wireless local area networks
US20150281997A1 (en) * 2014-03-28 2015-10-01 Fujitsu Limited Link aggregation apparatus and method for distributing a tcp flow to multiple links
CN106169978A (en) * 2016-07-07 2016-11-30 杭州华三通信技术有限公司 The treating method and apparatus of BMP message
CN107707519A (en) * 2017-07-10 2018-02-16 贵州白山云科技有限公司 A kind of flow-medium transmission method, device and system
CN111224888A (en) * 2018-11-27 2020-06-02 华为技术有限公司 Method for sending message and message forwarding equipment
CN111835721A (en) * 2020-06-10 2020-10-27 成都国泰网信科技有限公司 Communication method and communication equipment based on link active state addressing
CN114337939A (en) * 2021-06-23 2022-04-12 中宇联云计算服务(上海)有限公司 Network system based on cloud network fusion technology and network optimization method
CN115361591A (en) * 2022-08-18 2022-11-18 中国星网网络应用有限公司 File transmission method based on 5G SBA and satellite-ground cooperative transmission system
CN115633037A (en) * 2022-10-18 2023-01-20 北京东土军悦科技有限公司 Method, device, virtual gateway equipment, medium and system for forwarding data packet

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217528A (en) * 2008-01-18 2008-07-09 杭州华三通信技术有限公司 A link aggregation method and device
CN102404156A (en) * 2011-12-12 2012-04-04 杭州华三通信技术有限公司 Data transmission method and device based on aggregation link
CN102811172A (en) * 2012-07-25 2012-12-05 中兴通讯股份有限公司 Virtual port mapping-based aggregated link scheduling method and data forwarding device
US20150282005A1 (en) * 2014-03-28 2015-10-01 Qualcomm Incorporated Link aggregation in wireless local area networks
US20150281997A1 (en) * 2014-03-28 2015-10-01 Fujitsu Limited Link aggregation apparatus and method for distributing a tcp flow to multiple links
CN104852988A (en) * 2015-05-29 2015-08-19 杭州华三通信技术有限公司 A message forwarding method and device
CN106169978A (en) * 2016-07-07 2016-11-30 杭州华三通信技术有限公司 The treating method and apparatus of BMP message
CN107707519A (en) * 2017-07-10 2018-02-16 贵州白山云科技有限公司 A kind of flow-medium transmission method, device and system
CN111224888A (en) * 2018-11-27 2020-06-02 华为技术有限公司 Method for sending message and message forwarding equipment
CN111835721A (en) * 2020-06-10 2020-10-27 成都国泰网信科技有限公司 Communication method and communication equipment based on link active state addressing
CN114337939A (en) * 2021-06-23 2022-04-12 中宇联云计算服务(上海)有限公司 Network system based on cloud network fusion technology and network optimization method
CN115361591A (en) * 2022-08-18 2022-11-18 中国星网网络应用有限公司 File transmission method based on 5G SBA and satellite-ground cooperative transmission system
CN115633037A (en) * 2022-10-18 2023-01-20 北京东土军悦科技有限公司 Method, device, virtual gateway equipment, medium and system for forwarding data packet

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
中国卫星导航定位协会编: "《卫星导航定位与北斗系统应用 壮大北斗产业 创新位置服务 2014》", 30 September 2014, 测绘出版社, pages: 232 - 233 *

Similar Documents

Publication Publication Date Title
US8925068B2 (en) Method for preventing denial of service attacks using transmission control protocol state transition
CN111447155B (en) Data transmission method, device, equipment and storage medium
US20090059788A1 (en) Method and Apparatus for Dynamic Adaptation of Network Transport
US11283555B2 (en) Packet transmission method, network component, and computer-readable storage medium
US20060235939A1 (en) Apparatus and methods for tunneling a media streaming application through a firewall
US11689646B2 (en) Network packet processing method and apparatus and network server
JP5447522B2 (en) Communication between client and server in mobile radio communication device
KR20100135855A (en) Method for enabling faster recovery of client applications in the event of server failure
CN112152880A (en) Link health detection method and device
US10129163B2 (en) Methods and apparatus for preventing head of line blocking for RTP over TCP
US20070140111A1 (en) Method and system for preventing data packet loss in a redundant PDSN environment
CN113765865B (en) Message processing method, device and system
CN109996349B (en) Session recovery method and device
CN116366535A (en) TCP-based data link aggregation method and device, readable storage medium and terminal
US20160261719A1 (en) Information processing system, control program, and control method
CN106992878B (en) Multicast detection method and device
CN114362893A (en) Data transmitting method, data receiving method, terminal and computer storage medium
CN110213362B (en) Method and device for pushing long information in bypass environment
CN117527458B (en) Multicast data distribution method and device, electronic equipment and storage medium
EP4124117A1 (en) Service transmission method, communication device and storage medium
CN116781650B (en) Data processing method and system
CN117640530A (en) Method and device for low-delay reliable data transmission of cluster network
CN111638997A (en) Data recovery method and device and network equipment
CN116827853A (en) Path processing method and device and electronic equipment
CN117082486A (en) SIM card application downloading method, device, equipment and storage medium

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