Hubs, Switches and Routers
The dumb, the smart and the know-it-all
An ethernet hub is an layer one device on the OSI-model.
An ethernet hub operates simply by passing the data, once received, out on all the ports. Whether or not a computer on the other sides needs that data. All the ports on a hub belong to the same ‘collision domain’.
This means that only one device in the network can transmit data. If multiple computers would do it at the same, this would cause collisions which would then cause all the traffic between computers to stop momentarily.
An ethernet switch is an layer two device on the OSI-model. Although, layer three switches also exist. These, in its very basics operate like a ethernet switch and ethernet router in one. Read ‘Ethernet routers’ below.
An ethernet switch connects multiple hosts in a single network together, making them able to communicate with each other.
A switch uses MAC addresses to forward data at layer two to other specific hosts in the network.
Each interface is its own collision domain, meaning that hosts can now send and receive data whenever they want to.
An ethernet router is an layer three device on the ISO-model.
An ethernet router connects multiple separate networks together. Making it able for hosts in two or more totally different networks to communicate with each other.
In simple terms, a router has table of different destination networks. When traffic passes the router it’ll look for the most specific route to forward the traffic to. If none are applicable, it’ll use the default route. (0.0.0.0/0)
Look at the image to the right:
Each colour is network, where black is then destined to the internet. As you can see, the router will forward the traffic based on the destination.