Networking Basics

IP Address Structure: Network Bits, Host Bits, Subnet Mask and CIDR

IP in Binary

An IPv4 address is a 32-bit number, usually written in dotted decimal like 192.168.1.1. Each of the four octets is 8 bits, so each ranges from 0 to 255.

Network Bits and Host Bits

An address consists of network bits (identifying the subnet) and host bits (identifying a device inside it). The subnet mask, such as 255.255.255.0, marks the boundary.

CIDR Notation

CIDR writes a range as IP/prefix, e.g. 192.168.1.0/24 means the first 24 bits are network bits - equivalent to mask 255.255.255.0. A /24 has 256 addresses; two are reserved for network and broadcast, leaving 254 usable.

Common Prefixes

CIDRSubnet MaskTotalUsable
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/24255.255.255.0256254
/16255.255.0.06553665534
/8255.0.0.01677721616777214
Use the "IP Range Lookup" tool to compute network, broadcast and usable hosts from any CIDR. →