What is a router?
It’s the brain of your network. It’s the thing that decides where your data needs to go to reach its destination outside your local network.
Think of it as a map of where to reach different networks outside of your own (because the internet is very complicated and very big, this map is necessary).
- Switches handle traffic within your local network
- Routers handle traffic leaving your local network
But how do they actually work?
Let’s say Bert needs to talk to IP 10.1.1.2 which is outside of his local network. He needs to somehow connect and talk to his default gateway first (the router).
Problem: Bert might not know the routers MAC address, so he sends out an ARP request, basically saying ‘Who has the gateway IP?’.
The switch forwards this request to everyone on his network. Nobody replies except one, the router. He says ‘Hey that’s me! Here’s my MAC address’
Now Bert can send his message to 10.1.1.2 via the router.
Bert builds the frame:
Destination MAC = router
Destination IP = 10.1.1.2
The switch forwards it to the router which receives the destination IP.
The router checks the IP, and decides the best path to get to it.
Problem: the router needs the MAC address of the next hop, so it sends out another ARP message saying ‘What’s the MAC address of the next hop?’
The router receives a reply, and rebuilds the frame:
New destination MAC = next hop
New source MAC = router
Destination IP = 10.1.1.2
This chain continues across routers until the destination IP is reached, and the destination device receives the message/ request.
So these guys are pretty busy, making decisions, resolving MAC addresses with ARP requests, and controlling how the data is sent across networks.
Thanks for reading!
@xTryed
@NetworkChuck Hey Chuck! I’ve just started your free CCNA course and am writing posts here as I learn. Feel free to check them out and correct me where I inevitably go wrong 😂 Love your teaching style 👊
What is a network hub?
Obsolete is what they are, and for good reason. But here’s the breakdown anyway.
This silly little box is basically the dumb cousin of the network switch.
The concept of connecting all your devices together (PCs, printers, servers) remains the same as a switch, but the method of sending data between these devices is the difference (and the reason these things are pretty much obsolete now).
Now for the silly part. When data comes in on one port, instead of sending it to the correct recipient, the hub blasts the data out to every single other port.
This is because hubs operate at Layer 1 of the OSI model. They have zero concept of MAC addresses, no memory and no logic. They simply receive a signal and repeat it to all ports.
This means every device gets every message, whether it was meant for them or not. So silly.
The hub has NO IDEA who the intended recipient is meant to be. It leaves it up to the receiving address to figure it out.
So it’s entirely up to each device’s network interface card (NIC) to check the destination MAC address in the frame and either say ‘Yes, that’s for me!’ or ‘Nope, not mine’ and discard it.
This structure creates problems, like data collision. Meaning if two devices tried talking at the same time, the data would collide and both would have to resend. The more devices there are on the network, the worse this gets.
That’s why switches replaced hubs; both do the same thing, but switches have the brains to do the job more efficiently.
You’ll almost never see hubs in action anymore, but understanding how they work is useful for appreciating why switches exist in the first place.
(These guys are so obsolete it was hard to even find an image of one that wasn’t a switch)
Thanks for reading, hopefully someone learned something new!
What is a network switch?
This funky box is basically a smart traffic controller for your local network.
It connects all your local devices, like your PC, printers, servers etc.
But what’s cool about them — unlike a hub, which blasts everything everywhere — is that they only send data to the device that needs it.
Think of it like a postman who actually reads the address and delivers to the right person, instead of throwing mail at every house on the street.
They do this by remembering which device is on each port, using the device’s MAC address.
These MAC addresses are stored in the switches CAM table, allowing frames to be forwarded to exactly where they need to be.
We love switches because they reduce unnecessary traffic and collisions on the network.
Managed switches take it further with VLANs, QoS, port mirroring and monitoring, but that’s all for another day.
Thanks for reading and I hope you learned something new!