LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   What's the difference between a hub and a switch? (https://www.linuxquestions.org/questions/linux-networking-3/whats-the-difference-between-a-hub-and-a-switch-933358/)

resetreset 03-08-2012 12:35 AM

What's the difference between a hub and a switch?
 
Trying to learn the basics of setting up a LAN here....


Thx.

catkin 03-08-2012 12:39 AM

AIUI a hub is a dumb broadcast device, sending all packets to all connected hosts, whereas a switch is smart and learns which MAC addresses are associated with IPs so directs traffic to only the intended host.

EDIT: lots of answers here.

prowla 03-08-2012 02:24 AM

A switch may also be managed, whereas a hub tends to be dumb.

nano101 03-08-2012 06:17 AM

with a hub you only have 1 collision domain, which means that only one person (pc/laptopm whatever) can "talk" at the same time. If more that one device tries to transmit packets a hub a collision can occur. Each device then has a random countdown timer until it can re-transmit (google csma/cd).

On switches, there are multiple collision domains, each switchport is its own collision domain which means that each device connected to a switchport and transmit packets no matter what another device connected to another switchport is doing.

hope that helps somewhat.

It doesn't matter about manageability. You can have a managed or unmanaged switch. (don't know about hubs, they're before my time)

johnsfine 03-08-2012 06:45 AM

I have seen managed and unmanaged hubs. I'm not sure what the boundary of defining "managed" is for switches. I don't recall using any switches that were entirely lacking in management features.

I think the fundamental difference is in collision domains as nano101 described. With a hub, only one packet can go through the entire hub at a time. With a typical switch, any combination of ports could be sending and receiving packets at the same instant and an individual port could be both sending and receiving. For that to be effective, the switch needs to remember MAC addresses as described by catkin, except I think it is MAC addresses by port it must remember. Many switches are unaware of any IP address other than its own. If the MAC address is remembered, the switch can forward the packet to only the port connected to that MAC address. Otherwise the switch must forward the packet to all other ports, making the switch as inefficient as a hub for that packet.

catkin 03-08-2012 07:02 AM

Thanks for the correction johnsfine :)

resetreset 03-08-2012 08:26 AM

thanks guys :)


All times are GMT -5. The time now is 01:10 PM.