Describe different types of IP addressing
IP facilitates the routing and delivery of data packets across networks. Every device on a network is assigned a unique IP address as its numerical…
The Internet Protocol (IP)
IP facilitates the routing and delivery of data packets across networks. Every device on a network is assigned a unique IP address as its numerical identifier.
IPv4 vs IPv6
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32-bit | 128-bit |
| Representation | Dotted decimal (e.g. 192.168.1.1) | Hexadecimal with colons (e.g. 2001:0db8:85a3:0000:0000:0:8a2e:0370:7334) |
| Address pool | ~4.3 billion unique addresses | ~340 undecillion (3.4 × 10³⁸) unique addresses |
| Header format | Complex, 14 fields | Simplified, 8 fixed fields |
| IPsec support | Optional | Mandatory |
Many IPv4 and IPv6 addresses are reserved for special purposes.
Public vs Private IP Addresses
Public IP Addresses
- Assigned to devices that connect directly to the internet
- Globally unique — no two devices share the same public IP simultaneously
- Managed by IANA and distributed through regional registries
- Used by web servers, email servers, and any internet-facing device
- Accessible from anywhere on the internet (given correct network/security config)
Private IP Addresses
- Used within private networks; not exposed to the internet
- Allow multiple devices to communicate internally
- Defined by RFC 1918; these ranges are not routed on the internet, so they’re reusable across different private networks
- Cannot be reached from the internet directly without NAT
Common private IP ranges:
| Range | Use case |
|---|---|
10.0.0.0 – 10.255.255.255 | Large private networks; 16,777,216 addresses (24-bit block) |
172.16.0.0 – 172.31.255.255 | Mid-sized networks; 1,048,576 addresses across 16 × 20-bit blocks |
192.168.0.0 – 192.168.255.255 | Small/home networks; 65,536 addresses across 256 × 16-bit blocks. 192.168.1.1 is a common default gateway |
Special Addresses
Loopback — 127.0.0.1
- IPv4 loopback address — routes traffic back to the same device
- Entire range
127.0.0.0–127.255.255.255is reserved for this, but127.0.0.1is the standard - IPv6 equivalent:
::1(shorthand for0000:0000:0000:0000:0000:0000:0000:0001, where::compresses consecutive zeros)
Static vs Dynamic IP Addresses
Static IP
- Permanently assigned to a device; does not change
- Must be manually configured by a network administrator or user
- Best for devices needing a stable, consistent address: web servers, email servers, printers
- Ensures reliable, uninterrupted access to services
Dynamic IP
- Temporarily assigned each time a device connects to the network
- Allocated by a DHCP server from a pool of available addresses
- Efficiently reuses the limited IPv4 address pool by reassigning addresses as needed
- Standard for most end-user devices (laptops, phones, etc.)
Network Address Translation (NAT)
IPv4’s ~4.3 billion addresses aren’t enough for every device in the world. IPv6 solves this but adoption has been slow due to hardware requirements. NAT bridges the gap.
NAT maps many private IP addresses to a single public IP address, dramatically reducing the number of public IPs needed.
Outbound traffic:
- A device on the private network initiates a connection to the internet
- The router (NAT device) replaces the private IP in the packet header with its own public IP
- It also modifies the source port number so it can track which device the reply belongs to
Inbound traffic:
- The router receives the response from the internet
- It consults its internal NAT table (which tracks active sessions) to translate the public IP + port back to the correct private IP + port
- The packet is forwarded to the originating device
Thousands of devices on a private network can all appear to the internet as coming from a single IP address — NAT is a key tool in conserving public IP address space.