CN108429700B - Method and device for sending message - Google Patents

Method and device for sending message Download PDF

Info

Publication number
CN108429700B
CN108429700B CN201710076967.1A CN201710076967A CN108429700B CN 108429700 B CN108429700 B CN 108429700B CN 201710076967 A CN201710076967 A CN 201710076967A CN 108429700 B CN108429700 B CN 108429700B
Authority
CN
China
Prior art keywords
value
mfl
tcp connection
state information
link state
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.)
Active
Application number
CN201710076967.1A
Other languages
Chinese (zh)
Other versions
CN108429700A (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710076967.1A priority Critical patent/CN108429700B/en
Priority to PCT/CN2017/105870 priority patent/WO2018145481A1/en
Publication of CN108429700A publication Critical patent/CN108429700A/en
Application granted granted Critical
Publication of CN108429700B publication Critical patent/CN108429700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/36Flow control; Congestion control by determining packet size, e.g. maximum transfer unit [MTU]
    • H04L47/365Dynamic adaptation of the packet size
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/166IP fragmentation; TCP segmentation

Abstract

The embodiment of the invention provides a method and a device for sending messages, wherein a sending end of a first TCP connection sends a first message of the first TCP connection, the sending end determines that link state information of the first TCP connection changes, and the link state information is used for representing transmission performance of the TCP connection; adjusting the MFL of the first TCP connection to a second value in accordance with the change in the link-state information; and the sending end sends a second message of the first TCP connection to the opposite end, and the specification of the TLS record of the second message is the second value. Therefore, the specification of the TLS record can be adjusted more flexibly according to the network environment, and the data transmission is smoother.

Description

Method and device for sending message
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for sending a packet.
Background
People now become more and more isolated from the internet, and at the same time, privacy and security issues become increasingly important. Encryption has always been an important feature to protect the privacy of a user's communications. SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are very widely used protocols, and in fact, TLS is an upgraded version of SSL, so SSL is sometimes used in the industry to represent TLS. According to data of national and foreign research institutions, SSL/TLS is adopted for encryption protection of nearly 60% of network traffic. SSL/TLS is used for guaranteeing the safety of data transmission on the Internet, and the data can be ensured not to be intercepted and intercepted in the transmission process on the network by using a data Encryption (Encryption) technology. The SSL/TLS protocol is positioned between the TCP/IP protocol and various application layer protocols and provides safety support for data communication.
SSL is a layer of Protocol between an application layer and a TCP/IP (Transmission Control Protocol/Internet Protocol) layer, and application data needs to be processed by the SSL layer before being sent out through the TCP/IP layer. In the process of SSL layer processing, application data is processed in units of TLS records (SSL Record), and the size of the TLS records is limited by specification. When the size of the application data exceeds the TLS record specification, the SSL protocol fragments the application data according to the TLS record as a unit, after the fragmentation is completed, the SSL protocol stack compresses each record, adds MAC (media access control) and performs encryption and decryption processing, and finally, the encrypted data is sequentially transmitted through a TCP interface.
However, in the prior art, the specification of the TLS record used is fixed, and cannot adapt to a variable network environment, thereby causing problems such as long time delay for the application layer to acquire data.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for sending a packet, which can adjust the specification of a TLS record more flexibly according to a network environment, reduce a time delay for an application layer to obtain data, and enable data transmission to be smoother.
One embodiment of the present invention provides a method for sending a packet, where the method includes: a sending end of a first TCP connection sends a first message of the first TCP connection, the maximum fragment length MFL of the first TCP connection is a first value, the MFL represents the specification of a maximum Transport Layer Security (TLS) record used for transmitting data by the first TCP connection, and the specification of the TLS record of the first message is the first value; the sending end determines that link state information of the first TCP connection changes, wherein the link state information is used for representing transmission performance of the TCP connection; according to the change of the link state information, the transmitting end adjusts the MFL of the first TCP connection to a second value; and the sending end sends a second message of the first TCP connection to the opposite end of the first TCP connection, wherein the MFL of the second message is the second value.
It should be understood that the TCP connection is any TCP connection that uses the TLS layer to process data. The link state information includes at least one of a round trip time RTT, a congestion window CWND, and a packet loss rate.
It should be understood that the sender may send, to the opposite end of the first TCP connection, that is, the device indicated by the destination address in the TCP message corresponding to the first packet. Or may be an input/output (I/O) device that is considered to transmit to a physical machine corresponding to the sender.
In one implementation, the MFL has a value range of 1300 bytes or more and 16KB or less.
In one implementation, the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change in the link state information includes: calculating the successful sending probability of the message corresponding to a plurality of values in the MFL value range by using the changed link state information; and adjusting the MFL of the TCP connection to a second value of the plurality of values, wherein the probability of successful transmission of the message corresponding to the second value is the maximum value of the probabilities of successful transmission of the message corresponding to the plurality of values.
In one implementation, the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change in the link state information includes: calculating the successful message sending probability of the first TCP connection by using the changed link state information; adjusting the MFL of the first TCP connection to a second value where the probability increases, wherein the second value is greater than the first value; adjusting the MFL of the first TCP connection to a second value where the probability decreases, where the second value is less than the first value.
In one implementation, the link state information includes a round trip delay RTT, and the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link state information includes: adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the RTT increases; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the RTT decreases.
In one implementation, the MFL has a preset value range, the link state information includes round trip delay RTT, and the adjusting, by the sending end, the MFL of the first TCP connection to the second value according to the change of the link state information includes: adjusting the MFL of the first TCP connection to a second value that is half of the first value if the RTT increases and the first value is less than a maximum value in the range of values; in the event that the RTT decreases and the first value is greater than the minimum value in the range of values, adjusting the MFL of the first TCP connection to a second value, the second value being twice the first value; adjusting the MFL of the first TCP connection to a second value when the RTT increases and the first value is a maximum value in the value range, or when the RTT decreases and the first value is a minimum value in the value range, the second value being equal to the first value.
In one implementation, the MFL is preset with a value range, the link state information includes a congestion window CWND, and the sending end adjusts the MFL of the first TCP connection to a second value according to a change of the link state information, including: adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the CWND is increased; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the CWND is decreased.
In one implementation, the MFL has a preset value range, the link state information includes a congestion window CWND, and the adjusting, by the sending end, the MFL connected to the first TCP to the second value according to the change of the link state information includes: when the CWND is increased, adjusting the MFL of the first TCP connection to a second value, wherein the second value is the smaller value of the product of the CWND and the maximum message length MSS of the first TCP connection and the first value, and when the product is smaller than the minimum value in the value range, the second value is the minimum value in the value range; adjusting the MFL of the first TCP connection to a second value when the CWND is reduced, wherein the second value is a larger value of a product of the CWND and a maximum message length MSS of the first TCP connection and the first value, and the second value is a maximum value of the value range when the product is larger than a maximum value of the value range.
In one implementation, the determining that the link state information of the first TCP connection changes includes: when a message is received or sent, detecting link state information of the first TCP connection to determine that the link state information changes; or detecting the link state information of the first TCP connection at a preset time or according to a preset time interval to determine that the link state information changes. On the other hand, the link status information may be periodically detected according to a preset time or a preset time interval.
It should be understood that the sending end is a terminal or a network device (e.g., a server), and the terminal or the network device may also be used as the receiving end to receive data. That is, the determination of link state information may be triggered in the form of an event trigger, such as the receipt of a message or the transmission of a message. It should be understood that the receiving or sending of a message as described herein means that the sender detects the receiving or determining that a message is to be sent, and the delay caused by the operation of the device (e.g., the execution of a program or task) should be tolerated.
In the embodiment of the present invention, a method for sending a packet is provided, where the method involves adjusting a specification (size) of a TLS record, and the method uses an MFL as the specification of the TLS record, and adjusts a value of the MFL based on link information of a TCP connection corresponding to the TLS, so that the specification of the TLS record can be flexibly adjusted according to a link state of a TCL connection, thereby reducing a time delay for an application layer to obtain data, and enabling data transmission to be smoother, thereby improving communication performance.
On the other hand, an embodiment of the present invention further provides an apparatus for sending a packet, where the apparatus includes a sending module, where the sending module is configured to send a first packet of the first TCP connection, where a maximum fragment length MFL of the first TCP connection is a first value, where the MFL indicates a specification of a maximum transport layer security TLS record used by the first TCP connection for transmitting data, and a specification of the TLS record of the first packet is the first value; an adjustment module, configured to determine that link state information of the first TCP connection changes, where the link state information is used to indicate transmission performance of the TCP connection; the adjusting module is further configured to adjust the MFL of the first TCP connection to a second value according to the change in the link state information; the sending module is further configured to send a second packet of the first TCP connection to an opposite end of the first TCP connection, where the MFL of the second packet is the second value.
As the apparatus is a corresponding apparatus to the above method, please refer to the above description of the method for various implementation manners, descriptions and beneficial effects of the apparatus.
In a third aspect, an embodiment of the present invention further provides an apparatus for sending a packet, where the apparatus includes: the processing circuit, the communication interface, and the storage medium, where the protocol stack program is stored in the storage medium, the communication interface is configured to send and receive information to and from other devices by executing the program in the storage medium, and the processor is configured to implement the method in each implementation manner in the first aspect by executing instructions in the storage medium.
In a fourth aspect, a storage medium is further provided, where the storage medium is used to store program codes for implementing the methods in the implementation manners of the first aspect.
Since the third and fourth aspects correspond to the method of the first aspect, please refer to the above description of the method for describing various implementations, descriptions and advantageous effects of the third and fourth aspects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a process of processing application data through an SSL layer according to an embodiment of the present invention;
fig. 2 is a simplified block diagram of a communication system provided by an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a transmitting end according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of another apparatus at a transmitting end according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention provide a method and an apparatus for sending a packet, and a technical solution 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. 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.
The following are some technical terms related to the embodiments of the present invention:
congestion window (CWND congestion window) refers to the number of packets that can be transmitted at most at a time by the source of data in TCP data transmission under congestion control. It should be understood that the congestion window may be abbreviated CWND or CWND. For example, in some codes cwnd is used for representation.
Transport Layer Security (TLS), a communications security protocol used to secure data transfers between applications on a client and/or server. The protocol is located between the application layer and the TCP/IP protocol stack.
A Message Authentication Code (MAC), is a small piece of check information used to verify the integrity of a Message.
Head of Line blocking (HoL), a phenomenon that limits transmission performance, due to multiple requests, such as by out-of-order transmission or HTTP pipelining, some packets are delayed by others (e.g., the other packets are lost and need to be retransmitted) to be reported to the application layer. It should be understood that head of line blocking may be abbreviated HoL or HOL.
RTT (Round-trip Time), Round-trip delay. The time delay is the time delay experienced by the transmitting end from the transmission of the data to the reception of the reception acknowledgement information (such as ACK or NACK) corresponding to the data transmitted by the receiving end. It should be understood that in one implementation, the acknowledgement information corresponding to the data is sent immediately upon receipt of the data by the receiving end, where "immediately" is understood to include the processing time necessary for the receiving end to transmit the acknowledgement message from the receipt of the data. It should be understood that the round trip delay may be abbreviated as RTT or RTT. For example, in some codes, rtt representation is used.
RTTVAR, a parameter in the TCP _ info structure (TCP _ info _ struct) that describes the variation in RTT in the performance of the TCP connection.
Maximum Fragment Length (MFL), a parameter that describes the size of the largest TLS record that can be used to transport data.
MSS, a parameter in the TCP _ info structure (TCP _ info _ struct) that describes the size of the largest segment of the TCP payload (size).
MAC, Message Authentication Code (Message Authentication Code). Means for ensuring data integrity of a message.
The technical solution provided by the embodiment of the present invention can be typically applied to a wireless communication system, such as, for example: a Global System for Mobile communications (GSM) Network, a Code Division Multiple Access (CDMA) Network, a Time Division-Synchronous Code Division Multiple Access (TDSCDMA) Network, a Wideband Code Division Multiple Access (WCDMA) Network, a General Packet Radio Service (GPRS) Network, a Long Term Evolution (LTE) Network, a Software Defined Network (SDN, Software Defined Network), a Wireless Sensor Network (Wireless Sensor Network), and the like.
Indeed, TLS is an upgraded version of SSL, so the industry sometimes also uses SSL to represent TLS. Thereby providing at least one of the following services for communication in the network: authenticating the user and the server to ensure that the data can be sent to the correct destination (e.g., client or server); encrypting data to prevent data from being stolen during transmission; the integrity of the data is maintained to ensure that the data is not altered during transmission. TLS is the underlying protocol included in an operating environment in many commercial deployments. Almost half of the internet traffic is protected by TLS. However, its design does not consider how to efficiently use low-latency or low-bandwidth types of networks, such as wireless and telecommunications networks. Because, there is head-of-line (HoL) blocking phenomenon in the transmission using the TCP protocol, that is, if a part of data in a packet (packet) is lost in the transmission, other received data will be stored in the buffer until the lost part of data is successfully retransmitted and reported to the application layer. For example, a packet has a length of 16K, and 1K of data is lost during transmission, and the remaining 15K of data needs to wait for successful retransmission of the 1K of data before providing the data of the packet to the application layer.
The following describes a process of processing data of an application layer by a TLS layer in conjunction with fig. 1, and fig. 1 shows a process of processing application data by the TLS layer. In the TLS protocol, application data is processed in units of TLS records (TLS Record). When the data volume of the application data to be transmitted exceeds the specification of the TLS record, the TLS layer will fragment the application data according to the TLS record as a unit, assuming that the application data is divided into n pieces, the data length of the first n-1 fragments is consistent with the specification length of the TLS record, and the data length of the last nth fragment may be generally less than the specification length of the TLS record. For the first n-1 slices, since the length is consistent with the size of the TLS record, we refer to the slice length at this time as the maximum slice length MFL (maximum fragment length), and since the maximum slice length is the same as the TLS record size, the subsequently mentioned MFL may also be considered as the TLS record size. After the fragmentation is completed, the TLS protocol stack compresses each record, adds MAC (media access control) and performs encryption and decryption processing and the like, and finally, the encrypted data are sequentially transmitted out by calling a TCP (transmission control protocol) interface.
It can be seen from this flow that the data volume of the packet sent by the TLS protocol through tcp once is strongly correlated with the specification data volume of the TLS record, and if the TLS record specification is larger, the packet sent by tcp once is larger, and if the TLS record specification is smaller, the packet sent by tcp once is smaller.
The TCP Protocol requires strict Data in-sequence transmission, that is, for a set of Data, when a certain Transport Protocol Data Unit (TPDU) is lost, a subsequent Data Unit can report the set of Data to the application layer only after the lost TPDU is retransmitted and received, which is a head-of-line (HoL) blocking problem of TCP. For example, a packet is processed by the TLS layer, the data stream sequentially includes data 1 to data 4, after data 3 is lost, the peer end needs to wait until the source end retransmits data 3 and receives data 3, that is, after all the data in the packet are received, parse data 1 to 4, and then transmit the parsed data to the application layer.
After receiving the message, the receiving end performs processing, specifically, encryption/decryption and MAC processing on the application data, by a TLS layer between the application layer and the TCP layer. For example, in the decryption process, when a TLS record is received, the TLS protocol stack decrypts the record, and after decryption is successful, MAC verification is performed. If data loss occurs in the transmission process of the TCP, at this time, since the TLS does not receive a complete TLS record, the TLS decryption process fails (an unencrypted mode may also be configured in the TLS, but in this mode, data is also verified to fail during MAC verification of the data), only when the data recorded in the whole TLS is complete, the TLS decryption and verification will succeed, and the decrypted data can be successfully sent to the application layer for processing.
Under TLS mechanism processing, even if a receiver receives 15k of data in a record (for example, the record specification is 16k, and 1k of data is lost during transmission), the application layer data cannot be processed, which suffers from HoL problem, only after the lost packet is retransmitted, the TLS can normally decrypt the data after the whole recorded data is completely received, and the waiting time is a large time delay.
Currently, the industry is open to implement communication using TLS record specification of fixed size. For example, the TLS Standard document RFC5246 section 6.2.1 specifies that the TLS record cannot be sized beyond 2^14 bytes (16 KB). OpenTLS is the most widely used open source code in the industry that implements TLS functionality, where the TLS record size is default to 16KB and cannot be adjusted. For another example, in the implementation of the Mbedtls open source code, the Mbedtls implements the function of the TLS layer, and the application is wide, and in the implementation of the Mbedtls open source code, a user is given a right to configure the specification of the TLS record, and the user performs configuration in the service initialization stage, and is not easy to change after configuration, that is, once the specification of the TLS record is determined, the user continues to use in the subsequent communication process, and if the specification of the TLS record needs to be adjusted, the user can only reinitialize the service to reconfigure the specification of the TLS record, and the service can be started again after the configuration is completed, and this process needs manual participation. It should be understood that the larger the specification of a TSL record, the more data is included in the record, and the more data is easily lost in transmission. The user can choose to configure the following specifications of 5 TLS records for the user to configure: 512 bytes, 1024 bytes, 2048 bytes, 4096 bytes, 8192 bytes, and 16384 bytes.
However, due to the complexity and variety of network environments, the above usage may bring about various problems. For example, when the link condition is poor, if the specification of the TLS record is too large, the problems of too large network delay and head of line blocking may be caused, and if the specification of the TLS record is too small, the network throughput and utilization rate may be too low, which may cause waste.
As can be seen from the above discussion, fragmentation (fragmentation is too small) and reassembly of large packets, which occur at the TCP layer, can result in significant latency. In the transmission process of the application data, if packet loss occurs, at least one RTT (Round-trip Time) delay is caused. The effect of a packet loss behavior on the TLS record size is described below using a test as an example. In this test, using an application load of 1600K, the TLS server was configured in hong kong and the TLS client was configured in bangalor, with an average RTT of 300ms, for transmission over the network between the TLS server and the TLS client. Upon request by the client, the data is transmitted from the TLS server via TLS encryption. The following are the test results:
1) the specification (size) of the TLS record is 16K, the packet loss rate is 0.1%, and the total delay is 9.1775121 s;
2) the specification (size) of the TLS record is 16K, the packet loss rate is 5%, and the total delay is 67.4828414 s;
3) the specification (size) of the TLS record is 1.5K, the packet loss rate is 0.1%, and the total delay is 13.1105458s
4) The size of the TLS record is 1.5K, the packet loss rate is 5%, and the total delay is 78.5495714s
Therefore, as can be seen from the above results, as the specification of TLS records increases, and the packet loss rate increases, the total delay (handshake + data transmission delay) increases. Even simply reducing the specification of TLS records to a smaller value does not reduce the delay, but instead generates more delay spikes (i.e. the delay suddenly increases at some point) at high packet loss rates.
Fig. 2 is a simplified block diagram of a communication system 100 according to an embodiment of the present invention, where the communication system 100 is only an application scenario of the present invention, and should not be construed as limiting the application scenario of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
According to fig. 2, the communication system comprises: a terminal (terminal)10, a server 20 and a network 30; in which the terminal 10 accesses the Network 30 through an access device, such as a WLAN (Wireless Local Area Network) access point or an access point of a cellular Network, and establishes a connection with the server 20 based on a specific Network protocol, and the server 20 transmits data, such as a video stream, to the terminal 10 using the established connection according to a request of the terminal 10.
Terminals, devices that provide voice and/or data connectivity to a user, including wireless terminals or wired terminals. The wireless terminal may be a handheld device having wireless connection capability or other processing device connected to a wireless modem. For example, the wireless terminal may be a mobile telephone (or referred to as a "cellular" telephone) or a computer having a mobile terminal. As another example, a wireless terminal may be a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device. For another example, the wireless terminal may be a mobile station (mobile station) or a part of a User Equipment (UE). The term "packet" in the description and claims of the present invention and the above-mentioned figures is the basic unit of network transmission, and is data organized in a certain format. Different types of network protocols define the format of data packets differently, but in general, a data packet can be divided into a header (header) and a payload (payload), wherein the header contains information necessary for the transmission of the data packet, such as address information, flag bits, etc., and the payload, also called data portion, contains the data content to be transmitted.
Network 30 may include a public network, a private network, a portion of the internet, and/or any combination thereof. For the sake of brevity, other portions of the network 30 are not illustrated.
Server 20 may be an application server, a server proxy, a data center server, or a gateway. Those skilled in the art will appreciate that a communication system may generally include fewer or more components than shown in fig. 2, and fig. 2 illustrates only those components that are more relevant to the disclosed implementation of an embodiment of the invention. For example, although three terminals 10 and one server 20 are shown in fig. 2, one skilled in the art will appreciate that a communication system may include any number of terminals and servers.
Fig. 3 shows main components of a sending end according to an embodiment of the present invention, where the sending end may be a server or a terminal, and the sending end is described below as a server, and according to fig. 3, the sending end includes a processor 201, a memory 202, and a Network Interface Card (NIC) 203. The memory 202 stores therein an executable program 21, the executable program 21 including: an operating system and an application program. The processor 201 may run the executable program 21 in the memory 202 to implement a specific function. In order to establish a communication connection between a transmitting end and a receiving end and transmit a data packet based on the established connection, multiple network protocols must be used, the protocols are combined together according to layers to form a Protocol Suite (Protocol Suite), and a component that implements the function of the Protocol Suite is called a Protocol Stack (Protocol Stack). As shown in fig. 3, the server 20 and the terminal 10 include a protocol stack 204 and a protocol stack 11, respectively. After being processed by the protocol stack 204, the data packet is sent to the terminal 10 through the transmitting circuit 231 of the network card 203; the receiving circuit 232 receives data packets of the application 12 running on the terminal 10 and passes them to the protocol stack 204 for processing. Wherein the protocol stack may be implemented by a suitable combination of software, hardware and/or firmware. In one embodiment, the Protocol stack 204 and the Protocol stack 11 include a TCP/IP (Transmission Control Protocol/Internet Protocol) Protocol stack, which refers to a Protocol stack implemented by referring to a Protocol family defined by a TCP/IP reference model, and the Protocol family includes two core protocols: TCP (transmission control protocol) and IP (internet protocol), the protocol family contains protocols that are classified into 5 abstract "layers" according to the definition of the TCP/IP reference model: the physical layer, the link layer, the network layer, the transport layer, and the application layer are defined in the prior art, and are not described in detail in the embodiments of the present invention.
It should be understood that between the TCP/IP protocol stack and the application layer, is the SSL layer 13 as described above. The SSL layer 13 is only schematically depicted in fig. 3 in the terminal. In the server, the SSL layer may also exist. It should also be understood that, in the prior art, the SSL layer at the upper layer cannot know the information of the lower layer (e.g., the link state information of the TCP connection, which may include round trip delay RTT, congestion window CWND, etc.).
According to the scheme, an adjusting module is deployed below an application layer above a TCP protocol layer, and can detect the link state of a TCP connection, so that the MFL is adjusted according to the link state of the connection, the MFL is flexibly matched with the link state of a network connection, and the performance of the TCP connection, such as transmission delay and the like, is improved. It should be understood that the module is used at the originating end of the data. Since the TCP connection is used to transmit data, the data may be transmitted between network devices or between a network device and a terminal, and the network device may be the server described above or other devices in the network that may run the application layer. In a TCP connection, either the network device or the terminal may be the origin of the data.
The adjustment module may be a set of programs inserted in the TLS layer, or a thread, a process, or a container for implementing the above-described functions. The specific implementation manner of the adjustment module is not limited in this application.
That is, the present invention provides a method for adjusting the size of TLS record, which is based on TCP layer information (e.g., TCP _ info _ struct) that can be obtained by continuously learning TCP data during actual communication. For example, at least one parameter of RTTVAR or CWND is used in the method to adjust the specification of the TLS record. It learns from changes in the delay, specification or congestion window of the TCP data so that the length of the packet can be changed multiple times, and thus the length of the packet can match the TCP window. In this way, the HoL bottleneck problem due to larger size packets can be overcome to some extent. In one implementation, the default MFL record specification may be maintained during the handshake process, and once the handshake process is complete, the TLS record specification may be adjusted according to RTTVAR during the transmission of the application data.
Moreover, those skilled in the art will appreciate that server 20 may include fewer or more components than those shown in FIG. 3, and FIG. 3 illustrates only those components that are more relevant to the various implementations disclosed by the embodiments of the invention.
Hereinafter, a communication procedure to which the present application relates is briefly described. First, since SSL performs data transmission based on TCP protocol, a TCP link, that is, a three-way Handshake (TCP Handshake), needs to be established between a receiving end and a transmitting end (that is, a client and a server) performing data transmission. Next, an SSL Handshake is performed, which includes three phases of Client/Server Key Exchange (Client/Server Key Exchange), certificate/Key/password Negotiation and Exchange (Cert/Key/Cipher spec Negotiation and Exchange), and Handshake completion (Handshake Complete). In the SSL handshake process, the client and the server need to complete SSL chain establishment, and the TLS record specification is not dynamically adjusted in the stage. As shown in fig. 4, in an implementation, before the SSL chain is established, the sending end configures a default MFL, and after the SSL handshake is established, the sending end sends data to the receiving end using the default MFL. In the method provided by the present application, along with the transmission of the data packet, the sending end adjusts the size of the MFL, so that the sending end can use the adjusted MFL fragment data. Adjusting the MFL may be regarded as a function of the adjusting module. That is, the specification of the TLS record is equal to the MFL. Adjusting the value of the MFL adjusts the specification of the TLS record.
That is, the present application describes a method for sending a packet, including: a sending end of a first TCP connection sends a first message of the first TCP connection, the maximum fragment length MFL of the first TCP connection is a first value, the MFL represents the specification of a maximum Transport Layer Security (TLS) record used for transmitting data by the first TCP connection, and the specification of the TLS record of the first message is the first value; the sending end determines that link state information of the first TCP connection changes, wherein the link state information is used for representing transmission performance of the TCP connection; according to the change of the link state information, the transmitting end adjusts the MFL of the first TCP connection to a second value; the sending end sends a second message of the first TCP connection to the opposite end of the first TCP connection, and the MFL of the second message is the second value.
Wherein the first TCP connection is a certain TCP connection.
The method for sending the message uses the MFL as the specification of the TLS record, and adjusts the value of the MFL based on the link information of the TCP connection corresponding to the TLS, so that the specification of the TLS record can be flexibly adjusted according to the link state of the TCL connection, the time delay of obtaining data by an application layer is reduced, the data transmission is smoother, and the communication performance is improved.
The link state information includes at least one of a round trip time RTT, a congestion window CWND, and a packet loss rate.
Wherein, the value range of the MFL is more than or equal to 1300Byte and less than or equal to 16 KB.
In one implementation, the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change in the link state information includes: calculating the successful message sending probability of the first TCP connection by using the changed link state information; adjusting the MFL of the first TCP connection to a second value where the probability increases, wherein the second value is greater than the first value; adjusting the MFL of the first TCP connection to a second value where the probability decreases, where the second value is less than the first value.
Reference is made in particular to the following according to Px(L) take the description of the relevant paragraph of MFL that matches the current link state.
In one implementation, the link state information includes a round trip delay RTT, and the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link state information includes: adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the RTT increases; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the RTT decreases.
Reference is made in particular to the following according to Px(L) takes the description of the relevant section of the MFL that matches the current link state, and the associated code.
In one implementation, the MFL has a preset value range, the link state information includes round trip delay RTT, and the adjusting, by the sending end, the MFL of the first TCP connection to the second value according to the change of the link state information includes: adjusting the MFL of the first TCP connection to a second value that is half of the first value if the RTT increases and the first value is less than a maximum value in the range of values; in the event that the RTT decreases and the first value is greater than the minimum value in the range of values, adjusting the MFL of the first TCP connection to a second value, the second value being twice the first value; adjusting the MFL of the first TCP connection to a second value when the RTT increases and the first value is a maximum value in the value range, or when the RTT decreases and the first value is a minimum value in the value range, the second value being equal to the first value.
Link status may be measured by rtt, in particular, with reference to the following, such that rtt changes affect the relevant paragraphs of MFL changes.
In one implementation, the MFL has a preset value range, the link state information includes a congestion window CWND, and the adjusting, by the sending end, the MFL connected to the first TCP to the second value according to the change of the link state information includes: adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the CWND is increased; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the CWND is decreased.
In one implementation, the MFL has a preset value range, the link state information includes a congestion window CWND, and the adjusting, by the sending end, the MFL connected to the first TCP to the second value according to the change of the link state information includes: when the CWND is increased, adjusting the MFL of the first TCP connection to a second value, wherein the second value is the smaller value of the product of the CWND and the maximum message length MSS of the first TCP connection and the first value, and when the product is smaller than the minimum value in the value range, the second value is the minimum value in the value range; adjusting the MFL of the first TCP connection to a second value when the CWND is reduced, wherein the second value is a larger value of a product of the CWND and a maximum message length MSS of the first TCP connection and the first value, and the second value is a maximum value of the value range when the product is larger than a maximum value of the value range.
Link status may be measured by CWND, in particular, as described below, such that CWND changes affect the relevant paragraph of MFL changes.
In one implementation, the determining that the link state information of the first TCP connection changes includes: when a message is received or sent, detecting link state information of the first TCP connection to determine that the link state information changes; or detecting the link state information of the first TCP connection according to a preset time or a preset time interval to determine that the link state information changes.
The adjustment P may be triggered in a variety of ways, particularly with reference to the adjustment module described hereinafterxParagraph (L).
The following describes in detail implementations of the above-described method, and to implement these implementations, the above-described adjusting module needs to be added.
The scheme of the present application can be considered to measure link states to dynamically adjust the MFL based on the link states. The main logic of the realization is as follows:
using probability P (i.e. P)x(L)) to measure the link state, where Px(L) represents the probability of success in transmitting a packet of data size X if the link status is L. It should be understood that Px(L) should actually be P (X, L), i.e., a binary function related to X, L, but for analytical convenience one of the two variables is often fixed and the relationship of the other variable to P is discussed, e.g., when L and P are concerned, it is written as Px(L). In the following analysis, X is used to denote MFL, i.e. the size of TLS record (size of TLS record) is identified.
It should be understood that the probability of success in sending the data packet indicates that the data packet is successfully transmitted from the originating end to the receiving end in one go without problems of packet loss, retransmission, etc. Wherein, Px(L) is related to the link status L, L can be measured by Round Trip Time (RTT), loss rate (loss rate), Congestion Window (CWND) and other factors, and the larger L, the worse the link status, and therefore Px(L) will be correspondingly smaller. Specifically, the following rules were followed
(a) When the round trip delay RT of the linkWhen T becomes large, L becomes large, Px(L) becomes smaller;
(b) when the loss rate becomes higher, L becomes higher, P becomes higherx(L) becomes smaller;
(c) when the congestion window CWND becomes larger, L becomes larger, Px(L) becomes smaller.
For example, in one implementation, it may be assumed here that P is fixed to X when the packet size is fixedx(L) and link state L are in a power-law distribution relationship, i.e. Px(L)=cL-rHere, c and r are constants larger than 0.
The adjustment module may trigger the adjustment P in a variety of waysx(L). For example, an event trigger mechanism. Specifically, the current link state may be detected when the originating terminal sends the application data through the TLS layer, or the receiving terminal receives the application data through the TLS layer, and of course, the link state may also be saved. In this way, when the originating terminal transmits application data through the TLS layer or the receiving terminal receives application data through the TLS layer, the comparison is performed with the link state recorded before, and when the link state changes (for example, at least one of RTT, loss rate, and CWND is detected to change), P is adjusted according to the rule using the relationship between the preset link state and PxThe value of (L).
It should be understood that this indicates that during an event such as the originating terminal sending application data through the TLS layer or the receiving terminal receiving application data through the TLS layer, or a short time after the event occurs (it should be understood that a delay due to program execution or a processing delay may be tolerated).
In another implementation, a timer mechanism may also be used for triggering. Specifically, a time threshold may be set, and in the case that the timer runs beyond the time threshold, the current link status may be detected and compared with the link status recorded before, (it should be understood that in the case that the timer runs out, the detected link status may be recorded). Then in the event a link status change is detected (e.g., RT detected)At least one of T, loss rate, and CWND) is changed), P is adjusted according to the above rule using a preset relationship between the link state and Px(L) and restarting the timer to wait for the next timeout before detecting the link status.
It should be understood that other ways of triggering adjustment P may be used as wellxThe value of (L) is not a limitation on the embodiments of the present invention.
The adjusting module can be according to Px(L) adjusting the value of MFL. It is to be understood that PxX in (L) represents the data amount of the packet. Since the packet is encapsulated using the MFL specification, at Px(L) in the case of taking a value, PxThe value of X corresponding to (L) is the value of Px(L) the value of the corresponding MFL. In one implementation, the MFL is first set within a suitable range of values, i.e., the MFL is always within the range regardless of changes in subsequent MFLs. Specifically, the Min _ MFL is 1300 bytes, the Max _ MFL is 16384 bytes, and the value of the MFL ranges from Min _ MFL to Max _ MFL. So set up because: (1) a Maximum Transmission Unit (MTU) in a TCP protocol is generally 1500 bytes (Byte), and since operations such as data filling and MAC addition need to be performed on a record in the process of SSL encrypting data, the size of original data before encryption of 1500 bytes (Byte) TCP data is about 1300 bytes (Byte), so that the minimum Min _ MFL is 1300 bytes (Byte); (2) the maximum TLS record is specified in SSL RFC as 16KB (byte), so the maximum Max _ MFL is taken to be 16KB (byte).
The adjustment module may use a variety of ways to adjust according to Px(L) adjusting the MFL. In one form, can be according to Px(L) take the MFL that matches the current link state. For example, according to the foregoing, it is assumed that X has a value range of: {1300,2k,3k,4k,5k,6k,7k,8k,9k,10k,11k,12k,13k,14k,15k,16k }, it being understood that 2k denotes 2KB, 3k denotes 3KB, 4k denotes 4KB, and the remainder 5k to 16k are similar. . Respectively calculating P according to possible values X of MFLx(L) and then setting MFL to correspond to the maximum PxX of (L), i.e. MFL ═ X { Max (P)x(L)), X ═ 1300,2k,3k … 16k, 16 k. In thatIn one case, if it is calculated that the transmission probabilities of a plurality of xs are equal and are all larger than the values of other xs, that is, a plurality of xs can make Px(L) taking the maximum value, then the larger of these X values is taken as MFL, (i.e., if P isX1(L)=PX2(L)=MAX(Px(L)), but X2>X1, MFL ═ X2). This approach can theoretically guarantee the highest probability of successful transmission for the currently selected MFL value.
In another implementation, exponential scaling may be used, i.e., MFL follows Px(L) is exponentially changed. For example, when L changes thereby causing Px(L) when the MFL becomes larger, the MFL is adjusted to be twice of the original value of the MFL; when L changes thereby causing Px(L) when the MFL becomes smaller, adjusting the MFL to be one half of the original value of the MFL; when P is unchanged, MFL is unchanged. It should be understood that the range of MFL is always within the preset range, i.e., [1300 bytes, 16384 bytes]Within.
In yet another implementation, the adjustment may be made in a progressive manner. For example, when PxWhen (L) becomes larger, the MFL is adjusted to be the product of CWND and MSS, and the larger value of the original value of MFL is expressed by a formula, that is, MFL is Max (old _ MFL, CWND × MSS); when P is presentxWhen (L) becomes smaller, the MFL is adjusted to be the product of CWND and MSS, and the smaller value of the original value of the MFL is expressed by a formula, that is, MFL is min (old _ MFL, CWND × MSS); when P is unchanged, MFL is unchanged. It should be understood that the range of MFL is always within the preset range, i.e., [1300 bytes, 16384 bytes]Within.
It should be understood that other ways to depend on P may also be usedx(L) the value of MFL is adjusted, and embodiments of the present invention are not limited.
On the other hand, the probability of success of data transmission can be considered from the viewpoint of the amount of data (or the number of data). That is, the specification of the TLS record (denoted as S, i.e., MFL) can also be adjusted in the following manner. Suppose that Pr _ s (K) is the probability of successful transmission of data K in a TLS record, and that the data in the TLS record that precedes the data K has been successfully transmitted. Wherein, the data K can be understood as the TCP number of the data at the receiving endAccording to the number K, it will be understood by those skilled in the art that the actual data, i.e., the data numbered 1, to the data K, includes the size of the data, and the unit of K is KB. For example, K is 1, i.e., Pr _ s (K) may be considered to indicate the probability of successful transmission of 1Kb of data. In other words, Pr _ s (K) means P as described hereinbeforex(L), K can be regarded as PxX in (L). That is, the specification (S) of the TLS record may be represented by K, where Pr _ S (K) is related to at least one of RTT, loss rate (loss rate), and congestion window (cwnd). CWND changes cause a change in Pr _ s (K). For example, if cwnd increases, Pr _ s (k) decreases. On the other hand, the change of the packet loss rate also causes the change of Pr _ s (K). For example, if the packet loss rate increases, Pr _ s (k) decreases. That is, S varies with Pr _ S (k), which varies with link quality parameters such as RTT, loss rate (loss rate), and congestion window (cwnd).
If Pr _ S (K) decreases, S also decreases. Let K be 1,2,4,8,16, and Pr _ s (K-1) > Pr _ s (K-2) > Pr _ s (K-4) > Pr _ s (K-8) > Pr _ s (K-16). Usually, the initial value starts with a smaller value of K, for example, K is set to 1, so that no more data can be transmitted (flood) into the network. At each update point in time, S is updated to S _ i such that S _ i is i max { Pr _ S (K i), i is 1,2,4,8,16}, that is, the value of K is updated to the value corresponding to K that takes the maximum value of Pr _ S (K) at the update point in time.
The method performed by the adjustment module to adjust the MFL value is described below in conjunction with code. First, the definitions of some parameters involved in the following code are explained:
a) curr _ MFL is the Maximum Fragment Length (MFL) used for the current data transfer.
b) default _ MFL is the default value for MFL. For example, it may be 16K.
c) max _ MFL is the maximum value to which the MFL can be increased.
d) min _ MFL is the minimum value to which the MFL can be reduced.
e) new _ MFL is a new value of the MFL to be set for data transmission.
f) curr _ rtt is estimated from tcp _ info, the current value of rtt.
g) prev _ rtt is the previous value of rtt, which was estimated during the last message transmission.
h) curr _ cwnd is estimated from tcp _ info, the current value of cwnd.
i) prev _ cwnd is the previous value of cwnd estimated during the last message transmission
j) MSS is the value of the largest segment estimated from tcp _ info.
In one implementation, the link state is measured by rtt, so that rtt changes affect MFL changes. For example, it can be designed such that: the MFL has a predetermined initial value, and is limited to a value range of 1300,2k,4k,8k,16k, it being understood that 2k denotes 2KB, 4k denotes 4KB, and the rest 8k and 16k are similar. When it is detected that rtt is increased, which indicates that the link condition is degraded, the MFL is reduced to half of the original value (i.e. the value before the rtt change) (but when the MFL is 2k, the value is 1300 bytes after the MFL is reduced due to the limitation of the value range); when rtt is detected to be smaller, which indicates that the link condition becomes better, the MFL is expanded to 2 times of the original value (but for 1300 bytes of MFL, the value is 2k after the MFL is expanded due to the limitation of the value range); the MFL size is maintained unchanged in the event that other changes in TCP link status are detected or in the event that changes in TCP link status are not detected.
In one case, the C language design code is as follows:
Figure BDA0001224675690000121
in yet another case, during initialization, some parameters are initialized, wherein curr _ MFL is set to default _ MFL, that is, MFL is first set to a preset value, max _ MFL is set to 16KB, and min _ MFL is 1300 Byte. The following code may be used:
Figure BDA0001224675690000122
that is, when a rtt change is detected, the value of MFL is changed only if the original value of MFL (i.e., the value before the rtt change, i.e., curr _ MFL) is greater than min _ MFL (i.e., 1300Byte), or if the original value of MFL is less than max _ MFL (i.e., 16KB), otherwise (i.e., curr _ MFL ═ 1300Byte or curr _ MFL ═ 16KB), the value of MFL is unchanged even if rtt changes. It should be appreciated that in order for the code described above to be able to adjust the MFL value according to rtt changes, default _ MFL should be set to a value greater than min _ MFL and less than max _ MFL.
In another implementation, the link state is measured by cwnd, so that cwnd changes affect MFL changes. For example, it can be designed such that: the current cwnd value is estimated based on a trigger condition (e.g., timing), and if a change in the value of cwnd is found, then a new value is assigned to the MFL, i.e., the original value of MFL is increased or decreased (i.e., the value prior to the change in cwnd, i.e., curr _ MFL). In one implementation, during initialization, some parameters are initialized, wherein curr _ MFL is set to default _ MFL, that is, MFL is first set to a preset value, max _ MFL is set to 16KB, and min _ MFL is 1300 Byte. In addition, an MSS may be introduced to control the variation of the MFL value together with cwnd. It can be implemented with the following code:
Figure BDA0001224675690000123
Figure BDA0001224675690000131
that is, in the case where cwnd becomes small, that is, cwnd detected is smaller than the previous cwnd (curr _ cwnd < prev _ cwnd), then: if the product of the current cwnd and the MSS (curr _ cwnd MSS) is less than min _ MFL, adjusting the MFL (new _ MFL) to min _ MFL, i.e. ensuring that the value of the MFL is not less than a preset minimum value; if the product of the current cwnd and the MSS is less than curr _ MFL (the original value of MFL), adjusting MFL (new _ MFL) to be the product of cwnd and MSS; in other cases, the original value of MFL is not changed (new _ MFL ═ curr _ MFL).
In the case that cwnd becomes large, i.e. the detected cwnd is larger than the previous cwnd (curr _ cwnd > prev _ cwnd), then: if the product of the current cwnd and the MSS (curr _ cwnd MSS) is greater than max _ MFL, adjusting the MFL (new _ MFL) to max _ MFL, i.e. ensuring that the value of the MFL is not greater than a preset maximum value; if the product of the current cwnd and the MSS is larger than curr _ MFL (the original value of MFL), adjusting MFL (new _ MFL) to be the product of cwnd and MSS; in other cases, the original value of MFL is not changed (new _ MFL ═ curr _ MFL).
In other cases, that is if cwnd is not changed, or in the case where other changes in TCP link state are detected or in the case where no changes in TCP link state are detected, the MFL size is maintained unchanged.
In summary, the present disclosure provides a method for sending a packet, which involves adjusting a specification (size) of a TLS record, and the method uses an MFL as the specification of the TLS record, and adjusts a value of the MFL based on link information of a TCP connection corresponding to the TLS, so that the specification of the TLS record can be flexibly adjusted according to a link state of a TCL connection, so that data transmission is smoother, and communication performance is improved.
On the other hand, as shown in fig. 5, the present application document describes an apparatus 500 for sending a packet, where the apparatus 500 includes a sending module 501 and an adjusting module 502, where the sending module 501 is configured to send a first packet of the first TCP connection, where a maximum fragment length MFL of the first TCP connection is a first value, the MFL indicates a specification of a maximum transport layer security TLS record used by the first TCP connection to transmit data, and a specification of the TLS record of the first packet is the first value;
the adjusting module 502 is configured to determine that link state information of the first TCP connection changes, where the link state information is used to indicate transmission performance of the TCP connection; and adjusting the MFL of the first TCP connection to a second value in accordance with the change in the link state information; the sending module 501 is further configured to send a second packet of the first TCP connection to an opposite end of the first TCP connection, where the MFL of the second packet is the second value.
In an implementation manner, the adjusting module 502 is configured to determine that the link state information of the first TCP connection changes when detecting that the apparatus receives a message or a message to be sent.
In another implementation, the adjusting module 502 is configured to periodically determine that the link state information of the first TCP connection changes at a preset time or according to a preset time interval.
The link state information includes at least one of a round trip delay RTT, a congestion window CWND, an average congestion window, and a packet loss rate.
Wherein, the value range of the MFL is more than or equal to 1300Byte and less than or equal to 16 KB.
It should be understood that the sending apparatus may send, to the opposite end (i.e. the receiving end) of the sending end in the first TCP connection, that is, the device indicated by the destination address in the TCP message corresponding to the first packet. Or may be an input/output (I/O) device that is considered to transmit to a physical machine corresponding to the sender.
The apparatus is a device corresponding to the above-described method embodiment, and therefore, reference is made to the foregoing description for various implementation manners, specific implementation details, and related technical effects of the apparatus. And in particular how to adjust the MFL in accordance with changes in the link state information, see the various implementations set forth above.
It should be understood that, in the apparatus, the adjusting module may be understood as being located between the application layer and the TCP protocol layer, and the adjusting module may be a process or a thread, or may be a piece of executable code.
Thus, the present document provides a device for sending a packet, where the device is related to adjusting the specification (size) of a TLS record, and the device uses an MFL as the specification of the TLS record, and adjusts the value of the MFL based on the link information of the TCP connection corresponding to the TLS, so that the specification of the TLS record can be flexibly adjusted according to the link state of the TCL connection, so that data transmission is smoother, and communication performance is improved.
It is to be understood that the transmitting end and the receiving end described in the above method embodiments may be implemented by any device having data transceiving capability. The sender may be a terminal or a server, for example. As shown in fig. 5, the transmitting-end apparatus 300 includes: a processing circuit 302, and a communication interface 304 and a storage medium 320 connected thereto.
The above mentioned adjusting module and the above mentioned method for sending a message may be implemented by the processing circuit 302 executing a program in the storage medium 320, and it should be understood that, regarding sending or receiving information of other devices to or from other devices, the processing circuit 302 needs to execute the program in the storage medium 320 to call the communication interface 304.
The processing circuitry 302 is used to process data, control data access and storage, issue commands, and control other devices to perform operations. The processing circuit 302 may be implemented as one or more processors, one or more controllers, and/or other structures operable to execute programs, etc. The processing circuit 302 may specifically include at least one of a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic component. A general-purpose processor may include a microprocessor, as well as any conventional processor, controller, microcontroller, or state machine. The processing circuit 302 may also be implemented as a combination of computing components, such as a DSP and a microprocessor.
The storage medium 306 may include a computer-readable storage medium, such as a magnetic storage device (e.g., hard disk, floppy disk, magnetic strip), an optical storage medium (e.g., Digital Versatile Disk (DVD)), a smart card, a flash memory device, Random Access Memory (RAM), Read Only Memory (ROM), programmable ROM (prom), erasable prom (eprom), registers, and any combination thereof. A storage medium 306 may be coupled to the processing circuit 302 such that the processing circuit 302 can read information and write information to the storage medium 306. In particular, the storage medium 306 may be integrated into the processing circuit 302, or the storage medium 306 and the processing circuit 302 may be separate.
The communication interface 304 may include circuitry and/or programming to enable bi-directional communication between the user device 300 and one or more wireless network devices (e.g., servers). The communication interface 304 may be coupled to one or more antennas (not shown in fig. 6) and include at least one receive circuit 316 and/or at least one transmit circuit 318. In one embodiment, the communication interface 304 may be implemented in whole or in part by a wireless modem.
In accordance with one or more aspects of embodiments of the present invention, the processing circuit 302 is adapted to execute a protocol stack program 320 stored in the storage medium 306 to implement some or all of the steps in the above-described method embodiments.
It should also be understood that the apparatus 500 is an apparatus that can send a TCP packet processed by the TLS protocol layer, and may be, for example, a terminal or a network device.
It should also be understood that the apparatus 500 may also be implemented by the transmitting end apparatus shown in fig. 6. For example, the sending module 501 may be implemented by the processing circuit 302 executing a program in the storage medium 320 to call the communication interface 304; on the other hand, the adjusting module 502 may be executed by the processing circuit 302 executing a program in the storage medium 320. As another example, the TCP/IP protocol stack, etc., mentioned above, may be stored in the storage medium 320.
While the above provides a detailed description of the method and apparatus for sending a message according to the embodiments of the present invention, the present invention applies specific examples to illustrate the principles and embodiments of the present invention, and meanwhile, for a person skilled in the art, according to the concepts of the present invention, there are changes in the specific embodiments and application ranges.

