549 views

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 the connection termination phase, suppose the SYN segment

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

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

by

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.

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

by

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