Chapter 1 - What is the Internet?

What to Expect

This isn't going to be your typical classroom where you sit and listen to boring lectures all day. You'll be learning in new and exciting ways. In this prework, we may employ some learning techniques that are foreign to you, but trust us that these are proven educational strategies that will transform the way you learn forever.

In this chapter (and several subsequent ones) we're going to use a tool that we call 1 in 3. We'll explain 1 concept in 3 ways. While it may feel redundant, each section becomes progressively more technical. It's a great way to get a broad understanding of a new field or concept.

This chapter is all about developing a deeper understanding of the internet.

Why spend time on this? Aspiring developers need to understand the basics of the internet's infrastructure in order to speak competently with clients and communicate effectively across technical teams at their organization. This is a high-level overview aimed at introducing common vocabulary and concepts relevant to the industry.


Part 1: Explaining it to a Child

Developer, Coder, Software Engineer, and Programmer are all terms used to describe people who build applications like Google, Instagram, Netflix, Word, and Powerpoint. As a future developer yourself, you should know the following:

  • The internet is a way to share your application with people around the world.

  • The web applications you build will live on a server. A server is a big computer (or multiple computers) that deliver your application (like Twitter) to users whenever they open their browser and type in the address (www.twitter.com).

  • The users' computers are called clients.

  • Clients request stuff from the server and the server returns a response.

So speaking generally, there are two big players when it comes to making web applications:

  1. The server (which holds all the files and data and delivers them to clients)

  2. The client (which requests the data/files when users type in a web address)


Part 2: Explaining it to an Adult

The structure of the internet and web applications:

