Showing posts with label subnet mask. Show all posts
Showing posts with label subnet mask. Show all posts

Wednesday, January 27, 2010

An Example of Subnetting a Class C Network

Subnetting varies in difficulty, depending on which class you are subnetting. More often than not, you will need to create a subnet for a class C network. A class C network allows for many networks to be created, but not as many hosts. In fact, you can create a hefty 2,097,152 networks- but only 254 hosts per network are allowed.
Let’s say we are subnetting a school’s network. We need 5 separate networks that have 30 computers on each subnet.
First we calculate how many usable subnets we need. Next we will need to determine how many hosts are required. Both of these values can be calculated with the following equations:
Two Important Equations to Remember:
________________________________________
• 1. Usable Subnets = (2^n) – 2 , where N = power of bits assigned
• 2. Usable Hosts = (2^n) – 2 , where N = power of bits remaining
Let’s start with usable subnets. Review the diagram below for a visual example.


If you are wondering what the “-2” part of the equation is for, this is how we account for the two addresses in each subnet we can’t use. We will review what these addresses are for more specifically later on. For now, let’s find out what our usable hosts are!



Alright Already! What’s My Subnet Mask?!
Getting your subnet mask at this point is incredibly easy. Simply take all of your network bits, and add them up. Look at the diagram below for a visual guide.



That’s it! You’re done. You have successfully created a subnet mask that can be used on the school’s network. Keep in mind that every computer must have the subnet mask set in order for them to be on the same network. Also note that since we are using a class C network, the first three octets will always be 255. When subnetting other classes, be sure to keep the network portions in mind.

Summary

Subnetting may not be fun, but it is required for students to know on networking exams. That means you should stay away from subnet calculators until you have grasped the full concept of how to do it yourself. These calculators should only be used as a time saving tool, not a learning tool or way to cheat on homework.
With enough practice, subnetting will become much easier. Class A and Class B networks are a bit trickier, but follow the same example as shown above and it should be quite easy to accomplish.

Subnet Masks

A subnet mask is what we use to assign different amounts of networks and hosts to an IP network. It essentially divides the IP address into two parts: the network and host. This is a trading game- the more hosts you have, the fewer networks you will have. And yet the more networks you have, the fewer hosts you will have. Review the class A default subnet masks as shown below.

The class B network will need to recognize two network portions, and two host portions. This can be seen in the below diagram.

Lastly, we have the class C subnet. It is the most commonly used subnet, so pay special attention to it in the upcoming lecture. You can see a diagram of the default subnet below.

Calculating subnet mask

The formula for finding out the number of bits is:

(2^n) – 2 = x

Where “n” is the number of bits you need to borrow and “x” is the number of subnets that will be produced.

You need 5 subnets:

(2^n) – 2 = x

Try 2 first:
(2^2) = 4 and 4-2 is 2 (this is too low)

Try 3 next:
(2^3) = 8 and 8-2 is 6 (this is correct since it will give you 6 subnets)

You have borrowed 3 bits.
So for your example, you would end up with:

199.120.16.0 /21 (since 24-3 = 21)