Understanding Network Devices
Imagine a highway where vehicles are travelling to reach a certain destination. Similarly Internet works. It is a highway where data packets are transferred to reach a certain address.
For a data packet to reach from ISP to the device, it has to pass through several checkpoints. We will look at these checkpoints one by one, and each checkpoint/device is important and has a certain role to play.
Modem
It connects your ISP to your network. The name modem means Modulator-Demodulator. It converts the signal from an analog signal to a digital signal (0’s and 1’s) which our computer understands. It also converts the digital signal to the analog signal making it able to transfer through different mediums like fiber optic, copper telephone wire, etc.
Router
Once the router translates the data then router takes over. It assigns IP addresses to different devices in a network, which makes it easy to identify where a data packet should go. It connects your network (Local Area Network) to the internet (Wide Area Network). When it receives the data, the router finds the best possible path for the data to reach its destination IP. It uses a routing table to determine the best path.
Switch vs Hub
These both work in a LAN and they connect devices with this network.
Switch - It is obsolete as it doesn’t have a mechanism to sort which data should go where. It just sends every data it recieves to every device in the connection. This makes it very unsafe regarding data privacy. Since it sends every data to everywhere, the network gets congested and network lag can occur.
HUB - HUB solves this problem. It maintains a map of every device with its MAC address which allows it find the particular device that the data is meant to go. Since it segregates the data it is much faster than the Switch. It is also more secure than the Switch.
FireWall
It acts as a security guard between a trusted network and an untrusted network. It can be on a device or the router itself. It continously monitors every data that it recieves. It checks the header of the packets against its rules where the rule can be ‘Block all traffic on port 23’ then it blocks everything.
Load Balancer
This device distributes the network traffic across multiple servers. In large companies where the traffic is huge they use these load balancers. This makes sure the traffic is distributed evenly and doesn’t bottleneck one server while other servers are not even recieving half of the traffic that server is recieving. It also redirects the traffic to other servers if one server gets crashed.
How do all these devices work together in a real-world setup?
When we request some data from a server
Data hits the modem.
The modem transforms the signal and sends it to the firewall.
Firewall checks the data and send it to the Router.
Router looks at the IP and sends it to the correct switch.
Switch then sends the data to its respective device.
If that traffic is high and there are many devices/servers then the switch sends the data to the load balancer, which in turn finds the suitable server to send the data.
