How The Internet Works: An Exhaustive Guide For Absolute Beginners
June 6, 2023 • 0 minute read •
Think of a city - a vast, sprawling metropolis. Now imagine that every person, building, vehicle, and street in this city is a part of the Internet. Your device is a citizen of this city, your favourite website is a popular destination, and the paths taken to reach there are the networks that make up the Internet. Intriguing, isn't it?
Welcome to our journey of understanding this massive, invisible 'city' that impacts our lives every day - the Internet. Despite being an integral part of our lives - helping us stay connected, learn, work, and entertain ourselves - the inner workings of the Internet can seem mystifying.
How does a video get from YouTube's servers to your screen? How does an email zip across the globe in seconds?
This guide will give you a richer understanding of our digital world and make you marvel at the magic that happens every time you go online. Let's dive in!
What is the Internet?
Let's start with the big picture. The Internet is a massive, global network of connected computers. But let's take this abstract idea and give it another flavour.
Think of the Internet as a gigantic postal system for the entire world. In this system, each computer is a post office. Some are small local branches (like your laptop at home), and others are major sorting centres (like the servers that power websites such as NewDev or Google). These post offices (computers) are scattered across the entire world.
Now, how do these offices communicate with each other? That's where our network comes in. A series of routes connect them - some are roads (like your home Wi-Fi), others are highways (like the high-speed cables that run between cities), and we even have flights (data transmitted via satellites). This vast, intricate network of connections forms the backbone of the Internet.
Data Travel - Packets, the Internet's Letters
Just as a postal system delivers letters and packages, the Internet's primary function is data delivery. But instead of physical mail, we're dealing with digital information - emails, web pages, images, and more. And here's where things get interesting.
Instead of sending a piece of information as a whole, the Internet sends data in small, manageable chunks known as packets.
Why do we do this? Well, imagine you're moving houses and want to transport your collection of a hundred pieces of artwork. You wouldn't carry all your pieces of artwork at once, right? That would be heavy, and you'd risk dropping and damaging your precious cargo. Instead, you'd pack them into several boxes and move them one at a time.
The same logic applies to data on the Internet. Sending large amounts of data as one whole piece would be inefficient and prone to errors. Instead, data is broken up into smaller packets, each carrying a part of the information. These packets are sent separately across the network, often taking different routes to reach the same destination.
IP Addresses - The Street Addresses of the Internet
Every device connected to the Internet, like every post office in our analogy, has a unique identifier known as an IP (Internet Protocol) address. Like a street address, an IP address allows data packets to find their way to a specific device among billions of others.
An IPv4 address, the most commonly used form, consists of four sets of numbers separated by periods, such as 192.168.1.1
. Each set can range from 0 to 255. It's very much like a house number (192
) on a particular street (168
), in a specific city (1
), and in a particular country (1
).
With the surge in devices needing unique addresses, we are rapidly running out of unique IPv4 addresses. To solve this problem, a new system called IPv6 was introduced, which provides a much larger pool of unique addresses. An IPv6 address looks like this: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
. It's as if we started adding apartment numbers, floor numbers, and room numbers to our addresses to accommodate more houses in the same area.
Domains and DNS - Humanizing IP Addresses
Remembering numeric IP addresses can be quite a chore. Imagine having to remember the exact latitude and longitude every time you wanted to visit your favourite restaurant! To make things user-friendly, we use domain names - easy-to-remember names for the numeric IP addresses.
For instance, instead of typing in 172.217.164.174
(which is pretty hard to remember), you can type www.google.com
and reach the same place. It's similar to recalling 'The White House' rather than '1600 Pennsylvania Avenue NW Washington, DC 20500.
So, how does this magic happen? Thanks to the Domain Name System, or DNS - the Internet's equivalent of a telephone directory. When you type www.google.com
into your browser, the DNS translates it into the corresponding IP address. It's like looking up 'The White House' in the Yellow Pages to find its address.
This is an excellent place to pause.
Okay, we've covered quite a bit of ground, and there's plenty more to come! Now, let's delve deeper into the inner workings of the Internet.
HTTP and HTTPS - The Web's Rules of Communication
With the stage set, let's talk about how these computers (or 'post offices') talk to each other. This is where HTTP (HyperText Transfer Protocol) and HTTPS (HTTP Secure) come in. These protocols define the rules for how data should be exchanged on the web.
Think of HTTP as the etiquette at a dinner party. Just as there are rules about which fork to use for which course, there are rules for how data should be sent and received. For example, when you click a link or type a URL into your browser, your computer sends an HTTP request to the server that hosts the website you want to visit. This request is like your order at a restaurant. The server then sends back an HTTP response, which is like your meal being served.
Now, HTTPS is the secure version of HTTP. It provides the same function but adds a layer of encryption to keep data private and secure.
Chapter 5: How a Google Search Works
Let's get into something we do multiple times daily - Google searches. How does typing a few words into Google yield millions of results in a fraction of a second?
Imagine a librarian with an extraordinary memory. This librarian has read every book in the library and remembers everything. So, when you ask for books about JavaScript, they can instantly recommend several, including my book, Simplified JavaScript for Very Important Programmers, which you can get on Amazon, Selar or Leanpub.
Google works similarly. Google's servers 'crawl' the web, visiting websites and reading their content. They then 'index' this information, creating a massive, searchable database. When you type a search query, Google's algorithm sifts through this vast index, ranking the results based on various factors, such as relevance to your query and the reliability of the website.
Internet Service Providers (ISPs) - Your Gateway to the Internet
An Internet Service Provider, or ISP, is the company that provides you with access to the Internet. They are like the bus service that takes you around our metaphorical city of the internet. ISPs own the infrastructure (the 'roads') that your data travels on when it leaves your house and ventures into the wider Internet.
When you type in a website address, your ISP routes your request through a series of networks (like different bus stops) until it reaches the server (the destination) hosting the website you want to visit. The server then sends the website data back along those networks until it reaches you.
Routers and Mobile Networks - Your Personal Internet Dispatchers
Finally, within your house, you likely have a router device. A router's job is to direct traffic on your home network. It's like your personal internet dispatcher guiding data packets to their correct destinations.
When your device sends a packet of data to the Internet, it first goes to your router. The router looks at the destination IP address and then sends the packet onto the broader Internet. When data comes in from the Internet, the router receives it and directs it to the correct device on your home network.
Now, for devices with SIM cards, like smartphones or certain types of tablets, there is the option of connecting to the Internet through a mobile network. The SIM card allows the device to communicate with the nearest cell tower, which then connects to the ISP, and in turn, the broader Internet.
This is how your mobile device maintains a network connection even when you're away from home or a Wi-Fi hotspot.
Whether you're using a router or a mobile network, the essential process is the same: your device sends out requests for data, which travel across networks until they reach their destination, before the requested data makes the return journey to your device. In the following section, we'll dive deeper into how all these components work together to make the Internet function seamlessly.
The Internet: A Symphony of Components
Now that we've individually examined all the essential components - from IP addresses and domain names to HTTP protocols, Google searches, ISPs, and connectivity devices - it's time to tie all the threads together and witness the symphony of the Internet in action. But before that, let's clear up a common misconception.
While Internet and World Wide Web (or the Web) are often used interchangeably, they aren't the same.
The Internet is the underlying infrastructure that allows devices around the world to communicate with each other.
The World Wide Web, on the other hand, is a service that runs on the Internet. It is a collection of websites and web pages that are accessible via the Internet. So when you're browsing websites, you're using the web, which is just a part of the Internet.
So while the web is a significant part of the Internet, it's not the Internet itself. All the websites you visit are part of the web, but the emails you send, the files you download, or the online games you play are all facilitated by the broader Internet infrastructure.
Now, let's see this in action!
Suppose you want to visit a website, www.newdev.com. It all starts when you type the URL into your web browser and hit enter.
Your browser doesn't understand the friendly domain name www.newdev.com. It needs the numerical IP address associated with that domain name, so DNS steps in like a handy phonebook to provide this.
Your device (the client) then packages a request for the website's data into small chunks called packets. These packets journey across the Internet, guided by their destination IP address and directed by various routers along the way.
Once the packets reach their destination – the website's server, it responds with the requested data, also in packets. This interaction is managed by protocols like HTTP or HTTPS.
Back at your end, the incoming packets pass through your connectivity device (like a router or cell tower if you're using mobile data) and then onto your device, where they're reassembled to reconstruct the original data.
The browser takes this data, usually written in HTML, CSS, and JavaScript, and interprets it to display the website on your screen. And voila! You're now viewing www.example.com
. This entire process happens in seconds and repeats every time you visit a new web page.
So, the Internet functions like a well-coordinated team, with each player knowing their part. Whether it's the DNS providing translations, routers guiding packets, or protocols overseeing the data exchange - each part contributes to the smooth operation of the whole. It's this teamwork that makes our journey on the Internet highway seamless.
Essential Terms to Know
-
Client: A client is any device, like your laptop or smartphone, that sends a request to a server over the Internet. When you type in a URL or click on a link, your device (the client) sends a request for information.
-
Server: A server is a computer that receives requests from clients and sends back responses. Websites are stored on servers, so when you want to visit a website, your client device sends a request to the server that hosts that site.
-
Browser: A web browser (like Google Chrome, Mozilla Firefox, or Safari) is a software application used to access information on the World Wide Web. It takes the data sent by the server and turns it into a website you can interact with.
-
URL (Uniform Resource Locator): A URL is the unique address of a web page on the Internet. It's what you type into your web browser when you want to visit a website. For instance,
https://www.google.com
is a URL. -
HTML (HyperText Markup Language): HTML is the standard language for creating web pages. It provides the structure of a webpage, like paragraphs, headers, links, and images.
-
CSS (Cascading Style Sheets): CSS is a style sheet language used to describe the look and formatting of an HTML document. It determines the colours, fonts, and layout of a webpage.
-
JavaScript: JavaScript is a programming language that makes web pages interactive. It's what makes buttons and web forms work, among other things.
-
Cookies: Cookies are small files stored on your computer by your browser that keep track of your activity and preferences as you browse the web.
-
Bandwidth: Bandwidth is the maximum rate of data transfer across a given internet connection.
Next Steps
-
Learn Basic HTML, CSS, and JavaScript: Understanding these foundational web technologies will give you a deeper understanding of how web pages are built and function. Click here to start learning how to code on NewDev.
-
Get Hands-On: Try building a basic web page using HTML, CSS, and JavaScript. You can find project-based web development tutorials on my Youtube channel
-
Understand Web Security Basics: Learn about the basics of Internet and web security, including secure passwords, the importance of HTTPS, and how to protect yourself from malware.
-
Explore Further: If a particular topic intrigues you, dive deeper. The Internet is a vast field, with topics ranging from network architecture to web design to data privacy.
Remember, the key to understanding the Internet is curiosity and hands-on exploration. So don't be afraid to ask questions and experiment.
If you learnt from this article, let me know in the comments section (coming soon!) or use the share button 💛 at the bottom-right to share this article with others. If you want to reach out to me directly, click on my NewDev profile to see all my social media links and contact info.