HOME

TheInfoList



OR:

TCP tuning techniques adjust the network congestion avoidance parameters of
Transmission Control Protocol The Transmission Control Protocol (TCP) is one of the main communications protocol, protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, th ...
(TCP) connections over high-
bandwidth Bandwidth commonly refers to: * Bandwidth (signal processing) or ''analog bandwidth'', ''frequency bandwidth'', or ''radio bandwidth'', a measure of the width of a frequency range * Bandwidth (computing), the rate of data transfer, bit rate or thr ...
, high- latency networks. Well-tuned networks can perform up to 10 times faster in some cases. However, blindly following instructions without understanding their real consequences can hurt performance as well.


Network and system characteristics


Bandwidth-delay product (BDP)

Bandwidth-delay product In data communications, the bandwidth-delay product is the product of a data link's capacity (in bits per second) and its round-trip delay time (in seconds). The result, an amount of data measured in bits (or bytes), is equivalent to the maximu ...
(BDP) is a term primarily used in conjunction with TCP to refer to the number of
bytes The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
necessary to fill a TCP "path", i.e. it is equal to the maximum number of simultaneous bits in transit between the transmitter and the receiver. High performance networks have very large BDPs. To give a practical example, two nodes communicating over a
geostationary satellite A geostationary orbit, also referred to as a geosynchronous equatorial orbit''Geostationary orbit'' and ''Geosynchronous (equatorial) orbit'' are used somewhat interchangeably in sources. (GEO), is a circular geosynchronous orbit in altitud ...
link with a
round-trip delay time In telecommunications, round-trip delay (RTD) or round-trip time (RTT) is the amount of time it takes for a signal to be sent ''plus'' the amount of time it takes for acknowledgement of that signal having been received. This time delay includes p ...
(or round-trip time, RTT) of 0.5 seconds and a bandwidth of 10
Gbit/s In telecommunications, data transfer rate is the average number of bits ( bitrate), characters or symbols ( baudrate), or data blocks per unit time passing through a communication link in a data-transmission system. Common data rate units are mu ...
can have up to 0.5×10 Gbits, i.e., 5 Gbit of unacknowledged data in flight. Despite having much lower latencies than satellite links, even terrestrial fiber links can have very high BDPs because their link capacity is so large. Operating systems and protocols designed as recently as a few years ago when networks were slower were tuned for BDPs of orders of magnitude smaller, with implications for limited achievable performance.


Buffers

The original TCP configurations supported ''TCP receive window size''
buffer Buffer may refer to: Science * Buffer gas, an inert or nonflammable gas * Buffer solution, a solution used to prevent changes in pH * Lysis buffer, in cell biology * Metal ion buffer * Mineral redox buffer, in geology Technology and engineeri ...
s of up to 65,535 (64 KiB - 1) bytes, which was adequate for slow links or links with small RTTs. Larger buffers are required by the high performance options described below. Buffering is used throughout high performance network systems to handle delays in the system. In general, buffer size will need to be scaled proportionally to the amount of data "in flight" at any time. For very high performance applications that are not sensitive to network delays, it is possible to interpose large end to end buffering delays by putting in intermediate data storage points in an end to end system, and then to use automated and scheduled non-real-time data transfers to get the data to their final endpoints.


TCP speed limits

Maximum achievable throughput for a single TCP connection is determined by different factors. One trivial limitation is the maximum bandwidth of the slowest link in the path. But there are also other, less obvious limits for TCP throughput. Bit errors can create a limitation for the connection as well as RTT.


Window size

In
computer networking A computer network is a collection of communicating computers and other devices, such as printers and smart phones. In order to communicate, the computers and devices must be connected by wired media like copper cables, optical fibers, or b ...
, RWIN (TCP Receive Window) is the amount of data that a
computer A computer is a machine that can be Computer programming, programmed to automatically Execution (computing), carry out sequences of arithmetic or logical operations (''computation''). Modern digital electronic computers can perform generic set ...
can accept without acknowledging the sender. If the sender has not received acknowledgement for the first packet it sent, it will stop and wait and if this wait exceeds a certain limit, it may even retransmit. This is how TCP achieves reliable
data transmission Data communication, including data transmission and data reception, is the transfer of data, signal transmission, transmitted and received over a Point-to-point (telecommunications), point-to-point or point-to-multipoint communication chann ...
. Even if there is no packet loss in the network, windowing can limit throughput. Because TCP transmits data up to the window size before waiting for the acknowledgements, the full bandwidth of the network may not always get used. The limitation caused by window size can be calculated as follows: \mathrm \le \frac \,\! where RWIN is the TCP Receive Window and RTT is the round-trip time for the path. At any given time, the window advertised by the receive side of TCP corresponds to the amount of free receive memory it has allocated for this connection. Otherwise it would risk dropping received packets due to lack of space. The sending side should ''also'' allocate the same amount of memory as the receive side for good performance. That is because, even after data has been sent on the network, the sending side must hold it in memory until it has been acknowledged as successfully received, just in case it would have to be retransmitted. If the receiver is far away, acknowledgments will take a long time to arrive. If the send memory is small, it can saturate and block emission. A simple computation gives the same optimal send memory size as for the receive memory size given above.


