Rethinking the TCP Nagle algorithm. - Mogul, J.C.
Modern TCP implementations include a mechanism, known as the Nagle algorithm, which prevents the unnecessary transmission of a large number of small packets. This algorithm has proved useful in protecting the Internet against excessive packet loads. However, many applications suffer performance problems as a result of the traditional implementation of the Nagle algorithm. An interaction between the Nagle algorithm and TCP's delayed acknowledgement policy can create an especially severe problems, through a temporary ?deadlock.? These flaws in the Nagle algorithm have prompted many application implementors to disable it, even in cases where this is neither necessary nor wise. We categorize the applications that should and should not disable the Nagle algorithm, and we show that for some applications that often disable the Nagle algorithm, equivalent performance can be obtained through an improved implementation of the algorithm. We describe five possible modifications, including one novel proposal, and analyze their performance on benchmark tests. We also describe a receiver-side modification that can help in some circumstances.
Keywords: Computer systems organization; Computer communication networks; Algorithms; Design