There are 2 types of computers: servers and clients. You can think of servers as being connected directly to the internet. Clients (the user's computer) access the internet through an ISP (Internet Service Provider) like Comcast, Google Fiber, AT&T, or Charter. When you open your computer (client) and type an address into the address bar on your browser (like www.google.com), a request is sent to the server that holds all the files and data for Google. When the server receives that request it sends back a response with the requested information (like an HTML, CSS, and JavaScript file). Your browser then executes those files and renders the HTML page that you see.

Next, you might type a search term into the Google search bar (like dogs on skateboards). Your computer (the client) then sends another request to the Google server asking for all the webpages that relate to dogs on skateboards. The server runs a fancy algorithm to find the most relevant webpages for you and then responds with the relevant data. This time you requested data instead of files, but the process still works in the same way: The client makes a request, the server responds, and the browser renders the results in the window for you (the user) to see.

But how does the server know where to send the response? Excellent question! To understand this, there are three important facts to understand:

  • First, every piece of hardware (like your computer) has an IP address that is unique to it within its network.

    • Wait, what's an IP address? It's just a set of numbers (like a Social Security Number).
  • Second, At every junction where two or more machines are accessing the internet, there's a router (another type of computer). The routers job is, not shockingly, to route things! It's a piece of hardware, so it too has an IP address.

  • Finally, packets. The internet is just a series of wires that connect computers via routers. Wires can only transmit so much data at once, therefore when we are sending large amounts data over the internet, it needs to first be broken down into chunks known as packets.

Packets are a bit complex, so let's take a moment to disect them together. Packets are constructed in three pieces: the header, data, and trailer (more on this will be covered later). Each packet is sent one at a time and then reassembled into one cohesive image when they reach their destination.

When you make a request, your computer prepares packets to be sent to the designated server with information about the data you are seeking. It goes like this:

  • During the preparation, the header of each packet is stamped with your IP address and sent to the internet.

  • On its journey, it soon hits a router.

  • The router stamps the header once more with it's own IP address and sends it on.

  • It soon hits another router which repeats the process of stamping it with it's own IP address.

  • This goes on through a dozen or so routers until it hits the server.

  • Once the packets hit the server, the server prepares packets in response to the request and uses the stamps to send it back down the pipeline in reverse.

Wait a second! How does the request get to to the server in the first place?

Welcome to the world of DNS! DNS (Domain Name System) is just a tool for looking up the IP associated with certain names (like google.com). You can think of it as a big phonebook. Just like a phonebook allows you to look up friends and find their phone numbers (assuming you live in 1999), when you type www.google.com into the address bar, the DNS looks up the url and translates it to an IP address (64.233.185.113).

Go ahead, type 64.233.185.113 into your address bar in your favorite browser. See! www.google.com is just an alias for the IP address of the Google server. And DNS is just the look up tool for finding the address from the name.

To summarize, it may be useful to think in terms of the US Postal Service. Think of everything that has to happen if Jimmy wants to send a letter to Sherri:

  1. He composes the letter.
  2. Places it in an envelope.
  3. Finds Sherri's address.
  4. Puts it on the outside along with his return address.
  5. He places the letter in the mailbox.

Jimmy's part of this process is now complete. Now the letter has to get to Sherri.

  1. The mail carrier collects the addressed envelope from the mailbox, along with those of Jimmy's neighbors.
  2. The carrier, ummm... carries them to the local Post Office.
  3. At the Post Office, the letters from the entire community are collected and sent to the Distribution Center. The Distribution Center sorts the mail, and sends each piece to one of many other Distribution Centers.
  4. The other Distribution Center further sorts the mail and sends it to the appropriate local Post Office
  5. The letter is sorted further still and given to a new mail carrier.
  6. The carrier delivers the letter to Sherri's mailbox.

Packets are delivered from one computer to another in a similar process, with each packet being forwarded up the chain, as determined by the router, and then back down until it arrives at its addressed destination.

And that's the internet in a (kind of large) nutshell.


Part 3: Explaining it to a Developer

What follows is a rundown of all of the concepts that we have covered so far, but in more technical detail. Think of this as a reference resource for much of the vocabulary that we'll be using during the course.

How does the internet work? In the very broadest sense, computers interact with one another via requests and responses. One computer (the client) asks another (the server) for some data via a request and receives some sort of result from the server in the form of a response.

Server: Physical hardware or software that takes requests from users and returns something back or completes a process. This might mean returning an HTML page, a picture, data, etc.

Client: The user or browser that makes requests to servers. This could be as simple as clicking a URL and requesting the page to load. Or it might be more complicated like sending data to the server and requesting that the server act upon it in some way.

Request: A message from the client to the server that includes the identifier of the requested resource (that is to say, the target of the request, be it a document, picture, or anything else), the method to be applied to the resource, and the protocol version (more on this will be covered later) in use.

Response: A message sent back to the client from the server after it has received and interpreted the request.

How are requests and responses routed?

The internet is a network of networks. Every computer has a unique Internet Protocol (IP) address within its network. When an application makes a request, that request is ultimately translated down the stack into binary chunks of data, called packets and directed to a specific IP. This packet is transmitted across the internet, where it is translated back into its original form.

The client's data is translated into packets and back by the TCP/IP stack.

The TCP/IP stack is the protocol stack used to transmit data to the internet. The name of the stack comes from the fact that it uses two major protocols - Transmission Control Protocol and Internet Protocol. A protocol is simply a set of rules that guides communication between computers on the internet. The TCP/IP stack is comprised of several layers:

  • Application Layer
  • Transport Layer
  • Internet Layer
  • Network Access Layer

The user generates some sort of data to send to the server, and makes the request via the Application Layer. This is the layer of the stack that applications will interface with directly.

Is your head spinning yet? That's okay - it should be! You are not expected to digest all of this today. Let's slow down and recap a little before we continue.

When you enter a web address in your browser, you are making a request to a server. The request is broken into packets. These packets are sent to the server, through the TCP/IP stack, starting with the Application Layer. The TCP/IP stack is not a phyiscal thing. It's a just a way of conceptualizing all the steps involved in every client-server interaction. The Application Layer of this model represents the rules guiding how the client and server will ask for information and repsond to those requests.

Think of it like this: The client and server have never met. The client is going to send a message to the server like this POST /user {data}. What the heck does that mean and how is the server suppose to respond? Who knows ¯\_(ツ)_/¯. Before communication can be meaningful both parties need to agree to a set of rules. "I need milk" means the person speaking is requesting white liquid produced by the mammary glands of a mammal, but I only know that because we English speakers have agreed to a set of rules regarding what words mean. Similarly, clients and servers need to agree to a set of communication rules before they can meaningfully communicate. These rules (or protocol) "exist" in our conceptual model (TCP/IP) in the Application Layer.

The Application Layer can be thought of as a translator. This layer is responsible for establishing the connection between client and server using the protocol determined by the Transport Layer, interpreting that data, and presenting it. This is the only layer that a client interacts with and this is the only layer that we really need to focus on.

Hypertext Transfer Protocol, or HTTP is the protocol (set of rules) most often used for sending data, but there are other protocols such as FTP, SMTP, and SSH.

HTTP is the backbone for the web. HTTP is the protocol (set of rules) that browsers, such as Chrome, Safari, Firefox, Edge, Internet Explorer, etc., use to communicate over the internet. HTTP itself has several methods associated with it, of which four are the most common.

  • GET - used to retrieve data from the server
  • POST - used to send data to the server
  • PUT - used to update data in the server
  • DELETE - used to delete data from the server

This data is then further translated down the stack in order.

  • TCP will direct the packet to a specific application on the server using a port number.
  • IP directs the packet to a specific computer using its IP address.
  • The network access layer converts the binary packet into network signals.

How is this packet transmitted between these networks?

Every computer on the internet does not know where the other is, and the packet is not broadcast to every computer like a radio signal. The packet is deliberately routed to the destination computer.

Routers are like packet directors, they tell the packet where to go next. The IP dictates how the packet is routed, as each router knows its sub-networks and what IP addresses are assigned to them. The router checks the destination IP address and directs the packet onward to the next router, or along some pre-designated route if the router has no information relating to the destination.

But what if we don't know the IP address? What if I just want to send a request to amazon.com?

IP addresses are translated into a human readable name via the Domain Name Service, or DNS. The DNS hierarchy is structured similarly to the IP routing hierarchy, and the IP associated with the requested domain is stored in the DNS database.


Additional Resources