in Computer Networks edited by
549 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

in Computer Networks edited by
by
549 views

2 Comments

In the connection termination phase, suppose the SYN segment

How SYN in the termination phase? Should not it be FIN segment?

1
1
Yes it’s FIN my bad
0
0

2 Answers

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

by

4 Comments

@adad check this diagram

0
0
FIN will consume the last sequence number after all the data bytes is acknowledged by the server.
3
3
Welp, thank you so much
1
1

Related questions