|- foyer - me, myself & i - gallery - chartlist - ispy - reflections - blog - did you know? - swyswsy -|
I noticed that quite a number of students have problems with subnetting techniques in networking subjects. Hopefully through my examples, the students in LAN and AdvNet would be able to benefit from it. For LAN students, you basically just have to master subnetting using Class B and C addresses. The technique for subnet addressing is generally the same for Class A addresses, it is just that the number of hosts/subnets are greater then B and C.
I will begin using a Class C IP address.
Question : You are to design a set of IP addresses that are subdivided into 2 departments with 50 stations in each department. The network address is given as 18.104.22.168
Provide the following to your design :
1. The class of the IP address, and default network and host ids
2. The subnet mask
3. All the subnet network addresses
4. The exact range of IP addresses used in the above network
[Tip : Sometimes you are not given an IP Address. You are free to choose any address that satisfies the question. Always check that the range in the particular class of address you choose satisfies the required number of subnets and hosts. This is to avoid answering the question halfway and then realizing you have used the wrong class of address and you would need to redo the question.]
1. Recall the range of IP addresses in each class.
Class A : 001.xxx.xxx.xxx – 127.xxx.xxx.xxx
Class B : 128.001.xxx.xxx – 191.254.xxx.xxx
Class C : 192.000.001.xxx – 223.255.254.xxx
Class D : 224.000.000.000 – 22.214.171.124
Note : Class D is generally used for multicasting and should not be used as a choice in subnetting.
IP address : 126.96.36.199 -> 11001000.01100100.00001010.00000000.
Recall for Class A : MSB is always 0. Class B = 10x, Class C = 11x, Class D = 111
Hence the class of the IP address 188.8.131.52 = Class C.
2. The default subnet mask for Class C -> 255.255.255.0
Recall that in a subnet mask, the bits in the network id are always ‘1’, and the host ‘0’. The mask tells the router which subnet it is in.
In our design, we are required to provide 2 subnets. Hence, we will need to ‘borrow’ the bits in the host id portion of the address. Remember, in IP addressing, we should never modify the network portion of the address.
Default netmask of Class C address -> 11111111.11111111.11111111.00000000.
We need 2 subnets, hence we will need to convert some of the ‘0’s in the host portion into ‘1’s. To find out how many, we could use 2 common methods.
Method 1 : (log2 2+2) = 2 [In a calculator, you would type log 4/log 2 as a change of base formula
Method 2 : 22 - 2 = 2
Now why am I adding and subtracting 2? Remember, in subnet addressing, all ‘0’s and all ‘1’s are not to be used. The – 2 comes from subtracting the cases of all 0s and all 1s. This is important, please remember this.
Why did I add 2 to Method 1 then? Recall that when you bring a positive number over the equation, it becomes negative. [10+2 = 12, is the same as 10+2-12 = 0] Also, remember if you use the log formulae, and you arrive at an answer with a remainder value, always bring it to the next whole number, regardless what the remainder value is. ie if you get 1.1 or 1.9, always bring it to 2, never back to 1, or you will fall short of the number of subnets required and hence answered the question wrongly.
Now, we have determined we need to change 2 bits to ‘1’ for the subnet mask. (netmask)
Ans : 255.255.255.192 ->11111111.11111111.11111111.11000000
Note : Try to remember, when you are asked for a subnet mask, the address always begins with 255. I used to get confused over this fact. Subnet mask and subnet addresses are 2 different thing, as you would see later.
3. Recall our original IP address is 184.108.40.206
We can only ‘play’ around with the last portion of the addresses, since this is a Class C address. (which makes this easier then subnetting a Class A address. Do you know why?)
The host portion of the IP address ->00000000
Recall we have determined that 2 bits are needed for subnet addressing. How many possible cases are there? Let’s see.
00000000, 01000000, 10000000, 11000000
There are 4 cases, but remember, all ‘0s’ and all ‘1s’ are invalid!!
00000000, 01000000, 10000000, 11000000
When you are asked for subnet addresses (you may be required to list or, or a particular address, make sure you read the question carefully), you are expected to list the address that represents the whole subnet.
Hence in this case, we have 2 subnets, Subnet #1 ->01000000 = 64
The actual range of IP addresses for subnet #1 begins from 220.127.116.11 – 18.104.22.168. (What is the exact range for subnet 2?)
4. In answering this portion, make sure you read the question carefully on how many hosts are required in each subnet. In the question, there are 50 hosts in each subnet.
Recall in subnet # 1, the subnet number = 22.214.171.124
Hence, the first IP that we be allocated would be the next host.
>First IP address = 126.96.36.199 ->188.8.131.52
Some students may get confused here, is it .114 or .115?
Remember when you are calculating the range, it includes the first IP address. Hence, you would take 65 +49 = 115
Now, try to come up with the solution for Subnet 2 on your own before looking at the answer provided below.
Subnet # 2 : First IP address = 184.108.40.206 – 220.127.116.11
Question : You are to design a set of IP addresses for 6 computer labs.
Each lab consists of 100 computers. In your answer, provide the following:
2. We have determined that a set of class B addresses will fulfill our requirements. The default subnet mask for a Class B address is 255.255.0.0 (Recall that in the default subnet mask, the network portion is always ‘1’ and the host portion is always ‘0’)
Since we have also determined we will need 10 bits for the subnet addressing, the subnet mask = 255.255.255.192
3. In the question, we are not provided with an IP address, hence we are free to choose any class B IP address of our choice. Let us select 18.104.22.168 (why not 22.214.171.124?) as the IP address assigned to us. The range of subnet addresses range from ‘1’ to ‘6’.
Therefore, the subnet address of subnet 4 = 126.96.36.199
[ 1002 = 410 ]
4th Subnet -> First IP = 188.8.131.52 (10000000.00000001)
The word maximum, tells us we have to take everything into account. We have allocated 3 bits for subnetting, which will give us a maximum of 6 subnets. We have given 7 bits for host allocation, which gives us a maximum of 128 hosts. Hence the max = 128 x 6 = 768.
I would highly recommend that all students read the question carefully, since they could ask a question on the maximum number of hosts in ONE subnet, etc.
So, how well have you done? I hope that everyone would be able to follow the logical flow in answering such questions. Next, we will look at subnetting using a Class A IP address. LAN students would probably not be tested on this range of IP addresses (but don’t take my word for it!) The technique is the same as the other classes, and is a good Class of IP address to practice with.
Given an a network address of 184.108.40.206, show how you can divide 2000 hosts in each of the 37 segments required. Also describe how a limited AND a direct broadcast can be executed from segment 2 to segment 3.
Solution : First of all there are 2 basic ways to approach. You can first cater for 2000 hosts, then for the 37 segments, or vice versa. You may get a different answer from the above 2 ways but they are still correct. Try it, you may email me for the solution, or check with your lecturer/tutor. Practice makes perfect!
For the second part of the question, a limited broadcast (Adv Networking students) always has an IP Address 255.255.255.255. The router sees this address as an invalid address and will not forward/send the datagram out of the segment, hence you will be doing a broadcast within the subnet itself. A direct broadcast gets more interesting.
For 37 subnets, we will need 6 bits. Hence,
Subnet 2 : 220.127.116.11 (00010100.00001000.0.0)