An Internet Protocol (IP) address is a unique string of numbers that identifies a device on a network. As shown in the diagram above, each router creates a private network that is inaccessible to the outside world. Each device connected to the router is given a unique IP address of its own to identify it. The Router Internal IP address usually looks similar to 192.168.x.x
. This is because there is a specific range allowed for private networks whereas public addresses have different ranges allowed.
An obvious question arises - if the private network is inaccessible to the outside world, how does one device outside the network connect with one in the network? To understand the answer to this question, it is important to know that the router has an “External IP” - an address assigned by the ISP to the router so it knows how to communicate with the router. Once the router receives the request, something known as “Network Address Translation” or NAT (seen more in further lessons) needs to be carried out. This allows the data to be sent to the correct destination.
It is important to note that at some point, the world was in danger of running out of IP addresses. This is because the general IPv4 format (32-bit - 192.168.1.1
) only allows for 4.3 billion unique addresses. To counter this, IPv6 was invented which allowed 128-bit addresses, enabling an almost limitless pool of addresses (about 3.4 x 10^38), which written in hexadecimal looks like - 2001:0db8:85a3:0000:0000:8a2e:0370:7334
.
IP addresses are categorized into public, private, static, dynamic, and special-purpose addresses, each serving distinct roles in networking. Public IP addresses are globally unique and assigned by organizations like the Internet Assigned Numbers Authority (IANA) or regional registries. These addresses are routable on the public internet and used to identify devices, websites, or servers that need direct access to the internet, such as web servers or cloud resources.
In contrast, private IP addresses are reserved for use within private networks, such as homes, offices, or data centers. They belong to specific ranges defined by RFC 1918, including 10.0.0.0/8
, 172.16.0.0/12
, and 192.168.0.0/16
. Static IP addresses remain fixed and are often used for devices that require consistent identification, such as servers, network hardware, and VoIP systems. These are crucial for applications that depend on a constant connection point, like hosting websites or remote desktop access.
On the other hand, dynamic IP addresses are temporary and assigned by Dynamic Host Configuration Protocol (DHCP) servers. They are widely used for client devices such as laptops, smartphones, and other user-facing systems because they are cost-effective and require less administrative effort to manage. There are also special-purpose IP addresses, such as loopback addresses like 127.0.0.1 used for testing and local communication, and multicast or broadcast addresses for sending data packets to multiple devices in a network.