📘 CodingMarble Learn

Computer Networks and How the Internet Works

A network is a group of devices linked to share data. Each device has an IP address. Data is cut into numbered packets. Routers pass each packet hop by hop towards its address, and TCP puts the packets back in order. DNS turns a website name into an IP address. Clients ask, servers answer. Firewalls, passwords, updates and encryption keep a network safe.

🎬 Step-by-step story

  1. A network is two or more devices joined to share data, by cable or Wi-Fi.
  2. Each device gets an IP address, like a house number, so data knows where to go.
  3. A big message is cut into small numbered packets, each with the to and from address.
  4. Routers pass each packet one hop closer. Packets can take different roads and are put back in order at the end.
  5. DNS is the phone book: it turns a website name into an IP address.
  6. Free play: send data, break a link to see a new route, and switch on a firewall.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Is Wi-Fi the same as the Internet?

No. Wi-Fi is only the wireless link between your device and the router. The router then connects to the Internet through your provider.

Why can't two devices have the same IP address?

Packets would not know which one to go to, just like two houses with the same number on one street.

Why cut data into packets at all?

Small packets share links fairly, can take the free road, and only a lost piece needs re-sending, not the whole file.

How do packets arrive in the right order if they take different roads?

Each packet carries a number. TCP at the receiver sorts them and asks again for any missing number.

Why do we need DNS if computers use numbers?

People remember names, not numbers. DNS looks up the number for the name so you do not have to.

What does a firewall actually do?

It checks each packet against rules and stops the ones that are not allowed, like a security guard at a gate.

What is a computer network?

A network is a group of devices (computers, phones, printers) linked so they can share data and resources. The link can be a wire (Ethernet cable, optical fibre) or wireless (Wi-Fi, mobile data).

Types by size

Key devices

IP addresses and packets

Every device on a network has an IP address. An IPv4 address has 4 numbers from 0 to 255, e.g. 192.168.1.5. That gives about 4.3 billion addresses, which is not enough, so the newer IPv6 uses much longer addresses written in hexadecimal.

Addresses starting 192.168 or 10. are private: used only inside a home or office LAN. Your router shares one public address with the outside world.

Data is sent as packets: small pieces, each with a header (from-address, to-address, packet number) and some of the data. This is called packet switching.

Routing and the TCP/IP layers

A router reads the to-address of each packet and sends it one step (a hop) closer, using a routing table. If a link breaks, routers pick another path, so the Internet has no single weak point.

Rules for talking are called protocols. The Internet uses a stack of layers:

  1. Application: HTTP/HTTPS (web), SMTP (email), DNS.
  2. Transport: TCP (reliable: numbers packets, checks, re-sends) or UDP (fast, no checks; used for live video and games).
  3. Internet: IP (addresses and routing).
  4. Link: Ethernet, Wi-Fi (the actual cable or radio).

DNS, servers and clients

A client asks for something; a server answers. Your browser is a client; a web server sends the page. Other services: email servers, file servers, print servers, game servers, DHCP (gives each new device an IP address automatically) and DNS.

DNS (Domain Name System) is the Internet's phone book. You type a name; your computer asks a DNS server for the IP; then it contacts that IP. In peer-to-peer networks there is no main server: every device shares with the others.

Keeping a network safe

Try it: open a command prompt and type ping example.com. You will see the IP address DNS found and how many milliseconds each packet takes to go and come back.

Key formulas and definitions

Worked examples

1. A school has 40 computers in one building connected with cables and switches. What type of network is this?

It covers one building, so it is a LAN (Local Area Network).

2. Is 192.168.1.300 a valid IPv4 address?

No. Each of the four numbers must be from 0 to 255, and 300 is too big.

3. A file is 3 MB and each packet carries 1,500 bytes of data. About how many packets are needed? (1 MB = 1,000,000 bytes)

3,000,000 ÷ 1,500 = 2,000 packets.

4. Trace what happens when you type www.example.org in a browser.

1) The browser asks a DNS server for the IP of www.example.org. 2) DNS replies with the IP. 3) The browser sends an HTTPS request, cut into packets, to that IP. 4) Routers forward the packets hop by hop. 5) The web server sends back the page in packets. 6) TCP puts them in order and the browser shows the page.

5. A link has a bandwidth of 100 Mbit/s. How long does it take, ideally, to send a 50 MB file? (1 byte = 8 bits)

50 MB = 400 Mbit. Time = 400 ÷ 100 = 4 s.

Common mistakes

Practice quiz

1. What does DNS do?
2. Which device sends packets between different networks?
3. A home network is usually a:
4. Which protocol re-sends lost packets?
5. In a client-server network, the server:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a computer network in simple words?

Two or more devices joined by cable or Wi-Fi so they can share data, like files, printers or the Internet.

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

The Internet is the worldwide network of networks. The Web is a service on it: web pages linked together and opened in a browser.

What is TCP/IP?

The main set of Internet rules: IP gives addresses and routes packets; TCP makes sure all packets arrive and are in order.

Where this is taught

Canada (Ontario)Grade 11A. Computer Technology Fundamentals
Canada (Ontario)Grade 11A. Computer Technology Fundamentals
Canada (Ontario)Grade 12A. Computer Technology Fundamentals
Canada (Ontario)Grade 12A. Computer Technology Fundamentals
ItalySecondaria di secondo grado – classe 5ª (esame di Stato)Computation, networks and simulation
PolandSzkoła podstawowa, klasa VIIUsing computers, digital devices and networks
PolandSzkoła podstawowa, klasa VIIIUsing computers, digital devices and networks
Spain2º ESODigitalising the personal learning environment
Spain3º ESODigitalising the personal learning environment
Spain4º ESODigital devices, operating systems and communication
Spain1º BachilleratoComputer systems and programming
CBSE (India)Class 10Networking
CBSE (India)Class 11Networking and Internet
CBSE (India)Class 11Basics of Networking
CBSE (India)Class 12Computer Networks
CBSE (India)Class 12Introduction to Computer Networks
USA (Common Core, NGSS, AP)Grade 8Networks and the Internet
USA (Common Core, NGSS, AP)Grade 9Networks and the Internet
USA (Common Core, NGSS, AP)Grade 10Big Idea 4: Computer Systems and Networks
Japan高校1年Networks and data
Japan高校(専門学科)1〜3年Marine Information Technology
FranceQuatrièmeComputing and programming
FranceTroisièmeComputing and programming
FranceSecondeThemes
FrancePremière3. Behaviour of products
FranceTerminale3. Behaviour of products
FranceTerminaleCompetences and content
Russia7 классDigital literacy
Russia7 классDigital literacy

Learn next

Related lessons

All Computer Science lessons