Internet basics
Let us say we have two people in a room, they have to talk to each other.
You can simply talk them.
Now if you have more than 2 people, you need to refer to their names for clarity.
If you have to talk to a friend but he lives in a different house than yours, now you need to a proper address to reach to him.
But what if there lives multiple people, you will just share the message to a gatekeeper. The gatekeeper will forward the message to the right house. If the house is not under his radar, the gatekeeper will request the next gatekeeper until it finds the right house.
Similarly, if you want a data within your house, you can ask directly. But if you want to get the data outside your house, you need to ask a gate keeper to get the data for you. This gate keeper is called a router. The router does not have the data itself but a server has. Once the server is identified, the server sends the data to the router and the router takes this data and send to the previous router, until reaches your router and finally you get the data.
If a router does not have the data we are looking for it forwards to next the next router until the right router finds the server.
How the gatekeeper sends the request to next gatekeeper. Actually a gatekeeper keeps a notebook with him where he has idea of where should send the request.
Essentially router has a notebook called a route table from which it knows where to send the request to the next. It does not have any brain, just simple mapping.
If request lies in a certain condition, send to it that router.
A sample router table:
my house if address is 192.168.1.* -> inside
If anything else -> ISP router
What does an ISP router has:
Google network -> left
YouTube network -> right
Unkknow network -> upstream
If router has no routing table, internet cannot work.
our laptop knows only one thing that it is inside the house. It does not understand what google is, what internet is or where the road goes outside. It needs a trusted helper.
Our router has one address for anything beyond inside network. We call it default gateway.
So our computer decides, if this is within, then use this otherwise the default gateway.
An IP address is house address it has two meanings:
192.168.1.10
192.168.1 -> network part
10 -> device part
In order to save the IP, we use NAT. name and address translation (simple meaning)
NAT will speak to the internet behalf of everyone inside the house.
Internet never sees our laptop, it sees on the router.
DNS system: Internet phonebook.
We type google.com
laptop asks what is address of google.come
DNS responds -> 142.250.72.14
Now laptop knows wehere to send the request.
It does not send data, it only anwsers name.
How internet works as per Mozilla developer network?
Here I will simply reiterate what is outlined by Mozilla developer network.
——
----
Internet is a large network of computers that talk to each other.
Internet is a way to connect computers all together and ensure that whatever happens, they find a way to stay connected.
Videos about internet.
Internet is a wire. Just a wire. It is not cloud. Instead, it is a wire lied beneath the surface.
Computers that are directly connected to these wires (intenet) are called servers. And the computer that we use is called client.
If we want to connect two computers we can use a wire (eithernet). Now they can share the data.
If we want to connect 10 computers, we can connect with 9 plugs and 45 wires in the similar fashion as of two computers.
To solve this problem, we can use a tiny single computer. All computers are connected to this tiny computer. We call this computer a network switch or switch in short. Now we need only 10 cables and 10 plugs. Easy peasy.
Now, we have billions of computers, can we connect them all with one switch? Hell No.
How can we do that why don't we connect two switches? That will help us scale. Now with, a few switches, we will be able to connect the computers.
But this will lead to another problem, the more switch we have the more distance our packet needs to go, it will take longer to send the data. Also, we cannot have mindlessly connected switches because breakage of one switch will cut off many computers to be connected. So what we can do, we try to keep the local network as small as possible, so that not majority of the connection gets impacted. We connect these local networks with another tiny computer called routers. So a router is a computer that knows how to forward the messages between networks. A router is like a post officer, that reads the address and forward to right reciepent without reading everything in the letter (data).
We are very close to computer now. All we need is a physical medium (wires) to connect to all the routers. Luckely, such infra structure already existed before internet and that is the telephone network.
To connect our network to telephone infrastructure, we use a special equipment called modem. The model turns the information from network into information manageable by telephone network infrastructure and vice-versa.
The commercial router in our home is likely, a switch, a router and a modem.
Now we are connected to telephone infrastructure, the next step is to send the message from our network to the network that we want to reach. For that we will connect our network to an Internet service providers, they manage their own special routers that are linked together and can also connect with other ISP's routers. So the message from our network is carried through the network of ISP's routers to the destination network.
The internet is connected with this whole infrastructure of networks.
To send a message to a computer, we need to know the identify that computer. For that we assign an address to the computer, it is called IP address (Internet protocol). Address is standardized by a series of four numbers separated by dots. like 192.0.2.172
Now computer can catch another computer easily. Now we cannot comprehend these numbers, we need a simplied way to identify a computer. We can do it by domain name. google.com is the name of used for 142.250.190.78
—
A router is a device which helps connect mulitple networks together and allows them to communicate with each other. It acts central hub, directing network traffic and ensuring that data packets are sent to the correct network.
It enables multiple devices to share the single internet connection and communicate with each other.
A router can be used without internet connection as it allows the local network devices to communicate with each other.
Comments
Post a Comment