Public IP vs Private IP
As the names suggest, the basic difference between public IP and private IP is the networks in which they are used. Before delving into those details, an IP address or the Internet Protocol address is a unique identifier assigned to each device on a network. This allows each different device on the network to be uniquely identified. There are two categories of IP addresses known as public IPs and private IPs. Public IPs, which are unique across the whole internet, lets devices to be connected to the internet. To manage uniqueness, their assignment is managed centrally through an organization. Private IP addresses are used in private networks that are not connected to the internet or connected to the internet through NAT. Here, the uniqueness inside the private network is enough and hence same address range would be used in different private networks that are isolated from each other. When IP version 4 is considered 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255 and from 192.168.0.0 to 192.168.255.255 are reserved for private addresses while the rest are for public IPs.
What is Public IP?
A public IP address is globally unique to the Internet. By standard, certain IP address ranges have been reserved to be used by private networks. Any IP that is not reserved for private IP can be used as public IP. An IP network should have a unique IP for each of its device. As the internet is also an IP network, IP addresses must be properly maintained to prevent same IP from being used by several devices. This IP address management is done by the organization called Internet Assigned Numbers Authority (IANA) where they assign IP ranges to different organizations. When these IP addresses are assigned the internet routers must be configured so that devices on the internet can access the IP. That is any assigned public IP address is globally routable. Public address ranges exist for both Internet Protocol version 4 and version 6 (IPv4 and IPv6). IP version 4 provides a huge number of IP addresses, but the number of devices with a public address assigned has become so large that now the IPv4 address scheme proves to be inadequate. Therefore, IPv6, which can provide more IP addresses when compared to IPv4, has been introduced and now is under use.
What is Private IP?
An organization can have devices that need to connect with other devices in the organization, but not necessary to connect to the internet. So, in such cases, assigning a unique IP within the internal network is enough, but it is not necessary to assign a public IP address. Here, as the network is isolated, theoretically any IP address range can be used with the only requirement that IP addresses within the private network should be unique. But, if by any chance, if such network is connected to the internet without modifying IP addresses, it will put rise to duplicate IP addresses. Therefore, the standards have reserved special IP address ranges to be used for private addresses. In IP v4, three address ranges have been reserved for private IPs. They are,
• From 10.0.0.0 to 10.255.255.255
• From 172.16.0.0 to 172.31.255.255
• From 192.168.0.0 to 192.168.255.255
Say the company A uses the IP addresses from 192.168.1.0 to 192.168.1.255 for their private network. Also, say the company B uses the same range for their private network. As these two networks are not connected to the internet, it is not a problem as the two networks are isolated. And also it is important to state that today the technology called NAT (Network Address Translation) allows even connecting the above two networks to the internet while having the same IPs. Here what is done is, the router in company A is given a unique public IP and the router in the company B is given another unique public IP. Then the routers will manage a NAT table that with appropriately forward packets from the internal network to the internet.
What is the difference between Public IP and P rivate IP?
• Public IPs are globally unique across the internet. But private IPs are not connected to the internet, and hence different private devices in different networks can have the same IP address.
• Public IPs can be accessed/ routed through the internet. But private IPs cannot be accessed via the internet. (But today the technology called NAT gives a work around to connect a private IP address range to the internet using just one public IP)
• IP addresses assigned for private IPs in IPv4 are from 10.0.0.0 to 10.255.255.255, from 172.16.0.0 to 172.31.255.255 and from 192.168.0.0 to 192.168.255.255. The rest can be used for public IPs.
• Public IPs are managed by the organization called Internet Assigned Numbers Authority (IANA). There is no such central management body for private IPs where they are managed by the administrator of the private network.
• Public IPs after being assigned must be configured on internet routers for proper routing to happen. But private IPs are not configured on internet routers but just on the private routers.
• To get a public IP, money should be paid for registration but, for private IPs, there is no cost.
• Private IP of a computer can be viewed in Windows by launching the network card details dialog box or using the IP Config command in command prompt. To view the public IP , one must go to the browser and use the web tool that displays the public IP or can simple type “my ip” on google.
Public IP vs Private IP
A public IP is an IP address that is exposed and connected to the internet. Therefore, a public IP must be unique on the internet. Management of public IP addresses are done by a central organization called Internet Assigned Numbers Authority (IANA) and after assignment internet routers must be configured so that they can be routed. A public IP costs money to be registered. Private IP addresses are used in private networks, which are not generally connected to the internet. (Nowadays, Network Address Translation allows connecting these as well to the internet). As private networks are kind of isolated, the same IPs can be used in different networks and maintaining the uniqueness within the network is enough. The private IPs can be freely used without any registration.
Images Courtesy: A little diagram of an IP address (IPv4) via Wikicommons (Public Domain)