Subnetting

Subnetting is used in IPv4 networks when an organization with a single logical IP network address has multiple physical networks. From an administrative perspective, each of these physical networks, or subnets, must be individually addressable as it significantly reduces the complexity of managing the network topology.

Subnetting uses a three-level addressing hierarchy as shown in Subnet Address. A subnetted domain further divides the host-number portion of the classful address into two parts, a subnet-number and a host-number on that subnet.

Figure 3. Subnet Address

Subnet Address


With the three-level subnet addressing, routers within the subnetted domain now use an extended-network-prefix to route traffic between individual subnets. The extended-network-prefix (Extended-Network-Prefix) is composed of the classful network-prefix and the subnet-number.

Figure 4. Extended-Network-Prefix

Extended-Network-Prefix


The extended-network-prefix is identified by a subnet mask. In classful topologies, the subnet mask (Subnet Masking) is a fixed attribute and must be the same value when assigned to all hosts and routers within the same network. The bits in the subnet mask have a one-to-one correspondence with the bits in the classful IP address. If a bit in the subnet mask has a value of 1, the system should treat the corresponding bit in the IP address as part of the extended-network-prefix. If the bits in the mask are set to 0 (zero), the corresponding bits in the IP address are part of the host-number.

Figure 5. Subnet Masking

Subnet Masking


The length of the extended-network-prefix is equivalent to the number of contiguous one-bits in the subnet mask. In Subnet Masking, the extended-network-prefix length would be 24, the number of contiguous one-bits. Slash notation is used to represent the IP address and subnet mask pair needed to perform routing. The example in Subnet Masking would therefore represent the IP address and its corresponding mask as 130.25.1.1 /24.

The subnetting of individual networks ensures that the subnet structure of a network is never visible outside of the private domain. The route from the Internet to any subnet of a given IP address is the same, regardless of the subnet on which the destination host resides. This is because all subnets of a given network number use that same network-prefix but different subnet numbers. To the Internet, all of the subnets of a given domain are collected into a single routing table entry, 130.25.0.0 /16, as shown in Subnetted Topology.

Figure 6. Subnetted Topology

Subnetted Topology