The toy FIN segment carries no payload bytes, but it still matters to the sequence count.

highlighted = computed this step

The FIN segment is empty of data

The segment has a TCP header and no payload after it.

payload length=0\text{payload length}=0
No payload bytesThe toy TCP FIN segment is decoded from exact header bytes.FIN header160 bits / 20 bytes0x9c4001bb000003eb000013895011100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101011byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000100010001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1003acknowledgment-number5001data-offset5reserved0x0flags0x11window0x1000checksum0x0000urgent-pointer0

It still acknowledges the server side

The FIN segment's acknowledgment field is 5001, carrying the server byte count the client has already received.

FIN ack field=5001\text{FIN ack field}=5001
No payload bytesThe toy TCP FIN segment is decoded from exact header bytes.FIN header160 bits / 20 bytes0x9c4001bb000003eb000013895011100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101011byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000100010001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1003acknowledgment-number5001data-offset5reserved0x0flags0x11window0x1000checksum0x0000urgent-pointer0

Control can move the count

Even with 0 payload bytes, this control flag will be counted by the peer.

FIN consumes=1\text{FIN consumes}=1
No payload bytesThe toy TCP FIN segment is decoded from exact header bytes.FIN header160 bits / 20 bytes0x9c4001bb000003eb000013895011100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101011byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000100010001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1003acknowledgment-number5001data-offset5reserved0x0flags0x11window0x1000checksum0x0000urgent-pointer0

Summary

FIN carries no data bytes, but the close signal is still part of TCP's sequence space.

payload bytes=0\text{payload bytes}=0
No payload bytesThe toy TCP FIN segment is decoded from exact header bytes.FIN header160 bits / 20 bytes0x9c4001bb000003eb000013895011100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101011byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000100010001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1003acknowledgment-number5001data-offset5reserved0x0flags0x11window0x1000checksum0x0000urgent-pointer0