Skip to main content

Networking and the web

What is TCP/IP?

Definition

TCP/IP is the pair of core internet protocols: IP routes packets between machines, and TCP turns that unreliable delivery into an ordered, reliable byte stream.

Also known as: Internet protocol suite

TCP/IP in more detail

IP, the Internet Protocol, gives every machine an address and forwards packets hop by hop toward it. It promises nothing: packets can be dropped, duplicated, delayed or delivered out of order, and IP will not tell you. That minimalism is why the internet scales — routers do very little work per packet — but it is not something an application can use directly.

TCP, the Transmission Control Protocol, adds the guarantees on top. It establishes a connection with a three-way handshake, numbers every byte so the receiver can reassemble the stream in order, acknowledges what arrived, retransmits what did not, and adjusts its sending rate to avoid congesting the path. To the program above it, a TCP connection looks like a pipe: write bytes at one end, the same bytes come out the other end in the same order.

The name is also used loosely for the whole suite, which includes UDP — a thin wrapper over IP with no ordering, no retransmission and no congestion control, chosen when latency matters more than completeness, as in video calls, DNS and QUIC. The layering is the thing to remember: HTTP is an application protocol carried by TCP, which is carried by IP. HTTP is not a peer of TCP/IP; it is a tenant.

TCP/IP example

Layers, top to bottom, for one page load

  HTTP        GET /index.html            what the bytes mean
  TLS         encrypts the HTTP bytes    (for HTTPS)
  TCP         port 443, ordered stream   reliability
  IP          203.0.113.10               routing
  Ethernet/WiFi                          the physical hop

TCP three-way handshake before any data moves:
  client -> SYN
  server -> SYN-ACK
  client -> ACK        connection established

# HTTP/3 replaces the TCP row with QUIC over UDP,
# and the HTTP row above it does not change.

TCP/IP — common questions

Is HTTP part of TCP/IP?
HTTP is an application-layer protocol in the TCP/IP suite, but it is not the same layer as TCP or IP. IP moves packets, TCP makes the stream reliable, and HTTP defines what the bytes in that stream mean.
What is the difference between TCP and UDP?
TCP guarantees ordered, complete delivery and controls its sending rate; UDP just sends datagrams and lets the application handle loss and ordering. UDP is preferred where a late packet is worse than a missing one, such as live audio and video.
What is an IP address?
A numeric address identifying a network interface — 32 bits in IPv4, written as four dotted numbers, or 128 bits in IPv6. Routers use it to decide where to forward each packet; DNS is what turns a hostname into one.

Keep reading

Every definition in the set is indexed A-Z in the developer glossary, and the cheat sheets cover the syntax once you know what you are looking for.

Browse the A-Z glossary