How internet reaches our homes?
The internet relies on a vast network of physical infrastructure to transmit data around the world. That network is backbone of the internet high capacity optic-fibre cables, router and switches that connects various location worldwide.
That backbone are managed and operated by telecommunication companies ISP (Internet service provider) and CDN (Content delivery network). millions of data travel under the sea with the help of large fibric cables that connect the world.
There are multiple network device which help to connect with ISP, network and provide security. In this blog we cover Router, modem, firewall, switch, hub:
Modem : If we break the modem mo-dem (modulator and demodulator) this name define the work of modem. Modem is mediator or can say translator between computer and ISP.
Let’s define the term of translator when we want to open a website in computer so we enter a URL and OS convert the input in binary form (0, 1) and wrap in packet inside packet there are frames which store binary through wi-fi, Ethernet cable connect to modem. Now, modem comes to the picture (remember modem know computer language binary (0, 1) and ISP medium fiber cable, copper wire) so modem convert to binary into waves and send to ISP.
ISP other side also be a modem that knows the waves and convert into binary form and then this process again repeat for response this reverse process called demodulator.
In simple term:
computer world works on binary.
Network world works on cables.
modem is the bridge both of them.
Router : Router decides which request where should to go. when OS send the packets in request data store , source IP = local IP and destination IP = server IP (from where data gets) so router tells this source IP can not send on network so instead of source IP router uses router IP with port number then store this information in to NAT table and send to modem.
When demodulator send response so router check where to send it from NAT table and then send it.
Firewall : While sending the data packets and receive response there is mediator which checks which packets should allow to go or which block means provide security protect from unnecessary request to router. In window also found window firewall.
Hub : It is a basic physical layer that send data to all connected device use to send information at a time.
Switch : It is a smart data link layer that send data only requested device behalf of MAC address. It is expensive but essential.
Load Balancer : It is used to manage load of a server which helps to distribute the traffic among several server that makes a system scalable, maintainable, and help to improve performance. Load balancer could be hardware and software. In hardware it needs a installation of dedicated load balancing device or software load balancer is in a virtual machine or in a cloud. CDN (Content Delivery Network) often user software load balancer.
Even as per the requirement or according to traffic load balancer reduce the number of server and also increase the number of server which makes cost efficient that called horizontal scaling.

Note: There is one very interesting thing these all network device are hardware but some device like router currently most of time use as a software and this transformation is tremendous and also load balancer.
Lets see how the whole network device works with diagram:

In this diagram simply a query run to open google.com behind the scene this whole process happening to get google.com IP address and then after get IP this whole process works again reverse order as you can see in this image.