Functions and uses of routers, switches, hubs, bridges, and gateways


1. Routers

A router connects different networks and sends data between them.

Key Functions

  • Works at Network Layer (Layer 3) of the OSI model.
  • Uses IP addresses to forward data.
  • Supports NAT (Network Address Translation) and DHCP (assigns IPs automatically).

Uses

  • Connects home/office LANs to the Internet.
  • Routes data between different subnetworks.
  • Ensures data reaches the correct destination.

Tip: Think of a router as a “direction guide” for data.


2. Switches

A switch connects devices within the same LAN (Local Area Network).

Key Functions

  • Works at Data Link Layer (Layer 2).
  • Uses MAC addresses to send data to the right device.
  • Reduces data collisions by creating separate collision domains.
  • Supports VLANs (Virtual LANs) for network segmentation.

Uses

  • Creates high-speed internal connections.
  • Reduces network congestion.
  • Connects computers, printers, and servers in offices.

Tip: Think of a switch as a “smart connector”.


3. Hubs

A hub is a basic and older device used to connect multiple devices in a LAN.

Key Functions

  • Works at Physical Layer (Layer 1).
  • Broadcasts data to all devices, not just the target one.
  • No intelligence to identify specific devices.

Uses

  • Very small and simple networks (mostly old).
  • Low-cost home setups (rare today).

Drawbacks

  • Creates a single collision domain → more traffic and slower speed.
  • Less secure than switches.

Tip: Think of a hub as a “dumb connector”.


4. Bridges

A bridge connects two LAN segments to work as one network.

Key Functions

  • Works at Data Link Layer (Layer 2).
  • Uses MAC addresses to filter and forward data.
  • Helps reduce network traffic by dividing it into segments.

Uses

  • Extends a LAN beyond physical limits.
  • Isolates traffic for better performance.

Tip: Think of a bridge as a “traffic controller”.


5. Gateways

A gateway connects different networks that use different protocols.

Key Functions

  • Works at multiple OSI layers, often the Application Layer.
  • Translates protocols, formats, or addresses.
  • Acts as an entry/exit point for a network.

Uses

  • Connects enterprise networks to the Internet.
  • Converts between IPv4 and IPv6.
  • Allows communication between different systems (e.g., email to SMS).

Tip: Think of a gateway as a “translator”.


6. Quick Comparison Table

DeviceOSI LayerFunctionUse Case
RouterNetwork (Layer 3)Routes data between networks using IPConnect LAN to Internet (WAN)
SwitchData Link (Layer 2)Sends data based on MAC addressesConnect devices in a LAN
HubPhysical (Layer 1)Broadcasts data to all devicesOld/simple networks
BridgeData Link (Layer 2)Connects and filters LAN segmentsExtend or segment a network
GatewayMultiple LayersTranslates between protocolsConnect different networks

7. Quick Memory Tips

  • Router → “Direction” – routes between networks.
  • Switch → “Smart Connector” – efficient LAN device.
  • Hub → “Dumb Connector” – sends everywhere.
  • Bridge → “Traffic Controller” – filters and segments.
  • Gateway → “Translator” – connects different systems.

8. Real-World Examples

  • Router: Home Wi-Fi router for Internet.
  • Switch: Office network connecting computers and printers.
  • Hub: Very old LAN setups.
  • Bridge: Linking wired and wireless parts of a network.
  • Gateway: Service that converts API data or email-to-SMS communication.


MCQs on Functions and Uses of Network Devices

1. Routers

  1. Which layer of the OSI model does a router operate at?
  • A. Physical Layer
  • B. Data Link Layer
  • C. Network Layer
  • D. Transport Layer
    Answer: C
  1. What is the primary function of a router?
  • A. Broadcasts data to all devices
  • B. Filters MAC addresses
  • C. Routes data between different networks
  • D. Translates protocols
    Answer: C
  1. Which protocol is commonly used by routers for assigning IP addresses?
  • A. DNS
  • B. DHCP
  • C. FTP
  • D. ARP
    Answer: B
  1. A router uses which of the following to make routing decisions?
  • A. MAC address
  • B. IP address
  • C. Port number
  • D. Subnet mask
    Answer: B

2. Switches

  1. At which layer of the OSI model does a switch operate?
  • A. Physical Layer
  • B. Network Layer
  • C. Data Link Layer
  • D. Application Layer
    Answer: C
  1. What is the main advantage of using a switch over a hub?
  • A. Cost-effectiveness
  • B. Reduction of broadcast domains
  • C. Reduction of collision domains
  • D. Protocol translation
    Answer: C
  1. A switch uses which address to forward data?
  • A. IP address
  • B. MAC address
  • C. Subnet mask
  • D. Port number
    Answer: B
  1. What feature allows switches to create separate virtual networks?
  • A. VLAN
  • B. NAT
  • C. Routing Table
  • D. DNS
    Answer: A

3. Hubs

  1. Which OSI layer is a hub associated with?
  • A. Data Link Layer
  • B. Transport Layer
  • C. Physical Layer
  • D. Network Layer
    Answer: C
  1. What is a major drawback of using a hub in a network?
    • A. High cost
    • B. Limited bandwidth
    • C. Creation of collision domains
    • D. Lack of security features
      Answer: C
  2. How does a hub transmit data?
    • A. Unicast to specific devices
    • B. Broadcast to all devices
    • C. Multicast to groups of devices
    • D. Encapsulates data frames
      Answer: B

4. Bridges

  1. What is the primary purpose of a bridge?
    • A. Connect different networks
    • B. Filter traffic between LAN segments
    • C. Assign IP addresses to devices
    • D. Convert protocols between networks
      Answer: B
  2. At which OSI layer does a bridge operate?
    • A. Physical Layer
    • B. Data Link Layer
    • C. Network Layer
    • D. Application Layer
      Answer: B
  3. A bridge forwards data based on which address?
    • A. IP address
    • B. MAC address
    • C. Port number
    • D. Subnet mask
      Answer: B
  4. Which of the following is NOT a function of a bridge?
    • A. Reducing collision domains
    • B. Filtering traffic by MAC addresses
    • C. Connecting two different networks
    • D. Extending the range of a network
      Answer: C

5. Gateways

  1. What is the primary function of a gateway?
    • A. Connects devices within the same LAN
    • B. Connects networks using different protocols
    • C. Filters traffic based on IP addresses
    • D. Broadcasts data to all devices in the network
      Answer: B
  2. At which OSI layer do gateways typically operate?
    • A. Physical Layer
    • B. Data Link Layer
    • C. Application Layer
    • D. Network Layer
      Answer: C
  3. Which of the following is an example of a gateway?
    • A. Router connecting two LANs
    • B. Switch in a LAN
    • C. Firewall translating IPv4 to IPv6
    • D. Bridge connecting two segments
      Answer: C
  4. Gateways are used to enable communication between:
    • A. Devices on the same network
    • B. Networks with different protocols
    • C. Switches and hubs
    • D. Segments within a LAN
      Answer: B

6. Miscellaneous and Scenarios

  1. Which device creates separate collision domains on each port?
    • A. Router
    • B. Switch
    • C. Hub
    • D. Bridge
      Answer: B
  2. Which device can connect a LAN to the internet?
    • A. Bridge
    • B. Gateway
    • C. Switch
    • D. Hub
      Answer: B
  3. What is the main difference between a switch and a hub?
    • A. Hubs use IP addresses, switches use MAC addresses
    • B. Switches create separate collision domains, hubs do not
    • C. Switches operate at Layer 1, hubs at Layer 2
    • D. Switches are used for routing, hubs for segmentation
      Answer: B
  4. What does VLAN stand for, and where is it implemented?
    • A. Virtual LAN, in hubs
    • B. Virtual LAN, in switches
    • C. Virtual LAN, in routers
    • D. Virtual LAN, in gateways
      Answer: B
  5. Which device is best suited for reducing the size of a routing table?
    • A. Router
    • B. Gateway
    • C. Switch
    • D. Bridge
      Answer: A

Tips for Success:

  • Focus on understanding the OSI layer for each device.
  • Practice with real-world examples to identify device functions in scenarios.
  • Revise key differences between switches, hubs, and routers to avoid confusion.