Skip to content

W2·A3 — Hub vs switch

Time: 35 min

Needs: 4 VPCS, an Ethernet hub, an Ethernet switch

GNS3 project: w02-a3-hub-vs-switch

Info

Times listed are approximate and provided as timing guidelines only. Take as much time as you need to complete the activity.

Question

What is the difference between a hub and a switch


Build it - start with a hub

Drag four VPCS and and one Ethernet hub into the canvas. Connect each VPCS to the hub.

Give them addresses:

# PC1 / PC2 / PC3 / PC4
ip 192.168.10.11/24        # .12 / .13 / .14
save

Confirm PC1 can ping the other three.


Predict first

If you listen on PC3's cable:

  1. Can you hear the conversation between PC1 and PC2? ______
  2. Same question, but with a switch in place of the hub. ______
  3. Which layer does a hub operate at? ______
  4. Which layer does a switch operate at? _____
  5. Which topology does a hub implement? ______
  6. Which topology does a switch implement? ______

Do this — listen on as a bystander

  1. Right-click the PC3 cable → Start capture.
  2. On PC1: ping 192.168.10.12
  3. Read Wireshark.

What just happened

  • PC3 was able to hear everything.
    • A hub is an electrical repeater — a signal arriving on one port is regenerated out of every other port, and it has no idea what a MAC address is.
    • We call this a broadcast domain: everybody receives everybody else's traffic.
    • We also call this a collision domain: only one host can usefully talk at a time
  • A hub may physically look like a star topology, but it functions as a bus topology. In the early days of networking, nodes on a network communicated by tapping into a single cable and taking turns to transmit. The hub improved on this design by shortening the length of the cable, but kept the same functionality.

Do this — swap the hub for a switch

  1. Delete Hub1. Browse Switches → drag an Ethernet switch on to the canvas and re-cable the VPCS.
  2. Right-click on PC3's cable -> Start capture
  3. On PC1: ping 192.168.10.12
  4. Read Wireshark

What just happened

  • PC3 see a little of the traffic, but not everything
    • it can see ARP request because they are broadcast
    • it sees neither ARP responses nor ICMP traffic. These are unicast, meaning a packet is sent to one and only one receiver and the response is sent to one and only one sender.
  • This is still one broadcast domain because the switch forwards broadcast packets to every node
  • It is no longer a single collision domain because the switch forwards unicast packets to the intended destination and no one else. This is what makes a switch a star topology
  • The switch learns the location of each node on the network by reading inbound source MAC addresses

Record

Mark with a what PC3 sees after the first ping from PC1 to PC2

ping on a hub ping on a switch
ARP request on PC3's wire
ARP reply on PC3's wire
ICMP request on PC3's wire
ICMP reply on PC3's wire

In one sentence: what does the switch know after the first ping from PC1 to PC2 that it did not know before?

If it went wrong

Symptom Cause Fix
No packets at all on PC3's link capture started after the ping start the capture first
ping fails with Host unreachable You're trying to ping an address that does not exist check the destination address
ping fails with Network unreachable Wrong subnet Ensure all addresses match 192.168.10.x