How TCP/IP Powers the Internet


How TCP/IP Powers the Internet

Simon
You tap a link, and almost instantly a request leaves your phone, crosses cables and routers, perhaps travels under an ocean, reaches a computer far away, and comes back as a page. It passes through machines run by people and companies you may never have heard of. The remarkable part is that this usually works without one central computer coordinating everything.

Hope
The secret is shared rules: protocols. The most important pair is TCP/IP, the basic grammar that lets devices exchange messages. We’ll follow one click and meet the packets, addresses, routers, ports, DNS, and security rules that make it work.

Simon
Let’s begin in 1969, when the network that eventually became the internet was still a new experiment called ARPANET. On October 29, student Charley Kline tried to log in from a lab in Los Angeles to a computer at the Stanford Research Institute, about five hundred kilometres away. He typed L, and it arrived. He typed O, and that arrived too.

Hope
Then he typed G, and the system crashed. So the first message sent over the network that became the internet was just “lo”—and the login worked about an hour later. It’s a memorable beginning for a technology now used to send everything from a short message to a video call.

Simon
As ARPANET grew, different networks appeared that couldn’t communicate with one another. In 1974, Vint Cerf and Bob Kahn published a design for connecting networks of networks, which became TCP/IP. On January 1, 1983, ARPANET switched to TCP/IP in one day—an event engineers call flag day, and one often treated as the internet’s birthday.

Hope
And the World Wide Web came later. Tim Berners-Lee proposed it at CERN in 1989 as one service running on top of the internet. A useful distinction is that the internet is the roads; the web is one kind of traffic travelling on them.

Simon
The first big idea behind those roads is the packet. Older telephone networks reserved a dedicated line for a whole call, even during pauses. Picture booking an entire road just for your car. The internet instead divides a message into small pieces, often around fifteen hundred bytes each, and sends those packets independently.

Hope
Imagine cutting a book into numbered postcards. Each postcard carries its destination, a return address, and a page number. They can take different routes and arrive in the wrong order, but the numbers let the receiving device put the book back together. That approach is packet switching.

Simon
Because no single line is reserved, millions of people can share the same cables, sending packets in the gaps between one another’s traffic. And if one route fails, packets can take another. The network can bend around damage instead of breaking, which was an important goal of the early research.

Hope
Sending a packet involves several different jobs, so networking is organized into layers. Each layer has a particular responsibility and relies on the one below it. Think of sending a gift: you prepare the message, package it, label it for delivery, and then let a vehicle carry it.

Simon
TCP/IP is commonly described with four layers. The application layer is the content, such as a web page, email, or chat. The transport layer—TCP or UDP—helps deliver it to the right program, with different guarantees about completeness and order. The internet layer, IP, handles addresses across networks, while the link layer moves data over one local connection, such as Wi-Fi, Ethernet, or fibre.

Hope
Each layer wraps the data from the layer above in its own header, like Russian dolls. That’s encapsulation. At the destination, the layers unwrap the data in reverse order. You may also hear about the seven-layer OSI model, which divides similar jobs more finely; when someone says “layer seven,” they mean the application layer.

Simon
At the physical level, all the data is ultimately represented as ones and zeros. Copper cables carry electrical pulses; fibre-optic cables carry flashes of light; Wi-Fi and mobile networks carry information on radio waves. The internet can use very different kinds of links while keeping the higher-level packet system consistent.

Hope
On many local networks, Ethernet is the main link standard. A network card has a forty-eight-bit MAC address, written as six pairs of letters and numbers. A switch uses MAC addresses to deliver frames to the right device on that local network.

Simon
Across oceans, undersea fibre cables carry nearly all the data moving between continents; satellites carry only a small share. And the link can be stranger than cable or radio. An April Fools’ document in 1990 described sending IP over carrier pigeons, and in 2001 a Linux user group in Bergen, Norway, actually tried it.

Hope
They sent nine pings, each tied to a pigeon. Four came back, taking roughly fifty minutes to an hour and three quarters. It was slow and lossy, but it was still valid internet traffic. The point is that IP doesn’t care what carries the bits.

Simon
Now let’s give a packet a destination. An IP address is a device’s address on a network, a bit like the address on a letter. The classic version, IPv4, is a thirty-two-bit number written as four values from zero to 255, separated by dots—for example, 142.250.183.14.

Hope
Thirty-two bits allow about 4.3 billion addresses, which sounded enormous in 1981. But the number of phones, laptops, televisions, and cameras grew far beyond what people had anticipated, and the central pool of new IPv4 addresses ran out in 2011. One widely used workaround is NAT, or network address translation.

Simon
With NAT, a home router has one public internet address, while devices inside the home use private addresses such as 192.168.1.5. Those private addresses can be reused in millions of homes. Picture an apartment building with one street address: a doorman keeps track of which flat made a request so that replies reach the right flat.

