</>
ShikshaCSLearn. Code. Grow.
๐Ÿ”
โ˜• Support Us
ShikshaCSโ€บNotesโ€บComputer Networks
Computer Networks
๐Ÿ•’ 9 min read

Network Devices (Hub, Switch, Router, Gateway)

The physical hardware that actually builds a network, and what makes each one different.

Hub โ€” The Simplest, Dumbest Device

A hub is a basic Physical-layer device that connects multiple devices in a network, but has NO intelligence โ€” it simply repeats any incoming signal out to EVERY other connected port, regardless of who the data is actually meant for. This creates a lot of unnecessary traffic and collisions, which is why hubs are almost entirely obsolete today, replaced by switches.

Switch โ€” Smart Local Connections

A switch, as covered earlier, operates at the Data Link layer and is much smarter than a hub โ€” it learns which MAC address is connected to which port, and forwards data ONLY to the intended recipient's port instead of broadcasting everywhere. This dramatically reduces unnecessary traffic and makes switches the standard choice for connecting devices within a LAN today.

Router โ€” Connecting Different Networks

A router operates at the Network layer and connects DIFFERENT networks together, using IP addresses to determine the best path for forwarding data between them. Your home router connects your local network (LAN) to your ISP's network (which eventually reaches the wider internet) โ€” this is fundamentally different from a switch, which only connects devices WITHIN one network.

Gateway โ€” The Network's 'Exit Door'

A gateway is a broader term for any device that acts as an entry/exit point between two different networks, often handling protocol translation if the two networks use different communication standards (not just different IP ranges). In many home setups, your router IS your gateway โ€” but the term 'gateway' more generally refers to ANY device performing this network-boundary role, even ones that translate between completely different types of networks.

How They Work Together

In a typical home setup: your phone connects wirelessly to a switch (built into your router), the switch forwards traffic to the router component, and the router (acting as your default gateway) forwards traffic onward to your ISP and the wider internet. Modern home 'routers' are actually combination devices โ€” bundling switch, router, gateway, and Wi-Fi access point functionality all into one physical box.

๐ŸŒ Real-World Use

The single box in your home that you call your 'Wi-Fi router' is actually doing the job of AT LEAST three devices at once: a switch (for wired Ethernet ports), a router (connecting your home network to your ISP), and a wireless access point (for Wi-Fi) โ€” all combined into one convenient physical unit.

๐Ÿ’ก Pro Tip

A frequently tested distinction: a switch operates within ONE network (Data Link layer, MAC addresses), while a router connects DIFFERENT networks together (Network layer, IP addresses) โ€” if a question asks about connecting your home network to the internet, the answer is always 'router', never 'switch'.

๐Ÿงช Quick Self-Test

Check what you just learned โ€” no pressure, just practice.

1. Why are hubs mostly obsolete today?

2. At which OSI layer does a router primarily operate?

3. What is a common example of a device performing a 'gateway' role at home?

โ† Back to all Notes