Subnet Mask
A subnet mask is a 32-bit number used to divide an IP address into a network portion and a host portion, helping to determine if devices are on the same local network or on different ones. It works by using binary ones for the network part and binary zeros for the host part, and it allows for efficient network management by splitting large networks into smaller, more manageable subnets.
How it works Separates network and host: A subnet mask, formatted like an IP address (e.g., \(255.255.255.0\)), separates an IP address into two parts: the network ID and the host ID.
Uses binary: In binary, the mask has ones ($1$s) for the network bits and zeros ($0$s) for the host bits.
Routes traffic: When a device needs to send data, it uses the subnet mask and its own IP address to see if the destination IP is on the same local network or a different one. If it's on the same network, the data is sent directly; if it's on a different network, the data is sent to a router for forwarding.
Why it's used
Efficiency: By creating smaller subnets, a subnet mask reduces the amount of broadcast traffic that needs to be sent to every device on the network, leading to better performance.
Management: It allows network administrators to logically segment networks for different departments (e.g., sales, HR) or security purposes, making the network easier to manage.
Security: Dividing a network into subnets allows administrators to apply different security policies to different segments, improving overall security through network segmentation.