Packet loss

When
packet loss Packet loss occurs when one or more packets of data travelling across a computer network fail to reach their destination. Packet loss is either caused by errors in data transmission, typically across wireless networks, or network congestion.Ku ...
occurs in the network, an additional limit is imposed on the connection. In the case of light to moderate packet loss when the TCP rate is limited by the congestion avoidance algorithm, the limit can be calculated according to the formula (Mathis, et al.): \mathrm \le \frac where MSS is the maximum segment size and ''P''loss is the probability of packet loss. If packet loss is so rare that the TCP window becomes regularly fully extended, this formula doesn't apply.


TCP options for high performance

A number of extensions have been made to TCP over the years to increase its performance over fast high-RTT links ("long fat networks" or LFNs). TCP ''timestamps'' (RFC 1323) play a double role: they avoid ambiguities due to the 32-bit sequence number field wrapping around, and they allow more precise RTT estimation in the presence of multiple losses per RTT. With those improvements, it becomes reasonable to increase the TCP window beyond 64 kB, which can be done using the '' window scaling'' option (RFC 1323). The TCP ''selective acknowledgment'' option (SACK, RFC 2018) allows a TCP receiver to precisely inform the TCP sender about which segments have been lost. This increases performance on high-RTT links, when multiple losses per window are possible. Path MTU Discovery avoids the need for in-network fragmentation, increasing the performance in the presence of packet loss.


Tuning slow connections

The default IP queue length is 1000, which is generally too large. Imagine a Wi-Fi base station having a speed of 20 Mbit/s and an average packet size of 750 byte. How large should the IP queue be? A
voice over IP Voice over Internet Protocol (VoIP), also known as IP telephony, is a set of technologies used primarily for voice communication sessions over Internet Protocol (IP) networks, such as the Internet. VoIP enables voice calls to be transmitted as ...
client should be able to transmit a packet every 20 ms. The estimated maximum number of packets in transit would then be: Estimated buffer size = 20000000 * 0,020 / 8 / 750 = 66 A better queue length would be: ifconfig wlan0 mtu 1492 txqueuelen 100


See also

*
Bufferbloat Bufferbloat is the undesirable latency that comes from a router or other network equipment buffering too many data packets. Bufferbloat can also cause packet delay variation (also known as jitter), as well as reduce the overall network thro ...
* Explicit Congestion Notification


References


External links

* - TCP Extensions for High Performance * - TCP Selective Acknowledgment Options * - The NewReno Modification to TCP's Fast Recovery Algorithm * - Enhancing TCP Over Satellite Channels using Standard Mechanisms * - An Extension to the Selective Acknowledgment (SACK) Option for TCP * - A Conservative Selective Acknowledgment-based Loss Recovery Algorithm for TCP * {{IETF RFC, 4138, link=no - Forward RTO-Recovery (F-RTO): An Algorithm for Detecting Spurious Retransmission Timeouts with TCP and the Stream Control Transmission Protocol (SCTP)
TCP Tuning Guide
ESnet
The Cable Guy: TCP Receive Window Auto-Tuning

The Web100 Data Bandwidth Testing

DrTCP
- a utility for
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
(prior to
Vista Vista may refer to: Software *Windows Vista, the line of Microsoft Windows client operating systems released in 2006 and 2007 * VistA, (Veterans Health Information Systems and Technology Architecture) a medical records system of the United States ...
) which can quickly alter TCP performance parameters in the registry.
Information on 'Tweaking' your TCP stack
Broadband Reports
TCP/IP Analyzer
speedguide.net
NTTTCP Network Performance Test Tool
Microsoft Windows Server Performance Team Blog
Best Practices for TCP Optimization
- ExtraHop
Pittsburgh Supercomputing Center TCP tuning guide
- PSC Tuning Network performance