A TCP data sequence number names the first payload byte in the stream.

highlighted = computed this step

Sequence number marks the first byte

After the handshake, this client is ready to send byte position 1001. The sequence field on the data segment names that first payload byte.

data seq=1001\text{data seq}=1001
Sequence number marks the first byteThe toy TCP data segment is decoded from exact header and payload bytes.TCP header160 bits / 20 bytes0x9c4001bb000003e9000013895018100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101001byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000110000001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1001acknowledgment-number5001data-offset5reserved0x0flags0x18window0x1000checksum0x0000urgent-pointer0Payload16 bits / 2 bytes0x6869byte 0byte 10110100001101001payload0x6869

The server side has its own count

The same segment acknowledges the server's next byte position, 5001. Client and server byte streams are counted separately.

ack field=5001\text{ack field}=5001
Sequence number marks the first byteThe toy TCP data segment is decoded from exact header and payload bytes.TCP header160 bits / 20 bytes0x9c4001bb000003e9000013895018100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101001byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000110000001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1001acknowledgment-number5001data-offset5reserved0x0flags0x18window0x1000checksum0x0000urgent-pointer0Payload16 bits / 2 bytes0x6869byte 0byte 10110100001101001payload0x6869

Not an offset inside the packet

Sequence 1001 is not byte zero of this packet. It is the connection's running byte count.

connection byte=1001\text{connection byte}=1001
Sequence number marks the first byteThe toy TCP data segment is decoded from exact header and payload bytes.TCP header160 bits / 20 bytes0x9c4001bb000003e9000013895018100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101001byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000110000001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1001acknowledgment-number5001data-offset5reserved0x0flags0x18window0x1000checksum0x0000urgent-pointer0Payload16 bits / 2 bytes0x6869byte 0byte 10110100001101001payload0x6869

Summary

The first byte of payload hi is carried at sequence 1001.

first payload byte=1001\text{first payload byte}=1001
Sequence number marks the first byteThe toy TCP data segment is decoded from exact header and payload bytes.TCP header160 bits / 20 bytes0x9c4001bb000003e9000013895018100000000000byte 0byte 1byte 2byte 310011100010000000000000110111011byte 4byte 5byte 6byte 700000000000000000000001111101001byte 8byte 9byte 10byte 1100000000000000000001001110001001byte 12byte 13byte 14byte 1501010000000110000001000000000000byte 16byte 17byte 18byte 1900000000000000000000000000000000source-port40000destination-port443sequence-number1001acknowledgment-number5001data-offset5reserved0x0flags0x18window0x1000checksum0x0000urgent-pointer0Payload16 bits / 2 bytes0x6869byte 0byte 10110100001101001payload0x6869