# Understanding Network Devices

### How the internet reaches a home or office ?

The ISP (Internet Service Provider) brings the internet signal from the backbone network to the user. They are connected to the backbone network through large data centers and distribute the internet signal to client(users) through telephone wires, copper cable, fiber optic cable, wireless connections.  
The Modem converts ISP signal into digital data. Then the Router distrubutes the internet through WiFi. A switch expands the network through wired connections.  
Firewall protects the network by blocking unauthorised access and for bigger systems load balancer are used to control heavy traffic.  
FLow —&gt; ISP → Modem → Router → Switch → Devices

### What is a Modem and how it connects your network to the internet?

Modem(Modulator Demodulator or Translator) → Its the first device that lets us connects to our home or office. It receives the analog signals from ISP.  
ISP understands Analog and our devices understands Digital.  
Modem, Demodulates incoming analog sinals into digital siganl and Modulates outgoing digital data into analog.  
Modem connects to both ISP through wires, cables and to the router which makes it accessible to our home or office network.

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

A modem creates the connection but Router distributes it and let’s us connect multiple deivices to the internet.  
It directs traffic through unique local IP addresses to each device via DHCP protocol.

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

Switch and Hub are network devices used to connect multiple computer in a local area network(LAN). When devices need to communicate with each other in LAN, a HUB or a SWITCH acts as a connection point.

![Difference Between a Switch and a Hub - Intellipaat](https://intellipaat.com/blog/wp-content/uploads/2024/06/Difference-Between-Hub-and-Switch.png align="left")

A Hub is an unintelligent device that broadcasts all data to every connected device. It operates at the pgysical layer of OSI model.

A Switch is an intelligent device that connects multiple devices like a hub and then sends data to the intended device using MAC address. It operates at the data link layer of the OSI model.

### What is a Firewall and why security lives here?

![Types of Network Firewall - GeeksforGeeks](https://media.geeksforgeeks.org/wp-content/uploads/20250805151242493838/network_firewall.webp align="left")

A Firewall is a network secutrity device that act as a barrier(First Line of Defence) between a trusted internal network and untrustworthy external networks such as internet. It monitors incoming and outgoing network traffic.

Security Lives here because it is at the entry and exit point meaning in between internal network and the internet.  
It protects the network from hackers, malwares and threats, unauthorised access.

![What Is a Firewall? [Definition & Explanation] - Palo Alto Networks](https://www.paloaltonetworks.com/content/dam/pan/en_US/images/cyberpedia/what-is-a-firewall/Firewall-benefits-new.png?imwidth=480 align="left")

### What is a Load Balancer and why scalable systems need it?

Load balancer acts as a traffic police that distributes incoming network traffic across multiple backend servers. It prevents servers from crashing, bottleneck, ensuring high availability.  
Example → when too many users want to access the same website, it overloads and crashes, to prevent it we use Load balancer.

![Scaling Systems: Load Balancing Explained | by Gyanaa Vaibhav | Medium](https://miro.medium.com/1*P1ZFQHagmjpru31roBvGAQ.png align="left")

It is essential for Scalable Systems because with time websites grow, that means more users will visit, to scale load balancer acts as the gatekeeping for adding or removing servers without affecting user experience.  
If a server fails load balancer detects it and redirects the traffic to healthy servers.

### How all these devices work together in a real-world setup?

In real world setup →  
1\. Internet enters through Modem.  
2\. The router distributes it into local network  
3\. The Firewall protects the network from vulnerabilites.  
4\. Switch connects multiple internal devices.  
5\. A Load Balancer distributes into multiple servers.
