Router vs switch vs modem: three devices in one box

☰ All 15 lessons

You know that box at home for the internet? We call it "the modem". But there are actually three things inside it.

Inside the home internet box: modem, router and switchISPfiber (light)the one box at homeModemlight ↔ dataRoutergives IPsSwitchLAN ports💻 laptop📺 TV🖥️ PC
  1. The ISP's fiber brings light; the modem turns it into digital data.
  2. The router gives devices private IPs and connects your network to the internet.
  3. The switch connects devices to each other using their MAC addresses.
One box, three jobs: modem, router, switch.

Modem: light into data

Your internet company, the ISP, brings a fiber cable to your house. What travels through that fiber is light, a signal made of light. Your phone and laptop can't understand light; they need digital data.

The modem turns that light into digital data, and when you send data out, it turns it back into a signal. That's called modulation and demodulation, which is where the name comes from: MOdulator-DEModulator, modem.

Router: connects your network to the internet

The internet has reached your house. But which data should go to which device: the phone, the laptop or the TV? The router decides that. The 192.168 private IPs from lesson 3 are given out by the router in that box. It connects your private network to the internet outside and sends each reply to the right device.

Switch: connects devices inside the network

Now imagine an office with 50 computers. The router doesn't have nearly enough ports for that many cables, so you add a switch. A switch connects computers to each other inside the same network, and uses their MAC addresses to decide which computer each piece of data should go to.

The four LAN ports at the back of your home box? That's a small built-in switch.

DeviceJobWorks with
ModemTurns the ISP's signal (light) into digital data and backThe ISP's line
RouterConnects your network to the internet, gives private IPs, sends data to the right deviceIP addresses
SwitchConnects devices to each other inside the networkMAC addresses

Why it matters for hackers: the router is the door between your network and the internet, so it's one of the first devices attackers look at: default passwords, old firmware, open admin pages. Change your router's admin password today if you never have.

Key takeaways

  • Modem = turns light from the fiber into digital data (MOdulator-DEModulator).
  • Router = connects your network to the internet and gives private IPs.
  • Switch = connects devices inside the network, using MAC addresses.
  • Your home box has all three.

Quick quiz

Pick an answer to check yourself. Answer both to mark this lesson done.

1. What connects many computers in the same network to each other by cable?

  1. A) Modem
  2. B) Switch
  3. C) ISP
  4. D) Browser
Show answer

Answer: B. A switch connects devices inside the same network, using MAC addresses to send data to the right device.

2. What gives home devices 192.168 IPs and connects the network to the internet?

  1. A) Router
  2. B) Switch
  3. C) Phone
  4. D) LAN cable
Show answer

Answer: A. The router gives devices private IPs and connects the network to the internet.

Module 1 test

Five questions on lessons 1 to 5.

1. What's the problem with learning only hacking tools, without networking?

  1. A) The tool won't open
  2. B) If the tool doesn't work like the video, you won't know what to do
  3. C) The internet gets slow
  4. D) No problem at all
Show answer

Answer: B. Like the MCB example: without a basic understanding, you don't know where to look when something goes wrong.

2. A college joins the networks of its campuses in different places into one big network. What is it?

  1. A) LAN
  2. B) WAN
  3. C) Bluetooth
  4. D) Modem
Show answer

Answer: B. A network spread across many places is a WAN (Wide Area Network).

3. Which of these is a public IP?

  1. A) 192.168.1.10
  2. B) 192.168.31.2
  3. C) 203.0.113.25
  4. D) 192.168.0.1
Show answer

Answer: C. Addresses starting with 192.168 are private home IPs. The other one is public.

4. Which address is put into a device's network interface card when it is manufactured?

  1. A) IP address
  2. B) MAC address
  3. C) Port number
  4. D) Domain name
Show answer

Answer: B. The MAC address is in the hardware. The IP is given by the network and can change.

5. What turns the light signal in a fiber cable into digital data?

  1. A) Switch
  2. B) Router
  3. C) Modem
  4. D) Phone
Show answer

Answer: C. Modem = MOdulator-DEModulator. It turns light into data, and data back into a signal.

Frequently asked questions

What is the difference between a router and a modem?

The modem converts the ISP's signal (light in a fiber cable) into digital data. The router takes that connection, gives your devices private IPs and sends data between your network and the internet.

What is the difference between a router and a switch?

A router connects different networks, such as your home network and the internet, using IP addresses. A switch connects devices inside one network using MAC addresses.

Do I have a modem, router and switch at home?

Usually yes, all in one box from your ISP. The fiber goes into the modem part, Wi-Fi and IPs come from the router part, and the LAN ports at the back are a small switch.

Do it hands-on.

This tutorial gives you the concepts. The 50 Days Ethical Hacking Challenge puts them to work in real labs, explained in Malayalam.