|
This is a TCP concept. TCP guarantees reliable dilevery of data. It does this by using sequence numbers. Each byte of data gets a sequence number. Both sides of the connection keep the other side informed of the sequence number of the next byte of data it needs to recieve. The sequence numbers do not start at 0 or 1. The initial sequence number is random. So both sides need to syncronize ISN's. This establishes a TCP connection.
1. The client sends a packet with it's ISN. This packet has a SYN flag. This packet is addressed to some well-known port on the server. And it has the local port number the client has picked for itself.
2. The server send a packet back to client. This packet does two things. First it sets the ACK flag and and sets the ack number to the client's ISN+1. And it sets the SYN flag and sends it's own ISN.
3. The client sends a packet to ACK the server's ISN+1.
At this point both client and server know each other's sequence numbers.
|