Claims (24)

1. A method for sending a message, the method comprising:
a sending end of a first TCP connection sends a first message of the first TCP connection, the maximum fragment length MFL of the first TCP connection is a first value, the MFL represents the specification of a maximum Transport Layer Security (TLS) record used for transmitting data by the first TCP connection, and the specification of the TLS record of the first message is the first value;
the sending end determines that link state information of the first TCP connection changes, wherein the link state information is used for representing transmission performance of the TCP connection;
according to the change of the link state information, the transmitting end adjusts the MFL of the first TCP connection to a second value;
and the sending end sends a second message of the first TCP connection to the opposite end of the first TCP connection, wherein the MFL of the second message is the second value.
2. The method of claim 1, wherein the link state information comprises at least one of a round trip delay RTT, a congestion window CWND, and a packet loss rate.
3. The method of claim 1, wherein the MFL has a value in a range of 1300 bytes or more and 16KB or less.
4. The method of claim 2, wherein the MFL has a value in a range of 1300 bytes or more and 16KB or less.
5. The method according to any of claims 1 to 4, wherein the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link status information comprises:
calculating the successful sending probability of the message corresponding to a plurality of values in the MFL value range by using the changed link state information;
and adjusting the MFL of the TCP connection to a second value of the plurality of values, wherein the probability of successful transmission of the message corresponding to the second value is the maximum value of the probabilities of successful transmission of the message corresponding to the plurality of values.
6. The method according to any of claims 1 to 4, wherein the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link status information comprises:
calculating the successful message sending probability of the first TCP connection by using the changed link state information;
adjusting the MFL of the first TCP connection to a second value where the probability increases, wherein the second value is greater than the first value;
adjusting the MFL of the first TCP connection to a second value where the probability decreases, where the second value is less than the first value.
7. The method according to any of claims 1 to 4, wherein the link state information includes a round trip delay RTT, and wherein the sender adjusting the MFL of the first TCP connection to a second value according to the change of the link state information comprises:
adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the RTT increases;
adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the RTT decreases.
8. The method according to any one of claims 1 to 4, wherein the MFL has a preset value range, the link state information includes round trip delay RTT, and the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link state information includes:
adjusting the MFL of the first TCP connection to a second value that is half of the first value if the RTT increases and the first value is less than a maximum value in the range of values;
in the event that the RTT decreases and the first value is greater than the minimum value in the range of values, adjusting the MFL of the first TCP connection to a second value, the second value being twice the first value;
adjusting the MFL of the first TCP connection to a second value when the RTT increases and the first value is a maximum value in the value range, or when the RTT decreases and the first value is a minimum value in the value range, the second value being equal to the first value.
9. The method according to any of claims 1 to 4, wherein the MFL has a preset value range, the link state information includes a congestion window CWND, and the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link state information includes:
adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the CWND is increased;
adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the CWND is decreased.
10. The method according to any of claims 1 to 4, wherein the MFL has a preset value range, the link state information includes a congestion window CWND, and the adjusting, by the sender, the MFL of the first TCP connection to a second value according to the change of the link state information includes:
when the CWND is increased, adjusting the MFL of the first TCP connection to a second value, wherein the second value is the smaller value of the product of the CWND and the maximum message length MSS of the first TCP connection and the first value, and when the product is smaller than the minimum value in the value range, the second value is the minimum value in the value range;
adjusting the MFL of the first TCP connection to a second value when the CWND is reduced, wherein the second value is a larger value of a product of the CWND and a maximum message length MSS of the first TCP connection and the first value, and the second value is a maximum value of the value range when the product is larger than a maximum value of the value range.
11. A method of sending a message, wherein the method of sending a message has all the features of any one of claims 1 to 10, and wherein the determining that the link state information of the first TCP connection has changed comprises:
when a message is received or sent, detecting link state information of the first TCP connection to determine that the link state information changes;
or detecting the link state information of the first TCP connection according to a preset time or a preset time interval to determine that the link state information changes.
12. An apparatus for sending a message, the apparatus comprising:
a sending module, configured to send a first packet of a first TCP connection, where a maximum fragment length MFL of the first TCP connection is a first value, where the MFL indicates a specification of a maximum transport layer security TLS record used by the first TCP connection to transmit data, and the specification of the TLS record of the first packet is the first value;
an adjustment module, configured to determine that link state information of the first TCP connection changes, where the link state information is used to indicate transmission performance of the TCP connection;
the adjusting module is further configured to adjust the MFL of the first TCP connection to a second value according to the change in the link state information;
the sending module is further configured to send a second packet of the first TCP connection to an opposite end of the first TCP connection, where the MFL of the second packet is the second value.
13. The apparatus of claim 12, wherein the link state information comprises at least one of a round trip delay RTT, a congestion window CWND, and a packet loss rate.
14. The apparatus of claim 12, wherein the MFL has a value in a range of 1300 bytes or more and 16KB or less.
15. The apparatus of claim 13, wherein the MFL has a value in a range of 1300 bytes or more and 16KB or less.
16. The apparatus according to any of claims 12 to 15, wherein in the aspect that the MFL of the first TCP connection is adjusted to a second value according to the change of the link state information, the adjusting module is configured to use the changed link state information to calculate a probability that the packet transmission corresponding to a plurality of values in the MFL value range is successful; and adjusting the MFL of the TCP connection to a second value of the plurality of values, wherein the probability of successful transmission of the message corresponding to the second value is the maximum value of the probabilities of successful transmission of the message corresponding to the plurality of values.
17. The apparatus according to any of claims 12 to 15, wherein in adjusting the MFL of the first TCP connection to a second value according to the change in the link state information, the adjusting module is configured to:
calculating the successful message sending probability of the first TCP connection by using the changed link state information; adjusting the MFL of the first TCP connection to a second value where the probability increases, wherein the second value is greater than the first value; adjusting the MFL of the first TCP connection to a second value where the probability decreases, where the second value is less than the first value.
18. The apparatus according to any of claims 12 to 15, wherein the link state information comprises a round trip delay RTT, and wherein the adjusting module is configured to, in adjusting the MFL of the first TCP connection to a second value according to a change in the link state information:
adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the RTT increases; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the RTT decreases.
19. The apparatus according to any of claims 12 to 15, wherein the MFL is preset with a value range, the link state information includes a round trip delay RTT, and in the aspect of adjusting the MFL of the first TCP connection to a second value according to the change of the link state information, the adjusting module is configured to adjust the MFL of the first TCP connection to a second value, where the RTT increases and the first value is smaller than a maximum value in the value range, and the second value is half of the first value;
in the event that the RTT decreases and the first value is greater than the minimum value in the range of values, adjusting the MFL of the first TCP connection to a second value, the second value being twice the first value;
adjusting the MFL of the first TCP connection to a second value when the RTT increases and the first value is a maximum value in the value range, or when the RTT decreases and the first value is a minimum value in the value range, the second value being equal to the first value.
20. The apparatus according to any of claims 12 to 15, wherein the MFL is preset with a value range, the link state information comprises a congestion window CWND, and the adjusting module is configured to adjust the MFL of the first TCP connection to a second value according to the change of the link state information
Adjusting the MFL of the first TCP connection to a second value, the second value being less than or equal to a first value, if the CWND is increased; adjusting the MFL of the first TCP connection to a second value, the second value being greater than or equal to the first value, if the CWND is decreased.
21. The apparatus according to any of claims 12 to 15, wherein the MFL is preset with a value range, the link state information comprises a congestion window CWND, and the adjusting module is configured to adjust the MFL of the first TCP connection to a second value according to a change of the link state information
When the CWND is increased, adjusting the MFL of the first TCP connection to a second value, wherein the second value is the smaller value of the product of the CWND and the maximum message length MSS of the first TCP connection and the first value, and when the product is smaller than the minimum value in the value range, the second value is the minimum value in the value range;
adjusting the MFL of the first TCP connection to a second value when the CWND is reduced, wherein the second value is a larger value of a product of the CWND and a maximum message length MSS of the first TCP connection and the first value, and the second value is a maximum value of the value range when the product is larger than a maximum value of the value range.
22. An apparatus for messaging, characterized in that the apparatus for messaging has all the features of the apparatus of any of claims 12 to 21, and in that the adjustment module is adapted to determine that the link state information of the first TCP connection has changed
When a message is received or sent, detecting link state information of the first TCP connection to determine that the link state information changes;
or detecting the link state information of the first TCP connection according to a preset time or a preset time interval to determine that the link state information changes.
23. A message sending device, configured to send a message, where the message sending device includes: a processor, a communication interface and a storage medium, wherein the storage medium stores a protocol stack program, the communication interface is used for transmitting and receiving information with other devices by executing the program in the storage medium, and the processor is used for realizing the method of any one of claims 1 to 11 by executing the instructions in the storage medium.
24. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by hardware, is capable of implementing the method of any one of claims 1 to 11.
CN201710076967.1A 2017-02-13 2017-02-13 Method and device for sending message Active CN108429700B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710076967.1A CN108429700B (en) 2017-02-13 2017-02-13 Method and device for sending message
PCT/CN2017/105870 WO2018145481A1 (en) 2017-02-13 2017-10-12 Method and device for transmitting packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710076967.1A CN108429700B (en) 2017-02-13 2017-02-13 Method and device for sending message

