Introduction to Subnetting.pdf - The Cisco Learning Network
Introduction to Subnetting.pdf - The Cisco Learning Network
Introduction to Subnetting.pdf - The Cisco Learning Network
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Introduction</strong> <strong>to</strong> <strong>Subnetting</strong><br />
By<br />
Joshua Plata
Table of Contents<br />
<strong>Introduction</strong>…………………………..……………………………………………………………………………2<br />
Decimal <strong>to</strong> Binary Conversion…………………………………………………………………………..……….3<br />
Terms and Concepts……………………………………………………………………………………..………..5<br />
<strong>Subnetting</strong> Problem ………………………………………………………………………………………………6<br />
Questions……………………………………………………………………………………………………7<br />
Table…………………………………………………………………………………………………………10<br />
Conclusion…………………………………………………………………………………………………………15<br />
Glossary of Terms………………………………………………………………………………………………...16<br />
1
<strong>Introduction</strong><br />
<strong>Subnetting</strong>, the act of splitting a network in<strong>to</strong> multiple smaller networks, forms the basis of modern networking. <strong>The</strong><br />
process by which subnets are accurately calculated, however, is often an enigma not only <strong>to</strong> entry-level networking<br />
students, but even <strong>to</strong> later-term networking students.<br />
This manual strives <strong>to</strong> teach students of any level a simple method of calculating subnets accurately and quickly, and is<br />
divided in<strong>to</strong> three major sections, all of which are critical <strong>to</strong> understanding the basics of subnetting:<br />
1. Decimal <strong>to</strong> Binary Conversion<br />
2. Terms and Concepts<br />
3. <strong>Subnetting</strong><br />
While the practical application of this knowledge is beyond the scope of this manual, it is the belief of the author that<br />
understanding the mechanics of the process of calculating subnets will form a solid foundation upon which a deeper<br />
understanding of networking principles can then be built.<br />
2
Decimal <strong>to</strong> Binary Conversion<br />
An understanding of decimal <strong>to</strong> binary conversion is critical not only for subnetting, but for many networking concepts<br />
and tasks. This is because the IP addresses we’re used <strong>to</strong> seeing are actually decimal representations of binary numbers.<br />
For example, where we see:<br />
10.200.170.1<br />
A computer or router sees:<br />
00001010.11001000.10101010.00000001<br />
This is actually much less complicated than it looks. A binary number has eight places, each place containing either a one<br />
or a zero. Each place in a binary number has a numeric value, as follows:<br />
Place 0 0 0 0 0 0 0 0<br />
Value 128 64 32 16 8 4 2 1<br />
3
Decimal <strong>to</strong> Binary Conversion<br />
Whenever a place contains a one, that numeric value is counted; a zero in a place is not. <strong>The</strong>refore:<br />
Binary Decimal<br />
10000000 128<br />
01000000 64<br />
00100000 32<br />
00000001 1<br />
00000010 2<br />
00000011 3<br />
00010100 20<br />
00010101 21<br />
As you can see from the last three examples, when there are multiple ones, you simply add the numerical values for the<br />
places they occupy. With this method, any number from 0 through 255 can be expressed within these eight places.<br />
4
Terms and Concepts<br />
While the volume of information that is outside the scope of this manual is substantial, there are certain terms and related<br />
concepts that need <strong>to</strong> be unders<strong>to</strong>od before we attempt <strong>to</strong> explain the mechanics of subnetting.<br />
Octet – each of the four positions in an IP address is referred <strong>to</strong> as an octet. In any given IP address, A.B.C.D, the octets are<br />
A, B, C and D. This term is derived from the fact that the numbers in each these positions are made up of eight<br />
bits; that is, an eight-digit binary number as previously discussed. <strong>The</strong>re are a <strong>to</strong>tal of thirty-two bits in an IP<br />
address/subnet mask.<br />
Subnet Mask – a basic definition of the Subnet Mask (SNM) is that it indicates a network’s class and is used <strong>to</strong> divide it<br />
in<strong>to</strong> subnetworks; however, the SNM actually contains much more information than just that for someone<br />
knowledgeable in its usage.<br />
CIDR – Classless Inter-Domain Routing. <strong>The</strong> CIDR value expresses the subnet mask in terms of the number of binary<br />
ones contained therein. For example, the subnet mask 255.0.0.0 contains eight ones (decimal 255 = binary<br />
11111111); therefore, the CIDR value is expressed as /8 (i.e. 10.200.170.0/8).<br />
5
<strong>Subnetting</strong><br />
This manual will cover the mechanics of subnetting for the scenario of a specific number of subnets needed. <strong>The</strong> answer<br />
table will be in the standard format of subnetting tests at ECPI College of Technology. Here is an example of the format:<br />
Problem: Your location has been assigned the network of A.B.C.D/E. You are tasked with dividing this network in<strong>to</strong> X<br />
subnets with Y hosts possible on each subnet.<br />
1. What is the original subnet mask?<br />
2. How many subnets are required?<br />
3. How many hosts are required on each subnet?<br />
4. What subnet mask will you use at your location?<br />
5. How many subnets will this new subnet mask allow?<br />
6. How many hosts will this new subnet mask allow on each subnet?<br />
Subnet <strong>Network</strong><br />
ID<br />
1<br />
2<br />
3<br />
4<br />
5<br />
LAST<br />
First Host Last Host Broadcast<br />
Address<br />
6
Problem<br />
Your location has been assigned the network of 57.128.0.0/10. You are tasked with dividing this network in<strong>to</strong> 7 subnets<br />
with max hosts possible on each subnet.<br />
1. What is the original subnet mask?<br />
Questions<br />
To calculate the original subnet mask, you look at the CIDR value. In this case, the CIDR value is /10. This means that in<br />
the subnet mask, there are ten binary ones. Each octet of the subnet mask holds eight binary places. So a CIDR value of<br />
/10, in binary, would look like:<br />
11111111.11000000.00000000.00000000<br />
From here, it’s a simple matter of binary <strong>to</strong> decimal conversion. An octet with all ones equals 255. <strong>The</strong> second octet, with<br />
two ones (128+64), is equal <strong>to</strong> 192. Since the rest of the bits are zeros, that makes the original subnet mask 255.192.0.0.<br />
2. How many subnets are required?<br />
This information is given in the problem. <strong>The</strong> answer is 7. Questions #2 and #3 are included <strong>to</strong> help new students think<br />
through this process step-by-step.<br />
3. How many hosts are required on each subnet?<br />
This information is also given in the problem. <strong>The</strong> answer is ‘max’.<br />
7
4. What subnet mask will you use at your location?<br />
Problem<br />
Questions<br />
To calculate the new subnet mask that will allow you the correct number of subnets, count on your fingers, starting at two<br />
and doubling it until you reach a number that is equal <strong>to</strong> or greater than the number of subnets that are required. For<br />
instance, <strong>to</strong> reach 7 subnets, you would count:<br />
2 – 4 – 8<br />
You needed three fingers <strong>to</strong> get <strong>to</strong> a number equal <strong>to</strong> or greater than 7, so you will add three <strong>to</strong> the original CIDR of /10.<br />
This gives you a new CIDR of /13 which looks like:<br />
11111111.11111000.00000000.00000000<br />
Using binary <strong>to</strong> decimal conversion, we see that the first octet is 255 (all ones), and the second octet, with five ones<br />
(128+64+32+16+8), is 248. <strong>The</strong>refore the new subnet mask that will be used at this location is 255.248.0.0.<br />
5. How many subnets will this new subnet mask allow?<br />
For this answer, think back <strong>to</strong> when you counted on your fingers. <strong>The</strong> number you s<strong>to</strong>pped at was 8. That is how many<br />
subnets the new subnet mask will allow.<br />
8
Problem<br />
Questions<br />
6. How many hosts will this new subnet mask allow on each subnet?<br />
To calculate the number of hosts per subnet, we use the formula 2 X - 2, where ‘x’ is the number of zeros in the new subnet<br />
mask. Since we already know that there are 13 ones in the subnet mask, out of a <strong>to</strong>tal of 32 bits, this leaves 19 bits that are<br />
zeros. Two <strong>to</strong> the nineteenth power (2 19 ) is 524,288; subtract two, and we are left with 524,286. This is the number of hosts<br />
available on each subnet.<br />
9
Problem<br />
Table<br />
<strong>The</strong>re is quite a bit of information contained in this table, so we will look at it one small step at a time. <strong>The</strong> completed<br />
table will be included at the end of this section.<br />
Step 1 – <strong>Network</strong> IDs<br />
<strong>The</strong> network ID for the first subnet, 57.128.0.0, is given in the problem.<br />
Subnet <strong>Network</strong><br />
ID<br />
1 57.128.0.0<br />
To calculate the network IDs for subnets 2 through 5, we look <strong>to</strong> the new subnet mask (255.248.0.0). We will subtract the<br />
last non-zero octet in the new subnet mask (248) from 256. <strong>The</strong> result, 8, will be what we increment the network ID by.<br />
Because the last non-zero octet was the second octet, the increment will occur there. <strong>The</strong>refore, the network ID for the<br />
second subnet will be 57.136.0.0 (second octet is 128 + 8), the network ID for the third subnet will be 57.144.0.0 (second<br />
octet is 136 + 8), and so forth. <strong>The</strong> resulting table would look like this:<br />
Subnet <strong>Network</strong><br />
ID<br />
1 57.128.0.0<br />
2 57.136.0.0<br />
3 57.144.0.0<br />
4 57.152.0.0<br />
5 57.160.0.0<br />
10
Step 2 – <strong>Network</strong> IDs – Last Subnet<br />
Problem<br />
Table<br />
<strong>The</strong> calculation of the network ID for the last subnet is slightly different. For this subnet, we need <strong>to</strong> look at the original<br />
subnet mask, which was 255.192.0.0. Other than that, the process begins the same; we subtract the last non-zero octet<br />
(192) from 256, which gives us the increment (64).<br />
<strong>The</strong> biggest difference in this case is that the increment shows us where the next network will be, not where the next subnet<br />
will be. When we increment the last non-zero octet by 64, the resulting address is 57.192.0.0. This address is outside the<br />
range of the 57.128.0.0/10 network. To find the network ID for the last subnet, we then decrement the last non-zero octet<br />
(192) by the new subnet mask’s increment (8). <strong>The</strong> resulting network ID for our last subnet would then be 57.184.0.0.<br />
Subnet <strong>Network</strong><br />
ID<br />
1 57.128.0.0<br />
2 57.136.0.0<br />
3 57.144.0.0<br />
4 57.152.0.0<br />
5 57.160.0.0<br />
LAST 57.184.0.0<br />
11
Step 3 – First Host<br />
Problem<br />
Table<br />
To find the first available host on a network, we merely add one <strong>to</strong> the last octet of the network ID. For example, for the<br />
network 57.128.0.0, the first available host would be 57.128.0.1. This pattern repeats throughout. <strong>The</strong> resulting table<br />
would be:<br />
Subnet <strong>Network</strong><br />
ID<br />
First Host<br />
1 57.128.0.0 57.128.0.1<br />
2 57.136.0.0 57.136.0.1<br />
3 57.144.0.0 57.144.0.1<br />
4 57.152.0.0 57.152.0.1<br />
5 57.160.0.0 57.160.0.1<br />
LAST 57.184.0.0 57.184.0.1<br />
12
Step 4 – Broadcast Address<br />
Problem<br />
Table<br />
<strong>The</strong> next step is <strong>to</strong> find the broadcast address, rather than the last available host. <strong>The</strong> reason for this will become clear<br />
momentarily. <strong>The</strong> broadcast address is the last IP address before the next network address. In other words, the broadcast<br />
address for the 57.128.0.0 network is the last IP address before 57.136.0.0.<br />
To find the last address in the 57.128.0.0 network, look at the last non-zero octet in the next network ID (136) and<br />
decrement it by one (135). <strong>The</strong>n change the remaining octets, with the value of zero, <strong>to</strong> 255. This will give us an IP<br />
address of 57.135.255.255, which is the broadcast address for the 57.128.0.0 network. Repeat this process with the<br />
remaining network IDs.<br />
<strong>The</strong> only exceptions are subnet #5 and the last available subnet. This is because the next network ID for either one is not<br />
listed in the table. For these network IDs, we must figure out the next subnet, as in Step 1. For example, with subnet #5,<br />
this gives us a network ID of 57.168.0.0. <strong>The</strong>n we apply the formula for calculating the broadcast address. In the example<br />
of subnet #5, we are left with the IP address of 57.167.255.255.<br />
Subnet <strong>Network</strong><br />
ID<br />
First Host Last Host Broadcast<br />
Address<br />
1 57.128.0.0 57.128.0.1 57.135.255.255<br />
2 57.136.0.0 57.136.0.1 57.143.255.255<br />
3 57.144.0.0 57.144.0.1 57.151.255.255<br />
4 57.152.0.0 57.152.0.1 57.159.255.255<br />
5 57.160.0.0 57.160.0.1 57.167.255.255<br />
LAST 57.184.0.0 57.184.0.1 57.191.255.255<br />
13
Step 5 – Last Host<br />
Problem<br />
Table<br />
<strong>The</strong> last available host calculation is similar <strong>to</strong> the first available host calculation. In this case, we decrement the last octet<br />
of the broadcast address by one. <strong>The</strong>refore, in the example of 57.135.255.255, the last available host would be<br />
57.135.255.254. This was the reason for calculating the broadcast address first, <strong>to</strong> make this step easier.<br />
Subnet <strong>Network</strong><br />
ID<br />
First Host Last Host Broadcast<br />
Address<br />
1 57.128.0.0 57.128.0.1 57.135.255.254 57.135.255.255<br />
2 57.136.0.0 57.136.0.1 57.143.255.254 57.143.255.255<br />
3 57.144.0.0 57.144.0.1 57.151.255.254 57.151.255.255<br />
4 57.152.0.0 57.152.0.1 57.159.255.254 57.159.255.255<br />
5 57.160.0.0 57.160.0.1 57.166.255.254 57.167.255.255<br />
LAST 57.184.0.0 57.184.0.1 57.191.255.254 57.191.255.255<br />
14
Conclusion<br />
While this manual did not address any of the practical applications of subnetting, it is the author’s hope that with the<br />
steps shown here, networking students may develop a better understanding of the process of subnetting. I believe that<br />
with a solid foundation in such a fundamental concept, students will be able <strong>to</strong> more effectively build their knowledge of<br />
more complex networking concepts.<br />
15
inary - a base-2 number system using only ones and zeros<br />
Glossary of Terms<br />
broadcast address - the last IP address of a network, used <strong>to</strong> communicate with any adjacent networks.<br />
CIDR - Classless Inter-Domain Routing. A method of expressing the subnet mask as a <strong>to</strong>tal of the binary ones contained<br />
therein.<br />
host - any device requiring an IP address, such as a computer, router, printer, etc.<br />
IP address - a unique identifier for any network device, consisting of four binary octets. It is represented as four decimal<br />
numbers, 0 - 255, separated by periods.<br />
last non-zero octet - the last octet of an IP address that is not a zero<br />
network ID - the IP address identifying a network. It is the IP address directly before the IP address for the first host;<br />
usually in the format x.0.0.0, x.x.0.0, or x.x.x.0.<br />
octet - an eight digit binary number.<br />
subnet - a small self-contained network that is actually part of a larger network<br />
subnet mask - a portion of an IP address that indicates a network’s class, size, and is used <strong>to</strong> divide it in<strong>to</strong> subnetworks<br />
subnetting - the act of splitting a network in<strong>to</strong> multiple smaller networks<br />
16