A. Petlund, K. R. Evensen, C. Griwodz, and P. Halvorsen (2008)
Latency reducing TCP modifications for thin-stream interactive applications
In: UpTimes - Magazine of the German Unix User Group (Proceedings of Linux Kongress 2008), ed. by W. Stief, pp. 150-154, German Unix User Group, Bachemer Str. 12, 50931 Köln, German Unix User Group (ISBN: 978-3-86541-300-0)
A wide range of Internet-based services that use reliable transport protocols display what we call thin-stream properties. This means that the application sends data with such a low rate that the retransmission mechanisms of the transport protocol are not fully effective. In time-dependent scenarios (like online games, control systems or some sensor networks) where the user experience depends on the data delivery latency, packet loss can be devastating for the service quality. Extreme latencies are caused by TCP's dependency on the arrival of new data from the application to trigger retransmissions effectively through fast retransmit instead of waiting for long timeouts. In order to reduce application-layer latency when packets are lost, we have implemented modifications to the TCP retransmission mechanisms in the Linux kernel. We have also implemented a bundling mechanisms that introduces redundancy in order to preempt the experience of packet loss. In short, if the kernel detects a thin stream, we trade a small amount of bandwidth for latency reduction and apply: Removal of exponential backoff: To prevent an exponential increase in retransmission delay for a repeatedly lost packet, we remove the exponential factor. Faster Fast Retransmit: Instead of waiting for 3 duplicate acknowledgments before sending a fast retransmission, we retransmit after receiving only one. Redundant Data Bundling: We copy (bundle) data from the unacknowledged packets in the send buffer into the next packet if space is available. These enhancements are applied only if the stream is detected as thin. This is accomplished by defining thresholds for packet size and packets in flight. Also, we consider the redundancy introduced by our mechanisms acceptable because the streams are so thin that normal congestion mechanisms do not come into effect. We have implemented these changes in the Linux kernel (2.6.23.8), and have tested the modifications on a wide range of different thin-stream applications (Skype, BZFlag, SSH, ...) under varying network conditions. The modifications are made available as a patch. Our results show that applications which use TCP for interactive time-dependent traffic will experience a reduction in both maximum and average latency, giving the users quicker feedback to their interactions. Availability of this kind of mechanisms will give Linux an edge when it comes to providing customizability for interactive network services. The quickly growing market for Linux gaming may benefit from lowered latency. As an example, most of the large MMORPG's today use TCP (like World of Warcraft and Age of Conan) and several multimedia applications (like Skype) use TCP fallback if UDP is blocked. The talk will outline the different aspects of using TCP for interactive time-dependent applications. We will present statistics from network traces from a range of thin-stream applications. A description of our developed mechanisms will be presented and compared to other related TCP modifications. We will also present the results from extensive tests performed using our modifications. We can also demonstrate our modifications.
