When the receiving end of a TCP connection sends its SYN/ACK packet(s?), are they sent separately? As in does the receiver send a packet with the control bit as SYN, with the receiving ends ISN, then a packet with the control bit set as ACK and its prediction of the senders next sequence number? Or can a packet contain both the SYN and ACK control bits with both the ISN and acknowledgement number?
The client begins the three-way handshake by sending a segment with the synchronize sequence number (SYN) control flag set, which indicates an initial value in the sequence number field. This value is known as the initial sequence number (ISN). The ISN is randomly chosen and is increased by one for each byte of data sent from the client to the server.
ACK : not set | SYN : set
The server must acknowledge the receipt of the SYN segment, so it sends a segment back with the ACK flag set. The client recognizes this as an acknowledgement that the server received the SYN from the client.
The value of the ACK number field is the ISN + 1.
The server also must initiate a response to the client. To achieve that the server uses the SYN flag in the same way that the client did. (So it is one segment)
ACK : set | SYN : set
The client responds with a segment containing ACK that is the response to the SYN sent by the server. There is no user data in this segment. The ACK field contains one more than the ISN received from the server.
After both sessions are established between client and server, all segments exchanged will have the ACK flag set.
ACK : set | SYN : not set
(Note: the whole conversation between the client and the server is actually two one-way sessions)