What Is an IP Address?
An IP (Internet Protocol) address is a unique identifier for every device on a network. To send and receive data on the internet, both sender and receiver need IP addresses. The most widely used IPv4 consists of 32 bits and provides about 4.3 billion addresses.
IPv4 Address Structure
An IPv4 address is divided into four 8-bit groups (octets) separated by dots.
192.168.1.100
11000000.10101000.00000001.01100100 (binary)
Each octet ranges from 0 to 255, so IPv4 addresses go from 0.0.0.0 to 255.255.255.255.
Public vs Private IP
| Aspect | Public IP | Private IP |
| Assigned by | ISP | Router |
| Internet access | Direct | Through NAT |
| Uniqueness | Globally unique | Unique within local network |
| Cost | Included in ISP fees | Free |
Private IP Ranges (RFC 1918)
| Class | Range | Subnet | Hosts |
| A | 10.0.0.0 ~ 10.255.255.255 | /8 | 16,777,214 |
| B | 172.16.0.0 ~ 172.31.255.255 | /12 | 1,048,574 |
| C | 192.168.0.0 ~ 192.168.255.255 | /16 | 65,534 |
🔢
Number Base Converter
Convert between binary, decimal, and hex
→
What Is a Subnet Mask?
A subnet mask separates the network portion from the host portion of an IP address.
IP: 192.168.1.100 = 11000000.10101000.00000001.01100100
Mask: 255.255.255.0 = 11111111.11111111.11111111.00000000
Network: 192.168.1.0 (where mask bits are 1)
Host: 0.0.0.100 (where mask bits are 0)
CIDR Notation
| CIDR | Subnet Mask | Hosts | Use Case |
| /8 | 255.0.0.0 | 16,777,214 | Large enterprise/ISP |
| /16 | 255.255.0.0 | 65,534 | Medium organization |
| /24 | 255.255.255.0 | 254 | Small office |
| /28 | 255.255.255.240 | 14 | Small subnet |
| /30 | 255.255.255.252 | 2 | Point-to-point link |
| /32 | 255.255.255.255 | 1 | Single host |
Number of hosts = 2^(32 - subnet bits) - 2 (excluding network and broadcast addresses)
IPv6: The Future of IP
| Aspect | IPv4 | IPv6 |
| Length | 32 bits | 128 bits |
| Addresses | ~4.3 billion | ~3.4×10³⁸ |
| Notation | 192.168.1.1 | 2001:0db8:85a3::8a2e:0370:7334 |
| NAT needed | Yes | No |
Useful Network Commands
- Check local IP:
ipconfig (Windows) / ifconfig (Mac/Linux)
- Check external IP:
curl ifconfig.me
- Test connectivity:
ping 8.8.8.8 (Google DNS)
- Trace route:
traceroute google.com
- DNS lookup:
nslookup example.com