blog posts

What are public and private IP addresses and what are the differences between the them?

It is important to know the meaning of private and public IP addresses and their differences. In this article, we will review the differences and how these two types of IPs work.

When it comes to IP addresses, “public” and “private” modifications may seem familiar to you. If you are unfamiliar with these two terms, explaining them may seem a bit confusing at first glance; But understanding them is very important. Before explaining private and public IPs, it is better to talk about how IPs work. In this article, we are going to compare public and private IP addresses to see how these protocols work on the modern Internet.

What is an IP address?

First, let’s look at what an IP address really is. An IP address stands for “Internet Protocol Address” and, as its name implies, includes numbers that are used to identify computers and other devices on the network.

You may have a name for your computer (for example, a laptop) so that you can use it to identify your device. Of course, computers work better with numbers; Therefore, when your computer tries to communicate with another device or computer on the network or the Internet, it will send the information to that destination’s IP address. Today, we still generally use IPv4 addresses with a general format of 165.132.1.10

Just like when you send a letter to a specific address in a region, the IP address allows the computer to send the data to another device. When you visit websites, your computer connects to the IP address of the webserver in question to download content from.

What is a public IP address?

A public IP address refers to an address that points your home network to the rest of the Internet. Because most personal networks use a router to connect to the Internet, this public address is reserved for your router.

Then, since all your home devices are connected to the Internet through the router, they use the router’s public IP address when going online. In this case, it does not matter what device you use, desktop, phone, happy home devices, or …, because the Internet connection will be done through your public IP. Each computer can also use its public IP to access the router.

What is a Private IP Address?

A private IP address is an address that is only used for devices inside your home network, and other devices on the Internet outside of your home will not have access to these addresses. Instead, a private IP address is used to connect the home network’s internal devices to each other; Therefore, your router knows where to send the received information.

Private IP addresses used on the home network are also used on thousands of other networks. For example, the IP address of your smartphone on your home network maybe 192,169,100.17. This address is not unique, and people in your neighborhood may use the same private IP address to connect their devices to the router and eventually the Internet.

It is worth noting that these addresses do not overlap; Because they are used in separate networks. If you have two identical ID addresses on a private network, you will end up with an IP conflict. In addition, private IP addresses may be known as local IPs or internal IPs; But in the end, the meaning of all these terms is the same.

How do public and private IP addresses work together?

To illustrate how private and public IP addresses work, think of campus with student mailboxes. If you lived on campus and wanted to send a letter to the holder of box 278, you could simply write “box 278” on the envelope and drop it in the university mailbox. Then, the staff will easily deliver your mail to the recipient.

However, if you lived off-campus and wanted to send a letter to the owner of box 278, you could not just put the word “box 278” in the envelope and put it in the standard mailbox. Post staff in this case do not know to which building the letter should be sent; Because there are many 278 fund locations in the country.

Instead, you should send the letter to the address of the university building and use the phrase “Box 278” in the continuation of the address. If you did not enter the fund number, the post office staff would not know which fundholder at the university is the main recipient of the letter. In this example, the address of the university building is similar to the public IP address. While the student fund number acts as a private IP address.

NAT And the evolution of the Internet Protocol

ُSo NAT, which stands for “Network Address Translation”, is an important term for in-home networks that are used to associate private and public IP addresses. NAT allows your router to share a public IP on many private IP addresses.

Your router uses NAT to track incoming traffic and then send it to the device on your network; For this reason, you can play online games while one device is playing music from another input. In which case both operations will work properly.

NAT is important; Because in the world, IP addresses under IPv4, the current version of the Internet Protocol, are gone. There are just over four billion potential IP addresses, and due to the large number of Internet-connected devices worldwide, the stock of unused IPs has been depleted.

The solution to this problem is to use IPv6, which can actually be considered a new generation of Internet protocol. This protocol uses 128-bit (2128) addresses and has ample space to provide a large number of IP addresses (3.4 times 10 to the power of 38). This figure is so large that it is impossible to understand. Our IPv6 addresses will not run out for very long. An example of a version 6 IP address is: 2001: db8: 8a2e: 370: 7334.

How to find your public and private IP address?

Finding both types of IP addresses for Internet-connected devices is not easy. And most of the time, you do not need to worry about it; But there are situations where it is important to know the IP address.

آی پی در گوگل

To check the public IP address of your home network, you can simply enter the phrase “What’s My IP” in the Google search engine. After entering the phrase, Google will show you a box containing your public IP address. Note that this address may change from time to time; So, if you try to get your public IP again in a few days or weeks. You will probably come across a new address and you should not be too surprised.

Conclusion

Understanding how both types of IP addresses work will help you better understand how the Internet works. Public IPs allow all local area networks to be widely identified on the Internet; While private IP addresses reduce the use of IPv4 addresses, as a result. Your router can manage the traffic of all your home devices. Both private and public IP addresses are important, and in most cases. They work properly without the need for user intervention.