An IP address (Internet Protocol address) is a unique numerical label assigned to every device connected to a network that uses the Internet Protocol. It serves two purposes: identification (which device is it?) and location addressing (where is it so packets can be routed there?).
Every device communicating over the internet must have an IP address. Routers use IP addresses to forward packets to the correct destination across the global network of networks.
IPv4 is the original and still dominant internet addressing system. An IPv4 address is 32 bits long, written as four octets (8-bit groups) in dotted decimal notation, separated by dots.
192.168.1.1 = 11000000.10101000.00000001.00000001
Each octet ranges from 0 to 255 (8 bits = 2⁸ = 256 values). Total IPv4 address space: 2³² = ~4.3 billion addresses.
| Class | First Octet Range | Default Subnet | Use |
|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 (/8) | Large organisations |
| B | 128 – 191 | 255.255.0.0 (/16) | Medium networks |
| C | 192 – 223 | 255.255.255.0 (/24) | Small networks |
| D | 224 – 239 | N/A | Multicast |
| E | 240 – 255 | N/A | Reserved/experimental |
These ranges are reserved for use within private networks (LANs) and are NOT routed over the public internet:
| Range | Subnet | Addresses |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Private addresses allow many devices in a LAN to share a single public IP via NAT (Network Address Translation).
With only ~4.3 billion addresses and billions of internet-connected devices, IPv4 addresses were exhausted. IANA (Internet Assigned Numbers Authority) allocated the last IPv4 blocks to regional registries in 2011.
NAT (Network Address Translation) was introduced as a workaround: a router holds one public IP address but translates internal private addresses for outgoing traffic, allowing many devices to share a single public IP.
However, NAT is a workaround, not a long-term solution — it breaks end-to-end connectivity and complicates peer-to-peer communication. The real solution is IPv6.
IPv6 is the successor to IPv4, designed to solve address exhaustion. An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits, separated by colons:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Total IPv6 address space: 2¹²⁸ = ~340 undecillion addresses (~3.4 × 10³⁸) — enough to assign billions of addresses to every person on Earth.
0db8 → db8::: 2001:db8:0:0:0:0:0:1 → 2001:db8::1:: can only appear once in an address to avoid ambiguity| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Address space | ~4.3 billion | ~340 undecillion |
| Notation | Dotted decimal (192.168.1.1) | Hexadecimal with colons |
| Header size | 20–60 bytes (variable) | 40 bytes (fixed) |
| NAT required | Yes (due to shortage) | No (abundant space) |
| Security | Optional (IPSec) | Built-in (IPSec mandatory) |
| Configuration | Often manual / DHCP | Auto-configuration (SLAAC) |
| Broadcast | Yes | No (uses multicast/anycast) |
| Fragmentation | Routers and hosts | Hosts only |
A subnet mask divides an IP address into two parts: the network portion (which network the device is on) and the host portion (which device within that network).
Example: 192.168.1.0 with subnet mask 255.255.255.0 (or /24 in CIDR notation) means the first 24 bits are the network; the last 8 bits identify hosts. This gives 2⁸ - 2 = 254 usable hosts (subtract 2 for network address and broadcast address).
CIDR (Classless Inter-Domain Routing) replaces the old classful system — a /n suffix indicates how many bits are in the network portion. More flexible and efficient allocation of address blocks.
DHCP automatically assigns IP addresses to devices on a network. When a device connects, it broadcasts a DHCP Discover message; the DHCP server offers an available IP address, which the device accepts. This removes the need to manually configure IP addresses on every device.
DHCP assigns addresses from a pool and leases them for a defined period — when the lease expires, the address may be reassigned.
8 questions · 20 marks · instantly marked
| Term | Definition |
|---|