L3 · NetworksNetworking 101 · part 2 of 7

How the Internet Delivers a Packet

You type a web address and a page appears. Here's the full chain of DNS, TCP, TLS and HTTP that makes it happen.

Takumi Yamada
· 6 min read · 3 references
networkingdnstcptlshttp

Type a web address and press Enter. A few hundred milliseconds later, the page appears.

A lot happens in between. This post follows one request from start to finish and names every step.

Layers, because nobody can solve it all at once

The internet works because the job is split into layers. Each layer does one part of the job and relies on the layer below it for the rest. The OSI (Open Systems Interconnection) model describes seven layers. The (Transmission Control Protocol)/IP (Internet Protocol) model, which is the one the internet actually uses, has four.

TCP/IP layerJobExample
ApplicationWhat the data means, ,
TransportDelivery between TCP,
InternetRouting between hostsIP
LinkMoving on the physical wire, Wi-Fi

The data travels in small pieces called packets. Each layer adds its own header, a short block of information, in front of the data it gets from the layer above. So an HTTP (Hypertext Transfer Protocol) request gets a TCP header, then an IP header, then an Ethernet header, and then it's sent. It works like putting a letter in an envelope, then that envelope in a bigger envelope, and so on. The receiver opens them in reverse order.

APPLICATIONHTTP requestGET / HTTP/1.1Host: negensystems.comTRANSPORTTCP segmentTCPheaderHTTP DATAINTERNETIP packetIPheaderTCPheaderHTTP DATALINKEthernet frameETHERNETheaderIPheaderTCPheaderHTTP DATAFCStrailerreplaced atevery hopread byevery routerfor the two endpoints only
One request on its way down the stack. The solid block in each row is the header that layer adds, and the brackets say who reads each part along the way.

This separation is why HTTP works the same over Wi-Fi or over a fibre cable. HTTP doesn't need to know which one is underneath.

Step 1: DNS, turning a name into a number

The network finds machines by , not by name. So first, your computer has to turn the name into a number such as 203.0.113.42. This step is called resolving the name.

$ dig +short negensystems.com
203.0.113.42

Your computer asks a resolver, a whose job is to look up names. The answer may already be saved, or cached, on your computer or at the resolver. If it isn't, the resolver asks the DNS (Domain Name System) servers in order. First it asks a root server, then the servers for the ending of the name, such as .com, and finally the domain's own server, which has the real answer.

LAPTOPnegensystems.com ?203.0.113.42RESOLVERcaches answersasks the others only whenthe answer isn't cached1ROOT SERVERSasked first2TLD SERVERSfor .com3AUTHORITATIVEfor negensystems.com
One lookup with nothing cached. The resolver does the asking, in the order of the numbers.

DNS normally uses UDP (User Datagram Protocol) on 53. The questions and answers are small, and if one gets lost, the computer simply asks again. For large answers, DNS uses TCP instead. Each answer comes with a time to live, which says how long it may be . Until then, the next lookup of the same name is instant.

Step 2: TCP, opening a reliable channel

Next, your computer opens a TCP connection to that address, on port 443, the port for (Hypertext Transfer Protocol Secure).

A port is a number that picks one service on a machine. That's how one IP address can offer many services. 443 is HTTPS, 80 is HTTP, 22 is (Secure Shell), and 53 is DNS.

to 203.0.113.42:443one TCP segmentONE SERVER, 203.0.113.42:443HTTPS:80HTTP:22SSH:53DNS
The address finds the machine, and the port finds the service on it.

The connection starts with the three-way handshake.

client                          server
  |  ── SYN  (seq=x) ─────────────▶ |   "let's talk, my seq is x"
  |  ◀──── SYN-ACK (seq=y, ack=x+1) |   "ok, my seq is y, got yours"
  |  ── ACK  (ack=y+1) ───────────▶ |   "got yours, go"

That's three messages, taking one round trip, and afterwards both sides agree on their starting sequence numbers. These numbers count the sent, so each side can tell what has arrived. From then on, TCP makes sure the bytes arrive in the right order, and sends again anything that was lost.

Step 3: TLS, making it private

Plain TCP isn't , so anyone along the way can read it. TLS (Transport Layer Security) adds encryption on top of TCP.

TCP ONLYplaintextYOUR MACHINEGET /inbox Cookie: id=4f2aSERVERanyone on the path can read thisTCP + TLSencryptedYOUR MACHINE8f 3a c1 9e 07 d2 5b e4 …SERVERon the path it is only scrambled bytes
The same request without TLS and with it. The hatched block is encrypted.

In a TLS 1.3 , the browser and the server do three things.

  1. They agree on which encryption methods to use.
  2. They create a shared secret key. They use a method called Diffie-Hellman key exchange, which lets two sides build the same secret by exchanging only public values. Someone who watches the exchange can't work out the secret.
  3. The server proves who it is with a certificate. The certificate is signed by a Certificate Authority, an organization your computer already trusts.

TLS 1.3 does all of that in one round trip. After that, every byte is encrypted and protected from changes. The padlock in your browser's address bar means this worked and the certificate was valid.

