Link to home
Start Free TrialLog in
Avatar of pcask
pcask

asked on

what does a switch do or how does it work?

what does a switch or a hub do, how does it work?
ASKER CERTIFIED SOLUTION
Avatar of tigermatt
tigermatt
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What tigermatt says is basically correct with a minor caveat.

since switches are layer 2 devices (unless we're talking about layer 3 switches) they forward FRAMES not packets. The forwarding process is done based on the MAC addresses and not the IP addresses.
lets have a brief history :)

its correct what is said above. however to put it in order.

you first had bus networks. here a packet of data when round the network from one pc to the next. no real "switches" and this made the network very slow and limited its size.

next came along hubs... these simple could receive packets on one port, and then flood them to all the other ports. this meant networks could be much larger. but there was a problems. in fact 2 problems. first the packet might come in to the hub on port 1 and the end station might be on port 2.. but the hub will still forward the packets to all the other ports. so using up network bandwidth needlessly. and secondly because they flood packets you get a high number of collisions and this limits the size of network you can have.

so along came the switch. with a switch does is read each source mac address of packets coming in to a port. and builds up a data base of what port each mach address is on. if its connected to and end station it will have  one mac address linked to that port. if it is connected to a second switch it may have hundreds. but the fact is it will know where a packet needs to go by looking in its database. so in the case the hub faced above. it would only forward the packet to port 2, and not flood it to any others.
most switches can hold 500+ mac address in there data base, and can filter the packets at wire speed. (ie at the same speed the travel down a wire) this requires a lot of computing power and complex hardware and software. so it was not until this could be made cheaper that switches could take over from hubs.

hubs and switches can be used on the same network. however just remember hubs create collisions domains, switches do not. I would only use a hub at the edge of a network, maybe to split a single network point on a desk in to two for a pc and printer...