Does TCP send a SYN/ACK on every packet or only on the first connection?

前端 未结 3 1871
清歌不尽
清歌不尽 2020-12-12 16:07

I have a TCP server that listens for an incoming client, then sends it one packet of data every second. I was wondering, does the SYN/ACK packet only get sent on initial con

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 16:49

    Picture this: The original TCP standard RFC 793 allowed data to be sent with the first SYN packet though. However, that's not the case today. What you get is a separate SYN packet during initiation of the Three-Way-Handshake from the requestor of the connection. Suppose A requests to connect with B, thus A sends a packet with a SYN bit set. B responds with an ACK to acknowledge receipt and sends A the ACK + SYN packets. Data can then be transmitted henceforth.

    Dordal has a very good explanation on this matter. Click this link here.

提交回复
热议问题