Handshake delay of TCP connection


Reading essays of HTTP authoritative guide

Basic steps of TCP connection Handshake:

  1. When requesting a new TCP connection, the client sends a small IP packet to the server. This packet sets a special syn flag, indicating that this is a connection request.
  2. If the server accepts the request, it will calculate the connection parameters and send back a TCP packet to the client. The syn and ACK flags in this packet will be set, indicating that the connection has been accepted.
  3. Finally, the client sends back a confirmation message to the server, informing it that the connection has been established, and sends data in this confirmation packet.

Generally, HTTP transactions do not exchange too much data. At this time, syn and ACK handshakes will produce a measurable delay. The ACK packets of TCP connections are generally large enough to carry the entire HTTP request message, while the HTTP response message can generally be put into an IP packet.

conclusionYes: small HTTP transactions may take about 50% or more time to establish TCP. Therefore, some measures or strategies are needed to reduce the impact caused by TCP setup delay.