Category: IP Subnetting

IP Subnetting

When Classful addressing is used an ENTIRE class A, B, or C network is needed for each individual network segment.  Here is an example of a network using classful addressing, notice that this can lead to a severely inefficient method of allocating IP address space:

classfulnetwork.PNG

The more reasonable option would be to reserve a single classful IP Network and use subnetting to break it up into three parts for this network instead.  This will allow for more efficient use of the IP address space given.

When subnetting, IP addresses are broken down into three parts:

  • Network
  • Subnet
  • Host

subnet1.PNG

This shows  the benefits to subnetting, essentially more efficiently using IP address space to preserve as many addresses as you can from what you’ve been allocated.

Here are some facts related to the format of an IP Address:

  • If the subnet has been defined with y host bits, there are 2y-2 valid usable IP addresses in that subnet, two of the numeric values are reserved
  • The first reserved address is the subnet number itself, this number has all binary 0s in the host bits
  • The second reserved number is the broadcast address, which has all 1’s in the host bits.
  • When doing classful subnetting if the subnet mask has x subnet bits then 2x possible subnets exist for that classful network.
  • Two subnet numbers, the highest and the lowest are discouraged from use:
    • Zero subnet: this is the subnet field that has all binary 0s, each zero subnet is the same as the classful network number
    • Broadcast Subnet: the subnet field with all binary 1`s same as the network broadcast address

How to find the subnet number and valid range of IP addresses – Binary

the range of valid IP addresses in a subnet begins with the IP that is 1 larger than the subnet number itself, it ends with the IP address that is 1 smaller than the broadcast address for the subnet.  So to find the valid range of addresses just calculate the subnet number and broadcast address:

  • To derive the subnet number, perform a bitwise Boolean AND between the IP address and subnet mask
  • To derive the broadcast address, change all the host bits in the subnet number from 0s to 1s

a bitwise Boolean AND means that you line the binary version of the address and the subnet on top of each other, and then AND the two bits that line up vertically.

  • Result = 1 if both bits are 1
  • Otherwise the result = 0

booleanand

So given the output above the Subnet Number is 172.31.103.0 and the broadcast address is 172.31.103.255.  So the valid range of IP addresses is: 172.31.103.1 – 172.31.103.254