Subnetting

The division of an address range of IPv4 addresses into several smaller address ranges to maintain security.

Subnetting for a network should be done in such a way that it does not affect the network bits.

Subnetting does two things: it gives us a way to break up networks into subnets and allows devices to determine whether another device/IP address is on the same local network or not.

  • Without subnetting, every internet-connected device would need its own unique IP address.

A subnet is a logical segment of a network that uses IP addresses with the same network address.

  • the subnet mask separates the IP address into the network and host addresses.

    • The β€œ255” address is always assigned to a broadcast address, and the β€œ0” address is always assigned to a network address.

We use the subnet mask as a template for the IPv4 address

  • From the 1-bits in the subnet mask, we know which bits in the IPv4 address cannot be changed.

    • These are fixed and therefore determine the "main network" in which the subnet is located.

The network address is vital for the delivery of a data packet.

  • If the network address is the same for the source and destination address, the data packet is delivered within the same subnet.

  • If the network addresses are different, the data packet must be routed to another subnet via the default gateway.

Last updated