When I was a kid, I used to think the internet was pure magic. Type something into a phone, and instantly, information would appear as if by a wizard's spell. But now that I'm learning to code, I've come to understand just how complex and intricate the internet truly is. I even asked my mom about it once, curious to know what she thought about getting everything with just a click. To her, it was simply a tool she used every day, but to me, it's a fascinating blend of technology and magic. So, let's unravel this mystery and understand how the internet works, turning what once seemed like magic into something we can all comprehend.
Overview : A Simple overview for first.
You Make a Request
- Imagine you're searching for "Virat Kohli" on your phone. You type it in and hit enter.
Wi-Fi Magic
- Your phone sends a radio signal through Wi-Fi to your router. It's like your phone whispering, "Hey router, I need some info!"
Router to ISP ( ISP means your Internet Provider)
- The router catches that signal and converts it into an electrical signal, sending it through wires to your Internet Service Provider (ISP). Think of the ISP as the gateway to the internet.
Journey Through Wires
The ISP sends your request through a network of wires, which might even travel under the ocean via fiber optic cables. These cables are like superhighways for data.
This is one of best video which will show you how internet travels through cables under Sea.
%[youtu.be/yd1JhZzoS6A?si=dLXqYgSUUl7-1Gk9]
DNS: The Internet Phone Book
- Your request reaches a DNS server, which translates "example.com" into an IP address, like finding a phone number in a phone book.
Data Reaches the Server
- The request continues to the server hosting the website you're trying to reach. This server processes your request and prepares the data to send back.
The Data Returns
- The server sends the data back through the same path: from the server, through the ISP, through the wires, through the router, and finally back to your device via Wi-Fi.
So now you know that , Whatever happens it happens physically and there is science behind it it all happens at nearly speed of light that’s why we see everything get at blink of an eye and it looks like Magic.
Now let’s Understand IP address , Domain Names and Routing.
IP Address : Imagine the internet as a vast city where every device is a house with its own address. These addresses are known as IP addresses, and they're crucial for data to find its way around. Just like how your home address ensures your mail gets to you, an IP address ensures data reaches the right device. For example, if you want to send a message to a friend's computer, you need its IP address, something like 192.168.1.1.
So When you connect to your ISP(JIO ,wifi provider) it gives you IP address.Think of it like your ISP handing you a temporary "visitor pass" every time you go online. This is called a dynamic IP address*, and it changes every time you reconnect. It’s like getting a new seat number every time you enter a movie theater.*
But it is totally different for Websites. Websites have static IP addresses*—permanent addresses that don’t change. These are assigned to the servers where the website is hosted.
- Domain Name : So just like i said that IP address are websites real address. But who wants to remember a string of numbers That's where domain names come in. They're the human-friendly versions of IP addresses. Instead of typing 192.168.1.1, you can simply type "google.com." It's like having a memorable name for your favorite restaurant instead of its street address.
- Routing : Now, let's talk about routing. Picture sending a letter from New York to London. The postal system uses a network of routes to deliver it. Similarly, the internet uses routers to direct data packets to their destination based on IP addresses. It's like a series of traffic cops guiding data to its final stop.
Let's walk through an example: visiting "ChaiandCode.com"
Your device doesn't know the IP for "ChaiandCode.com" so it asks a DNS server.
The DNS server looks up the domain and finds the IP address, like 203.0.113.4.
Your device sends the request to this IP.
Data packets travel through routers, each getting them closer to the destination.
Finally, the server at 203.0.113.4 sends back the website data to your device.
That’s how “Mota Mota hisaab kitaab“ hai Internet ka , Now lets go more deep and understand in more depth as i said Internet is World in itself.