The Internet in a Nutshell

The internet is simply a collection of computers that are connected via wires and routers and that communicate using the Internet Protocol (IP).

Every computer that is connected to the Internet is assigned a unique numeric IP address.  This includes our personal computers.  In fact, if we google my IP address, google will display our computer’s IP address. If we click on the link above what we’ll see is an IP address in dotted decimal form.  71.63.32.48, for example, is a dotted-decimal IP address.  Web servers, computers that serve up the web pages of web sites, also have unique IP addresses.  For example, if we enter 172.217.13.78 in our browser, the google.com web server will return to our browser the google.com home page.

When a program on one computer wants to send a message to a program on another computer (like request a web page from a web server), it encapsulates the message in what is called a packet.  The packet contains both the source and destination IP addresses, the message, and other information.

Since sequences of letters like google.com are easier to remember than IP addresses, individuals, organizations, and companies register domain names to identify their servers on the internet.  A domain name consist of a sequence of domains separated by dots, for example, www.n0code.net.  The last domain (net in our example) is called the top-level domain (TLD).  There are many top-level domains.  The original TLDs are com, org, edu, gov, net, int, gov, and mil.  The company that oversees Internet domain names (ICANN) has recently approved over a thousand new TLDs, like io, ninja, black, and xyz.  A current list of TLDs can be found at https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains.

Domain names are mapped to IP addresses in the Domain Name System (DNS).  The DNS is a collection of web servers on the Internet whose main purpose is to provide a DNS resolver with the IP addresses that is mapped to a given domain name.

When we want to request a web page of a web site, we enter a Universal Resource Locator (URL) in the search field of a browser and press enter.  A URL contains the domain name followed by other optional information that tells the server what resource (e.g. file) we are requesting as well as other data that we want to pass to the server.  Since the packets the browser creates must contain the IP address of the destination server, not the domain name, the browser must resolve the IP address from the domain name using a DNS resolver.

The domain name resolution process begins with the client contacting its DNS resolver and requesting a lookup.  If the DNS resolver doesn’t have the IP address in its cache, it sends the request to a root DNS server.  If the root DNS server doesn’t have the IP address cached it returns the IP address of the top-level DNS server and the DNS resolver sends another lookup request to the top-level DNS.  If the top-level DNS doesn’t have the IP address cached it returns the IP address of the next-level DNS, and so on until the IP address is resolved.  When the DNS resolver resolves the domain name, it sends the IP address to the  client.

Once the client has the IP address of the destination server, it forms and sends the packet(s) to the computer’s gateway router.  Routers route packets through the web of routers and wires that make up the internet.  When a router receives an incoming packet, it inspects the packet to determine its destination IP address and uses its routing table to determine which wire to send the packet out on.  After it determines the best route to the destination, the router updates the packet and sends it on its way.  The packet then hops from router to router until it gets to the destination computer.

When the destination server receives the request from the client it responds by sending packets containing the website data back to the client.