• edited by
2,335 views
0 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

2 Answers

Best answer
1 1 vote
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 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

Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
1.7k
1.7k views
tusharb asked Jan 22, 2022
1,719 views
Can the header length of IPV4 change at the router? If yes, then why?
2 2 votes
2 2 answers
1.1k
1.1k views
iarnav asked Dec 16, 2018
1,126 views
Say Client buffer is of 12000 Bytes and MSS is 1200 B and this info is sent to server and now server send the info in (SYN +ACK) segment as Server Buffer = 18000 B and MS...
0 0 votes
1 1 answer
614
614 views
viral8702 asked Dec 2, 2023
614 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?
0 0 votes
1 1 answer
1.1k
1.1k views
Sahil_Lather asked Jan 26, 2023
1,114 views
Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a...