Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Networking Devices: Repeaters, Hubs, Bridges, Switches, Routers & Gateways

Lesson 10 of 15 in the free Computer Networks notes on Siksha Sarovar, written by Rohit Jangra.

Networking Devices: Repeaters, Hubs, Bridges, Switches, Routers & Gateways

---

1. Repeater (Layer 1 — Physical Layer)

A repeater is the simplest networking device — it operates purely at the physical layer.

Function

  • Regenerates and amplifies a weakened/distorted signal
  • Extends the maximum transmission distance of a cable segment
  • Does not examine any addressing information — it blindly forwards every bit

Characteristics

FeatureDetail
OSI LayerLayer 1 (Physical)
AddressingNone — works on raw signal bits
Collision domainSame as input — all connected segments form one collision domain
FilteringNone
PurposeExtend cable distance (e.g., beyond 100m Ethernet limit)

---

2. Hub (Layer 1 — Physical Layer)

A hub is a multi-port repeater — every signal received on any port is retransmitted on all other ports.

Why Hubs Are Inefficient

  • Shared collision domain: All ports compete for the same bandwidth
  • Half-duplex: Only one device can transmit at a time
  • Wasted bandwidth: Every device receives every frame, even if not addressed to it
  • Security risk: All devices can see all traffic (eavesdropping trivial)
Hubs are now obsolete — replaced entirely by switches in modern networks.

---

3. Bridge (Layer 2 — Data Link Layer)

A bridge connects two or more LAN segments and filters traffic based on MAC addresses.

How a Bridge Works

  1. When a frame arrives, the bridge records {source MAC → incoming port} in its MAC address table
  2. It checks if the destination MAC is in its table:
  • If destination MAC is on the same side → drop the frame (no need to forward)
  • If destination MAC is on the other side → forward the frame
  • If destination MAC is unknown → flood (forward out all ports except incoming)
  1. Each port is in its own collision domain — eliminates inter-segment collisions

Bridge vs Switch

FeatureBridgeSwitch
Ports2–424–48+
SpeedSoftware-based MAC lookupHardware-based ASICs
PerformanceLowerMuch higher
UseLegacy segment joiningModern LAN backbone

---

4. Switch (Layer 2 — Data Link Layer)

A switch is a multi-port bridge with hardware-accelerated MAC address table lookups.

Switch Operation

  1. Learning: Records {source MAC → port} for each frame received
  2. Filtering: Drops frames destined for the same segment they came from
  3. Forwarding: Sends frame only to the correct destination port
  4. Flooding: If destination MAC unknown or broadcast → sends to all ports

Key Switch Features

FeatureDetail
Collision domainOne per port (full duplex possible)
Broadcast domainOne per VLAN (all ports by default)
AddressingMAC address table (CAM table)
SpeedWire-speed forwarding via hardware ASICs
VLANsCan segment network logically without physical rewiring

Layer 3 Switches

Modern "Layer 3 switches" can perform IP routing in hardware — combining switch speed with router functionality. Used in enterprise LAN cores.

---

5. Router (Layer 3 — Network Layer)

A router routes IP packets between different networks using routing tables.

Router Operation

  1. Receives an IP packet, examines the destination IP address
  2. Looks up the destination in the routing table (longest prefix match)
  3. Determines the next hop and outgoing interface
  4. Decrements TTL by 1; if TTL reaches 0, drops packet and sends ICMP Time Exceeded
  5. Forwards packet out the appropriate interface

Router Key Features

FeatureDetail
OSI LayerLayer 3 (Network)
AddressingIP addresses (logical, 32-bit IPv4 or 128-bit IPv6)
Collision domainSeparate per interface
Broadcast domainSeparate per interface — routers do NOT forward broadcasts
Routing decisionsBased on routing table (static, RIP, OSPF, BGP)
NAT/PATCan translate private IPs to public IPs
FirewallOften combined with basic packet filtering

How Routers Differ from Switches

FeatureSwitch (Layer 2)Router (Layer 3)
Forwarding basisMAC addressIP address
Broadcast domainOne (all ports)Separate per interface
Routing protocolNoneRIP, OSPF, BGP
Cross-networkNo (same network only)Yes (different networks)
SpeedHardware (ASIC)Historically slower; now fast too

---

6. Gateway (Layer 4–7)

A gateway provides protocol translation between two networks that use fundamentally different protocols.

TypeFunctionExample
Protocol gatewayTranslates between protocols (TCP/IP ↔ IPX/SPX)Legacy NetWare integration
Email gatewayConverts between email protocols (SMTP ↔ X.400)Enterprise email systems
Voice gatewayConverts VoIP (SIP/RTP) ↔ PSTN (analogue/digital voice)VoIP to telephone line
Default gatewayThe router a host sends packets to when destination is outside its subnetHome router
Exam Tip (High Frequency): Repeater/Hub = Layer 1 (no addressing). Bridge/Switch = Layer 2 (MAC address). Router = Layer 3 (IP address). Gateway = Layer 7 (application protocol translation). The phrase "default gateway" in networking refers to the router that handles traffic to other networks — it is NOT a true application-layer gateway in the strict sense.

---

Study Deep: Switch vs Router in Modern Networks

  • VLANs blur the line: With VLANs, a single switch can segment a network into multiple broadcast domains — something only routers could do in the past. But inter-VLAN routing still requires a router (or Layer 3 switch).
  • Spanning Tree Protocol (STP): Networks with multiple switches create redundant paths. STP prevents broadcast storms (infinite loops) by blocking redundant paths and activating them only on failure.
  • SDN (Software-Defined Networking): Modern data centres separate the control plane (routing decisions) from the data plane (packet forwarding), allowing centralised, programmable control of all switches and routers.