Hub

A physical layer device that allows for connections from many computers at once.

Since the data sent to hub is sent back to all the computers in the network it is up to them to determine if the data was meant for them. It causes a lot of noise.

Collision domain - A network segment where only one device can communicate at a time. If multiple systems try sending data at same time, the electrical pulses sent across the cable can interfere with each other.

Mostly historical artifact Xd

Switch (switching hub)

L2 device. Can inspect ethernet protocol data and determine which system the data was intended for and sending solely to the intended system. Eliminates Collision domain.

Router

Hubs and switches: The primary devices used to connect computers on a single network, usually referred to as a LAN, or local area network.

Router: A device that knows how to forward data between independent networks

Router is a L3 device. Can inspect IP data.

ISP uses core router to handle complex network.

Border Gateway Protocol (BGP): Routers share data with each other via this protocol, which lets them learn about the most optiamal paths to forward traffic.