edited by
999 views
0 votes
0 votes

In the connection termination phase, suppose the FIN segment from the client-side contains data ranging from sequence no 100 to 200,

So will the ACK no from the server start from 201 or 202?  Will the FIN flag consume 1 extra sequence number at the end, making the ACK no 202?.

EDIT: My main query is, if FIN consumes a sequence number, in the context of my question, will that sequence number be 99, before the beginning of the data segment or 201, after the data segment

edited by

2 Answers

Best answer
1 votes
1 votes
For sequence number purposes, the SYN is considered to occur before 
the first actual data octet of the segment in which it occurs, while the FIN is considered to occur after the last actual data octet in a segment in which it occurs.

https://www.rfc-editor.org/rfc/rfc793#page-26

So the seq no consumed will be 201

3 votes
3 votes

First random sequence number is selected by client, it will be send to the server along with SYN = 1.

A random sequence number will also be selected by the client and it will also respond with SYN = 1 and ACK = sequence number sent by client + 1

So yes 1 ACK will be consumed by the SYN flag.

Refer below image for better clarity.

Source: https://www.geeksforgeeks.org/tcp-connection-establishment/

 

PS: During connection termination we use FIN flag not SYN flag

Related questions

0 votes
0 votes
2 answers
1
tusharb asked Jan 22, 2022
745 views
Can the header length of IPV4 change at the router? If yes, then why?
0 votes
0 votes
1 answer
3
viral8702 asked Dec 2, 2023
203 views
In fragmentation, if any fragment gets lostthen in which case whole packet will be sent again?and in which case only that fragment will be sent again?