Understanding Network Devices

The whole world is dependent on the internet for connectivity but have you ever thought how this internet actually reaches us?
The internet is a global network where data is transferred in signals that are carried through fibre optics wires from one place to another. The countries around the world are connected to each other via undersea fibre-optics cables. The signals from the internet do not travel directly from one place to another, they travel through multiple networks and hardware devices that transport signals and handle the routing of data to reach their destination.
What is a Modem and how it connects your network to the internet ?
As mentioned earlier, the internet carries data as signals that travel at an enormous speed. Different devices and networks work with different signal formats. It is important to convert these signals to a usable one for the receiver hardware device or network. When signal is passed from one device or network to another the conversion of signal is carried out by the modem. Modem stands for modulator-demodulator, it converts signals to format required by the receiving hardware or network. In the context of internet access, it takes the internet connection from your local ISP (Internet Service provider) , converts it into a format the local network will understand and then passes it to the router.
What is a Router and how it directs traffic ?
Routers are network devices that connect different networks or sub-networks within and across the internet. Data sent over the internet is divided into packets and all packets have a destination IP address. The router reads each packet to find out the destination IP address and sends the data packet through a route accordingly. The data may have to pass multiple intermediate devices before it reaches the final destination. It is possible that multiple paths are present to reach the same destination in this case the router selects one based on protocols and network metrics like cost and shortest distance(not the physical).
Router vs Modem:
Modem is responsible for converting the internet signals into a format the local network devices understand while the router is responsible for making sure that the data sent actually reaches the destination.
Switch vs Hub: how local networks actually work ?
Hub : A hub is a basic networking device used to connect multiple devices in a local network. It is also called a broadcast device because it sends data to all the devices in the local network at the same time. It has multiple ports. It does not examine addresses or have any intelligence and memory.
Switch : The switch is a smart device that works with MAC addresses to send data to devices. It maintains a routing table of MAC addresses of devices connected in the network. When a switch receives data it sends data only to the intended receiver rather than sending it to all.
Switch vs Hub:
Switch:
Switch is faster, more efficient
Sends data only to the receiver device
Hub:
Hub sends data to every device it is connected
It does not have any routing tables or memory
What is a Firewall and why security lives here ?
A firewall is a network security device or software that monitors the incoming and outgoing network traffic and filters them based on predefined security rules. There are different types of firewalls that live at different levels of the OSI model to protect the computer and network from unauthorized access, network threats and network-based attacks.
What is a Load Balancer and why scalable systems need it ?
A load balancer is a network device or software that distributes the incoming traffic across multiple servers. Without a load balancer, all the requests will be handled with only one machine leading to delay in fulfilling requests or even crashing of the system. Scalable systems need a load balancer for distributing the load,improving performance and making sure all systems are up and running for all the users.
How all these devices work together in a real-world setup ?
Lets see how the devices we discussed in this blog work hand in hand in the real world. Consider a scenario where the user requested a website - example.com
The modem will be the first one to receive the data from the ISP and will convert it into signals the local network can understand.
The router will check the packets in the signal and forwards them to the correct internal network
The firewall inspects the packet to check if there is anything wrong with the packets and only allows safe packets inside the network
The signal is sent to the load balancer which will check which server has the capacity to handle the request, then forwards the request to that server.
The switch receives the response packets from the server, checks their header to find the destination MAC address and forwards the data to the correct device in the local network.



