Network Diagram: How the Internet communcates

Introduction

The Internet is like a complex postal system for data. Each time you visit a website, your computer follows a series of steps to request and retrieve the resources needed to display the page. In this reading, we’ll break down how all the parts of the Internet work together to handle these requests.

Step 1: Making a Request

The process begins when you type a URL into your browser and hit "Enter." Your computer opens a port (e.g., port 80 for HTTP or port 443 for HTTPS) to establish a connection with the web server hosting the website’s resources.

Analogy: Think of this as opening your mailbox to send a letter. The port is the opening through which data flows.

Diagram 1: Making a Request
Diagram 1: The browser opens a port to initiate the connection.

Step 2: DNS (Domain Name System)

Your computer doesn’t know the IP address of the website you’re trying to visit, so it queries a DNS server to find it. This happens over a UDP connection, where your computer sends a packet containing:

The DNS server responds with the IP address of the web server, which your computer saves in its DNS cache for future use.

Diagram 2: DNS Query
Diagram 2: Your computer queries the DNS server for the IP address.
Diagram 3: DNS Response
Diagram 3: The DNS server responds with the IP address of the web server.

Step 3: Establishing the Connection

With the web server's IP address in hand, your computer initiates a connection using a process called the three-way handshake:

  1. Your computer sends a SYN (synchronize) packet to the server.
  2. The server responds with a SYN-ACK (synchronize-acknowledge) packet.
  3. Your computer sends an ACK (acknowledge) packet to complete the handshake.

This handshake establishes a session between your computer and the web server, allowing data to flow smoothly.

Analogy: This is like agreeing to a phone call: you say "hello," the other person responds, and you confirm you're ready to talk.

Diagram 4: Establishing the Connection
Diagram 4: The three-way handshake establishes a session with the server.

Step 4: Requesting and Receiving Data

Once the session is established, your browser begins sending HTTP requests to the web server. These requests ask for web pages and other assets (e.g., images, CSS, JavaScript files). The server responds with the requested data, which your browser uses to render the website.

When you’re done browsing, the session is closed to free up resources.

Analogy: This is like ordering items from a catalog. You send in a list of what you want (HTTP requests), and the company ships you the items (server responses).

Diagram 5: Requesting and Receiving Data
Diagram 5: The browser requests web pages, and the server responds with data.

Key Takeaways

By understanding these steps, you can better appreciate how the Internet functions and troubleshoot issues when something goes wrong.