Chapter 1
Clients, servers, and their communication protocols
In the first chapters, you will learn more about the entire chain of actions triggered by displaying a website.
It might seem abstract and difficult for now, but I promise, everything will become clearer very soon.
Today, we start with essential notions on the web: clients and servers.
- What are they?
- How do they communicate?
Clients and Servers
Imagine yourself as a customer in a three-star restaurant. It's so chic that you have at your disposal a server who can advise you on the dish, another on the dessert, a third on wines...
Each one brings you a different service. They are trained to respond to all sorts of requests: "I want a gluten-free dish", "can we have some bread"...
Servers each have their mode of communication and vocabulary. Asking the wrong server for the bar could result in you getting a fish.
💡 In the IT world, it's just the same!
Concretely, a computer server is software that runs continuously on a machine. In everyday language, the word 'server' is used to refer either to the software or the machine.
The server is constantly listening for incoming requests to provide quality service to its clients.
There are dedicated servers for each service: websites, emails, file transfers...
Each of these servers has its own vocabulary, its way of organizing communications: each follows its own protocol.
To load a website, you therefore need to communicate with a web server following its protocol.
Web servers communicate using HTTP and HTTPS protocols.
By default, your computer has no idea how to do this, so you need to install dedicated software.
This software, capable of communicating with the server following the protocol, is called a “client”.
Clients that can speak to web servers: web browsers.
Chrome, Safari, Firefox, Opera, Edge… these are all HTTP clients with the ability to interpret a server's HTTP response.
Communication Protocols
Now imagine you want to communicate with your grandmother by mail to ask for her pancake recipe.
You write your letter following your communication protocol “Hi Granny, please send me your pancake recipe, goodbye”.
For your letter to reach Granny, you must drop it at your village post office. There is also a protocol to follow so that they agree to provide this service: “place your letter in an envelope with a stamp, write your address and the destination address”.
You send it by registered mail to ensure its proper delivery.
The post office wants to send the letter to a sorting center. They also have a protocol in place: “put the letter in a package with all the other letters of the day”.
To transport the package, the office calls a carrier following their protocol: “here is the address of the sorting center”.
Your letter is on its way to the sorting center. The center unpacks the package, checks the address on the letter, then puts the letter in another package destined for another center.
In summary, to get the "pancake recipe" service, you indirectly call upon other services: post office, sorting center, carrier.
Each uses its own protocol.
Your letter was placed in an envelope, then in a package, then in a truck.
You now have access to a global network. Granny will receive your letter wherever you both live.
Cool, you've just understood how the internet works! 😎
There are thousands of protocols, offering just as many services: security against hacking, data transmission without loss, file transfers, etc…
Different models represent them in layers, going from the closest to the client (the one writing the letter) to the closest to the physical medium (the road).
The Internet was founded on the TCP/IP model, now called the “Internet Protocol Suite”.
This model is divided into 4 layers:
-
4 - Application: this layer represents the protocols very close to you. These are the most well-known protocols to the general public: HTTP (web), FTP (file transfer), DNS (domain name resolution), SSH (remote connection to a machine), SMTP (email), etc…
To load a web page, we use the HTTP protocol. In the example: you are the client, Granny is the server, your letter is the request. - 3 - Transport: this is the layer that controls the flow and manages errors. It’s the tracking on your registered letter. For a web page, it’s the TCP protocol. Complex cases, like streaming services, use UDP instead to prioritize speed over quality. They don’t mind losing a second of video.
- 2 - Internet: this is the post office. Based on Granny’s address, your letter is routed from sorting center to sorting center. IP (Internet Protocol), using IP addresses, allows sending messages all over the world.
-
1 - Network Access: the carrier. It physically organizes the movement of letters between participants: by truck, train, airplane...
Ethernet and its derivatives are used between two machines connected by a twisted pair cable or optical fiber. Wi-Fi and its counterparts are used for wireless communications.
The destination address you give to the carrier corresponds to the MAC address of your network card.
On the road, trucks carry packages, containing envelopes, containing letters.
👉 Over the twisted pair cable, the electrical signal represents Ethernet frames, containing IP packets, containing TCP segments, containing HTTP messages.
The postman rings at Granny’s to hand over the envelope. She opens it and reads the letter, shows it to her friends because she is happy, and then responds in another letter which will make the return journey.
👉 The server receives an Ethernet frame, ascends to the HTTP request, processes it, and then responds with the website content.