# The Internet

> A global network of physical cables and routers that allows computers to communicate.

Subject: Internet | Lesson 1 of 35 | 3 min read
Interactive lesson: https://codewithanimation.in/internet/the-internet
Next: [Packets & Routing](https://codewithanimation.in/internet/packets-and-routing.md)

## What is the Internet?

The Internet is a massive, global network of computers connected to each other. It is fundamentally a 'network of networks'.

It consists of both **hardware** (physical cables like undersea fiber optics, routers, and switches) and **software** (protocols that dictate how data navigates that hardware).

## Why it matters

Web developers build applications that sit on top of this physical infrastructure. Understanding it helps you reason about performance and security.

Because data is bound by the speed of light and physical distance, every 'hop' between routers adds latency. Because data travels through dozens of third-party physical routers, encryption (HTTPS) is absolutely necessary.

## How it works

When a device sends data over the internet, it isn't sent as one giant file. Instead, the TCP/IP protocol breaks it down into small chunks called **packets**.

These packets travel across various routers and cables to reach their destination IP address. Because the network is decentralized, packets from the same file might take entirely different physical routes to avoid traffic congestion or broken links.

## Common mistake: The Web vs The Internet

The #1 misconception is confusing the 'Internet' with the 'World Wide Web'.

The Internet is the underlying physical infrastructure (the roads and highways). The Web is just a specific service built on top of it (the shops and traffic) that uses the HTTP protocol to share HTML documents. Other services like Email and online gaming use the Internet but are not 'the Web'.

## Tip: The Postal Service Model

Think of the Internet as the global postal system. IP addresses are the unique street addresses for every house. Routers are the local post offices that read the address and forward the mail. The Web is just one type of mail being sent through this infrastructure.

## Try it: Packet Routing Simulator

Send a message through the network. Watch how the data breaks into packets and dynamically routes across nodes to reach its destination.

The animation is on the lesson page and is not part of this text version: https://codewithanimation.in/internet/the-internet

## Check yourself

### Question 1

What is the fundamental difference between the Internet and the World Wide Web?

- A. The Internet is the global network infrastructure, while the Web is a service that runs on top of it.
- B. The Internet is for computers, and the Web is for mobile devices.
- C. They are exactly the same thing, just different terms.
- D. The Internet was invented for websites, while the Web is for email.

Correct answer: A

Think of the Internet as the physical roads and infrastructure. The World Wide Web is just the traffic and the shops built along those roads.

- Why not B: Incorrect. Both mobile and desktop devices use the Internet infrastructure to access the Web.
- Why not C: This is a common misconception! The Internet is the physical network, while the Web is a collection of linked documents.
- Why not D: Actually, both websites and email are distinct services that run on the overarching infrastructure of the Internet.

### Question 2

In the context of the Internet, what is the primary role of 'packets'?

- A. They are small chunks of data broken down for efficient and reliable transmission across the network.
- B. They are small programs that render web pages on the client's browser.
- C. They act as security firewalls to block malicious traffic.
- D. They are physical cables connecting different continents.

Correct answer: A

Sending a massive file all at once could block the network or fail completely if interrupted. Breaking data into small packets allows them to take different routes and reassemble at the destination, making the network highly resilient.

- Why not B: Browsers render pages using code like HTML/CSS. Packets just deliver the raw text of that code.
- Why not C: Firewalls block traffic, whereas packets are the vehicle carrying the data itself.
- Why not D: Cables are the physical hardware; packets are the digital data traveling through them.

### Question 3

How do devices on the Internet know exactly where to send data to each other?

- A. Using IP (Internet Protocol) addresses, which act like unique digital postal addresses.
- B. By searching Google for the exact location of the computer.
- C. Using HTML tags that define the destination.
- D. By broadcasting the data to every computer on Earth until the right one responds.

Correct answer: A

Every device connected to the Internet has an IP address. Network routers act like traffic cops, looking at the destination IP address on a packet and sending it to the next closest router until it arrives.

- Why not B: Search engines help humans find web pages; they don't handle the physical routing of data between computers.
- Why not C: HTML structures content on a page, it does not handle network routing.
- Why not D: Broadcasting to the entire Internet would instantly crash it! Data is precisely routed to specific IP addresses.

## Remember this

- The Internet is physical hardware and network rules. The Web is just one application built on top of it.
- Data is chopped into packets which find their own path through routers across the world.
- Everything operates on unique IP Addresses.
