All hubs are just devices to hook wires together into a one big wire, some are passive were they are just places to plug stuff into, others are multi-port repeaters in that they have a supply of electricity to boost the signal strength. That is all hubs are. hubs are considured a level 1 device, meaning they are purely physical connectors and do not do anything other then that. If you have a 100mbit line plugged into a hub from one computer and a 10Mb line from another it will run at 10Mb speed on both lines, if they 100Mb line is set to autdetect. Even if you have a hundred 100Mb lines hooked into a hub and one 10Mb, the effective speed of the entire network will be reduced to 10Mb, even if the computers communicating are using 100Mb. You See in Ethernet all signals are sent to all computer, to the electrical signals it's just one big dumb wire. Like plugging your TV into a wall socket. A hub just provides that connection.
And remember that a repeater is simply a device to add signal streagth to make a ethernet line longer then it's normal limitations. A active hub is a multi-port repeater, and a passive hub is just a physical connection, you don't see many passive hubs no more.
Switches:
A switch is a entirely different thing. It can just be used as a hub just fine. Different switches have different capabilities, some even have router-level capabilities, but most don't need it.
Generally a switch without the added on routing capabilities is a multiport Bridge. A Bridge is a level 2 device. Meaning that it operates above the physical layer in the data link layer. This is the higher-end of the ethernet specifications. Ethernet doesn't use TCP/IP or anything like that. TCP/IP is
encapsulated in a ethernet packet, but ethernet doen't depend on it in order to function. You could use netbuie for instance to operate in a ethernet network or Novell's IPX/SPX protocals. In order to identify a computer, ethernet uses the MAC address. This is a unique identifing number that is built into the hardware of every ethernet device every made and should be completely unique identifier (although some devices allow you to modify the MAC address) in all the world.
Plus remember that on a ethernet LAN using a hub every computer is normally connected to every other computer on one long "wire". Only one computer can communicate at one time, it uses up the entire bandwidth.. Because it is a "baseband" technology, One electrical pulse travels the entire length of the wire. Every computer receives the electrical signal. It's a first come first serve deal. If two computers communicate at the same time, the signal gets garbled and a collision happens, then both computers shut up for a random length of time and try again. To many computers on a LAN at once, to many collisions, with reduced bandwidth. All computer receives the signal, it it's addressed to it's MAC address it is kept, if not the packet is ignored and dumped.
A bridge creates a record of MAC addresses. Say you got 4 computers, 2 (1 and 2) on one side, 2 (3 and 4) on the other side of the bridge(bridge 1), then you have a second bridge(#2 attached to that on the 3/4 side and it has computers 5/6. The bridge receives packets and passes them thru, at the same time recording the respective MAC addresses. So then if 1 talks to 2, the bridge stops the packets, so that 3/4/5/6 can communicate freely saving bandwidth. If 1 wants to talk to 3, then the bridge1 allows the packet thru and 2/3/4 get the packet, but 2 and 4 ignores it because it's not assigned to their MAC addresses. However, if 1 wants to talk to 6 then both bridges allow the packet to pass and 2/3/4/5/6 all get the packet and all but 6 ignore it, so then you lose the nice bandwidth savings and might as well have a repeater in the last instance.
With switches, bridges are rarely used any more....
Finally you get the Router. The router operates at level 3 and 4. Meaning the network and transport layers. This is above the ethernet specification. This is were the TCP/IP comes into use. IPX/SPX is another routable protocol, but Netbuie is not(for that you must use a WINS server -crap). Say you have a router with 3 ethernet networks attached. It has three ports, a/b/c. Computers 1 and 2 are attached to A. 3/4, B. And 5/6, C. Each network will have a different subnet. All the computers are set up to use there respective router port as a "gateway". Each port on the router needs to have it's own IP address from the same subnet as the computers that are attached to that port.
1 and 2 talk freely to each other over ethernet. However if they want to talk to any others they must send it thru the router. The send the packet on the ethernet using the router's port MAC address, but with the TCP/IP address of the intended computer. The router recieves the packet, strips away the ethernet portion, looks in it's tables finds the correct network and then reattaches the Ethernet portion using it's OWN MAC address for whatever port it is SENDING from. Then sends it to the intended target.
As you see routers will save bandwidth on the network quite a bit, and bridges will too, but not as well. But routers are complicated and expensive compared to bridges. SO that's why they created switches.
Switches are multiport bridges (most of the time) Each computer is connected by it's private line to a port. It's like it's own little private collision domain (collision domain is the correct term for the ONE BIG WIRE concept from before). 1/2/3/4 are all connected to their own port on the switch. Like a bridge the switch records the the MAC address of all the computers. If 1 wants to send to 3, the switch gets the packet, filters it and only sends it out to 3, thus all the rest of computers are spared from the exess signal and are free to transmit to each other if they want.
Your cheap DSL switches for small home networks usually have primitive router stuff built into them. Enough so that they can be a gateway and retransmit the the packet into the internet thru the dsl modem or whatever. Plus they may have extra stuff built in higher up in the levels like a DHCP server to assign TCP/IP information to each computer, plus a simple http server for monitoring and configuring, a DNS server to provide name resolution to the computers.. etc etc. Professional-level switch's don't have these, but they do have many features such as a VPN.
The "levels" are from the OSI's sepifications.
more info