Skip to content
uencoder

TCP Cork

TCP Cork (TCP_CORK) pauses sending until a full MSS accumulates or the socket is explicitly uncorked, batching data to reduce packet counts.

Purpose

It reduces per-packet header overhead in scenarios where multiple small writes should be merged into a single TCP segment.

Mechanism

After setting TCP_CORK=1, the kernel buffers subsequent writes without sending until the data fills an MSS or the socket is uncorked. It is mutually exclusive with TCP_NODELAY, and it is used to send HTTP headers and body in one merged burst.

Use cases

  • Batching HTTP responses
  • Reducing TCP segment counts
  • Bulk sending

Related tools

References