Publications (2)

Publication Number Publication Date
CN108429700A CN108429700A (en) 2018-08-21
CN108429700B true CN108429700B (en) 2021-04-20

Family

ID=63107905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710076967.1A Active CN108429700B (en) 2017-02-13 2017-02-13 Method and device for sending message

Country Status (2)

Country Link
CN (1) CN108429700B (en)
WO (1) WO2018145481A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111163037A (en) * 2018-11-07 2020-05-15 大唐移动通信设备有限公司 IP fragmentation optimization method and device
CN112911693B (en) * 2019-11-19 2022-03-29 大唐移动通信设备有限公司 Message processing method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050120213A1 (en) * 2003-12-01 2005-06-02 Cisco Technology, Inc. System and method for provisioning and authenticating via a network
CN101924771B (en) * 2010-08-26 2013-11-06 北京天融信科技有限公司 Core-level TCP adhering junction method for accelerating application proxy
US8843738B2 (en) * 2012-05-14 2014-09-23 Sierra Wireless, Inc. TLS abbreviated session identifier protocol
CN103929370A (en) * 2013-01-11 2014-07-16 中国科学院声学研究所 TCP congestion control method for bandwidth reservation network
CN103647759B (en) * 2013-11-26 2017-11-24 华为技术有限公司 The machinery of consultation of MSS a kind of and device
TWI580226B (en) * 2014-06-12 2017-04-21 智邦科技股份有限公司 Method for determining maximum segment size
CN105704084A (en) * 2014-11-24 2016-06-22 中兴通讯股份有限公司 Processing method of TCP connection, processing device and mobile terminal
CN105429910A (en) * 2015-11-06 2016-03-23 京信通信技术(广州)有限公司 Message transmission and processing method and device

