CS FundamentalsHardProduct-company placement

A client writes a 50-byte header and then a 200-byte body to a TCP socket as two separate write() calls, then waits for the reply. Nagle's algorithm is on at the client and delayed ACKs are on at the server. What typically happens?

  1. A. Both writes are sent at once because they fit in one MSS
  2. B. The body waits until the server's delayed ACK for the header arrives, adding up to the delayed-ACK timeout to each request
  3. C. The server discards the header because it is smaller than the MSS
  4. D. Nagle sends the body first since it is larger

Correct answer: B. The body waits until the server's delayed ACK for the header arrives, adding up to the delayed-ACK timeout to each request

Nagle holds small data while earlier data is unacknowledged, and the server delays its ACK hoping to piggyback on a reply it cannot produce without the body. The deadlock lasts until the delayed-ACK timer fires; the fix is one write (or TCP_NODELAY).

More Computer Networks questions

Exams that ask this topic