PACKET TRANSMISSION METHOD, TERMINAL, NETWORK DEVICE, AND COMMUNICATIONS SYSTEM
20190319889 ยท 2019-10-17
Inventors
Cpc classification
H04W28/06
ELECTRICITY
H04L47/263
ELECTRICITY
H04L69/161
ELECTRICITY
H04L47/34
ELECTRICITY
H04L69/163
ELECTRICITY
International classification
H04W28/06
ELECTRICITY
Abstract
A packet transmission method and related apparatus are disclosed. A transmit end retransmits a first packet to a receive end and decreases a congestion window and a slow start threshold upon determining that the first packet has been lost. The receive end sends an ACK in response to the retransmitted first packet to the transmit end on receipt of the retransmitted first packet for the first time, where the ACK contains a proactively constructed DSACK option for informing the transmit end that the first packet has been received repeatedly. The transmit end therefore compensates the congestion window and/or the slow start threshold.
Claims
1. A packet transmission method, comprising: receiving, by a terminal, a retransmitted packet, wherein the retransmitted packet is sent by a server after the server determines that a sent first packet has been lost, and a sequence number of the retransmitted packet is the same as a sequence number carried in the first packet; and upon receiving the retransmitted packet for the first time, sending, by the terminal to the server, a first acknowledgment packet used to respond to the retransmitted packet received for the first time, wherein the first acknowledgment packet comprises a repetition indication field, and the repetition indication field is used to indicate that the first packet has been received repeatedly, and is used to trigger the server to increase at least one of a congestion window size or a slow start threshold.
2. The method according to claim 1, wherein the first acknowledgment packet is sent by the terminal when the terminal receives for the first time a packet whose sequence number is the same as that of the first packet.
3. The method according to claim 1, wherein the first acknowledgment packet further comprises a SACK option, and the SACK option is used to indicate sequence number information of a packet that has been received by the terminal.
4. The method according to claim 3, wherein the repetition indication field comprises the sequence number of the first packet, and the repetition indication field is located in a 1.sup.st block of the SACK option in the first acknowledgment packet.
5. The method according to claim 3, wherein the repetition indication field comprises the sequence number of the first packet, the repetition indication field is located in a DSACK block, and the DSACK block is used to report a packet repeatedly received by the terminal to the server.
6. The method according to claim 1, wherein further comprising: establishing, by the terminal, a TCP connection to the server by using a wireless network, wherein the wireless network comprises at least one access point.
7. A terminal, comprising an application processor, a memory, and a communications subsystem, wherein the memory stores a protocol stack program; the communications subsystem is configured to receive a retransmitted packet, wherein the retransmitted packet is sent by a server after the server determines that a sent first packet has been lost, and a sequence number of the retransmitted packet is the same as a sequence number carried in the first packet; the application processor runs the protocol stack program in the memory, so as to: when the communications subsystem receives the retransmitted packet for the first time, construct a first acknowledgment packet used to respond to the retransmitted packet received for the first time, wherein the first acknowledgment packet comprises a repetition indication field, and the repetition indication field is used to indicate that the first packet has been received repeatedly, and is used to trigger the server to increase at least one of a congestion window size or a slow start threshold; and the communications subsystem is further configured to send the constructed first acknowledgment packet.
8. The terminal according to claim 7, wherein the communications subsystem is specifically configured to send the constructed first acknowledgment packet when a packet whose sequence number is the same as that of the first packet is received for the first time.
9. The terminal according to claim 7, wherein the first acknowledgment packet further comprises a SACK option, and the SACK option is used to indicate sequence number information of a packet that has been received by the terminal.
10. The terminal according to claim 9, wherein the repetition indication field comprises the sequence number of the first packet, and the repetition indication field is located in a 1.sup.st block of the SACK option in the first acknowledgment packet.
11. The terminal according to claim 7, wherein the terminal connects to a wireless network and establishes a TCP connection to the server, by using at least one access point.
12. A network device, configured to forward a packet between a transmit end and a receive end, wherein the network device comprises a processing circuit, a communications interface, and a storage medium; the communications interface is configured to: receive a retransmitted packet sent by the transmit end to the receive end, forward the retransmitted packet to the receive end, and receive a first acknowledgment packet of the receive end in response to the retransmitted packet, wherein the retransmitted packet is sent by the transmit end after the transmit end determines that a sent first packet has been lost, and a sequence number of the retransmitted packet is the same as a sequence number carried in the first packet; and the first acknowledgment packet is sent by the receive end when the receive end receives the retransmitted packet for the first time; the storage medium stores a protocol stack program, and the processing circuit is adapted to execute the protocol stack program stored in the storage medium, so as to: add a repetition indication field to the first acknowledgment packet to obtain a second acknowledgment packet, wherein the repetition indication field is used to indicate that the first packet has been received repeatedly, and is used to trigger the transmit end to increase at least one of a congestion window size or a slow start threshold; and the communications interface is further configured to send the second acknowledgment packet.
13. The network device according to claim 12, wherein the first acknowledgment packet is sent by the receive end when the receive end receives for the first time a packet whose sequence number is the same as that of the first packet.
14. The network device according to claim 12, wherein the first acknowledgment packet and the second acknowledgment packet both further comprise a SACK option, and the SACK option is used to indicate sequence number information of a packet that has been received by the receive end.
15. The network device according to claim 14, wherein the repetition indication field comprises the sequence number of the first packet, and the repetition indication field is located in a 1.sup.st block of the SACK option in the second acknowledgment packet.
16. The network device according to claim 14, wherein the network device is an access point, and the receive end connects to a wireless network and establishes a TCP connection to the transmit end, by using the network device.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0031] To describe the technical solutions in the embodiments of the present invention or in the prior art more clearly, the following briefly describes the accompanying drawings required for describing the embodiments or the prior art.
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
DESCRIPTION OF EMBODIMENTS
[0047] To make persons skilled in the art understand the technical solutions in the present invention better, the following clearly describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely some rather than all of the embodiments of the present invention.
[0048]
[0049] In the specification, claims, and accompanying drawings of the present invention, the term terminal is a device that provides voice and/or data connectivity for a user, for example, a wireless terminal or a wired terminal. The wireless terminal may be a handheld device with a wireless connection function, an Internet of Things device, or another processing device connected to a wireless modem. For example, the wireless terminal may be a mobile phone (or referred to as a cellular phone) or a computer having a mobile terminal. For another example, the wireless terminal may alternatively be a portable, pocket-sized, handheld, or computer built-in mobile apparatus, or an in-vehicle mobile apparatus. For still another example, the wireless terminal may be a part of a mobile station or user equipment (UE). The packet is a base unit of network transmission and is data organized in a specified format. There are different definitions for a packet format in different types of network protocols. However, usually, one packet may include a header and a payload. The header includes information that is necessary in a packet transmission process, for example, address information and a flag bit. The payload is also referred to as a data section of a packet, and includes data content to-be-sent. The terms first, second, third, fourth, and the like (if existent) are intended to distinguish between similar objects, but do not necessarily indicate a particular order or a specific sequence.
[0050]
[0051] The communications system 100 includes a terminal 110, an access point 10, a wireless access gateway 12, a wide area network 14, a first application server 20, a second application server 30, and a third application server 40. Persons skilled in the art may understand that one communications system may usually include fewer or more components than those shown in
[0052] For example, although three application servers 20, 30, and 40 have been described in
[0053] The terminal 110 includes an application controller 120, a TCP/IP protocol stack 130, and a wireless modem 140. The wireless modem 140 is connected to an antenna 142. Persons skilled in the art may understand that the terminal 110 may include fewer or more components than those shown in
[0054] The application controller 120 is configured to control and/or monitor an application that runs on the terminal 110. For example, a first application 121, a second application 123, and a third application 125 run under control of the application controller 120. The first application 121, the second application 123, and the third application 125 are client-side application of the first application server 20, the second application server 30, and the third application server 40, respectively. Persons skilled in the art may understand that the TCP/IP protocol stack 130 may be executed by a proper combination of software, hardware, and/or firmware. The TCP/IP protocol stack 130, the wireless modem 140, and the antenna 142 cooperate to complete data sending and receiving. The application controller 120 may be specifically a processor or a processor core.
[0055] The first application 121 may be a web page browser that requests information from the first application server 20. To facilitate communication between the first application 121 and the first application server 21, the first application 121 and the server both create a corresponding socket, establish a TCP/IP connection based on the socket, and then transmit data by using the TCP/IP connection. The client socket and the server socket are referred to as a socket pair. Each socket is usually described by using a unique 5-tuple structure. The unique 5-tuple structure includes a protocol ID, a source IP address, a destination IP address, a source port number, and a destination port number.
[0056] Establishment of the TCP/IP connection between the first application 121 and the first application server 21 may be initiated by the first application 121. The first application 121 generates a socket open command (socket open). The command is transferred to the TCP/IP protocol stack 130, to trigger the TCP/IP protocol stack 130 to establish a TCP/IP connection to the first application server 21 through three message interactions (also referred to as three handshakes); then the TCP/IP protocol stack notifies the first application 121 that the connection has been established.
[0057] Next, the first application 121 and the first application server 21 can transmit, based on the established TCP connection, data encapsulated into a TCP packet.
[0058] URG: urgent pointer in effect;
[0059] ACK: acknowledgment number in effect;
[0060] PSH: immediate sending to an application layer for processing;
[0061] RST: reset upon an exception;
[0062] SYN: a synchronization flag, where setting to 1 means a connection is established; and
[0063] FIN: a finish flag, requesting to release a connection.
[0064] The following describes TCP retransmission and congestion control mechanisms by using specific examples. For simplified descriptions, in this embodiment of the present invention, one of two connected devices is referred to as a transmit end, and the other device is referred to as a receive end. It can be understood that the transmit end and the receive end may be any device that has a transmitting and receiving capability. For example, the transmit end may be the server, and the receive end may be the terminal. In addition, the transmit end and the receive end are two opposing roles, and are interchangeable. To be specific, a device may be a transmit end in one scenario, and may be a receive end in a different scenario.
[0065] The TCP retransmission mechanism ensures reliable packet transmission, and the retransmission mechanism mainly includes timeout-based retransmission and fast retransmit. A basic process of timeout-based retransmission is: The transmit end starts a timeout timer after sending a packet, and the transmit end retransmits the packet if the timeout timer expires before receiving an acknowledgment packet indicating that the packet has been correctly received. A value of the timeout timer is usually expressed by a retransmission timeout (RTO). The RTO is usually set to be the same as an RTT (Round Trip Time), which is a time it takes for a packet to be sent plus a time it takes for an acknowledgment of that packet to be received. The RTT may be obtained through sampling.
[0066] A fast retransmit algorithm is not driven by time, but driven by data. As shown in
[0067] RFC 2018 proposes a selective acknowledgment (SACK) technology. A selective acknowledgment (SACK) option is added to an acknowledgment packet header, to indicate that the receive end has received and temporarily stored discontinuous data blocks. The transmit end may check, based on this information, which data has been lost. As shown in
[0068] TCP can ensure reliable data transmission by using the retransmission mechanism, but retransmission may also aggravate network congestion, especially when a network transmission delay is relatively long. To relieve the network congestion problem, TCP introduces congestion control algorithms. The congestion control algorithms mainly include: (1) a slow start algorithm; and (2) a congestion avoidance algorithm. A principle of the slow start algorithm is as follows:
[0069] (1) after a TCP connection is established, a congestion window is initialized as cwnd=1 (the full spelling of cwnd is Congestion Window), indicating that one packet or one piece of MSS (Maximum Segment Size) data can be sent;
[0070] (2) each time when an ACK is received, cwnd increments by 1, presenting a linear growth; and
[0071] (3) each time when an RTT expires, cwnd=cwnd * 2.
[0072] Specifically, as shown in
[0073] (1) when an ACK is received, cwnd=cwnd+1/cwnd; and
[0074] (2) each time when an RTT expires, cwnd=cwnd+1.
[0075] In this way, packets are prevented from increasing excessively quickly to lead to network congestion, but increase slowly until adjusted to an optimal value of a network.
[0076] Further, when a packet loss occurs in a data transmission process, timeout-based retransmission or fast retransmit is inevitably triggered, and when retransmitting a lost packet, the transmit end determines, based on the packet loss, that network congestion has occurred, and therefore reduces a congestion window size, so as to lower a speed of injecting packets into the network, thereby relieving network congestion. It can be understood that, in different algorithms, different definitions may be provided for a specific manner of reducing a congestion window size, and are not listed one by one herein. In addition, some congestion avoidance algorithms also help reduce a slow start threshold ssthresh while reducing the congestion window size.
[0077] Based on the retransmission upon packet loss and avoidance upon packet loss solutions, an embodiment of the present invention provides a packet transmission method. A basic principle of the packet transmission method includes: A receive end adds special information to a TCP header of an acknowledgment packet in response to a retransmitted packet received for the first time, to inform a transmit end that the retransmitted packet has been received repeatedly, and sends the acknowledgment packet to the transmit end; and after receiving the acknowledgment packet, the transmit end deduces, based on the special information carried in the acknowledgment packet, that this packet loss is disordered reception rather than a congestion-caused packet loss, and that retransmission and congestion window avoidance that are triggered because of this packet loss are unnecessary. Based on this, the transmit end compensates a congestion window size and a slow start threshold, thereby increasing a downlink throughput. The following describes the technical solution of the present invention by using a more specific embodiment.
[0078] As shown in
[0079] Step 701. After establishing a TCP connection to a receive end through three handshakes, a transmit end transmits a plurality of packets (for example, packets 1 to 4 in
[0080] Step 702. The receive end returns acknowledgment packets (shown by arrows from the receive end to the transmit end in
[0081] Optionally, in an embodiment, sequence numbers (seq) of packets sent by the transmit end increase progressively. An amplitude of the progressive increase is related to a quantity of bytes in a transmitted packet. For example, after three handshakes, first two packets sent by the transmit end are both 1440 bytes long, a seq of the 1.sup.st packet is an initial value 1, and then a seq of the 2.sup.nd packet is 1441. Correspondingly, if the receive end receives the 1.sup.st packet correctly, the receive end returns an acknowledgment packet in response to the 1.sup.st packet, to indicate that the 1.sup.st packet has been received and that an ack of the returned acknowledgment packet is the seq of the 2.sup.nd packet, that is, 1441. When the transmit end sends subsequent packets, a packet seq change and an ack change of an acknowledgment packet returned by the receive end may be derived by that analogy. In addition, for definitions of the seq and the ack, refer to
[0082] Optionally, after step 701, the transmit end may further record a largest sequence number of the sent packets, for subsequent packet loss detection.
[0083] Step 703. After determining, based on a packet loss detection algorithm, that a first packet has been lost, the transmit end immediately retransmits the lost first packet, and triggers a congestion avoidance algorithm to decrease a congestion window size and/or a slow start threshold. The first packet (that is, FR 3) that is retransmitted is also referred to as a retransmitted packet, and a sequence number of the retransmitted packet FR3 is the same as a sequence number carried in the first packet.
[0084] Step 705. After receiving the retransmitted packet FR 3 for the first time, the receive end immediately constructs a first acknowledgment packet corresponding to the retransmitted packet, and sends the first acknowledgment packet to the transmit end. The first acknowledgment packet includes a repetition indication field, and the repetition indication field is used to indicate that the first packet has been received repeatedly. The immediately described herein means being within a proper processing time interval after the retransmitted packet FR 3 is received, where the time interval is greater than or equal to 0, and is less than or even far less than a period of a timeout timer for the first packet. For example, if the period of the timeout timer corresponding to the first packet is T, a predetermined time interval should be less than T, or less than T/2, or even less than T/4. Preferably, the predetermined time interval equals 0 or approaches 0, which means that the receive end sends the first acknowledgment packet almost simultaneously upon receiving the retransmitted packet FR3.
[0085] Specifically, in an embodiment, before receiving the retransmitted packet FR3 for the first time, the receive end has not received any packet whose sequence number is the same as that of the retransmitted packet FR3 (which is the same as sequence number of the first packet). In other words, the first acknowledgment packet is sent by the receive end when the receive end receives for the first time a packet whose sequence number is the same as that of the first packet.
[0086] Step 707. The transmit end receives the first acknowledgment packet, and compensates the congestion window size based on a repetition indication field carried in the first acknowledgment packet. Specifically, the transmit end deduces, based on a packet sequence number in the repetition indication field, that the first packet has been received in disorder rather than lost because of congestion, and that the retransmission and congestion window avoidance that are triggered because of the loss of the first packet are unnecessary. Therefore, the transmit end increases a congestion window size. Optionally, in an embodiment, the transmit end also increases a slow start threshold while increasing the congestion window size.
[0087] In step 703, there are a plurality of packet loss detection algorithms that can be used by the transmit end. Using a fast retransmit mechanism shown in
[0088] Optionally, in step 703, the transmit end may alternatively start timeout-based retransmission after the timeout timer for the first packet expires, to retransmit the first packet. For specific implementation details of timeout-based retransmission, refer to the foregoing embodiment. Usually, timeout timer periods set for all packets by a protocol stack are the same. In other words, all the packets have the same timeout timer period.
[0089] Similarly, there are a plurality of congestion avoidance algorithms for step 703. In an embodiment, if a loss of the first packet leads to timeout-based retransmission, the transmit end may decrease the slow start threshold to cwnd/2, and then set cwnd to 1, to enter a slow start process again. In another embodiment, after determining, based on the ACK, that the first packet has been lost and starting fast retransmit, the transmit end may decrease the congestion window size by half and set the slow start threshold to an updated congestion window size. In another embodiment, alternatively, after determining that the first packet has been lost, the transmit end may only decrease the congestion window size by , , or another proper value, but not adjust the slow start threshold. It can be understood that, for different congestion avoidance algorithms, the amplitude and manner for reducing the congestion window size and the slow start threshold vary, but all based on the principle of avoidance upon packet loss. That is, after determining that a network packet loss has occurred, the transmit end proactively decreases the congestion window size and/or the slow start threshold.
[0090] For specific implementation details about the congestion avoidance algorithm, refer to
[0091] In step 705, the receive end determine, based on the sequence number of the received retransmitted packet and a sequence number of a packet that has currently been received and stored temporarily, whether the retransmitted packet is received for the first time.
[0092] Optionally, in an embodiment, the repetition indication field in step 705 includes the sequence number of the first packet. In another embodiment, the repetition indication field may include both the sequence number and a length (usually described in bytes) of the first packet.
[0093] Optionally, in an embodiment, if the transmit end and the receive end have both enabled a SACK option, the repetition indication field is located in the SACK option in the first acknowledgment packet. Preferably, the repetition indication field may be located in the 1.sup.st block of the SACK option in the first acknowledgment packet. The block may also be referred to as a DSACK (Duplicate SACK) block, and is used to report a duplicate packet received by the receive end to the transmit end. For example, the receive end proactively constructs a field including the sequence number of the first packet, and inserts the field into the 1.sup.st block of the SACK option in the first acknowledgment packet. After the insertion, if the SACK option in the first acknowledgment packet exceeds a maximum limit (four blocks), the last block is deleted.
[0094] In another embodiment, the repetition indication field is located in another unoccupied field in a header of the first acknowledgment packet. In another embodiment, alternatively, the repetition indication field and an existing field in a header of the first acknowledgment packet may use a same field. For example, in a field having 32 bytes occupied by the ack field, some bytes may be assigned to the repetition indication field.
[0095] In the packet transmission method provided in this embodiment of the present invention, for the retransmitted packet that has been received only once, the receive end adds the repetition indication field containing the sequence number of the retransmitted packet to the header of the acknowledgment packet in response to the retransmitted packet, and sends the acknowledgment packet to the transmit end, to deceive the transmit end into believing that the retransmitted packet has been received repeatedly, and after receiving the acknowledgment packet containing the repetition indication field, the transmit end deduces, based on the sequence number recorded in the repetition indication field, that the congestion window avoidance because of previous retransmission of the packet having the sequence number is unnecessary, and based on this, the transmit end compensates the congestion window size and/or the slow start threshold.
[0096] The following table describes results of testing the packet transmission method provided in this embodiment of the present invention in a network environment. The packet transmission method provided in this embodiment of the present invention is used in a wireless network scenario, and a downlink throughput of a mobile terminal increases by about 30%.
TABLE-US-00001 Mobile Mobile Mobile phone 1 phone 2 phone 3 Computer Sequence (before (before (after Computer (before (after Number optimization) optimization) optimization) optimization) optimization) 1 1.53 MB/s 1.47 MB/s 1.73 MB/s 1.19 MB/s 2.01 MB/s 2 1.64 MB/s 1.39 MB/s 2.19 MB/s 1.38 MB/s 2.23 MB/s 3 1.62 MB/s 1.28 MB/s 2.15 MB/s 1.51 MB/s 2.51 MB/s 4 1.48 MB/s 1.30 MB/s 2.15 MB/s 1.33 MB/s 2.57 MB/s 5 1.32 MB/s 1.42 MB/s 2.33 MB/s 1.70 MB/s 2.20 MB/s 6 1.38 MB/s 1.40 MB/s 2.17 MB/s 1.47 MB/s 2.42 MB/s 7 1.35 MB/s 1.52 MB/s 2.14 MB/s 1.62 MB/s 2.53 MB/s 8 1.47 MB/s 1.45 MB/s 2.37 MB/s 1.68 MB/s 2.55 MB/s 9 1.31 MB/s 1.31 MB/s 2.14 MB/s 1.52 MB/s 2.69 MB/s 10 1.38 MB/s 1.50 MB/s 2.12 MB/s 1.50 MB/s 2.99 MB/s 11 1.44 MB/s 1.55 MB/s 2.32 MB/s 1.42 MB/s 2.74 MB/s 12 1.51 MB/s 1.69 MB/s 2.30 MB/s 1.30 MB/s 2.49 MB/s Average 1.45 MB/s 1.44 MB/s 2.18 MB/s 1.47 MB/s 2.49 MB/s
[0097] In another scenario, if the transmit end and the receive end have both enabled a timestamp option, each TCP packet includes two timestamp fields (TSval and TSecr). Usually, lengths of both TSval and TSecr are 32 bits. TSval is used to represent a timestamp for the transmit end to send a TCP packet, and when sending an ACK in response to the TCP packet, the receive end echoes a TSval value of the TCP packet to the TSecr field in the ACK when sending the ACK in response to the TCP packet. Because the TCP connection is bidirectional, the receive end places its current timestamp into the TSval field when echoing TSecr in the ACK. The timestamp is a value that increases progressively in a monotonic manner along with time. Because the receive end only needs to simply echo TSval in the ACK, both sides of communication do not need to perform time synchronization. Specifically, as shown in
[0098] Further, in a scenario in which the transmit end and the receive end have both enabled a timestamp option, based on the principle of the packet transmission method described in the embodiment related to
[0099] S1. After determining, based on a received acknowledgment packet, that a packet has been lost, a transmit end retransmits the lost packet, and decreases a congestion window size and/or a slow start threshold. As shown in
[0100] S2. After receiving for the first time the retransmitted packet (for example, the packet having the sequence number 31 in
[0101] S3. The receive end reads TSval field values in timestamp options of packets whose sequence numbers are immediately before and immediately after the sequence number of the retransmitted packet, respectively, where the TSval field values are respectively denoted by TS.sub.before and TS.sub.after, and TS.sub.beforeTS.sub.after; and then calculates an approximate TSval value, denoted by TS.sub.xmit, that is less than TS.sub.rexmit, based on a squeeze theorem or another similar algorithm. The approximate TSval value makes TS.sub.beforeTS.sub.xmitTS.sub.after hold true. For example, as shown in
[0102] S4. The receive end constructs an acknowledgment packet in response to the retransmitted packet according to a TCP protocol specification, where a TSecr field value of the constructed acknowledgment packet is set to the calculated approximate TSval value TS.sub.xmit, instead of an actual transmission timestamp of the retransmitted packet. In other words, the receive end forges the timestamp of the retransmitted packet. As shown in
[0103] S5. The receive end sends the constructed acknowledgment packet to the transmit end.
[0104] S6. After receiving the acknowledgment packet constructed in S5, the transmit end deduces, based on a timestamp recorded in the TSecr field in the acknowledgment packet, that this acknowledgment packet is in response to a previously sent packet that has a same sequence number, instead of the retransmitted packet (in other words, the packet having this sequence number is not lost), and that the retransmission and congestion window avoidance that are triggered because of a determined loss of the packet having this sequence number are unnecessary; and based on this, the transmit end compensates a congestion window size and/or a slow start threshold.
[0105] In the packet transmission method provided in this embodiment of the present invention, for the retransmitted packet that has been received only once, the receive end forges a timestamp option to deceive the transmit end into believing that the retransmitted packet has been received repeatedly, and the transmit end further deduces that the congestion window avoidance because of previous retransmission of the packet having the sequence number is unnecessary, and based on this, compensates the congestion window size and/or the slow start threshold, achieving an effect similar to that of the packet transmission method shown in
[0106] It should be noted that in the packet transmission method described in the embodiment related to
[0107] In an embodiment, functions of the transmit end described in the embodiment related to
[0108] In another embodiment, functions of the receive end described in the embodiment related to
[0109] It can be understood that the packet transmission method described in this embodiment of the present invention may be further applied to a network device. The network device is an access point or a router, and is configured to forward a packet between the transmit end and the receive end.
[0110] As shown in
[0111] Similarly, in a SACK option enabled scenario, after a receive end returns an acknowledgment packet in response to a retransmitted packet, a network device may also use the method described in step 705 in
[0112] As shown in
[0113] The communications subsystem 330 is a basic communications unit of the terminal 300. In an embodiment, the communications subsystem 330 is a wireless modem (Modem), and mainly performs functions such as baseband processing, modulation, demodulation, signal amplification and filtering, and balancing. The communications subsystem 330 includes a baseband processor 331, a radio frequency module 332, and an antenna 333. The baseband processor 331 and the application processor 310 may be integrated into one chip. In another embodiment, the baseband processor 331 and the application processor 310 may be deployed separately: The baseband processor 331 and the application processor 310 act as two separate chips to exchange information in an inter-core communication mode. In this separate deployment manner, the baseband processor 331 is equivalent to a peripheral of the application processor 310. The two processors require respective independent external memories and respective independent software upgrade interfaces.
[0114] The radio frequency module 332 is mainly responsible for signal sending and receiving. The baseband processor 331 is responsible for signal processing, for example, A/D or D/A conversion of a signal, signal coding and decoding, and channel coding and decoding. The baseband processor 331 supports one or more of wireless communications standards. The wireless communications standards herein include but are not limited to GSM, CDMA 1, CDMA2000, WCDMA, HSPA, LTE, and the like. In an embodiment, the radio frequency module 332 includes radio frequency circuits that perform functions such as radio frequency receiving and sending, frequency synthesis, and power amplification. The radio frequency circuits may be packaged in a radio frequency chip. In another embodiment, some or all of the radio frequency circuits included in the radio frequency module 332 and the baseband processor 331 are jointly integrated into a baseband chip.
[0115] The memory 320 usually includes a memory and an external storage device. The memory may be a random access memory (RAM), a read-only memory (ROM), a high-speed cache (CACHE), or the like. The external storage device may be a hard disk, an optical disk, a USB disk, a floppy disk, a tape drive, or the like. The executable program is usually stored in the external storage device. The application processor 310 loads the executable program to the memory from the external storage device, and then executes the program.
[0116] Optionally, the terminal 300 further includes a Wireless Fidelity (Wi-Fi) module 350. The Wi-Fi module 350 supports the IEEE 802.11 protocol series. The terminal 300 may connect to a wireless local area network (WLAN) by using the Wi-Fi module 350. In an embodiment, the Wi-Fi module 350 may be a Wi-Fi chip, and communicates with the application processor 310 by using a bus. In another embodiment, the Wi-Fi module 350 may be integrated into the communications subsystem 330, for example, the baseband processor 331.
[0117] It can be understood that the communications subsystem 330 and the Wi-Fi module 350 are both configured to receive data from the outside or send data of the terminal 300 to an external device. The terminal 300 usually includes both the communications subsystem 330 and the Wi-Fi module 350, to support both cellular network access and WLAN access. However, considering costs or another factor, alternatively, the terminal 300 may include only one of the communications subsystem 330 and the Wi-Fi module 350.
[0118] Optionally, the terminal 300 further includes a display 360 configured to display information entered by a user or information provided for a user, various menu interfaces of the terminal 300, and the like. The display 360 may be a liquid crystal display (LED), an organic light-emitting diode (OLED), or the like. In some other embodiments, a touch panel may cover the display 360 to form a touch display screen.
[0119] In addition, the terminal 300 may further include a camera 380 configured to take photos or shoot videos and one or more sensors 370 such as a gravity sensor, an acceleration sensor, or an optical sensor.
[0120] In addition, persons skilled in the art may understand that the terminal 300 may include fewer or more components than those shown in
[0121] Specifically, as shown in
[0122] It should be noted that the term executable program used in this embodiment of the present invention should be widely explained as including but not being limited to an instruction, an instruction set, code, a code segment, a subprogram, a software module, an application, a software package, a thread, a process, a function, firmware, middleware, or the like.
[0123] An embodiment of the present invention provides a network device 400. As shown in
[0124] The processing circuit 402 is configured to: process data, control data access and storage, send a command, and control another component to perform an operation. The processing circuit 402 may be implemented as one or more processors, one or more controllers, and/or another structure that can be configured to execute a program. The processing circuit 402 may specifically include at least one of a general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), and a field programmable gate array (FPGA) or another programmable logical component. The general purpose processor may include a microprocessor and any conventional processor, controller, microprocessor, or state machine. The processing circuit 302 may be implemented as a computing component such as a combination of a DSP and a microprocessor.
[0125] The storage medium 406 may include a computer readable storage medium, such as a magnetic storage device (for example, a hard disk, a floppy disk, or a magnetic stripe card), an optical storage medium (for example, a digital versatile disc (DVD)), a smart card, a flash memory device, a random access memory (RAM), a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), a register, or any combination thereof The storage medium 406 may be coupled to the processing circuit 402, so that the processing circuit 402 can read information and write information into the storage medium 406. Specifically, the storage medium 406 may be integrated into the processing circuit 402. Alternatively, the storage medium 406 and the processing circuit 302 may be separate.
[0126] The communications interface 404 may include a circuit and/or a program to implement bidirectional communication with the terminal 400 and one or more wireless network devices (such as a router, a switch, or an access point). The communications interface 404 includes at least one receive circuit 416 and/or at least one transmit circuit 418. In an embodiment, an entire communications interface 404 or a part of the communications interface 404 may be implemented by a wireless modem.
[0127] In an embodiment, the storage medium 406 stores a protocol stack program 420. The processing circuit 402 is adapted to execute a protocol stack program 420 stored in the storage medium 406, to implement functions of a protocol stack. The protocol stack specifically implements some or all steps in the embodiment related to
[0128] Based on the packet transmission method described in the foregoing embodiments, an embodiment of the present invention further provides a packet transmission apparatus 500. As shown in
[0129] The packet transmission method and device provided in the embodiments of the present invention have been described in detail. The principle and implementations of the present invention have been described herein using specific examples. The descriptions of the embodiments of the present invention are merely intended to help understand the method and the core idea of the present invention. In addition, persons of ordinary skill in the art can make variations and modifications to the present invention in terms of specific implementations and the application scope based on the ideas of the present invention. Therefore, the content of this specification shall not be construed as to limit the present invention.