Hub is outdated technology. Network switch is now used even in home Lan systems.
Network switch, that connects and selects between network. It works at layer # 2. You can get speed such as 10/100 Mbit/s or 10/100/1000 Mbit/s or 10 Gbit/s ports Ethernet standards.
Router is used to router traffic between two network. Routing is the process of selecting paths in a network along which to send network traffic. Linux can act as software router, for bigger network Cisco or other routers are used.
You need to get a good book to learn about networking.