|
Home -Networking Info - Hex and Binary - Wild Card Masks - TTY Info - Photo Pages - Blog - About us - |
|
Long Division Table
This is an example of a very LOOOOOONG and tedious way to find a subnet number. At the end of his example, I will show you the easy way to get the same answer. This is a quote from his web page --- Finding A Particular Subnet By: Drew Campbell Community College of Beaver County IT Manager & CNAP Regional Academy Instructor 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:
2. Bits borrowed: If the first 25 bits (from left to right) are 1's, we get: 11111111.11111111.11111111.1 0000000A Class B address takes up the first 2 octets (16 bits), when subtracted from 25, leaves us with 9 bits (borrowed).
11111111.11111111.11111111.1 0000000255 . 255 . 255 . 128
( 9 we borrowed) This gives us 512 subnets, with 510 useable. So we can find the 460th.
So 2^7 (2*2*2*2*2*2*2) = 128 hosts per subnet, 126 useable per 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:
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.
460 * 128 = 58880
2 | 58880 2 | 29440 R 0 (Note: The colors I'm using represent2 | 14720 R 0 the answer to each division2 | 7360 R 0 and the corresponding remainder.2 | 3680 R 0 So, the first step is "2 into 588802 | 1840 R 0 equals 29440, with a remainder2 | 920 R 0 0", and so on )2 | 460 R 02 | 230 R 02 | 115 R 02 | 57 R 12 | 28 R 12 | 14 R 02 | 7 R 02 | 3 R 12 | 1 R 10 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 00111100Now, let's look at the original problem again: 162.124.0.0 / 25 ; S ubnet 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: Starting with the last bit borrowed, plug in the 460 (IN BINARY! Right to left) and you have this: 162.124. 1 1 1 0 0 1 1 0 . 0 |_ _ _ _ _ _ _ Convert the 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. |