Home › Networking › TCP/IP
Networking

TCP/IP

Underneath HTTP is TCP/IP, the pair of protocols that actually move the bytes. IP gets a packet to the right machine; TCP makes sure the bytes arrive in order and none go missing.

IP addresses and ports

An IP address names a machine (like 93.184.216.34); a port names a program on it (web servers usually listen on 80 and 443). Together they are an endpoint.

The handshake

Before any data moves, TCP does a three-step handshake: SYN, SYN-ACK, ACK. After that both sides have an open connection they can send bytes over in either direction.

Packets and reliability

Data is split into packets. Each gets a sequence number so the other end can put them back in order and ask again for any that go missing. You get a clean stream of bytes without worrying about any of that.

Keep reading: Python  ·  JSON  ·  JavaScript