# Understanding network devices

Some basic understanding : before knowing what devices does your local network uses let’s understand what happens when you query something or when you open a website and other things over internet  
1 — your request starts from your device like your laptop or mobile  
2 — it travels through local network devices  
3 — it exists your network and reaches over internet  
4 — finally it arives in the server that’s hosting the website or application  

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1770978723180/d353970e-5bd4-478e-bd1c-3c14f87479e4.png align="center")

This journey is handled by multiple networking devices, each with **one clear responsibility**

## First we will see <mark>what is modem?</mark>

A modem is the entry gate to the internet which have the responsibility of converting signals from your internet service provider into digital data that your network can understand and vice versa  
It exists because your computer only understands digital signals and when the data comes from ISPs over telephone lines,fiber,cables so <mark>modem comes between this and it modulates and demodulates the signal that’s why we call it as modem</mark>  
Modem never assigns ip or connects devices it just acts like a translator it only connect your private network to the ISP network

## What is a router and how it directs traffic?

If the modem connects you to the internet the router manages traffic inside your network and decides where data packets should go, What a router actually do is  
— It assigns private IP addresses  
— connects multiple devices to one internet connection  
— chooses best path for outgoing and incomming traffic  
and also performs NAT which is network address translatator because when you’re connected with a router with a private IP the router converts that into one public ip and that’s why it does NAT inside it  
<mark>A router is like a </mark> **<mark>traffic police officer</mark>** <mark> at an intersection—directing vehicles to the correct road.</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1770982683618/5b5e31e7-87ca-4eae-8ad2-512db0e3ac7c.png align="center")

Now you may be thinking what is this S1 and S2 they are <mark>switches which helps the router to send the data to the local network and make sure the msg that has come to the network should go to exact device but we have something more which has a responsibility like hub but isn’t exact same as switch which is hub but what’s the difference between them now let’s see the difference between hubs and switches</mark>

## Switch vs Hub: how local networks actually work?

Switch which is smart and modern and it is helpfull for sending data to the exact intended device using MAC addresses it is faster , secure , and also efficient in traffic handling like a post office deliverying letters to exact address not anywhere and not to different person and it goes to only that person  

Then comes the Hub which is like a broadcasting device which sends data to every where no proper management just shouting to everyone it wastes bandwidth and causes collision with zero intelligence

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1770987595820/700df1ef-69c1-4ce2-9ab2-aa328226bb5a.png align="center")

Now the packets are going from one network to another what if someone who isn’t autharized comes in your network and harms your network or harms another netwrok what would you do then here where the firewals takes place now

## What Is a Firewall and Why Security Lives Here?

A firewall is like a gatekeper in your network just like the watchman when someone comes in the society they ask first who you are where you want to go and then they confirms do you want to come in and when you say yess they let them come inside society here the same concept takes place  
When any unautorized ip addresses tries to enter your network they don’t let them come in and there are some rules which allow or block traffic based on defined rules

Firewall mainly protect against:  
—unauthorized access  
—malicious trafic  
—suspicious ip addresses  
And also some unsafe ports  
  
But the main question is where they operate and live?  
<mark>they mainly operate at:<br>—Network level (IP,Ports)<br>—Application level (HTTP,HTTPS rules)<br>they mainly live in:<br>—Between router and internal network<br>—Front of server or in production systems</mark>  
It is simply an security guard asking for Id before entry.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1771000658442/55d33ce8-585c-4555-a7d2-604b552b929e.png align="center")

## What is load balancer and why do we need scalable systems?

Now when you have connected all devices from local network to over internet and added security in your system one thing that you can tackle in your future how will you handle soo much load? because the system that you are using are not perfect and handle and do query as many as they want ofc they are machines they have some limits that’s why scalable system comes and the concept of load balancing comes in place  
now you’ll think what is load balancer?

<mark>Load balancer is simply used to distribute incoming trafic across multiple servers which you’ll call as a scalable systems<br>now why does the load balancer exist?<br>—to handle millions of user<br>—to gurantee uptime(never goes down never stops)<br>—to scale automatically<br>now what do they do?<br>—to prevent server overloading<br>—to improve performance of your application<br>—to enable horizontal scaling<br>There are three types of load balancers:<br>—Hardware type load balancers<br>—Software type load balancers<br>—Cloud type load balancers</mark>

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1771001465781/b51498b0-790f-4761-91b2-b32bde66d562.png align="center")

There is scaling whic is where you get horizontal scaling and also database scaling because if server can handle loads database should also be the same where more things takes place and here you can see how using loadbalancer can improve your uptime and efficiency

## Now how all this work together?

let’s first connect everything and then I’ll explain the exact data flow

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1771002047381/2c2e5573-0d2d-43f8-b8a9-fb18d9193193.png align="center")

All this comes together and works and makes you access the World wide web and the internet and everything works in ms so you see quick and fast over the internet one more question comes in your mid why you need to learn all this?

If you’re a backend or full-stack developer and you ignore networking:

* You won’t understand latency issues
    
* You’ll misconfigure servers
    
* You’ll struggle with deployment
    
* You’ll fail system design interviews
    

Modern systems depend on:

* Load balancers for scale
    
* Firewalls for security
    

Routers and switches for connectivity

##   
Conclusion  
Network devices are **not optional knowledge**—they are **foundational**.

* **Modem** connects you to the ISP
    
* **Router** directs traffic and manages IPs
    
* **Switch** efficiently connects local devices
    
* **Firewall** protects the network
    
* **Load Balancer** enables scalable backend systems
    

Understand these properly now, or struggle later in real projects.
