Why Partition Networks?
Without subnets, all network traffic would propagate to every device, causing massive congestion. Subnetting segments a network into isolated broadcast domains, increasing security and control.
Subnet Masks and Bitwise Operations
A subnet mask (e.g. 255.255.255.0) splits an IP address into a network portion and a host portion. Devices apply a bitwise AND operation on their IP address and subnet mask to determine if a destination IP is inside the local subnet or requires routing to the gateway.
IP: 192.168.1.50 -> 11000000.10101000.00000001.00110010
Mask: 255.255.255.0 -> 11111111.11111111.11111111.00000000
Network: 192.168.1.0 -> 11000000.10101000.00000001.00000000CIDR Notation
CIDR (Classless Inter-Domain Routing) replaced classful networks with slash notation (e.g. 192.0.2.0/24). The "/24" indicates that the first 24 bits are the network ID, leaving 8 bits for host addresses (supporting 256 IPs, with 254 usable for devices).
