Computer networking (switch/hub)?

Can someone post a detailed (as much as you can write about) description between a hub and a switch used in a network environment?
thanks,

Well, if i recall correctly, a hub is not as good as a switch under most circumstances.

A hub is limited by the speed of its slowest computer. For example, theres are 2 computers, one runs on a 10Mb/s NIC, the other runs on a 10/100 Mb/s NIC. Even though the second computer can theoretically transfer at 100 Mb/s, the hub limits its speed to 10 Mb/s max because thats the speed of the slower NIC. A switch doesn’t have this limitation, it runs as fast as each computer can go. That probably also why switches cost more.

I’m guessing there isn’t this kind of problem if all the computers have NICs of the same speed but your hub need to support that higher speed as well.

Then again, I could be way off. I read about it a while back.

A switch has an address. If you talk to Harrt’s printer, your pc talks to just Harry’s PC.
Hubs do not have an address. Your PC would ask all the PCs on the hub if they are Harry’s. This takes up time.

A hub operates at at the physical layer. It essentially connects every port connected to it to each other. As SouprChckn notes, it mandates that every port be identical, i.e. no token-ring to ethernet, no ethernet 10 to ethernet 100, etc. When you push a packet in one port, it gets spit out every other port. So if a computer on port A wants to send a packet to port B, ports C, D, E (etc) will get wasted copies. Because of this, all the connections share the available bandwidth. If port A is talking to port B, and port C is talking to port D, they’ll both get slower speeds than if they were talking through it alone.

Anymore, a switch is more a marketing term than a technical term. A switch is either a router or a bridge, or somewhere in between. Here’s what bridges and routers are:

A bridge works one step up the protocol ladder from the hub at the datalink layer. A bridge can have some intelligence, so it learns what datalink addresses are used on the computers hanging off each of it’s ports. After it learns who is out there, if it receives a packet on port A destined for a computer on port B, it will only send the packet out port B.

A router works one step up the protocol ladder from the bridge at the network layer. It looks at each port as a separate IP network (or other type of network, but IP is pretty much everything these days). A router has awareness not just of the computers that are on each of it’s ports, but also the other routers out there. So it can get a packet that has come from an original source two hops (routers) away in one port to a computer several hops away through another port.