Q:What is the difference between a hub and a router?
A: From jsr138...
A hub is for connecting networking components together, like two computers and a network print server, etc. A hub will have at least two ports, typically more. Hubs are not intelligent. When one device is sending data to the network, it [hub] sends the data to each and every other port on the hub. Thus, when computer A is transmitting to computer B, everyone else not only can see the transmission, but they must wait until the hub is clear before they can communicate. Hubs are not considered secure. And, as pointed out earlier, hubs cannot cross 'networks'. You can use any protocol you like on a hub.
A switch is like a hub, but it has two important differences. A switch learns which computer is on which port. So, when computer A is transmitting to computer B, the switch will only put the signal on the port for computer B. This is more secure than a hub. Also, while computer A is talking to computer B, computer C can also be talking to computer D at the same time. This allows for more throughput under the right circumstances. Note that while computer A is talking to computer B, if computer C also wants to talk to computer A, he still must wait for computer A to finish. Switches cannot cross 'networks' either. You can use any protocol you like on a switch.
A router is a networking device that allows traffic to pass from one network to another. 'Network' being defined here as a group of devices that share address space as defined by the protocol. You can think of a router as a sort of traffic cop at the opening of a tunnel that leads out of the city. When the traffic that is going by is headed for other destinations within the city (network), the traffic cop forces that traffic to stay within the city limits. When traffic comes along for some other city, the cop lets that traffic go out the tunnel. In this manner, data that is traveling on your LAN stays on your LAN, but data that is headed somewhere else (i.e., the Internet, or another office division) is allowed to exit the LAN for the other network. Routers typically employ some sort of network address translation (NAT) to make the outbound traffic compatible with the outside network. For a protocol to be able to go out a router, it must be 'routable', like TCP/IP. NetBEUI cannot be used to go out a router.
When most people around here say the word 'router', they are talking about a specific device known as a Cable/DSL router. A Cable/DSL router actually combines four different functions into one device. 1st, it is a true router in that it keeps LAN traffic on the LAN, but allows outbound traffic to travel to the WAN (wide area network). 2nd, it typically (but not necessarily) has a multi-port switch or hub to allow you to tie multiple computers to it. 3rd, it has a DHCP client built in to the WAN port, so that if your ISP offers dynamic IP addresses, the router will get that info from your ISP (your external address). 4th, it has a DHCP server built into it so that it can assign IP addresses and feed DNS and gateway info to your computers (your internal addresses). By combining these four functions into one device, it allows you to more easily establish an internal network and share your broadband cable or dsl Internet connection with all of your computers. Cable/DSL routers employ NAT so that it appears to your ISP (and the rest of the Internet) that you only have one device, and they create an effective (and configurable) firewall. Again, any protocol may be used on the internal ports, but only 'routable' protocols can go out to the WAN like TCP/IP.
One note: Most Cable/DSL router also includes some sort of firewall protection to block against port probing and such.