Interview Prep/Networking/Network Models, TCP, UDP & Ports

What are TCP sequence numbers and acknowledgements used for?

IntermediateConceptNetwork Models, TCP, UDP & Ports
Answer

Every byte in a TCP stream has a sequence number. The sender labels each segment with the number of its first byte, and the receiver acknowledges the next byte it expects (cumulative ACK). Gaps trigger duplicate ACKs, and three duplicate ACKs trigger fast retransmit without waiting for the timer.

Initial sequence numbers are randomized to stop blind spoofing and to avoid confusion with segments from older connections.

All Networking questions Roadmap: Networking for DevOps

More on Network Models, TCP, UDP & Ports