Efficient data transmission with TCP

In this lesson, we'll study the main data transfer mechanisms used by TCP.

Segment Transmission Strategies

In a transport protocol such as TCP that offers a byte stream, a practical issue that was left as an implementation choice in RFC 793 was when a new TCP segment should be sent.

There are two simple and extreme implementation choices:

  1. Send a TCP segment as soon as the application has requested the transmission of some data.
    • Advantage: This allows TCP to provide a low delay service.
    • Disadvantage: If the application is writing data one byte at a time, TCP would place each byte in a segment containing 20 bytes of the TCP header. This is a huge overhead that is not acceptable in wide area networks.
  2. Transmit a new TCP segment once the application has produced MSS bytes of data. Recall MSS from this lesson on TCP Headers.
    • Advantage: Reduced overhead
    • Disadvantage: Potentially at the cost of a very high delay, which may be unacceptable for interactive applications.

Nagle’s Algorithm

An elegant solution to this problem was proposed by John Nagle in RFC 896 called Nagle’s Algorithm.

In essence, as long as there are unacknowledged packets, Nagle’s algorithm keeps collecting application layer data up to maximum segment size, to be sent together in a single packet. This helps reduce the packetization overhead by reducing small packets.

Get hands-on with 1400+ tech skills courses.