Hope
Mobile operators can do something similar on a much larger scale, letting thousands of phones share one public address. NAT helps stretch IPv4, but it means the public address does not necessarily identify just one device.

Simon
IP addresses are assigned in blocks, and each address has a network part and a host part. Think of a postal address: a pin code helps route mail to an area, and a house number identifies a home within it. A subnet mask, or a slash number, tells devices where that network-and-host boundary falls.

Hope
For example, in 192.168.1.0 slash 24, the first twenty-four bits identify the network and the last eight identify addresses within it. Eight bits give 256 possible values, but the first address names the network and the last is used for broadcasting to everyone, leaving 254 device addresses. Slash 24 is also written as the mask 255.255.255.0.

Simon
Change the slash number and the block size changes. A slash 16 has more than sixty-five thousand addresses, while a slash 30 has just four. This flexible system is called CIDR, and it lets organizations receive blocks that fit their needs.

Hope
When your computer wants to send something, it checks whether the destination is in its own subnet. If it is, it can deliver locally. If it isn’t, it sends the packet to the default gateway—usually your router—which is the way out to other networks.

Simon
The long-term answer to IPv4’s limited address space is IPv6. Its addresses are 128 bits long and written as eight groups of hexadecimal digits separated by colons. Long stretches of zeros can be shortened using a double colon.

Hope
That gives IPv6 about 340 undecillion addresses—a three followed by thirty-eight zeros. IPv4 has fewer addresses than there are people on Earth; IPv6 has enough to assign trillions of addresses to every grain of sand on every beach without making a dent. With that much space, devices can have public addresses again without relying on NAT in the same way.

Simon
IPv6 also simplified the packet header to help routers process packets faster. But IPv4 and IPv6 cannot communicate directly with each other, so both versions currently run side by side. A large and growing share of internet traffic, including on many Indian mobile networks, already uses IPv6.

Hope
An address tells us where a packet is going, but not the full route. Routers move packets hop by hop. Picture a sorting office at a road junction: a router looks at the destination and decides which road to use next, rather than planning the entire journey.

Simon
Each router has a routing table listing address blocks and the next hop for each. When several entries match, it chooses the most specific one, called the longest prefix. If it has no more specific match, it can use its default route.

Hope
What keeps a packet from circling forever? Every IP packet carries a time-to-live counter, or TTL. Each router reduces it by one; when it reaches zero, the router discards the packet and sends back a short error message.

Simon
Traceroute uses that rule to reveal a route. It sends packets with a TTL of one, then two, then three, and so on. Each router that discards a packet can reveal itself, letting you see the hops between your device and a website. On Windows, you can try it with tracert followed by a website name; you may see ten to twenty hops and sometimes city names.

Hope
A company’s internal routers can share route information, but the public internet consists of tens of thousands of separate networks run by different organizations. These networks are called autonomous systems. Between them, the Border Gateway Protocol, or BGP, spreads information about which address blocks can be reached through which network.

Simon
A network announces to its neighbours, “These address blocks are reachable through me.” Neighbours pass that information along, and it spreads across the internet—like gossip between giants. For a long time, networks largely trusted what their neighbours announced.

Hope
That trust has led to some startling disruptions. In February 2008, Pakistan Telecom was ordered to block YouTube inside the country and announced a more specific route for YouTube’s addresses, intending it to stay local. The announcement leaked outward, and much of the world began sending YouTube traffic toward Pakistan. YouTube was unreachable for many people for about two hours.

Simon
In October 2021, Facebook caused a disruption of its own. A maintenance command accidentally disconnected its backbone, and its BGP routes were withdrawn. Facebook, Instagram, and WhatsApp disappeared from the internet for about six hours; reports even said some staff badges stopped opening doors.

Hope
Networks increasingly use RPKI to sign route announcements so false claims can be identified and rejected. It’s one response to the fact that routing decisions depend on information shared by many separate organizations.

Simon
The IP address gets a packet to the right computer, but that computer may be running a browser, a chat app, and a game at the same time. How does the data reach the intended program? That’s the job of ports. If an IP address is a building, a port number is the flat.

Hope
Ports range from zero to 65,535. Some common ones are 80 for ordinary web traffic, 443 for secure HTTPS, 22 for SSH, 25 for sending email, and 53 for DNS. Your device usually uses a temporary random port for its side of a connection.

Simon
The transport layer offers two very different choices: UDP and TCP. UDP is like sending a postcard: you send it, but there’s no built-in confirmation that it arrived and no system to put postcards back in order. It’s fast and simple.

Hope
TCP is more like registered post with tracking. It numbers the pieces, confirms delivery, resends what gets lost, and delivers everything in order. Web pages, email, and file downloads use TCP when every byte must be right. Video calls, games, and live streams often prefer UDP, where a late packet may be less useful than a small glitch.

