TCP/IP

Key points

  • TCP/IP is a worldwide standard set of rules (protocols) for exchanging data over the internet.
  • "IP" specifies the destination (address), while "TCP" splits data into pieces and makes sure it's delivered reliably.
  • Before sending data, a signal exchange called the "3-way handshake" prepares the connection.
📍 IP Specifies the destination (IP address)
✅ TCP Splits data and delivers it reliably

What is TCP/IP?

TCP/IP is the basic rule set for internet communication, built around two core protocols: "TCP" and "IP."

When you send a package, you need both a mechanism to deliver it to the right destination (IP) and a mechanism to confirm it arrived intact (TCP). Communication over the internet works because of this division of labor.

🔑 Everyday exampleThink of a courier delivery: IP is like the shipping label that specifies the delivery address, while TCP is like the "fragile" sticker plus confirming that the package arrived undamaged.

The role of IP addresses

An IP address is a numeric address assigned to each device connected to the internet. When sending data, this address is specified as the destination.

Sender
(your PC)
Specify destination
IP address
Internet
Destination
server

DNS is the mechanism that looks up this IP address from a domain name. We cover the details in the dedicated DNS topic.

TCP's job: delivering reliably

TCP splits the data you want to send into small pieces and delivers them in the correct order, without any gaps. If any data goes missing along the way, it requests a resend.

Original data
Split
Sent as
packets
Reassembled
in order
Restored to the
original data

🔑 Everyday exampleIt's similar to shipping moving boxes in multiple cartons and unpacking them in the numbered order written on each box at the destination. If even one box doesn't arrive, you need to have just that box resent.

The signal before communication begins: the 3-way handshake

Before actually sending data, TCP establishes a connection by exchanging a "we're about to communicate" signal with the other party three times. This is called the "3-way handshake."

Client
① SYN
(Can we connect?)
Server
Client
② SYN/ACK
(Sure — and you?)
Server
Client
③ ACK
(Got it, let's begin)
Server

🔑 Everyday exampleThis resembles the opening exchange of a phone call. ① "Hello?" → ② "Yes, who's calling?" → ③ "It's [name], nice to speak with you." Only after this three-step exchange does the actual conversation (the data exchange) begin.

The difference between TCP and UDP

TCP prioritizes reliability, which comes at the cost of extra back-and-forth. "UDP," on the other hand, is a protocol that prioritizes speed by sending data without confirmation. Each is used depending on the situation.

TCPPrioritizes reliability. Used for browsing websites, email, etc.
UDPPrioritizes speed. Used for video streaming, online games, etc.

Summary

TCP/IP is the basic rule set for internet communication, built on a division of labor where IP specifies the destination and TCP delivers the data reliably. It also includes mechanisms like the 3-way handshake for exchanging signals before communication begins.

Related topics:

🏠 Back to top