Subnetting
SUBNETTING
A key element in any network is to be able to use your resources most efficiently. When networking big businesses or universities together, it is not always affordable to create many networks. This is when you use subnetting. You can use subnetting for a number of reasons, such as organization, use of different physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space, security, and to control network traffic. Subnetting is a process where you take your networks and break them down into mini networks. This allows for more people to access or use your network. In the paragraphs that follow, I will give an in-depth understanding of what sub netting is by defining it and giving examples of subnetting, I will describe different types of subnetting, and explain the benefits of using it.
According to the encyclopedia, the word subnetting is defined as; “A subnetwork or a subnet is a range of local addresses within the address space that is assigned to an organization.” To understand a subnetwork, it is first important to fully understand how a network works. A network address is given an IP address. The IP address serves as an address, similar to addressing a letter. In a network, there is the network portion of the address and there is the host portion. The network address is telling the computer in which general area to send the information to, (to which router will it be sent to) just as you would put the city to where the letter is going to. The host portion of the network address tells the router or switch to which individual work station the information is going to. This is like putting a street address on your letter. So, the network address tells the general area (router/switch) the information is going to, and the host address tell the specific workstation the information is going to.
The network and/or host address will be a series of 4 numbers ranging from 1-254. (Technically it is 0-255, but 0 and 255 are not used as addresses) Each number is separated by a period. An example of a typical network addressed would be;
107.13.235.45
Binary Code
To understand why the number goes to 255, you must first understand Binary code. The word Binary means “two” or “base two”. Computers use the Binary Code language to work with data. All data that is stored in a computer is only represented by a 0 or a 1. Binary code consists of an eight bit number. Each bit, or number, has a value. So if you go from right to left, the value of the first digit is 1, and it doubles at each digit. So the values goes, from right to left, 1st digit- 1, 2nd digit- 2, 3rd digit- 4, 4th digit- 8, 5th digit- 16, 6th digit- 32, 7th digit- 64, and 8th digit- 128. All of these numbers added together will give you 255. (Note, if you prefer to go from left to right, you can do that as well, just start with 128 instead of 1) Here are some examples of binary codes;
01100101= 101 (64+32+4+1)
00000000= 0 (0+0= 0)
11111111= 255 (128+64+32+16+8+4+2+1= 255)
So when we type in the number 113, the computer does not see 113, but rather 01110001. Therefore the binary system is a way to use a language with only using 0’s and 1’s. All computers and computer components run on Binary Code.
Classes of Network Addresses
A network will have different address classes. They are Class A, Class B, and Class C. (Class D is not commonly used). A company that has 50 computers will not need the same type of networking than that company with 5000. They created the classes to be able to meet different needs. In a Class A address, the first number is the network number. The following three numbers are host numbers. This type of network allows you to have many hosts with fewer networks. Also, in a Class A network, the number for the network will range from 1-126 (technically it is 1-127, but 127 is used for testing). An example of this would be;
45.107.240.19
Notice that the first number, 45, is between 1 and 126. This means that the information is going to network 45. 107, 240, and 19 are set for host numbers. (One could more accurately say it is one host, but the three remaining digits are designed for hosts.) If a company will have a private network, it will usually fall in this category. Ball State has a network address of 10. . .
The second class, Class B address will have the first number range between 128-191. In a Class B address, the first two sets of numbers are networks, and the remaining two are hosts. An example of a Class B address would be;
154.17.234.9
In this, the first number, 154 falls between 128 and 191. The numbers 154 and 17 are both network numbers for this address, whereas 234 and 9 are the host numbers.
In a Class C network, the first number will range from 192-223. The first three numbers will represent networks, and the last one will represent a host. An example of a Class C network would be;
209.13.147.92
The first number, 209, fits in the range, and 209, 13, and 147 are all network numbers. 92 is left as the host number. (One should keep in mind that MOST subnetting takes place in a Class C network).
So to recap, this is the break down of all four classes.
Class A- N.H.H.H (1-127)
Class B- N.N.H.H (128-191)
Class C- N.N.N.H (192-223)
Remember that numbers in the computer are represented by Binary Code, so it may look more like this;
Class A: 01100001.00011100.10101010.11111001
N H H H
Class B: 10111110.11111111.00000000.01010101
N N H H
Class C: 11011110.00000000.00000000.00111001
N N N H
Depending on what you need for your network, the range of hosts can be anywhere from 256 – 16.8 million hosts. If you have a small business, with only one department, you will more than likely go with a Class A network. On the other hand, if your business is quite large, with multiple departments, you will need something like a Class C. This is because you have more networks that will be able to separate each department in your business.
Subnetting
In any network, you will have a certain number of networks and a certain number of hosts available to you. Sometimes, that number isn’t quite enough. (Usually there are not enough networks) In this case, you are able to borrow bits from your host portion of the address to create more networks. Subnetting a network means using the subnet mask to divide the network and break a large network into smaller, more efficient, more manageable segments, or subnets. When you subnet, you take a network, and change a portion of it in order to provide more networks. Listed below is a basic example of subnetting:
In this example, the main network address is 150.150.0.0. In this address, we change the 3rd Octet, which is 0. From this, we create five new networks; 150.150.1.0, 150.150.2.0, 150.150.3.0, 150.150.4.0, and 150.150.5.0. Notice that the number changes in the third Octet, which is the host. This means that this is a class B network. You can also tell this by the address beginning with 150. Now that you know what subnetting looks like, we will go in detail as to how subnetting works.
Subnet Mask’s
Although using a subnet mask is not the only way to subnet a network address, it is the most common, therefore it is important to fully understand the concept. According to Jeff Grimm, a graduate student for Information and Communication Sciences at Ball State University, the term subnet mask is defined as “a 32-bit number resembling an IP address that is used in conjunction with IP addresses to create a specific number of subnetwork’s, each with a specific number of hosts.” Simply put, the number of available networks and hosts in the standard address class structure can be expanded by borrowing bits from the host portion and using them to allow for more networks. The function of a subnet mask is to extract the network ID portion of an IP destination address and determine whether an IP address exists on the local network or whether it must be routed outside the local network. The subnet mask contains 4 8-bit octets, just like an IP address shown above. An example of a subnet mask would be
11111111.11111111.11111111.00000000
This is the most common default subnet mask, which is also written as 255.255.255.0. A subnet mask does not replace the IP address, but rather works with the IP address to allow the user to “borrow” bits from the host part of the address to make more networks. By default, the network portion of a subnet mask will be all 1’s and the host portion will be all 0’s. Therefore, if we have a Class B address where no bits were borrowed, it would look like this;
11111111.11111111.00000000.00000000 or 255.255.0.0
N N H H
If we wanted to borrow 8 bits from the host portion to create more networks, it would look like this;
11111111.11111111.11111111.00000000 or 255.255.255.0
N N N H
Notice that the third octet has now become part of the network address. We borrowed bits from the Host portion of the address, and made them part of the network address. Keep in mind that you do not have to borrow bits in increments of 8. Lets say we wanted to borrow 5 bits from the same address of 255.255.0.0. It would look like this:
11111111.11111111.11111000.00000000 or 255.255.248.0
N N N H H
We still were able to add the bits we needed for the Network portion, but by doing this, it leaves more host opportunities. Remember, when you borrow bits for subnetting, you are borrowing them from the host portion of your address.
As mentioned above, you will never be given just a subnet mask. The mask is always given along with the IP address, and is never written in binary form (the binary is to help people understand how subnetting works). An example of an address with the subnet mask would look like this;
72.146.232.16 255.255.224.0
IP Address Subnet Mask
In this address, the 72.146.232.16 is the IP address. This will not change. Based on the subnet mask, we know we borrowed 3 bits from the host portion. (we can refer to the portion in this paper that explains binary. 128+64+32=224)
Basic Rules of Subnetting
Now that we have a basic understanding of subnetting, and what a subnet mask is, it is important to understand some basic rules of subnetting. First, in any 8 bit octet of an IP address (146.17.35.97) where each number represents an 8 bit binary code, the numbers 0 or 255 cannot be used. You cannot have an IP address of all 0’s or all 1’s. They represent the network ID and a broadcast number (it is not important to understand what each of these are, but rather just understand you are not able to use them). Keep in mind, this only applies to the IP address. You can have all 1’s and 0’s for the subnet mask, in fact, there are default subnet masks for each class. They are as follows:
Class A- 255.0.0.0
Class B- 255.255.0.0
Class C- 255.255.255.0
You will use a different mask for the different types of class you are using. Going back to not using all 0’s or 1’s. You know that these are set aside for the Network ID and Broadcast numbers. We also know that subnetting is used to, among other thing, increase the number of networks allowed. When using subnet masks, there is a general rule to go by. To calculate the number of hosts or the number of networks for a given subnet mask, use the following formula: 2^(number of bits used) -2. We know that we are able to “borrow” bits. You will always take 2 to the power of the number of bits. We subtract 2 from that number, because you are not able to use all 1’s of 0’s. This formula will give you the number of usable hosts or networks. For instance, if we take the IP address of 172.16.0.0 255.255.192.0. Based on this, we know that is it a Class B address, so on the mask, 255.255.192.0 is used by default. The 255.255.192.0 represents the number of bits we want to borrow, which is 2 (128+64=192). Therefore we would use the following formula to calculate the number of networks available.
2 ^ 2 - 2= 2 Networks.
We take 2 to the power of, in this case, 2 which equals 4. Then we subtract 2 since we cannot use all 1’s and all 0’s, which gives us 2 usable networks from this subnet mask.
We can also determine the number of hosts that are available from this mask. We know we borrowed 2 bits from the 3rd octet, leaving us 6 bits in the 3rd and 8 in the 4th. This means we have or can say are borrowing 14 bits. If we plug this into the formula, we get:
2 ^ 14 – 2 = 16,382 Hosts
We take 2 to the power of 14 which equals 16,384. Then we subtract 2 which give us 16,382 hosts.
http://www.ralphb.net/IPSubnet/subnet.html
http://www.networkcomputing.com/unixworld/tutorial/001.html
http://dictionary.reference.com/browse/address%20mask
http://www.tcpipguide.com/free/t_IPAddressClassABandCNetworkandHostCapacities.htm
http://www.faqs.org/docs/linux_network/x-087-2-issues.ip-addresses.html
http://www.comptechdoc.org/os/linux/manual4/networkclasses.html
http://compnetworking.about.com/od/workingwithipaddresses/a/subnetmask.htm
http://www.pku.edu.cn/academic/research/computer-center/tc/html/TC0306.html
http://www.tekmom.com/buzzwords/zdbinary.html
http://www.dummies.com/WileyCDA/DummiesArticle/id-2265.html