- Tell local and wide area networks and network devices apart
- Explain the structure of an IP address and the job of DNS
- Put in order the steps that happen when a website opens
- Know the difference between HTTP and HTTPS
Aysel types a website address into her browser and presses Enter, and in less than a second a page arrives from a server that may be in another country. In that short moment her request passes through dozens of devices, the address is turned into numbers, and the page travels back in pieces. Let's follow that journey step by step.
What is a computer network?
A group of computers and other devices linked by communication channels so that they can exchange data and share resources such as printers, files and an internet connection.
| Network type | Area covered | Example |
|---|---|---|
| Local area network (LAN) | a room, a building or a campus | a school computer lab, home Wi-Fi |
| Wide area network (WAN) | cities, countries, continents | a bank's network linking all its branches, the internet |
The internet is the largest wide area network, joining millions of networks around the world — a “network of networks”. Your home network is connected to the internet by a router. Routers pass data from one network to another and choose a good path for it. Most things on the internet follow the client–server model: your browser (the client) sends a request, and the computer that hosts the website (the server) sends back a response.
IP addresses and packets
Every device on a network has an IP address — like a postal address, it tells where data should be delivered. In the widely used IPv4 format an address is four numbers separated by dots, for example 192.168.1.10. Each number is one byte, so it ranges from 0 to 255, and the whole address is 32 bits.
a) Why can't an IPv4 address contain a number of 256 or more?
b) How many different IPv4 addresses are possible?
Show solutionHide solution
192.168.1.300 is not a valid address.b) The address is 32 bits: 2³² = 4,294,967,296, about 4.3 billion addresses.
There are more connected devices than that, so the newer 128-bit IPv6 format was created; its addresses are written in hexadecimal, for example
2001:db8::1.A large file or page does not travel across the network in one piece: it is split into small parts called packets. Each packet carries the IP addresses of the sender and the receiver. Packets may take different routes, and at the destination the TCP protocol puts them back in the right order and asks again for any lost ones.
DNS: the internet's phone book
People remember names better than numbers, so websites have domain names like www.example.com. DNS (the Domain Name System) turns a name into an IP address: your computer asks a DNS server “what is the address for this name?” and gets an IP address in reply. The rightmost part of the name is the top-level domain: .com, .org, or country domains such as .az (Azerbaijan), .tr (Türkiye) and .ru (Russia).
HTTP and HTTPS: how a browser talks to a server
A protocol is a set of agreed rules that lets devices understand each other. Web pages are delivered with the HTTP protocol: the browser sends the server a request (for example, GET /index.html), and the server returns the page together with a status code. HTTPS is the secure version of the same protocol: the data is encrypted, so nobody along the way can read or change it.
| Code | Meaning |
|---|---|
| 200 | OK — everything is fine, the page was sent |
| 301 | the page has moved permanently to another address |
| 404 | Not Found — there is no such page |
| 500 | internal server error |
Now let's put all the pieces together. Here is what happens when a website opens:
- 1You enter the address
Aysel types
https://www.example.cominto the browser. - 2DNS lookup
The computer asks a DNS server for the IP address of
www.example.com. - 3Connection
The browser opens a TCP connection to the server at that IP address; with HTTPS, encryption keys are then agreed on.
- 4HTTP request
The browser asks for the page with a
GETrequest. - 5Response
The server sends back the code
200 OKand the page's HTML in packets. - 6Building the page
The browser reads the HTML, loads the images and style files in the same way and shows the page on the screen.
const url = new URL('https://www.example.com/lessons/informatics?lang=az');
console.log(url.protocol);
console.log(url.hostname);
console.log(url.pathname);
console.log(url.searchParams.get('lang'));▸ Expected output
https: www.example.com /lessons/informatics az
URL object makes it easy to take them apart.Key points
- A computer network is a group of linked devices that exchange data; the internet is a network of networks.
- An IPv4 address is 32 bits: four numbers from 0 to 255, such as 192.168.1.10.
- Data travels in packets, and routers choose their path.
- DNS turns a domain name into an IP address.
- HTTP delivers pages and HTTPS protects them with encryption; 404 means “page not found”.
Check yourself
10 questions. Every correct answer earns XP.