Chapter 6: What is Routing? Understanding Switches, Hubs, and Routers
Introduction
Every time you browse the internet, send an email, or stream a video, your data travels through multiple networking devices to reach its destination. These devices include switches, hubs, and routers, which work together to route data efficiently.
But what exactly do these devices do? How does routing work? And why do we need different devices for networking? In this chapter, we’ll break down these concepts in simple terms using real-world analogies to help you understand how networks function.
What is Routing?
Routing is the process of finding the best path for data to travel across networks. Routers direct network traffic, just like how GPS finds the best route for a car trip.
Real-World Analogy: GPS Navigation for Data
Imagine you are driving from City A to City B.
You can take different routes (shortest, fastest, least traffic).
A GPS (router) finds the best route based on real-time conditions.
Similarly, a router determines the best path for your data packets to travel across networks.
Without routing, data would be lost or delayed, just like taking the wrong road on a trip.
What is a Router?
A router is a device that connects different networks and ensures data is sent correctly between them.
Functions of a Router:
✅ Assigns IP addresses to devices in a network.
✅ Directs internet traffic to the correct destination.
✅ Acts as a gateway between local devices and the internet.
✅ Provides security by blocking unauthorized access (firewall).
Real-World Analogy: A Post Office Sorting Letters
A post office (router) receives letters (data packets) from different senders.
It reads the addresses and sends each letter to the correct city (network).
Similarly, a router reads IP addresses and forwards data to the correct destination.
How to View Your Router Settings in Ubuntu UI
Open Settings → Network.
Click on your active connection (Wi-Fi or Ethernet).
Check Gateway – This is your router’s IP address (usually
192.168.1.1
).Open a browser and enter
192.168.1.1
to access the router’s settings (if required).
What is a Switch?
A switch is a networking device that connects multiple devices within the same network and forwards data efficiently.
Key Features of a Switch:
✅ Connects devices in a LAN (Local Area Network).
✅ Forwards data only to the intended device.
✅ Improves speed by reducing unnecessary traffic.
Real-World Analogy: A Hotel Receptionist
In a hotel, guests call the reception to connect to a specific room.
The receptionist (switch) forwards the call only to the intended room, instead of broadcasting it to everyone.
Similarly, a switch sends data only to the right device, improving efficiency.
Hub vs. Switch: What’s the Difference?
Feature | Hub | Switch |
Sends data to all devices | ✅ Yes | ❌ No |
Sends data only to the intended device | ❌ No | ✅ Yes |
Efficient and reduces network congestion | ❌ No | ✅ Yes |
A switch is smarter than a hub because it knows where to send data, whereas a hub sends data to all devices, causing unnecessary traffic.
What is a Hub?
A hub is an older networking device that broadcasts data to all connected devices, even if it’s only meant for one.
Why are Hubs Rarely Used Today?
❌ They create unnecessary traffic by sending data to all devices.
❌ They are less secure, as all devices receive the same data.
✅ Switches have replaced hubs because they send data only where needed.
Real-World Analogy: A Loudspeaker vs. Private Calls
A hub is like using a loudspeaker in a room – everyone hears the message, even if it’s meant for one person.
A switch is like making a private phone call – only the intended recipient gets the message.
How Do These Devices Work Together?
In a typical network setup:
A router connects the network to the internet.
A switch connects multiple devices within a local network.
A hub (if used) broadcasts data to all connected devices.
Example: A Small Office Network
Router → Connects the office network to the internet.
Switch → Connects all office computers, printers, and servers.
Devices → Each employee’s PC gets an IP address and can access the internet through the router.
Conclusion
Understanding routing, switches, hubs, and routers is crucial for managing networks. These devices work together to ensure data reaches its destination quickly and securely.
Key Takeaways:
✅ Routing finds the best path for data, like GPS navigation.
✅ Routers connect networks and direct internet traffic.
✅ Switches improve efficiency by forwarding data only to the intended device.
✅ Hubs are outdated because they send data to all devices instead of just the correct one.
✅ Ubuntu UI allows you to check your router settings easily.
Next Chapter: How to Create IP Routes in Ubuntu Using the UI.