The Three-Way Handshake
Before any data flows, TCP performs a three-way handshake: SYN → SYN-ACK → ACK. This establishes sequence numbers on both sides and confirms bidirectional reachability.
Sequence Numbers
Every byte of data is numbered. The receiver sends ACKs that say 'I've received everything up to byte N, send me N+1 next.' This is how TCP guarantees ordering and detects loss.
Slow Start
TCP doesn't blast data at line rate from byte one. It starts with a small congestion window and doubles it each round trip until it hits a threshold or detects loss. This is slow start — a deliberate ramp-up to probe available bandwidth.
#include
using namespace std;
int main() {
int number;
cout << "Enter an integer: ";
cin >> number;
cout << "You entered " << number;
return 0;
}Head-of-Line Blocking
Because TCP guarantees order, a single lost packet blocks all subsequent packets from being delivered to the application — even if they've already arrived. This is the fundamental tension HTTP/3 + QUIC was designed to solve.
