The Nagle Algorithm

The Nagle Algorithm (IETF RFC 896) is used within TCP/IP to automatically concatenate several small buffer messages. By reducing the number of sent packets, the Nagle Algorithm improves network efficiency, but it can also degrade the responsivity of the application. TCP/IP allows for the enabling or disabling of the Nagle Algorithm. Use the setsockopt function with TCP_NODELAY set to TRUE for disabled or FALSE for enabled. An example of enabling/disabling the Nagle Algorithm is contained within the client and server source code as a new command line argument (n=0 for enabling, n=1 for disabling).

Related Topics: