LearnViz CompSci
Home / Learn / Computer Networks / Switches and Hubs

Beginner Topic 11 of 50 Computer Networks

Switches and Hubs

Devices forwarding frames within a local network.

How it works

A hub is a simple layer 1 device that repeats every incoming signal to all ports, so all devices share one collision domain. A switch is a layer 2 device that learns which MAC address is on which port and forwards frames only to the right port, giving each port its own collision domain and allowing full-duplex connections and many simultaneous conversations. Managed switches add VLANs, port mirroring, spanning tree and access control.

Step-by-step walkthrough

  1. A hub repeats every bit to all ports and causes collisions.
  2. It also sends to PC 2, wasting bandwidth.
  3. A switch learns which MAC is on which port.
  4. It forwards frames only to the right port.
  5. Switching gives each port its own collision domain.

Where it is used

Switches form the backbone of LANs and data centers, and hubs are now obsolete. Layer 3 switches also route between VLANs.

Common pitfall

A switch floods unknown destinations and broadcasts, so large flat networks create excess broadcast traffic. Loops without spanning tree cause storms. MAC table overflow attacks make a switch behave like a hub. Secure unused ports, segment with VLANs and monitor with port mirroring.

Where it fits in the course

Switches and Hubs is topic 11 of 50 in Computer Networks, rated Beginner. It follows Ethernet. The next topic is Routers.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Switches and Hubs?
Devices forwarding frames within a local network. It belongs to Computer Networks and is a beginner-level topic.
Where do people use Switches and Hubs?
Switches form the backbone of LANs and data centers, and hubs are now obsolete.
What is the most common mistake with Switches and Hubs?
A switch floods unknown destinations and broadcasts, so large flat networks create excess broadcast traffic.
What should I learn before this topic?
Start with Ethernet, the topic just before it in Computer Networks.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Computer Networks quiz.
Is Switches and Hubs hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Switches and Hubs?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Switches and Hubs?
Ethernet, Routers, MAC Addresses are closely connected. The full list is in the related topics section of this page.
What should I study after Switches and Hubs?
Continue with Routers, the next topic in Computer Networks.

Related topics