CS FundamentalsHardGATE CS · Product company CS fundamentals

A remote-shell client writes one keystroke (1 byte) at a time to a TCP socket with Nagle's algorithm enabled; the RTT is 50 ms and the user types 40 keys per second. What does Nagle's algorithm do?

  1. A. Sends every keystroke immediately in its own segment, because the data is urgent
  2. B. Sends the first byte at once, then coalesces later keystrokes until the outstanding data is ACKed
  3. C. Holds all bytes until a full MSS has accumulated
  4. D. Holds all bytes until the 200 ms delayed-ACK timer fires

Correct answer: B. Sends the first byte at once, then coalesces later keystrokes until the outstanding data is ACKed

Nagle allows only one unacknowledged small segment in flight; bytes typed during the 50 ms wait are coalesced, so about 2 keys go in each segment here. It never waits for a full MSS when no data is outstanding, which is why it adds little delay for interactive traffic unless it meets delayed ACKs.

More Computer Networks questions

Exams that ask this topic