How the Web works | Cyber Security Tutorial - Learn with VOKS
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Back Next

How the Web works

Learn this topic step-by-step with VOKS Tutorials.

How The Web Works

The Web is something we use every day, but many beginners do not clearly understand what happens behind the scenes when they type a website address into a browser.

The Difference Between The Internet And The Web

Many people think they are the same, but they are different.

Internet

The Internet is the global network of connected computers. It is the infrastructure — the cables, routers, and servers that allow devices to communicate.

Web

The Web (World Wide Web) is a service that runs on the Internet. It allows us to access websites using browsers.

The Internet is the road system.

The Web is one of the services that uses those roads.

Basic Components Of The Web

To understand how the web works, you must know the main components:

Client

The client is your device (computer, phone, tablet). It uses a browser like Chrome or Firefox.

Server

A server is a computer that stores websites and sends them to users when requested.

Browser

A browser is software that retrieves, interprets, and displays web content.

Protocol

A protocol is a set of rules for communication. The web uses HTTP or HTTPS.

DNS

The Domain Name System translates human-friendly names (like example.com) into IP addresses.

Step 1: You Enter A URL

A URL (Uniform Resource Locator) looks like this:


https://www.example.com/index.html

This URL has several parts:

  • https → Protocol
  • www.example.com → Domain name
  • /index.html → Specific resource on the server

Step 2: DNS Lookup

Computers do not understand domain names. They understand IP addresses like:


93.184.216.34

When you enter a URL:

  1. Your browser asks the DNS server:
  2. "What is the IP address of www.example.com?"
  3. The DNS server responds with the correct IP address.

Now your browser knows where to send the request.

Step 3: Establishing A Connection

Your browser connects to the server using:

  • HTTP (HyperText Transfer Protocol)
  • HTTPS (HTTP Secure)

HTTPS is encrypted using TLS, which protects your data.

The connection is usually established over TCP (Transmission Control Protocol).

Step 4: Sending An HTTP Request

After connection, your browser sends an HTTP request.

Example of a simple HTTP GET request:


GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html

Explanation:

  • GET → Request method
  • /index.html → Resource requested
  • Host → Domain name
  • User-Agent → Information about the browser
  • Accept → Type of content expected

Step 5: The Server Processes The Request

The server:

  1. Receives the request.
  2. Finds the requested file.
  3. Runs server-side code if necessary (like PHP, Python, Node.js).
  4. Prepares a response.

Step 6: The Server Sends An HTTP Response

Example of an HTTP response:


HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1256

<html>
  <head>
    <title>Example Page</title>
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

Explanation:

  • 200 OK → Status code (success)
  • Content-Type → Type of data returned
  • Content-Length → Size of data
  • HTML → The webpage content

Step 7: The Browser Renders The Page

The browser:

  1. Reads the HTML.
  2. Requests additional files (CSS, JavaScript, images).
  3. Builds the DOM (Document Object Model).
  4. Applies styles.
  5. Executes JavaScript.
  6. Displays the final page.

What Is HTML?

HTML (HyperText Markup Language) defines the structure of web pages.

Simple HTML example:


<!DOCTYPE html>
<html>
<head>
  <title>My First Page</title>
</head>
<body>
  <h1>Welcome</h1>
  <p>This is a webpage.</p>
</body>
</html>

HTML defines structure, not design.

What Is CSS?

CSS (Cascading Style Sheets) controls appearance.

Example:


body {
  background-color: lightblue;
}

h1 {
  color: darkblue;
}

CSS makes pages look visually appealing.

What Is JavaScript?

JavaScript adds interactivity.

Example:


document.querySelector("h1").addEventListener("click", function() {
  alert("You clicked the heading!");
});

JavaScript allows dynamic behavior.

Static Vs Dynamic Websites

Static Website

  • Sends fixed HTML files.
  • Content does not change unless manually updated.

Dynamic Website

  • Content is generated by server-side programs.
  • Uses databases.
  • Changes based on user interaction.

Example technologies:

  • PHP
  • Python (Django, Flask)
  • Node.js

What Happens When You Click A Link?

When you click a link:

  1. Browser sends a new HTTP request.
  2. Server responds.
  3. Browser re-renders page or updates part of it.

Modern websites often use AJAX or APIs to update content without reloading the entire page.

What Is HTTPS And Why It Matters

HTTPS encrypts data between browser and server.

Without HTTPS:

  • Passwords can be intercepted.
  • Data can be modified in transit.

With HTTPS:

  • Data is encrypted.
  • Identity of server is verified using certificates.


# Example URL
https://www.example.com/index.html

# Example IP address
93.184.216.34

# Example HTTP GET request
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html

# Example HTTP response
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1256

<html>
  <head>
    <title>Example Page</title>
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

# Example HTML
<!DOCTYPE html>
<html>
<head>
  <title>My First Page</title>
</head>
<body>
  <h1>Welcome</h1>
  <p>This is a webpage.</p>
</body>
</html>

# Example CSS
body {
  background-color: lightblue;
}

h1 {
  color: darkblue;
}

# Example JavaScript
document.querySelector("h1").addEventListener("click", function() {
  alert("You clicked the heading!");
});
QUICK KNOWLEDGE CHECK

Test Your Understanding

Answer 5 questions generated from this lesson. Your result is calculated instantly and is not saved.

0 / 5 answered
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL
Course contents
Cyber Security
01 Introduction 02 Types of Cyber Threats 03 Cyber Security Domains 04 CIA Triad (Confidentiality Integrity Availability) 05 Career paths in Cyber Security 06 Certifications 07 Ethics and Responsible Disclosure 08 Laws and Regulation (e.g. GDPR, NDPR) 09 What is an OS? 10 Types: Window, Linus, macOS 11 Command-line vs GUI 12 OS Internals Overview (filesystems, processes, permissions) 13 Windows command prompt basics 14 Linux Bash Basics 15 File System Navigation 16 Basic Scripting 17 IP Addressing 18 DNS, DHCP 19 Mac Address 20 OSI VS TCP/IP Models 21 Ports and Protocols (TCP, UDP) 22 Common Protocols (HTTPS, FTP, SSH, etc.) 23 Packet structure 24 Firewalls, IDS/IPS, VPNs 25 Common attacks: MITM, Sniffing 26 Secure Network Practices 27 How the Web works 28 HTTP vs HTTPS 29 URLs, Headers, Cookies 30 Client-Server Architecture 31 Introduction To Web Security 32 OWASP Top 10 Overview 33 Common Threats (XSS, SQLi, CSRF) 34 Inpute validation and authentication flow 35 Basic Exploitation demo (e.g. XSS) 36 Burp Suite Introduction 37 Using a Browser For Testing 38 Password security 39 MFA-Antivirus 40 Cyber Hygeine Practice 41 Intro To Tools: Nmap, Wireshark, Netstat