How do we connect to the internet and why with the same Public IP?

Like most people around the world, we all connect to the Internet from a single IP address (Internet protocol) and use a router (which can be at home or even not in the case of connections such as Fastweb) that connects all devices to the home network.
This architecture is a trick that goes against the original principle of the internet, that of connecting multiple devices directly to each other.
The problem was that IP addresses are limited in number, exactly less than 4.2 billion IPv4 IP addresses available which when compared to all computers and cell phones connected to the internet worldwide are very few.
In other words, there are more connected devices on the planet than public IP addresses to identify them on the network .
To ration this shortage of IPv4 addresses, this trick has been studied that allows every device in a house or in an area to access the internet.
The Internet service provider if it were to assign a unique public IP address for each home device that connects to the internet would need an additional free address every time you buy a new computer, tablet, smartphone, game console, or any other thing.
For this reason, the ISP generally assigns a single IP address for each of its subscribers and, in certain cases, even a single address for several people.
READ ALSO: How a Router works "> Public and private IP address
The router assigns local IP addresses to the connected devices.
In practice, a router creates a small internet network (called an intranet) in which the connected devices and computers can communicate with each other.
However, these local IP addresses are not reachable from the Internet.
In other words, the public IP address could be something like 23.24.35.63 and can be reached from any computer in the world connected to the internet.
The private IP address of the computer, on the other hand, is something like 192.168.1.133 that cannot be reached from the Internet and is visible only within the local network.
To understand this mechanism well, you can think of a building with many offices.
The address of the office building can be in Via Dante 15, Rome, Italy and anyone can reach this address with a letter sent by post.
This address is a public address, then inside the building there are various numbered offices which can be understood as local IP addresses.
Room B4 is not a unique and globally recognizable address, it is used by many buildings to identify offices.
READ ALSO: What is a Static IP and what are the advantages
3) Network Address Translation (NAT) and Port Forwarding
When you connect to something on the Internet, such as a website, the computer sends packets through the router.
The router modifies the packets and assigns them a unique port for each outgoing connection.
When the website or another server sends the data to the computer, it passes it through that specific port so the router knows that it must send the data to the device itself which first started the original connection.
This is how routers manage Internet traffic for multiple computers simultaneously using a single IP address, acting as a traffic warden who tells the machines (the packets that form the traffic) which way they should go (the ports).
Furthermore, a router does not pass unsolicited incoming traffic such as, for example, attempts to connect from outside by strangers (or hackers).
This essentially means that the router acts as a sort of firewall, eliminating unsolicited incoming traffic.
For this reason, even having a static public IP it is not immediate to connect directly to it from a computer outside the network.
If you want to receive incoming traffic you need to configure port forwarding on the router.
For example, you could tell the router that you are running a server for a certain video game on port 25565 on a specific local IP address.
When the router receives a connection on port 25565, it knows that it must pass traffic through the specified private IP address.
This is the reason why port forwarding is necessary for applications that function as servers to receive incoming traffic from outside the local network.
With port forwarding you can therefore also use a computer as a webserver, as an ftop server or as a media streaming server.
READ ALSO: Create a server on your computer to share resources on the internet
4) Future scenarios
As mentioned above, IPv4 addresses are limited so there are two ways to remedy the problem and allow the internet to continue growing:
- Taking advantage of the new IPv6 internet protocol that allows it can offer a huge number of unique IP addresses (2 high 128) and could in theory allow everyone to have their own personal address.
- Large-scale NAT, so that public IPV4 addresses will remain available to providers and will be shared by entire city areas.
This is currently the Fastweb scenario which is a large local area network (like a large building).
Port forwarding in these cases does not work and a PC cannot be used as a server reachable from the internet.
Unfortunately when the Internet was created it had not been imagined for so many connected devices and it is only thanks to home routers and NAT technologies that today we can connect with so many devices without migrating to the IPv6 Internet protocol .

Leave Your Comment

Please enter your comment!
Please enter your name here