Simon
Before TCP sends data, the two sides perform a three-way handshake. Your computer sends SYN: hello, I’d like to talk, and I’ll start counting from this number. The server replies SYN-ACK: I heard you, and I’ll count from this number. Your computer sends ACK: great, I heard you too.

Hope
That’s why the old TCP joke takes a while: “Hi, I’d like to hear a TCP joke.” “Hello, would you like to hear a TCP joke?” “Yes, I’d like to hear a TCP joke.” Only then does the joke begin. The connection starts by confirming that both sides can communicate.

Simon
After the handshake, TCP gives every byte a sequence number, like page numbers on our postcards. The receiver acknowledges what it has received. If an acknowledgement doesn’t arrive in time, the sender assumes something was lost and sends it again; duplicates are discarded, and gaps are filled.

Hope
The result is a complete, ordered stream for the program, even if packets arrived out of order along the way. When the conversation is finished, each side sends FIN to say goodbye, and the other confirms. A web connection begins and ends with this small exchange of messages.

Simon
TCP also has to control how quickly data is sent. Flow control protects the receiver: it tells the sender how much room is available, through a value called the window. That prevents a fast server from overwhelming a slower phone.

Hope
Congestion control protects the network itself. In October 1986, the early internet experienced congestion collapse. Between two labs in Berkeley about four hundred metres apart, speed fell from 32 kilobits per second to 40 bits per second—about a thousand times slower.

Simon
The problem was a vicious cycle: people resent lost packets as fast as possible, which causes more congestion and more losses, which causes more resending. It’s like a traffic jam where every driver keeps honking and pushing forward. Van Jacobson and colleagues helped fix it with congestion-control techniques.

Hope
TCP now starts gently with slow start, increases its speed step by step, and backs off sharply when it detects loss before climbing again. The resulting rise-and-fall pattern is happening across billions of connections. Modern versions are smarter, but the basic idea remains: share the road rather than overwhelm it.

Simon
People use names such as youtube.com instead of memorizing IP addresses. DNS, the Domain Name System, translates those names into addresses. It’s often called the internet’s phone book, but it’s not one giant book. It’s a tree read from right to left: root, top-level domains such as dot com or dot in, and then an organization’s own name servers.

Hope
Your device asks a DNS resolver, often run by your internet provider. If the resolver doesn’t already have the answer, it can ask a root server where to find the dot-com servers, ask a dot-com server where to find youtube.com, and then ask YouTube’s own name server for the final address.

Simon
There are thirteen root-server identities, named A through M, but each is copied across hundreds of locations around the world—more than a thousand sites in total—sharing the same addresses. That helps a query reach a nearby copy. Answers are cached for a while, so most lookups take only a few milliseconds.

Hope
Caching is useful, but a wrong cached answer can send people to the wrong place, so DNS security matters. In October 2016, a botnet called Mirai, built from hacked home cameras and video recorders, flooded DNS provider Dyn with junk traffic. Many people couldn’t reach Twitter, Netflix, Reddit, or GitHub for hours, even though those sites were running; their names could not be looked up.

Simon
When your phone joins Wi-Fi, it usually doesn’t need you to type in its network settings. DHCP assigns them automatically. Remember the four steps as DORA: Discover, Offer, Request, Acknowledge.

Hope
First, the phone asks whether a DHCP server is available. The router offers an address, the phone requests it, and the router acknowledges the assignment. DHCP also provides the subnet mask, default gateway, and DNS servers. The address is a lease, so it expires unless the device renews it.

Simon
There’s another local step. To send a frame to the router, your phone needs the router’s MAC address, even if it knows the router’s IP address. On a local network, it uses ARP, the Address Resolution Protocol, to ask, “Who has 192.168.1.1? Tell me your MAC address.”

Hope
That question is shouted to everyone on the local network, and the router answers. It’s a little like a teacher calling a roll number and having one student stand up. Because ARP trusts this local exchange, a device on a shared network can lie and claim to be the router—one reason public Wi-Fi needs encryption on top.

Simon
At the application layer, the web uses HTTP: HyperText Transfer Protocol. It’s a conversation of requests and responses. A browser might request “GET /index.html,” and the server replies with a status code, headers, and the page itself.

Hope
Status codes summarize what happened: 200 means OK, 301 means the resource moved, 404 means it wasn’t found, and 500 means the server had a problem. A handy rule is that four-hundreds indicate a client-side mistake and five-hundreds a server-side one. And 418 means “I’m a teapot,” from a 1998 April Fools’ standard about controlling coffee pots over the internet.

