How does the Internet Work?
Tags: beginners, internet, basics
Published: 2020-02-24 11:31:38

Let's deep dive into a journey of what happens in the backend when a client(user) accesses the internet and how the server renders the data.

Whatever data we fetch over the internet are stored in some server inside a data center. Server can be thought of as a computer whose job is to provide us the content whenever requested.

Now you must be pondering as how this data is then transmitted from the data-centers located at different corners of the world to the users requesting them. One solution is to use Satellite communication, but since the distance involved is high, it would lead to users facing severe latency. So one more solution is to use a wired medium - one of the best wired medium is infact used to move the data from the data-centers to the users, _drumrolls_ __'Optical Fibers'__.

Optical fibers are a form of wired media, where in the data is transmitted in the forms of bits(zeros and ones) as light. This complex network of optical fibers can be generalized as the __*Internet*__. These optical fibers are scattered and placed throughout the world,covering all kinds of terrains.So from this we can figure out that we as clients are not usually directly connected to the internet, rather indirectly through an Internet service provider, while the datacenters' servers are directly connected to the internet. 

###How does the optical fibers identify the sender and receiver of the data?###
This is done by a bunch of unique number and dot combinations known as IP Address which forms the shipping address in the Internet world. IP Address can be analogous to a home address but the stark contrast being that it is mostly a fixed value and depends on the Internet Service Provider(ISP) or the network where our system is connected. These IP Addresses can be static or dynamic. Most of the IP Addresses assigned to devices of the end users are dynamic in nature. For getting a static IP, some premium is to be paid. If you want your device use the same IP Address both at home as well as when you visit your grandma in the country-side having a different ISP, it would cost you a hefty sum.
 
Static IP Address is mostly used for dedicated Web,Database or other servers and also for accurate geological tracking purposes.

But now that the problem of identifying the sender receiver has been resolved, we come across a new issue- how do we ip addresses. The solution is pretty straight forward - needn't remember them at all, use domain names like _facebook.com_,_google.com_,_youtube.com_ instead, which correspond to IP Addresses.

###How does a domain name gets converted into an IP Address?###
For this conversion, a phone directory like stuff called DNS is used. The DNS Server provides the ip address corresponding to the domain name that the user enters in the client computer.

##Summarizing the process:##
User enters domain name in browser __->__ browser looks up for the ip address corresponding to that domain name in the DNS Server __->__ this request is then forwarded to the data-center, or rather the respective server in the data-center __->__ Once the request reaches the server, data starts flowing out of it in the form of light-pulses through optical fibers(in the form of well defined packets) __->__ The router converts this light signals to EM signals and our laptop/mobile phones receive them.