Step 4: HTTP, actually asking for the page

Only now does the browser send the request the user wanted.

GET / HTTP/1.1
Host: negensystems.com
User-Agent: Mozilla/5.0 ...
Accept: text/html

The server replies.

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 5120

<!DOCTYPE html>...

The first line of the reply holds the status code. 200 OK means success. The Host line in the request matters a lot, because it lets one server with one IP address host many different websites. The server reads it to decide which site should answer.

ONE SERVER AT 203.0.113.42Host: negensystems.comsent to 203.0.113.42negensystems.comone siteHost: example.orgsent to 203.0.113.42example.organother sitethe same address
Two sites on one server. The address is the same, so the Host header is what tells them apart.

All of this travels inside the encrypted TLS connection, which travels inside TCP, which travels inside IP packets.

Step 5: IP routing, how packets cross the world

The data is split into IP packets and handed to the network. Each packet carries a source address and a destination address, and each one travels on its own, one step at a time, through routers. A is a device that passes packets towards their destination.

No single machine knows the whole route. Each router looks at the destination address, checks its routing table, and sends the packet one step closer. It works like a postal system, where each post office only needs to know which direction each postcode is in.

to 203.0.113.42one IP packetROUTERROUTING TABLEdestinationsend on198.51.100.xlink A203.0.113.xlink Banything elselink Clink Alink Bthe next hoplink CThe router knows which link is one step closer. It does not know the rest of the path.
One hop. Every router on the path makes this same decision.
$ traceroute negensystems.com
 1  router.lan        0.4 ms
 2  isp-gateway       8 ms
 3  backbone-1       14 ms
 ...
 9  203.0.113.42     22 ms

traceroute lists the routers a packet passes through, with the time each step took. Packets can take different routes, arrive in a different order, or be thrown away when a link is too busy. The IP layer promises nothing, and this is called best effort delivery. Reliability is TCP's job. TCP sits one layer above IP and puts everything back in order.

The whole trip, in order

Here is one page load, from start to finish.

  1. DNS turns the name into an IP address, usually from a cache.
  2. The TCP handshake takes three packets and opens a reliable connection.
  3. The TLS handshake takes about one round trip. It creates the keys and checks the .
  4. The HTTP request and response finally fetch the page, all of it encrypted.
  5. IP routing happens underneath all of these steps, moving packets from router to router as best it can.

The page you see is HTTP data, wrapped in TLS, carried by TCP, addressed by IP, and sent over Ethernet or Wi-Fi. Each layer knows nothing about the details of the others, and that separation is why the internet could grow so large.

ENCRYPTEDRESOLVERDNS · UDP 53BROWSERyour machineSERVERHTTPS · TCP 4431DNSname → addressusually cachednegensystems.com ?203.0.113.422TCPthree-way handshakeSYNSYN-ACKACK3TLS 1.3keys and certificateClientHello + key shareServerHello + certificate4HTTPrequest and responseGET /200 OK + HTML5IPunder every arrowhop by hop, best efforthops 4–8your machinerouter.lanisp-gatewaybackbone-1203.0.113.42
One page load. Each step costs about one round trip, and every arrow travels as IP packets along the path at the bottom.

My Take

When I'm debugging a slow Go service, knowing these layers tells me where to look.

If the first byte arrives slowly but the rest is fast, the delay is probably in TLS or DNS. "Connection refused" means the wrong port, or nothing is listening on it. Connections that fail now and then point to a problem on the network path, not in your application.

Three tools each show one part of this. dig shows DNS, traceroute shows IP routing, and curl -v shows TLS and HTTP.

Check yourself

3 questions · nothing is saved
  1. 1.What does the three-way handshake (SYN, SYN-ACK, ACK) settle?
  2. 2.What lets one server with one IP address host many different websites?
  3. 3.What does a router need to know to pass a packet on?

References & Primary Sources

Official specifications, standards, and documentation cited in this post.

  1. [1]

    DARPA Internet Protocol specification defining packet fragmentation, addressing, and routing

    RFCrfc-editor.org
  2. [2]

    Modern 1-RTT cryptographic handshake and forward secrecy for web encryption

    RFCrfc-editor.org
  3. [3]

    Core DNS resolution mechanisms, message formats, and record types

    RFCrfc-editor.org

Who wrote this

Author profile and background

Takumi Yamada

Takumi Yamada

· Backend Engineer

Backend engineer building services, databases, Linux tooling, and NEGEN SYSTEMS. Writing about low-level mechanics, distributed systems, and real-world security.

End of post
NEGEN SYSTEMS
Receipt · post 5 of 31
Written
Nov 20, 2025
Length
1,266 words · 6 min
Built
…
Served by
…
Delivered
…
Over the wire
…
Go's share
…
Next in Networking 101 · part 3 of 7

TCP vs UDP, and Why It Matters

One protocol makes sure every byte arrives, the other gets data there fast, and choosing between them affects everything from games to QUIC.

6 min read