Overview

The TCP demo-applet simulates a single-directional unicast data transmission in a number of problematic scenarios. Although there are many factors that cause TCP to decease its transmission speed, I chose to focus on three problems: long delays, asymmetric networks, and errors. These problems are common on media that were not originally designed for interactive data communications such as satellites and cable-modems. A well planned 10/100 base Ethernet LAN should not experience any of these problems.

By changing the controls in the applet, the user can see the actual bandwidth that TCP enables in various network scenarios. The actual bandwidth value is calculated based on the formulas presented below.

 

Instructions

The TCP-Down applet has 4 controls:

  • Down-link - The bandwidth of the link from the sender to the receiver.
  • Up-link - The bandwidth of the link from the receiver to the sender.
  • Delay - The Round Trip Time (RTT) that it takes for data to transfer from one host to the other and back again.
  • Errors - The Bit Error Rage (BER) percentage of uniformly distributed errors in the link.
Set the desired scenario by changing the controls and click "Go". The animation will commence and the actual bandwidth will be presented. You can change the different controls during the animation without having to stop.

For best results, view the applet in a full-sized browser with a 1024/768 resolution.

 

Long Delays

In order to prevent packet loss caused by insufficient buffer space for the incoming data, TCP implements a mechanism called "Advertised Receive Window", in which the sender can only send a maximum number of bytes as explicitly allowed by the receiver. This mechanism is implemented by the receiver in each packet transmitted to the sender, such as ACK packets. Thus, a sender gets an allowance, sends the allowed number of bytes, and will then cease sending until the next ACK arrives, carrying the new allowance. The maximum size of this allowance, the RWIN, is limited to 64 Kbytes in TCP; however, most operating systems implement a maximum RWIN of 8-16 Kbytes (the TCP-Down applet assumes an RWIN of 16 Kbytes). As long as the delay between the sender and receiver is short, the ACKs travel quickly, presenting no problem. However, when the delay is long, the sender has to wait a relatively long time before sending data again, even if it has a free down-link. Therefore, it follows that the maximum transmission rate possible under this mechanism (and ignoring all other factors) is governed by the formula:

Max BPS = (Advertised receive Window) / (Round Trip Time)

Most network links have a short delay and the problem isn't felt. However, for links with an inherent long delay such as satellites, where the RTT is typically 500-700 ms, the maximum transmission speed is limited by this problem. Note that this problem is independent of the actual link capacity.

 

 

Error Detection and Recovery

Packets may be lost due to exceeding link capacity, exceeding buffering capacity in the network, or Bit Errors (BER) on the transmission links. TCP provides a reliable transport service, but in certain situations this reliability can involve significant speed penalties.

When a loss is detected, TCP takes steps to recover the lost data and reduce the assumed congestion level by dramatically reducing its transmission rate. The exact action taken depends on the way the loss was detected. If the loss was detected by a time-out, TCP will enter "slow start" mode where it starts transmitting at a slow rate and then doubles the transmission rate for every acknowledgement. If the loss was detected by the duplicate ACK mechanism, TCP will reduce its sending rate to a little more than 50% of the current rate, and go into "congestion avoidance" mode where the transmission rate is increased linearly instead of doubling.

The affect of errors on the actual bandwidth is calculated according to the following formula:

Max BPS = sqrt(MSS * 6) / (Round Trip Time) / sqrt(BER)

The calculations in the applet are based on an MSS of 1500 bytes, and a uniform distribution of bit errors.

 

 

The Asymmetry Problem

Many networks are provisioned in an asymmetric manner (meaning that the down-link is greater than the up-link), either in terms of allocated bandwidth, or even using a different technology for each direction (e.g. a hybrid satellite/dial-up network). This is especially inherent in Internet/Intranet environments, where traffic patterns typically exhibit intrinsic asymmetry. Unfortunately, asymmetry has been shown to be a problem for TCP.

TCP's sending rate is constrained by the rate at which ACK's arrive from the receiver. For every 2 data packets that the sender transmits, the receiver must return an ACK packet. Assuming that the data packets are full Ethernet packets (1518 bytes each), and that the ACK packet is a minimum size Ethernet packet (64 bytes), then the maximum ratio permitted between the down-link and the up-link for full speed transmission is 1518*2/64, or as shown in the following formula:

Max BPS = Min(down-link, up-link*47)

For example, given a dial-up link of 33.6 Kbps we will exceed the limit if we want more than about a T1 rate in the forward direction.

 

 

Bandwidth Calculation

The actual bandwidth is calculated according to the following algorithm:

The maximum throughput that each of the three performance-reducing factors (the delay problem, asymmetry problem, and errors problem) permits is calculated. The lowest of the three values is chosen and presented as the actual bandwidth.

 

 

References and Acknowledgments

TCP/IP Illustrated, Volume 1
R.W. Stevens
Addison-Wesley, 1993

Enhancing TCP Over satellite Channels using Standard Mechanisms, Request For comments, RFC 2488
M. Allman, D. Glover and L. Sanchez,
Internet Engineering Task Force (IETF), 1999
http://www.ietf.org/rfc/rfc2488.txt

Test results of BER effects on TCP/IP performance
Anil Agarwal
COMSAT Labs

Special thanks to Michael Orr, Flash Networks' CTO, for his guidance and support!

 

www.rad.com