Understand who asks what from whom when a web page appears on your screen.
Open this lesson in KodokonPicture a restaurant. You sit down, you call the waiter, you order a dish, and the waiter brings it to you. The web works in exactly the same way. You, with your browser, are the client: you are the one doing the asking. On the other side sits a server: a computer that is switched on around the clock, somewhere in an air-conditioned building, whose only job is to wait for requests and answer them. There is nothing magical about a server: it is a machine like yours, except it never sleeps and it has no screen.
The single most important thing to remember: the server never makes the first move. It sends you nothing until you have asked for something. Every time you type an address or click a link, your browser sends a request, and the server sends back a response. Request, response. Request, response. The entire web comes down to that back and forth.
For a request to reach its destination, every connected machine has an IP address: a series of numbers that acts as a postal address, for example 93.184.215.14. Your message is not sent in one piece: it is chopped into small chunks called packets, which each travel their own way through dozens of intermediate machines, then get reassembled in the right order on arrival. You can check that a machine answers with the ping command.
ping -c 2 example.com
PING example.com (23.215.0.136): 56 data bytes
64 bytes from 23.215.0.136: icmp_seq=0 ttl=54 time=17.3 ms
64 bytes from 23.215.0.136: icmp_seq=1 ttl=54 time=16.9 ms
--- example.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet lossAnd what exactly does the server send back? Text. A web page is nothing more than a text file written in HTML that the server ships to you and that your browser lays out. You can see this with your own eyes without a browser, using the curl tool, which sends a request and prints the raw response in the terminal.
curl -s https://example.com | head -n 5
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />