How does the Internet work?
In today's world, it's almost impossible to imagine life without the internet's constant presence. Whether it’s for work, education, or personal use, the internet has become the go-to tool for everyone everywhere.
But have we ever stopped and wondered, how the internet actually works? When I send a msg to my friend asking him when he’s going to pay me back for the lunch we had yesterday, he instantly receives the message if we’re connected to the internet (although he may choose to ignore it).
AND there are multiple ways to reach a destination and figuring out which way is efficient is the fundamentals of Computer Networks.
What is the data?
The data in this case is made up of bytes.
Any image you download, any message, or the movie you’re watching on Netflix
right now ultimately is made up of a bunch of bytes. To send or receive this
data we have to follow a set of protocols.
To ensure the efficient transfer of data, we
may use some methods to speed up the process. Imagine you're sending a large
file across the internet. The bigger the file, the longer it takes to travel.
But wait! There's a trick to speed things up: packets.
Think of a packet as a small container for your data. Instead of sending the entire file as one giant box, we break it down into numerous smaller packets. These packets are then individually sent through multiple pathways (streams) on the network, like different lanes on a highway.
IP Addresses and Why do we need them?
You must have heard of IP addresses a lot
if you’re a bit tech-savvy. IP (Internet Protocol) addresses are used to
uniquely identify a connection on the Internet. Every user that is connected to
the World Wide Web has his/her own unique ID that is used to send or receive
data.
There are two types of IP Addresses:
1.
IPv4
(32-bit) 192.168.19.2
2.
IPv6
(128-bit) 2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF.
IPv4 addresses are generally more commonly
used as they have become the standard. IPv6 can be used if the range of IPv4 is
not sufficient and more is required. IPv4 can hold values in each of its octets
from 0-255.
IP Addresses can be broken down into three categories
- Private IP
- Public IP
- Local IP
- Private IP:
Imagine your home network as a large
apartment building. Each apartment has its own unique address within the
building, allowing residents to navigate and access common areas. This is
similar to a private IP address. It's assigned by your network router and only
visible within your local network, allowing your devices (like your phone,
computer, and printer) to recognize and communicate with each other.
The IP ranges below are most commonly used
by machines for a private network.
169.254.0.0
through 169.254.255.255
10.0. 0.0
through 10.255. 255.255.
172.16. 0.0
through 172.31. 255.255
192.168. 0.0 through 192.168. 255.255
- Public IP:
Now, imagine the entire building has a
single address on the street, allowing visitors and deliveries to find it. This
represents your public IP address. It's provided by your internet service
provider (ISP) and acts as your network's identity on the vast internet. Any IP
other than a private IP would be considered a Public IP
- Local IP:
The local IP address is just a way to call your
own computer without needing to identify it by name or its own private IP. For
example, instead of using 192.168.10.2 to contact your own device, you can
simply use 127.0.0.1 which will always connect to your own device.
Another way to connect to your own device is to use localhost which
does the same work.
These IP addresses are used all the time whenever the internet is accessed.
Packets:
As we know data is divided into
smaller packets over the internet to speed up the transfer process, the path
that these packets may take is one to wonder about.
Packets generally have to go from a source IP to a destination IP. From the source IP, the packet will generally first move towards the local network port which is called a router.
A router manages traffic between networks
by forwarding data packets to their intended IP addresses and allowing multiple
devices to use the same Internet connection. We need a router because all
connections inside of a local network have private IPs which are different from
the public IPs on the internet.
A connection cannot be established between a private and public IP. Both the IP addresses must be of the same nature. Here the router has its own IP which is a public IP and through the router, one can access the private IPs on a network. All hosts connected to a single router will each have one public IP.
What’s my IP?
To find out your own IP addresses you can
open up the terminal on your Windows and type in the command ipconfig
Here we can see that this command shows us our local/private IP addresses. To find out our public IP, you will need to go onto Google and search “what's my ip” and find it out yourself.
How do packets travel?
Packets travel from router to router until they reach their destination. Each jump from a router or host to another router is called a hop. This process causes latencies and delays and there can be more than one efficient way of sending a packet which is called packet-forwarding.
- Packets can be lost in transit.
- Packets may be overloaded on a specific router causing delays.
- Packets may arrive out of order.
We can see the time it takes for packets to travel to a specific website from our current location by using the ping command followed by a website address or IP
The ping command sends 32 bytes of data to www.google.com and waits for the time it takes back and repeats this 4 times to get the best possible average. It shows us the time it took for each ping and also shows us the TTL which is Time to live, which is the amount of hops the packet takes/ the amount of routers it goes through.
From this, we know that the internet is a very unreliable way of communication, and making it reliable is what computer networks aim to do.
Comments
Post a Comment