IPv4 Explained
Understanding IPv4 addresses, subnet masks, CIDR notation, and how IP addressing works.
IPv4 Address Format
Basic Structure
192.168.1.100
1921681100
- • Four numbers (octets) separated by dots
- • Each octet ranges from 0 to 255
- • 32 bits total (8 bits per octet)
- • Over 4 billion possible addresses
Binary Representation
192
11000000
168
10101000
1
00000001
100
01100100
Computers work with the binary representation internally, but we use decimal notation for readability.
Subnet Masks and CIDR
What is a Subnet Mask?
A subnet mask tells your computer which part of an IP address identifies the network and which part identifies the specific device on that network.
Example Network
Network: 192.168.1.0/24
Subnet Mask: 255.255.255.0
Usable Range: 192.168.1.1 - 192.168.1.254
Broadcast: 192.168.1.255
CIDR Notation
/24 = 255.255.255.0
/16 = 255.255.0.0
/8 = 255.0.0.0
/30 = 255.255.255.252
Common Subnet Sizes
| CIDR | Subnet Mask | Hosts | Use Case |
|---|---|---|---|
| /30 | 255.255.255.252 | 2 | Point-to-point links |
| /28 | 255.255.255.240 | 14 | Small office networks |
| /24 | 255.255.255.0 | 254 | Home/office networks |
| /16 | 255.255.0.0 | 65,534 | Large corporate networks |
Private IP Address Ranges
Class A
10.0.0.0/8
Range: 10.0.0.0 - 10.255.255.255
Hosts: 16.7 million
Use: Large enterprises
Class B
172.16.0.0/12
Range: 172.16.0.0 - 172.31.255.255
Hosts: 1 million
Use: Medium businesses
Class C
192.168.0.0/16
Range: 192.168.0.0 - 192.168.255.255
Hosts: 65,534
Use: Home/small office
Private vs Public
These private ranges are reserved for internal networks and cannot be routed on the public internet. Your router uses NAT to translate between private and public addresses.
IPv4 Limitations
Address Exhaustion
IPv4 provides about 4.3 billion addresses, but with billions of devices worldwide, we've essentially run out of new public IPv4 addresses.
- • IANA pool exhausted in 2011
- • Most regions out of new allocations
- • IPv4 addresses now traded like commodities
Solutions
- •NAT: Share one public IP among many devices
- •CGNAT: ISP-level sharing (with limitations)
- •IPv6: Vastly more addresses (long-term solution)