Simon
HTTP itself doesn’t remember earlier requests. Websites use cookies—small notes stored by your browser and sent back with later requests—to remember things like whether you’re logged in or what’s in your shopping cart. HTTP continues to evolve: HTTP/2 can send many files over one connection at a time, and HTTP/3 uses QUIC, built on UDP, to start connections faster and work better on shaky mobile networks.

Hope
Plain HTTP travels as readable text, so someone on the path—perhaps on café Wi-Fi—could read or change it. HTTPS is HTTP wrapped inside TLS, Transport Layer Security. TLS provides privacy, so others can’t read the traffic; integrity, so changes can be detected; and authenticity, so your browser can check it’s talking to the site you asked for.

Simon
How can your device and a server agree on a secret key when they’ve never met and anyone might be listening? Picture mixing paint. Each side keeps a secret colour, mixes it with a public colour, and shares the mixture. Then each adds its own secret colour to the other side’s mixture; both reach the same final colour, while a listener who saw only the public mixtures can’t work it out.

Hope
Real TLS uses mathematics rather than paint, but the analogy captures the shared-secret idea. The browser also needs to know that the server really is your bank and not an impostor. The server presents a certificate, a digital ID signed by a trusted certificate authority, and the browser checks that signature against authorities it already trusts.

Simon
A decade ago, many websites still didn’t use HTTPS. Free certificate services such as Let’s Encrypt helped change that, and today most web pages people visit are encrypted. The browser’s padlock signals that HTTPS protection is in use.

Hope
The web is only one member of a larger cast of protocols. SMTP sends email between mail servers, while IMAP lets you read messages from different devices, which is why an inbox can look the same on your phone and laptop. SSH gives engineers a secure remote terminal, and FTP was an older way to move files.

Simon
NTP keeps clocks around the world synchronized to within milliseconds, which matters for things like bank transactions and security certificates. ICMP carries network error and test messages. Its best-known tool is ping, which sends an echo request and times the reply.

Hope
The creator of ping, Mike Muuss, named it after the sound of sonar on a submarine: send a ping, wait for the echo. Nearby, Wi-Fi and Bluetooth handle local radio links, and mobile networks handle the radio connection to a tower. Above those different links, the same IP packets can keep flowing.

Simon
That’s the elegance of the design: applications can run over IP, and IP can run over many kinds of link—copper, light, radio, or even pigeons. Engineers draw the arrangement as an hourglass, with IP at the narrow waist connecting many applications above to many possible links below.

Hope
Now let’s trace a click from beginning to end. You join Wi-Fi, and DHCP gives your phone an IP address, a subnet mask, a gateway, and DNS servers. ARP finds the router’s MAC address so your phone can send a local frame to it.

Simon
You type a website name, and DNS translates it into an IP address—asking through the root, top-level domain, and site name servers if the answer isn’t already cached. Your browser then opens a TCP connection to port 443 with the three-way handshake. A TLS handshake agrees on secret keys and checks the site’s certificate.

Hope
The browser sends an encrypted HTTP GET request. Layer by layer, the data is wrapped, passes through your home router’s NAT, and travels from router to router according to routes shared through BGP. Its path might include an undersea fibre cable.

Simon
The server unwraps the request, builds the page, and sends it back as many packets. TCP puts the data in order, TLS decrypts it, and the browser draws the page. All of that often happens in less than a second.

Hope
Understanding these ideas matters because so many technology jobs touch networks: software development, cloud computing, cybersecurity, data, and AI. When something breaks, knowing the layers helps you work out where to look rather than treating the whole internet as a mystery.

Simon
You can start exploring your own computer. On Windows, ipconfig shows your IP address, mask, and gateway. Ping tests whether a machine is reachable and how long a reply takes; tracert shows the hops; and nslookup asks DNS a question directly.

Hope
For a closer look, install Wireshark, a free tool that displays packets flowing in and out of your computer. Open a website and you can watch the DNS lookup, TCP handshake, and TLS handshake happen. It turns the abstract ideas into observable events.

Simon
A useful study order is to learn layers and encapsulation first, then IP addressing and subnetting with lots of practice. After that, study routing, TCP and UDP, then DNS, DHCP, and HTTP, and finally security topics such as TLS and firewalls. Certifications like CCNA roughly follow this path.

Hope
And keep the pictures in mind: packets as numbered postcards, layers as Russian dolls, addresses as pin codes, routers as sorting offices, TCP as a handshake and tracked delivery, DNS as a phone book, and TLS as secret paint mixed in public. Each analogy highlights a different part of the system.

Simon
So the next time a page loads in a blink, you’ll know it wasn’t magic or one computer in charge. It was a polite conversation among thousands of machines, moving packets across different networks while following the same small set of rules—rules agreed upon by people who may never have met.

Ask anything
We've read this whole study set, so questions about it get the best answers.