Skip to main content

Super netting

Even though we appear to be in the twilight years of IPv4, you may still be faced with the question of super netting.

In the IPv4 world, we use a subnet mask to separate the network and host portion of an IP address.  With the IP address divided into 4 groups representing 8 bits, the normal subnets look like this:

255.0.0.0

255.255.0.0

255.255.255.0


The 255 is the decimal representation of 8 bits, all set to ‘1’.  The 0’s are the decimal representation of 8 bits, all set to ‘0’.  This makes subnetting easy.  Let’s say you need a subnet that can handle 4000 hosts?  Standard subnets will not work.  Here is how you figure out the subnet ID

Convert the 4000 to binary.  User the programmer mode on the Windows calculator

Just type in 4000 in DEC mode, and then switch to BIN mode.

image

The binary for this is 11111010000

If we add some leading zeros to make this an even 16 bit number, we get

0000111110100000

Now, place them into octets.

00001111.10100000

We can see by the leading one, that we need to borrow the lower 4 bits of the third octet for use as the host ID.  The leading 4 will be used as part of the network ID. In Window calculator, let’s figure out what just the first 4 leading bits will be.  To do this, set the calculator in BIN mode and type 11110000.  Now click DEC mode. You get the number 240.  Your subnet mask is:

255.255.240.0 or 11111111.11111111.11110000.00000000

There are also a limited number of subnets possible with subnetting.  We will continue to use the above subnet of 255.255.240.0 as our example.  Since we can only use the leading 4 bits for the network ID, we have to calculate the possible subnets.

00000000 ---- 0
00010000 ---- 16
00100000 ---- 32
00110000 ---- 48
01000000 ---- 64
01010000 ---- 80
01100000 ---- 96
01110000 ---- 112
10000000 ---- 128
10010000 ---- 144
10100000 ---- 160
10110000 ---- 176
11000000 ---- 192
11010000 ---- 208
11100000 ---- 224
11110000 ---- 240


Of these 16 subnets, the first and last one are reserved.  We only have 14 available subnets.

The IP address is derived from a combination of the bits from the host portion, and the network portion.  Let’s say that we need to use the last two bits of the third octet, and the first 6 of the fourth for our host ID.

00000011.11111100

We know that the first four bits are reserved for the network ID.  Lets place this in the 192 subnet.  Out subnet ID will look like this.

11111111.11111111.11000000.00000000

Let’s combine our host and network IDs

11111111.11111111.11000011.11111100

Running the 3rd octet through the Windows Calculator, we get 195.  If our network ID is 10.10.xxx.yyy, we can now determine that out IP address is 10.10.195.252

This is a very complicated method.  The link below will take you to a chart on the internet to try and help you determine the number of subnets and hosts a particular network can support.
http://www.pantz.org/software/tcpip/subnetchart.html

Comments

Popular posts from this blog

Adding a Comment to a GPO with PowerShell

As I'm writing this article, I'm also writing a customization for a PowerShell course I'm teaching next week in Phoenix.  This customization deals with Group Policy and PowerShell.  For those of you who attend my classes may already know this, but I sit their and try to ask the questions to myself that others may ask as I present the material.  I finished up my customization a few hours ago and then I realized that I did not add in how to put a comment on a GPO.  This is a feature that many Group Policy Administrators may not be aware of. This past summer I attended a presentation at TechEd on Group Policy.  One organization in the crowd had over 5,000 Group Policies.  In an environment like that, the comment section can be priceless.  I always like to write in the comment section why I created the policy so I know its purpose next week after I've completed 50 other tasks and can't remember what I did 5 minutes ago. In the Group Policy module for PowerShell V3, th

Return duplicate values from a collection with PowerShell

If you have a collection of objects and you want to remove any duplicate items, it is fairly simple. # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   # Remove the duplicate values. $Set1 | Select-Object -Unique 1 2 3 4 5 6 7 What if you want only the duplicate values and nothing else? # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   #Create a second collection with duplicate values removed. $Set2 = $Set1 | Select-Object -Unique   # Return only the duplicate values. ( Compare-Object -ReferenceObject $Set2 -DifferenceObject $Set1 ) . InputObject | Select-Object – Unique 1 2 This works with objects as well as numbers.  The first command creates a collection with 2 duplicates of both 1 and 2.   The second command creates another collection with the duplicates filtered out.  The Compare-Object cmdlet will first find items that are diffe

How to list all the AD LDS instances on a server

AD LDS allows you to provide directory services to applications that are free of the confines of Active Directory.  To list all the AD LDS instances on a server, follow this procedure: Log into the server in question Open a command prompt. Type dsdbutil and press Enter Type List Instances and press Enter . You will receive a list of the instance name, both the LDAP and SSL port numbers, the location of the database, and its status.