Now that you know how the front end is tied together with the back end, it’s a good time to take a closer look at how the web works.
We all use the Internet (most likely) every day, but:
- What is the Internet, like really?
- How does it all work under the hood?
Free Guide: Contents
- What is coding?
- Intro to programming languages
- Front-end and backend
- How does the Internet work?
- Useful tools for coding
- Computer Science fundamentals
What is the Internet?
To get started, here is a helpful video about the basics you should watch. If you feel confused about the topic, the video will answer quite a few questions.
Simply put, the Internet is a wire buried in the ground. It might be made of fiber optics, copper, or these days also beamed via satellites or cell phone networks.
A wire? Doesn’t sound too glamorous.
Why is the Internet so useful then if it is just a wire?
Because any two or more computers connected to this wire can communicate with each other.
And this communication is what our modern world is built on, really. The ability to transfer data and information from one side of the planet to the other almost instantly is a rather new concept, though. But it has changed the world forever in just 30 or so years.
To understand how this entire thing works, let’s look at web servers next.
What is a web server?
A web server has two main characteristics:
- It is a special computer connected directly to the Internet.
- The server’s hard drive stores any documents that should be accessible via the Internet.
You can think of a server as a landlord for websites. When you create a website and need space for your documents, you rent it from a server for a given period.
Moreover, your web server not only stores and hosts your website files. It also knows what to do whenever someone wants to visit your website. It makes it accessible for everyone connected to the Internet.
So when your website gets a visitor, the serves retrieves the correct files from the storage space to be sent to the their web browser.
Looking for some web space for your own website? If you’re not sure which one to choose, check out what I use at Resources / Hosting and Domains.
I’m connected to the Internet. Is my computer a web server?
The computers you and I use daily aren’t servers. They’re not directly connected to the Internet.
Our “regular” computers are called clients, since they are connected indirectly to the Internet through an Internet Service Provider (ISP).
Let’s say you are using your computer at home and you want visit a website via your DSL connection. You then connect to the Internet via your ISP, which in turn allows you to access the website files on a web server that you request via your web browser.
How is data transferred via the Internet?
Data travels on the Internet in small packets.
For example, an image file is chopped into smaller pieces when it’s sent. When it reaches its destination via the Internet, the data bits are patched together again.
Let’s imagine you and your best friend are both using your DSL connection at your place.
You have two computers that use your ISP, but you are visiting two different websites on your laptops: you are on Facebook and your friend is checking their emails at Gmail.
Now, how does Facebook’s server know which laptop to send the files to that you requested? And how does Gmail’s server know how to not display your friend’s emails on your laptop screen?
The solution is IP addresses and routers.
IP addresses and routers: helping data navigate
Everything connected directly or indirectly to the Internet, has a unique IP address. And I mean everything:
- Cell phones
- Servers etc.
At any point where two or more parts of the Internet intersect, there is a device called a router.
Routers direct information packets – or files – through the Internet. They send data packets one step at a time towards their final destination such as your laptop.
When you log in to Facebook, your laptop sends data to Facebook’s server. Each router that the data packet meets along the way adds its own “stamp” to the packet.
That way, when Facebook’s server sends a data packet back to you in return, it follows the same router path, tracking its way back to the correct client – your computer.
Remember Hansel and Gretel? Just like the breadcrumbs they used to find their way back home, routers also leave their mark on data packets that need to find their way back home.
What is an IP address?
Every server has a unique internet protocol (IP) address.
Just like a postal address for mail, IP addresses help computers find each other.
Every device, such as a computer or a cell phone, that is using a Transmission Control Protocol/Internet Protocol (TCP/IP) network has this unique identifier.
What is a domain name?
The IP address consists of a unique string of numbers.
Since such strings are difficult to remember for us humans, we can alias an IP address with a more readable name called a domain name.
For instance, mikkegoes.com is the domain name used on top of my website’s IP address.
Thus, using the domain name is simply an easier way for us to reach a computer over the Internet.
To register your own domain, check out Resources / Domains & Hosting.
What is a Domain Name Server (DNS)?
DNS is like a phone book for the Internet.
Basically, the DNS is the complete collection of domains and their registered IP addresses, all stored in a giant database.
This distributed system allows other computers to know where to find your website.
What is the World Wide Web (WWW)?
So what is the difference between the WWW and the Internet then?
These two terms are often used interchangeably, but in fact they are far from being the same thing.
The WWW is not the Internet.
- The Internet is a technical infrastructure which allows billions of computers to be connected to each other.
- The WWW is simply a service built on top of of that infrastructure.
The Web stands for a collection of hypertext documents that are linked together. These include websites like the one you are visiting right now.
Of course, your favourite web applications are also part of this enormous collection of hypertext documents that make up the Web.
In short, the Internet simply provides a means to access these documents, for example using your web browser.
Summing it up
- The WWW consists of all the documents that are linked together via the Internet
- The Web is simply a service built on top of the infrastructure offered by the Internet
What is a URL?
Now we know that the WWW is a collection of documents: text files, images, videos, style sheets, database tables and much more.
Every document on the Web that is accessible through the Internet need a unique web address, the Uniform Resource Locator or URL.
A URL is simply an address or a reference to a resource on the Internet.
What is a web browser?
Chrome, Firefox, Safari, Opera, Internet Explorer – they’re all web browsers. But what do they do exactly?
A web browser is a tool that is used to present a web page to a curious visitor.
Whenever you surf online and wish to open a specific web page, your browser sends a request to the server and their hard drive where the files are stored that make up that exact web page.
Then, the server sends these files to your web browser, which in turn displays the contents together with their styling and interactive elements.
All of the most popular web browsers and their different versions display and render HTML and CSS in a slightly different way.
So when you are viewing your web page in Firefox and it’s looking great, it doesn’t necessarily mean that your page works as smoothly for a Safari user.
Therefore, it’s a crucial part of any website project to thoroughly test the website with different browsers.
Final thoughts: How does the Internet work?
I hope you found some useful information in this section of this chapter.
Even though the massive infrastructure for communication offered by the Internet isn’t something you need to think about daily, it’s a good idea to understand how it all works.
The main takeaway here is that the Internet is not the WWW.
Also, at latest when you create and launch your own website, it’s helpful to know what’s happening in the background.
In the next part of this chapter, we will take a look at some tools and software that are necessary or helpful for learning to code.