Understanding Network Devices
Do you ever wonder how you upload a picture on instagram and it reaches the world? or you search for a youtube video and something from across the world pops up at your desk? This happens using multiple network devices such as Modem, router, switch, hub etc. Let’s talk more about them.
The Modem
The Modem is the bridge between your home and the internet service provider(ISP). We know that the computer understands only digitals ( 0s and 1s) and the ISP sends signals which computer cannot understand. The modem sits between them and converts signals to digitals and vice versa.
Modem stands for Modulator Demodulator.
NOTE : You only need one modem per internet connection. If the modem dies, the internet is "down" for everyone.
The Router
Imagine you are in your home and search for “Arijit Singh breakup songs” (we all have our days😿) and the results are sent to your dad’s phone. Now that would be a disaster. So how does the modem know which device exactly requested the data? The router is the solution for it.
The router is the brain of your local network. The router creates a Local Area Network (LAN) and in the LAN each device is given a unique ID and keep a tab of who is doing what.
Most modern routers have built-in antennas to send data wirelessly, but "Wi-Fi" is just a feature of the router, not the internet itself.
Hub vs Switch
Hubs and switches are Intermediary Devices used to transfer data from one point to another.
The Hubs are used to broadcast the data to all the devices in the network. It acts as a common connection point for devices in a network. When data arrives at one port, it is copied and sent to all other ports.
The Switches are the smart Hubs. Switches are used to transfer data to a specific device.It uses a process called Packet Switching, using the MAC address of the device to send data only to that device.
Switches are used mostly and hubs are rarely used and mostly only for monitoring.
Hubs are in layer 1(Physical) and switches in layer 2 (Data link) of the OSI layer.
Hubs have low efficiency whereas switches have high efficiency.
Data flow : One-to-all (Hub) , one-to-one(switch)
The Firewall
The firewall is the security system that monitors your incoming and outgoing networks traffic and prevents illegal access of the network. It sits between the internet and your router and each data packet is inspected, if it finds any malicious data then it blocks it.
Security lives at the edge of your network because you want to stop the "bad guys" before they even touch your computers or servers.
The Load Balancer
You might have heard this term often discussed with System Design. It does the work just as the name says, it is used to balance the load and prevents overload of any server.
For example, you have a SaaS product and you blow up on internet. Many people start rushing to your website and suddenly you get 1 million users. This can crash your server. This is where the load balancer comes into picture. When a user visits the site, the Load Balancer receives the request first. It looks at the 10 servers, sees which one is the "least busy," and sends the user there.
The Real World Working of all these devices

When a signal comes from ISP, it is converted to digital(0s and 1s) via Modem for the computer to understand → The firewall checks it and passes the safe data → The load balancer receives this and sends it to a server with low or no load(only in systems with multiple users) → The Switch receives the data and forwards it to the request node → Finally, the data hits your server. This is where your code lives, processes the request, and sends a response back through the same chain.