Home - Subnetting Info  -T HEX - Wildcard Masks-

Finding a Subnet address

Long Division Way

 There are several ways to find a particular Subnet address. Many more can be found thru a search on the internet. I will show you the longest way and then the easy way to get the same answer.

This is an example of a very LOOOOOONG and tedious way to find a subnet address.



 We've learned how to subnet different classes of addresses, but how do we find a particular subnet? Sure, you can write out each of the network numbers, but what if you need to find a subnet in the hundreds? Or thousands? Or TEN THOUSANDS?!?

Let's take a look

 Given: 162.124.0.0 / 25

Find the following:

  1. Class
  2. Bits Borrowed
  3. Subnet Mask
  4. Number of subnets & useable subnets
  5. Number of hosts & useable hosts
  6. The 460th subnet

  

  1. Well, we should know the class. 1st octet is 162 - it's a Class B

  2. Bits borrowed: If the first 25 bits (from left to right) are 1's, we get:

11111111.11111111.11111111.10000000

A Class B address takes up the first 2 octets (16 bits), when subtracted from 25, leaves us with 9 bits (borrowed).

   

  1. The subnet mask is 255.255.255.128, since the network & subnet bits are set to 1's.

11111111.11111111.11111111.10000000

255 . 255 . 255 . 128

 

  1. The number of subnets is 2^9 (2*2*2*2*2*2*2*2*2)

( 9 we borrowed)

This gives us 512 subnets, with 510 useable.

So we can find the 460th.

  

  1. The number of hosts are the last 7 bits (0's in the mask).

So 2^7 (2*2*2*2*2*2*2) = 128 hosts per subnet, 126 useable per subnet.

  

  1. What is the 460th subnet?

Tough question? Sure. You could sit & write out ALL the network numbers, but there's an easier way. There are others ways, but this is the one I know:

  1. First, let's find our increment. The last non-zero octet in the subnet mask is the
  2. fourth. (255.255.255.128)

We'll subtract it from 256 (which is the number of possibilities in an 8-bit number => range is 0 ­ 255, 256 possibilities)

256 - 128 = 128, our network increment.

 

  1. Now, we'll take our increment (128) and multiply it by the subnet we're trying to find (the 460th)..

460 * 128 = 58880

 

  1. Now, we'll divide 2 into 58880 and each additional answer and keep track of the remainder [R], which will make up our binary subnetwork:

2 | 58880

2 | 29440 R 0 (Note: The colors I'm using represent

2 | 14720 R 0 the answer to each division

2 | 7360 R 0 and the corresponding remainder.

2 | 3680 R 0 So, the first step is "2 into 58880

2 | 1840 R 0 equals 29440, with a remainder

2 | 920 R 0 0", and so on )

2 | 460 R 0

2 | 230 R 0

2 | 115 R 0

2 | 57 R 1

2 | 28 R 1

2 | 14 R 0

2 | 7 R 0

2 | 3 R 1

2 | 1 R 1

0 R 1

Now, lets write out the remainders, reading from bottom to top:

1110011000000000

Since we work in 8-bit octets, let's group the remainders the same way, starting from RIGHT to LEFT:

11100110 00000000

*Note: You won't always have an even number of bits. If you see you only have 4, 5, 6, whatever left at the beginning, put trailing zero's in front.

EX: 110100111100

From right to left grouping: 1101 00111100

Put zeros in front of the first group: 00001101 00111100

Now, let's look at the original problem again:

162.124.0.0 / 25 ; Subnet mask is 255.255.255.128

..and our remainders (grouped): 11100110 00000000

and in decimal: 230 . 0

 Since we borrow into the 3rd & 4th octet (and the 1st & 2nd are network-given Class B), our groups represent the 3rd & 4th octet addresses:

162.124.230.0 = our 460th subnet.  

===========================================================================================================================

Wow, that was tiresome! Hope I did all my division and remainder carrying correct or I'll have to do it again.

Now let's do the same thing the easy way -

What is the 460th subnet of 162.124.0.0/25?

We know that 9 bits were borrowed leaving us with 7 bits for hosts:
162.124._ _ _ _ _ _ _ _ . _ | _ _ _ _ _ _ _

Starting with the last bit borrowed, plug in the 460 and you have this:

162.124. 1 1 1 0 0 1 1 0 . 0 |_ _ _ _ _ _ _


Convert that third octet (11100110) (that last 0 is in the 4th octet) to decimal and you get 230. So the 460th subnet would be 162.124.230.0

This is so much easier and faster.