Also Published As

Publication number Publication date
WO2018145481A1 (en) 2018-08-16
CN108429700A (en) 2018-08-21

Similar Documents

Publication Publication Date Title
US11570098B2 (en) Systems, apparatuses and methods for cooperating routers
Cui et al. Innovating transport with QUIC: Design approaches and research challenges
US9641650B2 (en) TCP proxy server
US7471681B2 (en) Determining network path transmission unit
BR112019009138B1 (en) APPLICATION CHARACTERIZATION USING TRANSPORT PROTOCOL ANALYSIS
US20120278492A1 (en) Using a server&#39;s capability profile to establish a connection
CN107645409B (en) Method and device for determining transmission fault reason of data
US8589586B2 (en) Method and apparatus for managing transmission of TCP data segments
CN110875799A (en) Transmission control method and device
US10524175B2 (en) Data transmission method and network device
WO2022017529A1 (en) Data transmission method and system, electronic device, and storage medium
US9917925B2 (en) Method for determining maximum segment size
US10382481B2 (en) System and method to spoof a TCP reset for an out-of-band security device
WO2012083762A1 (en) Data transmission method, apparatus, and system
CN108429700B (en) Method and device for sending message
EP3539235B1 (en) Systems, apparatuses and methods for cooperating routers
US11038994B2 (en) Technique for transport protocol selection and setup of a connection between a client and a server
US20230171191A1 (en) Systems, Apparatuses and Methods for Cooperating Routers
JP4447028B2 (en) Communication control method, transmission apparatus, and computer program
Vernersson Analysis of UDP-based reliable transport using network emulation
WO2020154872A1 (en) Transmission control protocol acceleration method and apparatus
JP2006005833A (en) Device, method and program for data communication, and recording medium
JP2009044694A (en) Method of counting number of transmission times of data unit, counting device, transmitter, and computer program
Bąk et al. Measurement methodology of TCP performance bottlenecks
CN117062257B (en) Multi-channel-based data transmission method, terminal equipment and target gateway

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
GR01 Patent grant
GR01 Patent grant