What is Subnet?
Also known as: Subnetwork
A logical subdivision of an IP network, created by borrowing host bits to form a subnet identifier, allowing efficient address allocation and traffic isolation within a larger network.
A subnet (short for subnetwork) is a logical partition of an IP network. In IPv4, a subnet is defined by an IP address combined with a subnet mask (or prefix length in CIDR notation), which separates the address into a network portion and a host portion. By extending the network prefix beyond the default classful boundary, administrators can create multiple smaller networks from a single larger address block.
Subnetting works by borrowing bits from the host part of the address. For example, a /24 network (255.255.255.0) provides 254 host addresses. If you borrow one bit from the host field, you get two /25 subnets, each with 126 usable hosts. Routers use the subnet mask to determine whether a destination address is local or must be forwarded to another subnet. All devices on the same subnet can communicate directly at Layer 2; traffic to a different subnet must go through a router or Layer 3 switch.
Subnets are fundamental to IPv4 address management. They reduce broadcast domain size, improve security by isolating traffic, and make routing tables more efficient through route summarization. IPv6 also uses subnetting, typically with a /64 prefix as the standard subnet size for a LAN. The concept is defined in RFC 950 for standard subnetting and RFC 4632 for CIDR, which supersedes classful addressing.
Key facts
- A subnet mask (e.g., 255.255.255.0) or CIDR prefix (e.g., /24) defines the boundary between network and host bits.
- Subnetting reduces broadcast domain size, limiting unnecessary traffic and improving network performance.
- Routers use the subnet mask to decide whether a packet's destination is on the local subnet or requires forwarding.
- IPv6 almost universally uses /64 subnets for LAN segments, allowing Stateless Address Autoconfiguration (SLAAC).
- CIDR (RFC 4632) replaced classful subnetting in 1993, enabling variable-length subnet masks (VLSM).
How it works in practice
Related terms
References
More in Networking & Routing
Anycast
Anycast is a network addressing and routing method where a single IP address is assigned to multiple servers, and routers send traffic to the nearest server based on routing protocol metrics.
AS Path
A BGP path attribute that lists the sequence of autonomous system numbers a route has passed through, used for loop detection and path selection.
ASN
A globally unique 16 or 32 bit number assigned to an autonomous system for use in BGP routing between organizations on the Internet.
Autonomous System
An Autonomous System (AS) is a group of IP networks under a single administrative routing policy, identified by a unique ASN (Autonomous System Number) for exterior gateway routing.
BGP
BGP (Border Gateway Protocol) is the path vector routing protocol that networks use to exchange reachability information between autonomous systems on the public internet.
CIDR
CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing packets using variable-length subnet masks (e.g., /24) instead of fixed classful boundaries.
Hop
A hop is one passage of a packet through a router or other layer-3 forwarding device as it travels from source to destination across an internetwork.
IPv4
IPv4 is the core Internet Protocol using 32-bit addresses, providing roughly 4.3 billion unique identifiers for network interfaces on the global internet.
IPv6
IPv6 is the most recent version of the Internet Protocol, using 128-bit addresses to provide an effectively unlimited number of unique identifiers for networked devices.
Latency
Latency (or round-trip time, RTT) is the time required for a packet to travel from a source to a destination and back, measured in milliseconds, and is a critical metric in network performance.