Cisco Switches vs Hubs

In this Cisco CCNA tutorial, you’re going to learn about the basics of hubs and switches. I’ll also do a comparison between the two devices. Scroll down for the video and also text tutorial.

Cisco Switches vs Hubs Video Tutorial

YouTube video

Liam Wake

Liam Wake

I passed the CCNA exam with a score of 877 with the help of your CCNA Course – I am over the moon. Thanks again for all your help.

Liam Wake

 

Hubs and Switches

 

The functions of hubs and switches are very similar. You take your end hosts in your Local Area Network (LAN), like your PCs, your servers, and your printers, and you plug them into a hub or a switch with an Ethernet cable. Those end hosts are then able to communicate with each other through the hub or the switch.

 

Cisco Switches vs Hubs

 

In the picture below, we've got a Cisco 2960 Catalyst switch. It's a 48-port model, so you could plug in a maximum of 48 hosts into that switch. But what if you've got more than 48 hosts in your campus, which you probably will have?

 

In that case, you're going to have multiple switches in your Local Area Network. Your switches will be connected to each other with Ethernet cables and that's your inter-switch links.

 

Cisco Switches vs Hubs 1

 

Hubs – Half-Duplex and Shared Collision Domain

 

Hubs always operate in half-duplex mode. That means that the attached hosts can either send or receive data. They can't do both at the same time. All of the hosts that are plugged into that hub share the same collision domain, meaning that only one device can transmit at a time.

 

If two devices do transmit at the same time, then they will detect that and they'll back off and they will then resend to make sure that there is not another collision again. The method that is used for detecting and recovering from collisions is CSMA/CD. That's the Carrier-Sense Multiple Access with Collision Detection.

 

Hubs – Half-Duplex and Shared Collision Domain

 

Switches – Full-Duplex and Separate Collision Domains

 

With switches, on the other hand, they can operate in either full-duplex or half-duplex. In practice, they're always going to operate in full-duplex mode because that's much more efficient.

 

When they are operating in full-duplex the attached host can both send and receive data at the same time, using their receive and transmit wires. Also, all hosts have their own dedicated collision domain. Because of that, we're not going to have collisions. A collision detection mechanism is not required.

 

Switches – Full-Duplex and Separate Collision Domains

 

Cisco Device Functions

 

Looking at the OSI stack, switches operate at Layer 2. Our hubs operate at Layer 1.

 

Cisco Device Functions

 

Hubs Operate at OSI Layer 1

 

Hubs are not MAC address aware. Whenever a frame is received on a port, it's flooded out to all the other ports apart from the one that it was received on. Because of that, all hosts that are plugged in there are going to receive a frame, so they're going to have to process it at least as far as seeing that it's not for them.

 

Hubs Operate at OSI Layer 1

 

Switches Operate at OSI Layer 2

 

Switches, however, operate at Layer 2 of the OSI model. They also operate at Layer 1, obviously. They've got physical ports on there. This means that switches are MAC address aware. Whenever a frame is received, the switch will look at the source MAC address in the Layer 2 Ethernet header, and it will learn that MAC address.

 

Switches Operate at OSI Layer 2

 

It will then add that MAC address to its MAC address table, which is a mapping between the MAC address and the port that is reachable on. If a unicast frame is later received where that MAC address is the destination, the switch will only send out the relevant port, unlike a hub that floods it out everywhere.

 

This is better for performance and security, as frames only go where they are required. Whenever a frame is received for the broadcast address or an unknown unicast address (it would be unknown because the switch hasn't learned about it yet), it will be flooded out all ports apart from the one it was received on.

 

Switches Operate at OSI Layer 2 1

 

That was the basics of hubs and switches and the difference between them. Back in the day, hubs were commonly used because switches were very expensive. Switches have come down in price so much now though that you can't even buy hubs anymore. Switches are always used.

 

Cisco Switches vs Hubs Configuration Example

 

This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.

Click here to download your free Cisco CCNA Lab Guide.

 

Cisco Switches vs Hubs Configuration Example

 

  1. View the dynamically learned MAC addresses on SW1 and verify that the router’s MAC addresses are reachable via the expected ports. Ignore any other MAC addresses in the table.

SW1#show mac address-table dynamic

Mac Address Table

-------------------------------------------

 

Vlan Mac Address Type Ports

---- ----------- -------- -----

 

1 0001.9626.8970 DYNAMIC Fa0/24

1 000c.cf84.8418 DYNAMIC Fa0/24

1 0060.2fb3.9152 DYNAMIC Fa0/2

1 0090.2b82.ab01 DYNAMIC Fa0/1

1 00d0.9701.02a9 DYNAMIC Fa0/24

 

2. Repeat on SW2.

SW2#show mac address-table dynamic

Mac Address Table

-------------------------------------------

 

Vlan Mac Address Type Ports

---- ----------- -------- -----

 

1 0001.9626.8970 DYNAMIC Fa0/3

1 000b.be53.6418 DYNAMIC Fa0/24

1 0060.2fb3.9152 DYNAMIC Fa0/24

1 0090.2b82.ab01 DYNAMIC Fa0/24

1 00d0.9701.02a9 DYNAMIC Fa0/4

 

3. Clear the dynamic MAC Address Table on SW1.

SW1#clear mac address-table dynamic

 

4. Show the dynamic MAC Address Table on SW1. Do you see any MAC addresses? Why or why not?

SW1#show mac address-table dynamic

Mac Address Table

-------------------------------------------

 

Vlan Mac Address Type Ports

---- ----------- -------- -----

 

1 0001.9626.8970 DYNAMIC Fa0/24

1 000c.cf84.8418 DYNAMIC Fa0/24

1 0060.2fb3.9152 DYNAMIC Fa0/2

1 0090.2b82.ab01 DYNAMIC Fa0/1

1 00d0.9701.02a9 DYNAMIC Fa0/24

 

Devices in a real world network tend to be chatty and send traffic frequently, this causes the MAC address table to update (you may see less entries in Packet Tracer).

The switch will periodically flush old entries.

 

Additional Resources

 

Types of Cisco Switches: https://www.ciscopress.com/articles/article.asp?p=2348265&seqNum=2

How Does a Switch Work?: https://www.cisco.com/c/en/us/solutions/small-business/resource-center/networking/network-switch-how.html

Hub vs Switch: What's the Difference?: https://www.guru99.com/hub-vs-switch.html

 

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

 

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

Libby’s passion for technology drives her to constantly learn and share her insights with others. When she’s not immersed in the world of tech, you’ll find her lost in a good book with a cup of coffee or out exploring nature on her next adventure—always curious, always inspired.