📘 Decent HTML Notes

Learn HTML step by step with simple examples



Lecture 1: Introduction to the Working of the Internet

HOW Does Internet Work

Principle 1: The Need to Share Information

The core idea is transferring information from one computer (A) to another (B), even when they are far apart. A simple but inefficient method is using physical storage like a USB. To improve, we connect the computers directly with a cable (e.g., ethernet or fiber optic). Data is transmitted as electrical signals or light pulses, with agreed codes (like high voltage = 1, low voltage = 0). This creates a direct link, enabling the exchange of bits (1s and 0s) electronically.

Principle 2: The Problem of Scale

Directly connecting every computer to every other one requires too many cables and doesn’t scale well. To solve this, a central device called a switch is used, where each computer connects only to the switch. The switch forwards messages to the intended recipient, making communication efficient. This setup forms a Local Area Network (LAN), allowing multiple computers in the same location (like homes or offices) to communicate effectively.

Principle 3: The Problem of Connecting Networks

When multiple local networks need to communicate, connecting every computer directly is impractical. Instead, a Router is used—a device that links one network to another and routes traffic between them. By connecting routers across different networks, we can build a large web of interconnected networks. This principle underlies the Internet, which is essentially a “network of networks,” made up of millions of local networks linked together by routers.

Principle 4: The Problem of Finding Anyone (Addressing)

To communicate across the global network, every device needs a unique identifier. This is provided by the IP Address (Internet Protocol Address), which works like a digital postal address. Routers use IP addresses to decide where to forward data, sending it step by step ("hops") toward its destination. This addressing system makes worldwide communication across the Internet possible.

Principle 5: The Problem of Reliability and Fairness

Large files can’t be sent as a single stream because it would block the network and risk corruption. The solution is to break data into small, numbered packets. Each packet carries part of the data, the sender and receiver IP addresses, and its sequence number. Packets may take different routes, but the receiver reassembles them in order, requesting missing ones if needed. This method is governed by the TCP/IP protocol, which ensures reliable communication over the Internet.

Now we can understand How our device connect to internet

IP Address
IPv4 (Internet Protocol version 4) is the traditional IP addressing system.

Structure: 32-bit number, written as four decimal blocks (0–255).

Example: 172.217.16.142

Capacity: Maximum of 2³² ≈ 4.3 billion addresses.

Problem: With the rapid growth of devices (phones, laptops, IoT), this limited pool is insufficient.

Impact: Led to the introduction of public and private IPs, and eventually IPv6 to overcome scarcity.
A Public IP address
A Public IP address is a device’s unique global identifier on the internet.

Analogy: Like a company’s main phone number.

Uniqueness: Must be globally unique; no two devices share the same one simultaneously.

Purpose: Makes a device reachable from anywhere (used by websites, email servers, etc.).

Assignment: Given by the ISP (leased, not owned).

Examples: Your home router’s IP, google.com’s server, Netflix’s server.

Note: From the internet’s view, your whole home network appears as one device under that single public IP.
Private IP Address

A local address used only within a private network (e.g., home Wi-Fi, office LAN).

Analogy: Like an employee’s private 4-digit extension number.

Uniqueness: Must be unique only inside the local network.

Example: My laptop can be 192.168.1.100 at home, and your laptop can have the same address at your home—no conflict.

Purpose: Enables devices on the same local network to communicate (e.g., laptop to printer, phone to Chromecast).

Assignment: Given by your router to devices on your network.

Reserved Ranges:

10.0.0.0 → 10.255.255.255 (large corporations)

172.16.0.0 → 172.31.255.255 (medium networks)

192.168.0.0 → 192.168.255.255 (most common for home use)
IPv6
IPv6 (Internet Protocol version 6) is the next generation of the Internet Protocol. Its primary purpose was to solve the address exhaustion problem of IPv4.

The fundamental difference is the size of the address:

IPv4: Uses a 32-bit address, giving us ~4.3 billion unique addresses.

IPv6: Uses a 128-bit address.

The difference between 32-bit and 128-bit is not 4x. It's an exponential leap that is difficult to comprehend.

The number of possible IPv6 addresses is 2^128, which is roughly:

340,000,000,000,000,000,000,000,000,000,000,000,000

(340 undecillion)
What Does an IPv6 Address Look Like?
Because it's so long, the format is different. It uses hexadecimal (numbers 0-9 and letters a-f) instead of just decimal numbers.

An example of a full IPv6 address:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

It's broken down into:

Eight groups of four hexadecimal characters.

The groups are separated by colons (:).

What is MAC Address

A MAC (Media Access Control) Address is a unique, permanent serial number burned into every network-capable piece of hardware (your laptop's Wi-Fi card, your phone, your smart TV, the network port on your desktop).

To track you, if you get offline and someone get the ip, they will get your message.

A MAC address is a 48-bit number. To make it readable for humans, it's typically written as 12 hexadecimal digits.

The most common ways you'll see it displayed are:

Colon-Separated (Most Common):
3C:22:FB:A3:B4:C5

Hyphen-Separated (Common on Windows):
3C-22-FB-A3-B4-C5

Period-Separated (Used by Cisco and other network gear):
3c22.fba3.b4c5

No Separators (Less common, seen in some software):
3C22FBA3B4C5
mac image

Port Number

A port number is a numerical identifier that specifies a particular process or service on a device within a network.

It works with the IP address to ensure data reaches the correct application.

Analogy: The IP address is like a building’s street address, while the port number is like an apartment number inside the building.

Range: 0 to 65,535 (16-bit number).

Well-known ports (0–1023): Reserved for common services (e.g., HTTP – 80, HTTPS – 443, FTP – 21).

Registered ports (1024–49151): Used by user applications and services.

Dynamic/Private ports (49152–65535): Temporary ports for client connections.

Purpose: Allows multiple services to run on the same device without conflict.
Diagram showing port numbers and their ranges

DNS(DOMAIN NAME SYSTEM)

Definition: DNS is like the phonebook of the internet. It translates human-readable website names (like www.google.com) into IP addresses (like 142.250.184.142) that computers use to identify each other.

Why it’s needed: People remember names easily, but computers communicate using numbers (IP addresses). DNS bridges this gap.

How it works:

You type a domain name in your browser.

The request goes to a DNS server.

The DNS server finds the corresponding IP address.

Your computer uses that IP to connect to the correct server.

Analogy: Like dialing a friend by name in your phone contacts instead of remembering their phone number.
DNS image