cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4241
Views
8
Helpful
2
Replies

Three Way Handshaking - Flag RST ACK

stefano.sassi
Level 1
Level 1

Dear All,

My question :

In the three way handshaking, the correct sequence number and ack number is like this :

1) Client : SYN, Seq=X

2) Server : SYN ACK=X+1, Seq=Y

3) Client : ACK=Y+1, Seq=X+1

The ACK number in the point #3 is correct in this case ? :

1) Client : SYN, Seq=X

2) Server : SYN ACK=X+1, Seq=Y

3) Client : ACK RST=Y+1, Seq=X+1

or is correct this :

1) Client : SYN, Seq=X

2) Server : SYN ACK=X+1, Seq=Y

3) Client : ACK RST=Y, Seq=X+1

Thank you in advance,

Stefano.

2 Replies 2

stschmidt
Level 1
Level 1

To establish a connection, TCP uses a 3-way handshake. Before a client attempts to connect with a server, the server must first bind to a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:

1. The active open is performed by sending a SYN to the server.

2. In response, the server replies with a SYN-ACK.

3. Finally the client sends an ACK back to the server.

At this point, both the client and server have received an acknowledgement of the connection.

Example:

1. The initiating host (client) sends a synchronization (SYN flag set) packet to initiate a connection. Any SYN packet holds a Sequence Number. The Sequence Number is a 32-bit field in TCP segment header. For example let the Sequence Number value for this session be x.

2. The other host receives the packet, records the Sequence Number of x from the client, and replies with an acknowledgment and synchronization (SYN-ACK). The Acknowledgment Number is a 32-bit field in TCP segment header. It contains the next sequence number that this host is expecting to receive (x + 1). The host also initiates a return session. This includes a TCP segment with its own initial Sequence Number value of y.

3. The initiating host responds with a next Sequence Number (x+1) and a simple Acknowledgment Number value of y + 1, which is the Sequence Number value of the other host + 1.

Hope this helps.

Stephen

Hi Stephen, Thanks for the suggestion, but my question it's little different : if the client does not answer whit a flag "ACK" but "ACK RST" , the ACK number will be "Y" or "Y+1" ? Thanks for the precious help, Stefano.

Review Cisco Networking for a $25 gift card