CalKit
IT/Dev

Understanding IP Addresses and Subnet Masks

Learn network basics easily: IP address structure, subnet mask roles, and CIDR notation. Also understand the difference between public and private IP addresses.

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

AspectPublic IPPrivate IP
Assigned byISPRouter
Internet accessDirectThrough NAT
UniquenessGlobally uniqueUnique within local network
CostIncluded in ISP feesFree

Private IP Ranges (RFC 1918)

ClassRangeSubnetHosts
A10.0.0.0 ~ 10.255.255.255/816,777,214
B172.16.0.0 ~ 172.31.255.255/121,048,574
C192.168.0.0 ~ 192.168.255.255/1665,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

CIDRSubnet MaskHostsUse Case
/8255.0.0.016,777,214Large enterprise/ISP
/16255.255.0.065,534Medium organization
/24255.255.255.0254Small office
/28255.255.255.24014Small subnet
/30255.255.255.2522Point-to-point link
/32255.255.255.2551Single host

Number of hosts = 2^(32 - subnet bits) - 2 (excluding network and broadcast addresses)

IPv6: The Future of IP

AspectIPv4IPv6
Length32 bits128 bits
Addresses~4.3 billion~3.4×10³⁸
Notation192.168.1.12001:0db8:85a3::8a2e:0370:7334
NAT neededYesNo

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

💬Frequently Asked Questions

🧮Related Calculators

Related Articles

Popular Calculators