Computer Network Components
2. Hub
A Hub is a basic networking device used to connect multiple computers or network devices
together in a Local Area Network (LAN).
How a Hub Works
When one computer on the network wants to send data to another computer:
1. The sending computer transmits the data packet to the hub through a cable.
2. 🔁 The hub does not know which computer the data is meant for.
3. 📢 So it broadcasts (sends) that data to all devices connected to it.
4. 💻 Each device checks if the message is for them.
o If yes, it accepts the data.
o If no, it ignores and drops it.
This process is like shouting a message in a room full of people — everyone hears it, but only
the right person responds.
Functions of a Hub
Function Explanation
Connectivity Connects multiple computers or network devices using cables.
Sends (broadcasts) data to all connected devices, not just the
Data Broadcasting
intended one.
Increases the strength of signals before forwarding them (in active
Signal Regeneration
hubs).
Simplified Allows basic communication among connected computers within a
Communication LAN.
3. Switch
A Switch is a networking device that connects multiple computers, printers, and servers within
the same Local Area Network (LAN) — similar to a hub, but smarter and faster.
While a hub sends data to every device on the network, a switch is intelligent enough to send
data only to the specific device that needs it.
This makes communication faster, more efficient, and more secure.
How a Switch Works (Step-by-Step)
When a computer sends data through a switch, here’s what happens:
1. 🧾 The data is packaged into frames (like digital envelopes).
2. 📬 Each frame contains the MAC address (unique physical address) of the destination
device.
3. 🔍 The switch reads that MAC address.
4. 📖 It looks it up in its MAC address table — a list that tells the switch which device is
connected to which port.
5. 🎯 The switch then sends the data only to that specific port/device, not to everyone.
This process is called “switching”, and it’s why switches are much faster and more efficient than
hubs.
Example
Imagine three computers — A, B, and C — connected through a switch:
If A sends a file to B,
the switch directs that data only to B’s port.
C won’t even see the message, so there’s no wasted bandwidth or confusion.
👉 In contrast, a hub would have sent the same data to all three computers, even though only B
needed it.
Key Features of a Switch
Feature Explanation
The switch keeps a list (table) of all devices and their MAC
MAC Address Table
addresses.
Selective Data Transmission Sends data only to the correct destination device.
Collision-Free
Reduces or eliminates data collisions.
Communication
Full-Duplex Mode Allows sending and receiving data at the same time.
High Speed Provides faster and smoother network performance than hubs.
Types of Switches
There are several kinds of switches depending on use and intelligence:
A. Unmanaged Switch
Simple “plug and play” device.
No configuration needed.
Common in homes or small offices.
B. Managed Switch
Can be configured and monitored by administrators.
Used in large organizations.
Allows VLANs, traffic control, and security management.
C. Layer 3 Switch
Works like a switch but can also perform some routing functions.
Used in advanced enterprise networks.
Advantages of Using a Switch
✅ 1. Faster Performance:
Because it sends data only to the intended device, the network is faster.
✅ 2. Reduced Collisions:
Unlike hubs, switches isolate communication paths — preventing data collisions.
✅ 3. Efficient Use of Bandwidth:
Switches use network bandwidth wisely by avoiding unnecessary broadcasts.
✅ 4. Enhanced Security:
Data is sent directly to its destination — not visible to all devices like in a hub.
✅ 5. Scalability:
You can easily connect multiple switches to expand the network.
Disadvantages of a Switch
❌ 1. Higher Cost:
More expensive than hubs due to advanced hardware and intelligence.
❌ 2. Configuration Complexity:
Managed switches require technical knowledge to set up.
❌ 3. Not Ideal for Tiny Networks:
For very small setups (2–3 devices), a switch might be overkill.
Hub vs Switch Comparison
Feature Hub Switch
Data Direction Broadcasts to all devices Sends only to the target device
Efficiency Low High
Speed Slower Faster
Layer Physical Layer (Layer 1) Data Link Layer (Layer 2)
Collision Domain Single (shared) Separate for each port
Use Today Obsolete Standard in modern networks
4. Router
A Router is a networking device that connects multiple networks together — most
commonly, it connects your Local Area Network (LAN) (like the Wi-Fi in your home or office)
to the Internet (WAN).
In simple terms, a router acts like a traffic manager — it directs data packets between networks
so that information reaches the correct destination efficiently and safely.
What Does a Router Do?
When you send an email or open a website:
1. Your computer sends the data (in small units called packets) to the router.
2. 🌐 The router examines the packet’s destination address.
3. 🧭 Using its routing table (a kind of digital map), the router decides the best path to send
that packet toward its destination.
4. 🚀 The router forwards the packet to the next device (another router, switch, or directly
to the Internet Service Provider).
Where Does a Router Operate?
A router operates at Layer 3 (the Network Layer) of the OSI Reference Model.
This layer is responsible for logical addressing — meaning it uses IP addresses (like
[Link]) to determine where data should go.
While switches use MAC addresses to send data within the same network, routers use IP
addresses to send data between different networks.
How a Router Works (Step by Step)
Let’s break down the process simply:
1. Receive: The router receives a data packet from one of the devices in the network.
2. Analyze: It reads the destination IP address on the packet.
3. Consult: It checks its routing table — a database that stores the paths to different
networks.
4. Forward: It sends the packet through the best path to reach its destination (either within
the LAN or out to the Internet).
📬 For example:
If you visit [Link], your router recognizes that the destination is outside your
local network, so it sends the request to your Internet Service Provider (ISP), which
passes it onward.
🧩 Key Functions of a Router
Function Explanation
Routing Determines the best path for data to travel.
Packet Forwarding Sends data packets to the next destination along the path.
Network Segmentation Divides large networks into smaller, manageable sections.
Traffic Management Reduces congestion by directing data efficiently.
Security Filtering Blocks unauthorized access through built-in firewalls or rules.
🧱 Advantages of a Router
✅ 1. Security
Routers help keep networks safe.
Even though data travels across shared cables or airwaves, only the intended recipient (based
on the IP address) can read it.
Most routers also have firewalls that block malicious traffic from the internet.
✅ 2. Reliability
If one server or part of the network fails, other networks connected through the router
remain unaffected.
This means routers help isolate and contain network problems.
✅ 3. Performance
Routers can reduce congestion by dividing large, busy networks into smaller sections.
For instance:
24 computers all communicating on one network create heavy traffic.
A router can split this into two groups of 12, cutting network traffic in half and
improving overall speed.