How Does The Internet Work?

Abidi Ghofrane
6 min readApr 8, 2020

What happens when you type www.holbertonschool.com in your browser and press enter?

Here’s a little fact, millenials will not survive without internet, And yet, not a lot of them know how it actually works. So if you’ve ever asked this question before, no better time than the lockdown to go visit all those unanswered questions. And no better place than this article for a little push on the basics. (wink wink)

Let’s start Shall we?

the internet is just an enormous system of interconnected wires buried deep underground transferring data back and forth. These wires enable compters that are connected to them to be connected with each other.

It’s all about data transfer

In order for that to happen, we need protocols. a protocol is a set of rules and standards specifying how computers should communicate with each other over a network. It dictates how to format, transmit, and recieve data by breaking larger functions into smaller ones.

How does the data find its way?

Simple, like your house has an address, so does your computer when logged on internet. most computers use the TCP/IP protocols.

IP is the Internet Protocol . An IP address is the unique identifier of a machine on a network it is a unique number that gets linked to all online activity. The TCP on the other hand is Transmission Control Protocol, the one responsible for specifying how data is exchanged by providing end to end communications that identify how it should be broken into packets, adressed, transmitted routed and recieved.

Here’s how an IP adress would look like

In case you’re wondering, a packet is the smallest unit of transmitted data. when data is sent accross the internet it is first split into many fragments called packets. The typical maximum packet size is between 1000 and 3000 characters.

How does the TCP/IP work?

Communication is done through compiling packets of data and sending them to the right destination. It does that through a series of abstract layers:

  • Physical layer (Datalink layer) : The network components that connect nodes and hosts in the network. It’s what handles the physical part.
  • Network layer (Internet layer) : It’s what controls the movements of packets, it takes care of sending data through the shortest route and if a route has problems it sends the packet through an other one.
  • Transport layer : It divides the data into packets, acknowledges the packets that it has recieved from the other device and makes sure the device acknowledges the packets it has recieved.
  • Application layer: It’s what the user usually interacts with such as emails and messaging

TCP/IP is attached with the client/server model in which one computer (user) makes a request to another computer (server) and this one finally provides the service requested. It is considered stateless. This means that every request is considered to correspond to a new user because each one is unrelated to the previous one made.

What’s a client/server model?

It is a distributed application structure that partitions workload between the providers of a resource or service, called servers, and service requesters called clients.

  • a Client is for example you typing the website in the browser. requesting to see the webpage
  • a Server is a special computer connected directly to the internet and web pages are files on that server

As mentioned earlier, Every server has an IP address but since 34.234.197.104 doesn’t exactly stay in mind, specially when there are millions of websites, they also have names like www.holbertonschool.com . Basically, we use domain names, because they are people friendly. They are more human readable and lend themselves far more to memorization and recognition, as opposed to the IP addresses that they represent. DNS, is the responsible protocol and infrastructure for connecting domain names with the proper ip addresses.

How does DNS work?

Right after typing the URL of a website in the web browser, the computer first checks its local DNS cache, which stores the IP address of websites it has visited recently. If it doesn’t find it, the request travels into the Internet to a DNS recursive resolver. a DNS resolver is usually the internet service provider it is designed to receive queries from client and make ones to the rest of the servers. so then it makes a request to the Root server who responds to the resolver with the address of a Top Level Domain (TLD) DNS server (such as .com or .net). The resolver then goes to the appropriate TLD and requests for the IP address of the domain’s nameserver, then the resolver sends a reqest to the TLD nameserver who hosts the last portion of a hostname . with the help of the domain registrar, the resolver makes a request to the authoritative nameserver. The authoritative nameserver is the last stop in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested.

Now that we have the ip address of the website we wish to visit, we know who to request for the website content. the next step involves communication with the web server.

What’s a web server?

web server are where the website’s files are stored. it also includes several parts that control how web users access hosted files, at minimum an HTTP server. An HTTP server is a piece of software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). This protocol basically defines how the data should be formatted and encoded in order to send/receive it.

HTTP

HTTPS is the more secured version of http, hence the ‘s’ for secure at the end of the acronym. The main difference between HTTP and HTTPS is that the data transfer itself is encrypted, the one we send as request and also the one we receive as respond. This added layer of security is done through a protocol known as SSL(Secure Socket Layer).

What is SSL ?

SSL is a protocol for establishing authenticated and encrypted links between networked computers. SSL certificates have a key pair: a public and a private key. These keys work together to establish an encrypted connection. This is done through a process known as the SSL handshake.

Ok so now we have the ip address, the web server is supposed to be secure are we get there yet? No, we need to pass through the web server. Imagine Facebook or twitter for example, millions and millions of users are connected to it daily, the traffic must be huge so servers will not have the ability to deal with all the request at the same time, that’s why we need a Load Balancer.

A Load balancer distributes the workload of a system to multipule individuals or groups of systems, it is used for balancing http traffic over multiple servers. the processing load can be shared accross many nodes rather than being limited to a single server. it has two main roles:

  • It increases the performance during times of high activity.
  • It increases the reliability of a web application by allowing redundancy. so if one server node fails the traffic is programmatically distributed to an other node without any interruption of the system.

As an other measure of security, besides SSL, we have Firewalls!

A firewall acts as a defence system for the computer, it monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules.

If you’re not a cyber criminal you’ll probably pass through it x) and now the server send a https response back to your browser and u can navigate the website!

--

--

Abidi Ghofrane

Software engineering student at Holberton School Tunis