This application is related to U.S. patent application Ser. No. 10/983,131, now U.S. Pat. No. 7,058,058, filed on Nov. 4, 2004, entitled “Transparent Optimization for Transmission Control Protocol Initial Session Establishment”, the contents of which are hereby incorporated by reference.
The present invention relates to the field of networking and the communication of data over a network and more particularly to transparent optimization for transmission control protocol (TCP) flow control.
The transmission control protocol (TCP) is one of the most widely used and reliable data transport protocols across communications networks. One of TCP's primary distinctions and the reasons for its widespread use is a robust algorithm to share bandwidth between current TCP sessions. This sharing algorithm within TCP is generally know as “congestion control” since it attempts to avoid the problems of network congestion by automatically scaling back the data transfer to match the available bandwidth capacity. Multiple concurrent and reliable data transfers across a shared network link may result in high congestion if each of the data transfer sessions tries to fully utilize the link capacity. This high congestion may result in high packet loss, which in turn may cause a large number of packet retransmissions, ultimately resulting in network collapse. TCP's congestion control algorithm avoids this problem by automatically determining how much bandwidth is available and sharing the total available bandwidth equally with other concurrent TCP sessions. TCP's dynamic sharing algorithm is therefore a fundamental building block of data communications across a packet switched internet protocol (IP) network and has resulted in the adoption of TCP/IP as a universal communications standard.
TCP utilizes various internal algorithms to provide its capability of congestion control. These algorithms include flow control, slow start, packet reordering, packet loss detection, retransmission timers, and numerous other mechanisms to dynamically decrease or increase the data transmission rate based on network conditions.
Network latency is a common problem that affects network and application performance. Network latency is attributable to several factors, including physical distance, number of hops, switching and router relays, and network congestion. Because these factors are not constants, networks may have unpredictable latency over a period of time. The variation in network latency depends on the distance spanned by the network link and the transmission medium used by the link. For instance, a local high-speed dedicated line between two buildings within a metro area may experience 5 milliseconds (ms) of one-way latency, while a global long distance asynchronous transfer mode (ATM) link between the United States and Europe may have anywhere from 50 to 250 ms of one-way latency. Similarly, a satellite link typically incurs about 240 to 300 ms of one-way latency, due to the time to transmit a signal up to an orbiting satellite and back.
The impact of latency on network applications may be traced directly to the inefficiencies of TCP under conditions of network latency. Most network applications can be classified into short-transaction based “chatty” applications or bulk data transfer applications. Bulk data transfer applications typically transmit 100s of kilobytes or megabytes of data across the network with the total transfer times being measured in several seconds, minutes, and in many cases hours. Examples of such applications include networked file systems, archiving and storage applications, file transfer protocol (FTP) transfers, sharing and distribution of large engineering or design documents, etc. In these applications, the common performance bottleneck is often the latency across the network, which causes lower application throughput via TCP. In particular, the flow control algorithm within TCP often causes the lower application throughput and higher application response time.
TCP's flow control algorithm is a mechanism to prevent the receiver from receiving more data than it is capable of processing or buffering. For example, if the receiving TCP stack has a buffer to store 16 kilobytes of data, the sender is not allowed to transmit more than 16 kilobytes of data at any time to the receiver. The receiver continuously sends back acknowledgments to the sender throughout the data transfer stating how much additional data the receiver can accept. This additional data that the receiver can accept is known as the “window indication” (or “window advertisement”) and is included as a field in the TCP header.
The flow control algorithm operates efficiently and does not introduce any unnecessary delays when the receiver and the sender are separated by a short distance low latency link. But as the distance and latency between the receiver and the sender is increased, the round-trip time (RTT) between sending a data packet and then receiving an acknowledgment from the receiver also increases. Since the flow control algorithm prevents the sender from transmitting data to the receiver when the receiver has not indicated that it is ready for this additional data, long RTTs between the two endpoints may cause the sender to delay sending additional data packets to wait for the next acknowledgment from the receiver. For example, if the receiver can accept 16 kilobytes of data at a time, then the sender may transmit all 16 kilobytes in a few milliseconds and then spend several additional milliseconds waiting for an acknowledgment to start transmitting the next block of 16 kilobytes. This period of time during which the sender is waiting for an acknowledgment depends on both the bandwidth and the link latency. The latency-based TCP idle time may cause a single TCP flow to achieve lower throughput than is actually available on the network link. This unused capacity translates into a higher transmission time since the TCP flow cannot utilize the full existing network bandwidth.
Flow pipelining is used for TCP connections that are limited in the rate at which they are able to transfer data because the maximum TCP window size configured on the receiver is smaller than the bandwidth-delay product of the network across which it is transferring the data. A conventional solution to this problem is for the receiver to advertise or indicate a window size that is bigger than the bandwidth-delay product of the network. However, for practical reasons, this indicated window size may be limited by the available memory on the receiver and the sender. As a result, a reasonable value is chosen by operating system developers and set as the default value of the window size. This value is adequate for most TCP connections across a local area network. But when a TCP connection is made across a high latency network, this value may not be adequate. The computers participating in the data transfer cannot dynamically discover and fix the small window size problem. This is because this problem can only be reliably observed by a device (which knows the bandwidth and current utilization of the long latency segment) processing data just before the longest latency segment of the network on the sender side. However, after this device determines that a particular transfer is window-limited, TCP provides no means for the device to inform the receiver that an increased window size is desired.
A solution that arbitrarily has this device increase the window size produces poor results because it generates a large amount of out of window data. Therefore, when there is a minor network error such as a single packet loss, this solution may cause a large amount of data that is outside of the receive window. The data that is outside of the receive window may be discarded by the receiver as it reaches the receiver. In addition to having the sender retransmitting the discarded data, it also causes the sender to misread the loss as a network congestion event and thus to slow down its transmission.
What is needed is a system and method for optimizing TCP's flow control to improve the performance of TCP sessions without intruding upon TCP's core algorithms.
The present invention is a system and method for optimizing TCP's flow control without intruding upon TCP's core algorithms. The invention bi-directionally monitors the state of TCP flows on both sides of a network pipe. A control module relatively near a sender's local area network (LAN) automatically identifies a packet flow that has become latency-limited (or “window-limited”) based on TCP header information. After the packet flow has been identified as window-limited due to the network latency, the control module relatively near the sender's LAN and another control module relatively near a receiver's LAN optimize this packet flow by increasing the window size indicated in the receiver's acknowledgment packet. Both control modules operate synchronously to transparently manage the packet flow between the sender and the receiver. This transparent optimization process allows the sender to maximize the amount of data in transit, thereby substantially minimizing the idle times during which the sender is waiting for additional acknowledgments from the receiver.
The features and advantages described in the specification are not all inclusive and, in particular, many additional features and advantages will be apparent to one of ordinary skill in the art in view of the drawings, specification, and claims. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter.
A preferred embodiment of the present invention is now described with reference to the figures where like reference numbers indicate identical or functionally similar elements. Also in the figures, the left most digit of each reference number corresponds to the figure in which the reference number is first used.
Reference in the specification to “one embodiment” or to “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
Some portions of the detailed description that follows are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of steps (instructions) leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical, magnetic or optical signals capable of being stored, transferred, combined, compared and otherwise manipulated. It is convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like. Furthermore, it is also convenient at times, to refer to certain arrangements of steps requiring physical manipulations of physical quantities as modules or code devices, without loss of generality.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussion, it is appreciated that throughout the description, discussions utilizing terms such as “processing” or “computing” or “calculating” or “determining” or “displaying” or “determining” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system memories or registers or other such information storage, transmission or display devices.
Certain aspects of the present invention include process steps and instructions described herein in the form of an algorithm. It should be noted that the process steps and instructions of the present invention could be embodied in software, firmware or hardware, and when embodied in software, could be downloaded to reside on and be operated from different platforms used by a variety of operating systems.
The present invention also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, application specific integrated circuits (ASICs), or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus. Furthermore, the computers referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.
The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may also be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any references below to specific languages are provided for disclosure of enablement and best mode of the present invention.
In addition, the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.
In one embodiment of the invention, control module 104 is located relatively nearer to receiver 102 than to sender 112, while control module 110 is located relatively nearer to sender 112 than to receiver 102. Accordingly, control module 104 is physically and logically associated with receiver 102, and control module 110 is physically and logically associated with sender 112.
After a TCP session has been established between receiver 102 and sender 112, TCP begins to provide flow control service to prevent sender 112 from overflowing the buffer of receiver 102. TCP flow control matches the rate at which sender 112 is sending application-layer data to the rate at which receiver 102 is reading the data. TCP provides flow control by having sender 112 maintain a variable called the receive window. The receive window is used to give sender 112 explicit information on how much free buffer space is available at receiver 102. The receive window is dynamic; that is, it changes throughout a TCP session's lifetime. Receiver 102 informs sender 112 how much spare room it has in the connection buffer by advertising its current value of the receive window in the window field of the TCP packet it sends to sender 112. By keeping the amount of unacknowledged data less than the value of the receive window, sender 112 can prevent itself from overflowing the receiver buffer at receiver 102.
At A, packet 1 arrives at receiver 102, which acknowledges it by sending an acknowledgment packet to sender 112 with an acknowledgment number (ACK) of 1000 and a window size (RcvWindow) of 1600. Since ACK+RcvWindow=2600, sender 112 can send packets 2, 3, and 4 to receiver 102. Sender 112 then sends packets 2 and 3 to receiver 102.
At B, packet 3 arrives at receiver 102, but packet 2 has been delayed at the network link. Receiver 102 sends another acknowledgment packet to sender 112 with ACK=1000 and RcvWindow=1600. Sender 112 sends packet 4 to receiver 102 at this time.
At C, packet 4 arrives at receiver 102, but packet 2 is still outstanding. Again, receiver 102 sends an acknowledgment packet to sender 112 with ACK=1000 and RcvWindow=1600. However, sender 112 cannot send packet 5 to receiver 102 at this time because it would bring up the sequence number to 2800, which is greater than ACK+RcvWindow. Sender 112 thus cannot send further packets to receiver 102 until receiver 102 sends a new acknowledgment packet to sender 112.
At D, the delayed packet 2 now reaches receiver 102. Receiver 102 sends an acknowledgment packet to sender 112 with ACK=2400 and RcvWindow=1600. In other words, receiver 102 slides or advances the receive window to allow sender 112 to send more data. This window advancement allows sender 112 to send data up to sequence number 4000 (i.e., ACK+RcvWindow=4000). Accordingly, sender 112 can send packets 5, 6, and 7 to receiver 102.
As can be seen, TCP's flow control algorithm prevents sender 112 from sending data to receiver 102 when receiver 102 has not indicated that it is ready for this additional data. As the distance and latency between receiver 102 and sender 112 is increased, the RTT between sending a packet and receiving an acknowledgment from receiver 102 also increases. Long RTTs between receiver 102 and sender 112 may cause sender 112 to delay sending additional packets to wait for the next acknowledgment from receiver 102.
Thus, in an embodiment of the invention, control module 104 and control module 110 cooperate to synchronously manage the packet flow between receiver 102 and sender 112. According to an embodiment of the invention, control modules 104 and 110 cooperate to increase the indicated window and to keep the pipeline increased to be greater than or equal to the product of network bandwidth and round-trip delay between receiver 102 and sender 112. Thus, embodiments of the invention optimize TCP's flow control by providing a larger indicated window for sender 112 to send data to receiver 102.
According to a preferred embodiment of the invention, control module 110 also characterizes the data packet as window-limited (e.g., by using one or more fields available in the TCP header or adding data to the data packet). Control module 110 can also characterize the data packet by using the lowest order bit of the window indication to indicate whether the current data packet is window-limited. After control module 110 characterizes the window-limited data packet, it sends the characterized data packet to receiver 102.
Before the characterized data packet reaches receiver 102, control module 104 associate with receiver 102 intercepts the characterized data packet and learns from seeing the characterization that this packet flow is window-limited. Control module 104 then removes the characterization from the data packet and sends the data packet to receiver 102. For a window-limited packet flow, control module 104 also increases the window indicated by receiver 102 if control module 104 has sufficient buffering resources. In particular, when receiver 102 sends one or more acknowledgment packets to sender 112, control module 104 intercepts these acknowledgment packets and increases 306 the indicated windows indicated in these acknowledgment packets. For example, the changed value of the window indication may be 64 kilobytes. According to an exemplary embodiment of the invention, control module 104 can set the value of the window indication to be as high as 1,073,725,440 bytes by negotiating the window scaling to a sufficiently high value during the connection setup. Control module 104 further sets a flag so that for a subsequent acknowledgment packet from the receiver it also increases the window indication.
Control module 104 sends the adjusted acknowledgment packets to sender 112. Sender 112 receives the adjusted acknowledgment packets and sees the adjusted window indicated in the acknowledgment packets. Because of the larger indicated window, sender 112 sends additional data packets to receiver 102, up to the amount allowed by the adjusted window. Before these data packets reach receiver 102, control module 104 intercepts 308 these data packets as they arrive at control module 104. Control module 104 then determines 310 if receiver 102 has already advanced its window far enough such that a particular data packet arriving from sender 112 is within the current window of receiver 102. In one embodiment of the invention, control module 104 can make this determination by monitoring packet flows from receiver 102 to sender 112. Specifically, control module 104 intercepts one or more acknowledgment packets sent by receiver 102 to sender 112 and determines if receiver 102 has advanced the window far enough to accommodate the data packet from sender 112 (e.g., by examining the acknowledgment number and window size). If receiver 102 has advanced the window far enough to accommodate the data packet, then control module 104 sends 312 the data packet directly to receiver 102 without storing the data packet in its buffer.
On the other hand, if receiver 102 has not advanced the window far enough to accommodate the data packet, control module 104 stores 314 the data packet in its buffer. While the data packet is stored in the buffer, control module 104 continues to monitor acknowledgment packets from receiver 102 to determine if receiver 102 has subsequently advanced the window. If control module 104 determines that receiver 102 has subsequently advanced the window far enough, it sends 316 the stored data packet to receiver 102. In an embodiment of the invention, if TCP timestamp is used in the data packet, control module 104 adjusts the timestamp of the data packet to be as recent as the latest data packet from sender 112 to receiver 102, before sending the data packet to receiver 102.
During the course of the TCP session, the packet flow may no longer be window-limited. For example, after receiver 102 advances its window, it sends one or more acknowledgment packets to sender 112. Based on the acknowledgment number and window size indicated in an acknowledgment packet, control module 110 determines that a data packet from sender 112 to receiver 102 no longer has a sequence number at or near the top of the indicated window and hence is not window-limited. Accordingly, control module 110 characterizes one or more data packets from sender 112 to receiver 102 as not window-limited. Control module 104 intercepts the characterized data packet on its way to receiver 102 and finds out that the packet flow is no longer window-limited. Therefore, for a subsequent acknowledgment packets sent by receiver 102 to sender 112, control module 104 intercepts the acknowledgment packet, adjusts the acknowledgment packet by reducing the indicated window, and forwards the acknowledgment packet to sender 112. In an embodiment of the invention, the amount of each reduction is such that the top of the indicated window remains constant. Control module 104 continues to reduce the indicated window until it reaches the size of the receive window. Moreover, control module 104 can continue to reduce the indicate window until the packet flow becomes window-limited. In this case, control modules 104 and 110 begin to increase the indicated window.
According to an embodiment of the invention, each time control module 104 or 110 changes any field of the TCP header, it also adjusts the checksum of the TCP header such that the checksum is correct if it was correct before the change and incorrect if it was incorrect before the change.
Furthermore, an embodiment of the invention also allows the reporting of control module performances. Specifically, the window indication that is stored in control module 110 along with the current sequence number and acknowledgment number is used to estimate the extent that the increase in window indication is increasing the rate of data transfer (which thus calculates an estimate of the data transfer rate without the optimization by control modules 104 and 110). This estimate can be used to continuously evaluate the efficacy of the optimization. However, with the larger window indication of this optimization, there are more packets passing through the network per second, and it is difficult to accurately estimate the times at which the same packets would pass through the network without the optimization. Accordingly, an embodiment of the invention finds out how much smaller each packet would have to be when not using the optimization so that the packets fit into the original window size, and have the rate at which packets arrive be the same as the rate of packet arrival with the optimization. Thus, the embodiment of the invention estimates how much smaller each packet would be if the packets arrive at the same rate as after the optimization. So for each packet, the following is calculated:
Size of the packet without optimization=True size of the packet*(original window size/(sequence number of the highest byte in the packet−the current acknowledgment number))
However, the size of the packet without optimization cannot be greater than the current true size of the packet. So if the calculation above produces a value that is greater than the current true size of the packet, then the value of the size of the packet without optimization is set to be the current true size of the packet.
This calculated number is accumulated over time to estimate the data transfer rate without the optimization. Specifically, the total size of packets without the optimization in a period (e.g., 1 second) provides the data transfer rate without the optimization. And the total of the true packet sizes in that period provides the data transfer rate with the optimization.
Control module 110 also characterizes 410 the data packet as window-limited and sends the characterized data packet to receiver 102. For example, control module 110 may characterize the data packet by using one or more fields available in the TCP header, adding data to the data packet, or using the lowest order bit of the window indication. Control module 110 monitors 412 subsequent packet flows between sender 112 and receiver 102. Control module 110 then determines 414 if the packet flow is still window-limited. If so, control module 110 continues to monitor the packet flows at 412. If not, control module 110 characterizes 416 a data packet from sender 112 to receiver 102 as not window-limited. The process flow then returns to 402.
Control module 104 also determines 512 if receiver 102 has advanced the window far enough to accommodate the data packet from sender 112. If receiver 102 has advanced the window far enough, control module 104 sends 514 the data packet without the characterization directly to receiver 102. The process flow then returns to 502. If receiver 102 has not advanced the window far enough, control module stores 516 the data packet in its buffer. When the window is advanced far enough, as indicated in one or more acknowledgment packets sent by receiver 102, control module 104 sends 518 the data packet without the characterization to receiver 102. The process flow then returns to 502. In an embodiment of the invention, if TCP timestamp is used in the data packet, control module 104 adjusts the timestamp of the data packet to be as recent as the latest data packet from sender 112 to receiver 102, before sending the data packet to receiver 102.
While particular embodiments and applications of the present invention have been illustrated and described herein, it is to be understood that the invention is not limited to the precise construction and components disclosed herein and that various modifications, changes, and variations may be made in the arrangement, operation, and details of the methods and apparatuses of the present invention without departing from the spirit and scope of the invention as it is defined in the appended claims.
This application is a continuation of U.S. application Ser. No. 10/981,900, filed Nov. 4, 2004, which claims the benefit of U.S. provisional Application No. 60/517,934, filed on Nov. 5, 2003, the entire content of each of which is incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
5163046 | Hahne et al. | Nov 1992 | A |
6252851 | Siu et al. | Jun 2001 | B1 |
6381638 | Mahler et al. | Apr 2002 | B1 |
6389462 | Cohen et al. | May 2002 | B1 |
6560243 | Mogul | May 2003 | B1 |
6564267 | Lindsay | May 2003 | B1 |
6587438 | Brendel | Jul 2003 | B1 |
6742044 | Aviani et al. | May 2004 | B1 |
6769030 | Bournas | Jul 2004 | B1 |
6772334 | Glawitsch | Aug 2004 | B1 |
6779033 | Watson et al. | Aug 2004 | B1 |
6826613 | Wang et al. | Nov 2004 | B1 |
7058058 | Singh et al. | Jun 2006 | B2 |
7158522 | Singh et al. | Jan 2007 | B1 |
7529246 | Singh et al. | May 2009 | B1 |
7583594 | Zakrzewski | Sep 2009 | B2 |
20010017844 | Mangin | Aug 2001 | A1 |
20020031088 | Packer | Mar 2002 | A1 |
20020172153 | Vernon | Nov 2002 | A1 |
20020181494 | Rhee | Dec 2002 | A1 |
20040008681 | Govindarajan et al. | Jan 2004 | A1 |
20040044796 | Vangal et al. | Mar 2004 | A1 |
20040193733 | Vangal et al. | Sep 2004 | A1 |
20050100056 | Chuberre et al. | May 2005 | A1 |
20050135250 | Singh et al. | Jun 2005 | A1 |
20050135252 | Singh et al. | Jun 2005 | A1 |
20050232161 | Maufer et al. | Oct 2005 | A1 |
20060154603 | Sachs et al. | Jul 2006 | A1 |
20070133605 | Herrmann | Jun 2007 | A1 |
20080056124 | Nanda et al. | Mar 2008 | A1 |
Number | Date | Country |
---|---|---|
WO 0002395 | Jan 2000 | WO |
Number | Date | Country | |
---|---|---|---|
20090274046 A1 | Nov 2009 | US |
Number | Date | Country | |
---|---|---|---|
60517934 | Nov 2003 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 10981900 | Nov 2004 | US |
Child | 12503230 | US |