The Internet

The Internet: how does it work? #

Suppose you’re sitting in your apartment, watching some crazy person on Zoom tell you about this new website about electronics that everybody is talking about. She says that the name of the website is, and she pastes a link to the site into the chat window. What happens when you click on the link?

First, name resolution #

First, your computer sends a universal datagram packet (UDP) to port 53 on a domain name system (DNS) server somewhere on the internet. The job of a DNS server is to look up the IP address of the website you’re looking for in the distributed global database of domain names.

If you have wireless where you live, the server that your computer targets is probably your wireless router. If you’re using your phone, it’s a server that’s run by AT&T, Verizon, or some phone company like that, and your phone was told where to find it when it connected to the cellular network. You could also be using a public server; for example, Google runs two public DNS servers at the weird IP addresses and

So your computer sends off the UDP packet saying, “Hey, where can I find” Despite the site’s worldwide popularity, your wireless router probably has no idea, so it makes a request like yours to the DNS server run by whoever sells you an internet connection, like RCN or Comcast.

But again, despite the site’s worldwide popularity, Comcast has no idea where to find it, so it makes a request to the authoritative name server for all the domain names that end in .com. If Comcast’s server didn’t know where to find that server, it could ask one of the 13 root name servers; those servers' addresses are hard-coded into the Comcast server’s memory, but Comcast has seen bajillions of requests for .com addresses before, so it surely has the .com name server address cached.

Finally, the .com server sends Comcast over to the authoritative server for, which is a server run by a domain name registrar in Paris, France, called Their name server,, at long last, answers the question! They do this because I paid them to register the domain name and provide these DNS services, and they know the right IP address because I typed it into their website last summer.

Here’s what the Gandi name server sends back:

id 65452
opcode QUERY
flags QR RD RA
;ANSWER 10799 IN A

That IP address,, gets passed back to your web browser, and all the DNS servers along the way cache the answer, in case someone else wants to know where to find the site.

Second, connect to the webserver #

Now your computer knows the IP address of the webserver you’re targeting. The server is one at a datacenter in New Jersey, owned by a company called Linode. I pay them $5/month, and they let me use their server. The server is almost certainly a multi-core behemoth that is running lots of virtual servers in parallel using a hypervisor, but as far as I can tell, it’s just like any other Linux server. My best guess is that the server is in the Cologix data center in Cedar Knolls, NJ:

The next step is that your computer sends out a TCP packet to start a connection to the server at Your computer only knows the IP address of your wifi router, so it sends the first packet to that address and hopes it gets there. Your router has no idea how to connect to a server in New Jersey, so it sends the packet upstream to a router at Comcast (or Tufts, or wherever you’re getting your internet connection). Your packet will be passed along from router to router. The routers along the way don’t know where to find your server, but they each contain a huge table that lists how to get to different networks.

If we use a tool called traceroute, we can see the steps that our packet takes to get to the server. From my house in Somerville, here’s the path it takes. (The path might be slightly different each time.)

Tracing route to []
over a maximum of 30 hops:

  1    <1 ms    <1 ms    <1 ms
  2     2 ms     1 ms     1 ms
  3    11 ms    11 ms    12 ms
  4    39 ms    11 ms    13 ms []
  5    13 ms     9 ms    10 ms []
  6     9 ms    10 ms    10 ms
  7    19 ms    33 ms    15 ms []
  8    15 ms    14 ms    14 ms []
  9    17 ms    30 ms    15 ms []
 10     *        *        *     Request timed out.
 11     *        *        *     Request timed out.
 12     *        *        *     Request timed out.
 13    16 ms    19 ms    18 ms []

Trace complete.

Third, we ask the server for the webpage #

stuff about HTTP, maybe HTTPS?

Should also add stuff about ports, NAT, and port forwarding