An IP Address (Internet Protocol Address) is a unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two main functions: host or network interface identification and location addressing.
Types of IP Addresses
- IPv4 (Internet Protocol version 4): The most widely used version. It is a 32-bit address written in dot-decimal notation (e.g.,
192.168.1.1). - IPv6 (Internet Protocol version 6): The newer standard designed to replace IPv4 due to address exhaustion. It is a 128-bit address written in hexadecimal (e.g.,
2001:0db8:85a3::8a2e:0370:7334).
Public vs. Private IP Addresses
Public IPs are unique across the entire internet and are assigned by ISPs. Private IPs are used within local networks (LANs) and are not routable on the public internet.
Private IP Ranges (RFC 1918)
To preserve public IPv4 addresses, specific ranges were reserved for private use within LANs. These addresses cannot be routed over the internet.
| Class | Range | CIDR |
|---|---|---|
| Class A | 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 |
| Class B | 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 |
| Class C | 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 |
Network Part vs. Host Part
Every IP address is divided into two parts:
- Network Part: Identifies the specific network or subnet the device belongs to. (Like a street name).
- Host Part: Identifies the specific device on that network. (Like a house number).
The Importance of Subnet Mask
The Subnet Mask is a 32-bit number that distinguishes the Network part from the Host part. It works by "masking" the network portion of the IP address.
192.168.1.10 with a subnet mask of 255.255.255.0:
• 192.168.1 is the Network.
• .10 is the Host.
IP Addressing Classes
IPv4 addresses were originally divided into classes to define network sizes:
| Class | Range (1st Octet) | Default Subnet Mask | Usage |
|---|---|---|---|
| Class A | 1 – 126 | 255.0.0.0 (/8) | Very large networks (ISPs, huge corps) |
| Class B | 128 – 191 | 255.255.0.0 (/16) | Medium-sized networks (Universities) |
| Class C | 192 – 223 | 255.255.255.0 (/24) | Small networks (Home, Small Business) |
| Class D | 224 – 239 | N/A | Multicast groups |
| Class E | 240 – 255 | N/A | Reserved for Research |
Note: 127.0.0.0/8 is reserved for loopback testing (localhost).