When you know IP address and mask number, you sometimes want to know subnet number, subnet broadcast address and range of valid IP addresses. In common ways, you can find these by convert the IP address with mask number to binary and perform boolean AND but that takes too much time. So let see how to find these answers in a short time.

Before I start, let see the general table which will used to describe IP address. In each column will be the IP address that separate by octet, dot-notation (x.x.x.x). In each row is the IP address.

Generic Subnet Table

Octet1234
Address
Subnet number
First Address
Broadcast Address
Last Address

Let’s start

I divide into 2 categories which depend on subnet mask:

  1. Do Maths with easy masks
    For the masks that contain only 255s and 0s. There are three masks which are 255.0.0.0, 255.255.0.0 and 255.255.255.0.
    I guess many people know this already, but l will explain a little bit to revise for someone.

    1. Find the subnet number
      • Copy first octet (mask 255.0.0.0), first two octets (mask 255.255.0.0) or first three octets (mask 255.255.255.0) from IP address
      • Put 0s in the remaining octets
    2. Find the broadcast the address
      • Copy first octet (mask 255.0.0.0), first two octets (mask 255.255.0.0) or first three octets (mask 255.255.255.0) from IP address. This is the same in ‘Find the subnet number’, step 1
      • Put 255s in the remaining octets
    3. Find range of valid IP addresses
      • To find the first valid IP address, copy the subnet number and add 1 to the fourth octet
      • To find the last valid IP address, copy the broadcast address and subtract 1 to the fourth octet
    4. Example
      • Mask 255.0.0.0
        Octet1234
        Address101101401
        Subnet number10000
        First Address10001
        Broadcast Address10255255255
        Last Address10255255254
      • Mask 255.255.0.0
        Octet1234
        Address101101401
        Subnet number1011000
        First Address1011001
        Broadcast Address10110255255
        Last Address10110255254
      • Mask 255.255.255.0
        Octet1234
        Address101101401
        Subnet number101101400
        First Address101101401
        Broadcast Address10110140255
        Last Address10110140254
  2. Do Maths with difficult masks
    In this case, most people find it’s difficult to calculate and some has to do by binary math which is time consuming. Let see the way to figure out in few seconds.

    1. Find the subnet number
      • I will define the column that contain the difficult number(not 255s and 0s) as the interesting column. For any octets fully to the left of the interesting column, copy value(s) from the original IP Address into all addresses(subnet number, first-last address and broadcast address).
        Octet1234
        Address13041021
        Mask2552552520
        Subnet number1304
        First Address1304
        Broadcast Address1304
        Last Address1304
      • For any octets fully to the right of the interesting column, put 0s in the subnet number.
        Octet1234
        Address13041021
        Mask2552552520
        Subnet number13040
        First Address1304
        Broadcast Address1304
        Last Address1304
      • Now the tricky part, find a ‘magic number’ which is 256 minus mask’s interesting octet. In this example, it is 256 – 252 = 4.
      • Find the multiple of the magic number that is closest to, but not greater than the the interesting octet of original IP address. For this case, it is 100 (4*25) which also not greater than 102.
      • Put the result from previous step in subnet number of the interesting column.
        Octet1234
        Address13041021
        Mask2552552520
        Subnet number13041000
        First Address1304
        Broadcast Address1304
        Last Address1304
    2. Find the broadcast address
      • For any octets fully to the right of the interesting column, put 255s in the broadcast address. The left part should be filled already in Find subnet number, the upper.
      • Again, use the magic number. By adding the magic number to the interesting octet of subnet number and subtract 1. In this example, the magic number is 256 – 252 = 4, 100 + 4 – 1 = 103.
      • Put the result from previous step in broadcast number of the interesting column.
        Octet1234
        Address13041021
        Mask2552552520
        Subnet number13041000
        First Address1304
        Broadcast Address1304103255
        Last Address1304
    3. Find range of valid IP addresses
      The way used to find the first and last IP addresses are the same in easy mask.

      • To find the first valid IP address, copy the subnet number and add 1 to the fourth octet
      • To find the last valid IP address, copy the broadcast address and subtract 1 to the fourth octet
        Octet1234
        Address13041021
        Mask2552552520
        Subnet number13041000
        First Address13041001
        Broadcast Address1304103255
        Last Address1304103254

Reference: CCNA Self-Study, CCNA ICND, Chapter 4: IP Addressing and Subnetting

Related post

    No related posts.