Computer Networking Math 100 Questions with Solutions
Solution:
Here, n = CIDR = 27
Network bit = 27
Host bit = 32 - n
= 32 - 27
= 5
So, Subnet Mask =
11111111.11111111.11111111.11100000
= 255.255.255.224
And, Complement Subnet
Mask
=
00000000.00000000.00000000.00011111
= 0.0.0.31
2. Find Network address
/ IP address / First address of the Network or Network subnet ID from above IP
address
Rule 1: ANDing given IP address with subnet mask
(as bits are changed in the 4th octet, we only consider 4th octet here)
4th octet of given IP
address (in binary) = 01110100
4th octet of subnet mask
(in binary) = 11100000 ANDing we get = 01100000 = 96 So, Network
Address = 175.231.232.96
Rule 2: Making host bits into zero of the given IP
address
Here, host bit exists =
32 - 27 = 5
and, given IP address's
4th octet = 116 = 01110100
converting host bits
into zero we get = 01100000 = 96
So, Network Address
= 175.231.232.96
3. Finding Broadcast
Address
Rule 1: ORing given IP address with Complement
Subnet mask (as bits are changed in the 4th octet, we only consider 4th octet
here)
4th octet of given IP
address (in binary) = 01110100
4th octet of Complement
subnet mask (in binary) = 00011111 ORing we get = 01111111 = 127 So,
Broadcast Address = 175.231.232.96
Rule 2: Making host bits into '1' of the Above
Network address
Here, 4th octet of
Network address = 01100000
So, host bit exists = 32
- 27 = 5
converting host bits
into '1' we get = 01111111 = 127
So, Broadcast Address
= 175.231.232.127
4. Find Fist address and
and Last address
Here, Network address =
175.231.232.96
So, First Valid host =
175.231.232.97
And, here Broadcast
address = 175.231.232.127
Last Valid host =
175.231.232.126
5. An organization has
an IP address 192.168.1.0/24, It should divide this address such that -
HQ LAN1 has 50 hosts
HQ LAN2 has 50 hosts
Sales LAN1 has 30 hosts
Sales LAN2 has 30 hosts
IT LAN1 has 12 hosts
IT LAN2 has 8 hosts
Now calculate subnetting
and find the network address, subnet mask, valid IP range, Broadcast address
using VLSM
Host |
Network address |
Host Range |
Broadcast address |
Subnet
mask |
50 |
192.168.1.0 |
Bit needed for 50 hosts are = 6 (as 26= 64 and 0 + 64 = 64), So Host Range will be 192.168.1.1 to 192.168.1.62 |
192.168.1.63 |
Here, host bit = 6, So, making host bits Into zero we get Subnet mask = 255.255.255.192 Another way, here Network bits = 32 - 6 = 26, So, CIDR = /26 and we say Full form = 192.168.1.0/26 |
50 |
192.168.1.64 |
192.168.1.65 to 192.168.1.126 |
192.168.1.127 |
255.255.255.192 |
30 |
192.168.1.128 |
192.168.1.129 to 192.168.1.158 |
192.168.1.159 |
255.255.255.224 |
30 |
192.168.1.160 |
192.168.1.161 to 192.168.1.190 |
192.168.1.191 |
255.255.255.224 |
12 |
192.168.1.192 |
192.168.1.193 to 192.168.1.206 |
192.168.1.207 |
255.255.255.240 |
8 |
192.168.1.208 |
192.168.1.209 to 192.168.1.222 |
192.168.1.223 |
255.255.255.240 |
6. An IP address 192.168.10.0/23, Find –
Subnet
Mask
Unique
ID (host) number
Broadcast
ID
Last
usable host address
Solution:
Here, CIDR = 23
11111111.11111111.11111110.00000000
=255.255.254.0
So, Subnet Mask = 255.255.254.0 (Ans - 1)
From CIDR we get host bit =
32 – 23 = 9
So, Total Host = 29=512
So, Unique or Usable Host =
512 – 2 = 510 (Ans
- 2)
(Because first host address is Network
address and last host address is Broadcast address, these 2 host address is not
used)
Now, to find Broadcast
address we have to find Network address at First. We see that there is a change in 3rd
and 4th octet of subnet mask.
So, we have to work with 3rd
and 4th octet of the IP address.
3rd and 4th
octet of Given IP = 10.0 = 00001010.00000000
3rd and 4th
octet of subnet mask = 254.0 = 11111110.00000000
Now, To Find Network address –
ANDing the IP
address with subnet mask we get
Network address’s 3rd
and 4th octet = 00001010.00000000
= 10.0
So, Network address = 192.168.10.0
(By chance, here Given IP address and
Network address is same, it happens for CIDR 23, if CIDR changed, it will not remain
same)
Now, From CIDR we know, here
host bit = 32 – 23 = 9
So, to get Broadcast address,
we will make last 9 bits of Network address into 1 (here in 3rd and
4th octet)
So, 3rd and 4th
octet of Broadcast address will be
= 00001011.11111111
= 11.255
So, Broadcast address =
192.168.11.255 (Ans
- 3)
So, from the above discussion
we get-
Network address = 192.168.10.0
So, First usable host address
= 192.168.10.1
We also get above, Broadcast
address = 192.168.11.255
So, Last usable host address
= 192.168.11.254 (Ans - 4)
7. From this IP address 192.168.10.2/28, Answer the following questions consider IPV4 address -
Subnet Mask
Network address
Broadcast address
First Network address
Last Network Address
Solution:
Subnet Mask
=
11111111.11111111.11111111.11110000
=255.255.255.240 (Ans – 1)
We get change in 4th
octet of subnet mask
4th octet of IP =
0 = 00000010
4th octet of
subnet mask = 11110000
ANDing 4th octet
of IP with subnet mask
we get 00000000 = 0,
So, Network address =
192.168.10.0 (Ans
– 2)
Here, CIDR = 28
So, making last (32 – 28) = 4
bits into 1 of network address
We get 00001111 = 15
So, broadcast address = 192.168.10.15
(Ans – 3)
First address is the next immediate
address of Network address
So, First address = 192.168.10.1
(Ans – 4)
Last address is the prior immediate
address of Broadcast address
So, Last address =
192.168.10.14 (Ans
– 5)
8. In the following IP address 172.20.0.0/27, find how many subnets and hosts per subnet?
Solution:
Here, given IP address = 172.20.0.0
=172.20.0.00000000
Subnet Mask =
11111111.11111111.11111111.11100000
=255.255.255.224
(Technique: 11100000 = (23 – 1)*25
= 7*32 = 224)
From 4th octet of
subnet mask we get Network bit = 3 and host bit = 5
So, Number of subnet = 23
= 8 (Ans -1)
And hosts per subnet = 25
= 32
And, valid host per subnet =
32-2 = 30 (Ans -2)
Extra: (If ask to find Network, Broadcast address)
ANDing Given IP address with
subnet mask we get
Network address = 172.20.0.0
Converting last (32-27)=5
bits of Network address into 1 we get
Broadcast address = 172.20.0.00011111
= 172.20.0.31
Extra: if ask how many connections is possible in this
network?
Ans: The
valid number of hosts is the answer; here in this math we can say it is 30
9. Find subnet of 172.16.2.1/22
which will be applicable for your office room having 50 and 23 PCs. Also find
the first and last usable IP addresses along with broadcast address
Solution:
Subnet mask
= 11111111.11111111.11111100.00000000
Given IP address
=172.16.00000010.00000001
So, Network address (By ANDing)
= 172.16.00000000.00000000
= 172.16.0.0
For 50 PCs
We need minimum 6 bits for
hosts (as 2^5=32 but 2^6=64)
So, Network address
= 172.16.0.0
First valid host address
= 172.16.0.1
Last valid host address
= 172.16.0.62
Broadcast address
= 172.16.0.63
For 23 PCs
We need minimum 5 bits for
hosts (as 2^4=16 but 2^5=32)
So, Network address
= 172.16.0.64
(the next address of previous
50 PCs broadcast address)
First valid host address
= 172.16.0.65
Last valid host address
= 172.16.0.94
Broadcast address
= 172.16.0.95
10. A network address is given 172.18.10.0/23, divide this network address into 4 subnets and find every subnet address, start address, subnet mask, broadcast address etc.
Solution:
As we should divide the given
network address into 4 subnets, we have to find a fixed CIDR for this
operation.
Here, total hosts = 2^(32-23)
= 2^9 = 512
Now, 512/4 = 128
We can write 2^7 = 128
We see, every subnet block
will have 128 hosts.
So, our network bit will be
(32-7) = 25
So, our new CIDR or subnet
prefix = /25
1st Subnet:
Subnet address =
172.18.10.0/25
Start address = 172.18.10.1
Subnet mask = 255.255.255.128
(as new CIDR = \25, and 2^7 = 128)
Broadcast address = 172.18.10.127
2nd Subnet:
Subnet address =
172.18.10.128/25
Start address = 172.18.10.129
Subnet mask = 255.255.255.128
(as new CIDR = \25, and 2^7 = 128)
Broadcast address = 172.18.10.255
3rd Subnet:
Subnet address = 172.18.11.0/25
(as 4th octet is filled up in previous subnet block, so 3rd
octet is changed)
Start address = 172.18.11.1
Subnet mask = 255.255.255.128
(as new CIDR = \25, and 2^7 = 128)
Broadcast address = 172.18.11.127
4th Subnet:
Subnet address =
172.18.11.128/25
Start address = 172.18.11.129
Subnet mask = 255.255.255.128
(as new CIDR = \25, and 2^7 = 128)
Broadcast address = 172.18.11.255
11. Given IP address 211.17.180.0/24, Administrator wants to divide it into 32 subnets, so what will be the subnet mask and how many hosts belongs to every subnet, what is the first and last address of 1st and last subnet address?
Solution:
As we should divide the given
network address into 32 subnets, we have to find a fixed CIDR for this
operation.
Here, total hosts = 2^(32-24)
= 2^8 = 256
Now, 256/32 = 8
We can write 2^3 = 8
We see, every subnet block
will have 8 hosts.
So, our network bit will be
(32-3) = 29
So, our new CIDR or subnet
prefix = /29
So, subnet mask
255.255.255.11111000
=255.255.255.248 (Ans -1)
1st subnet:
Host number per subnet = 2^3 –
2 = 6 (Ans -2)
First address = 211.17.180.1
(Ans -3)
Last address = 211.17.180.6 (Ans -4)
Last subnet:
Host number per subnet = 2^3 –
2 = 6 (Ans -5)
First address = 211.17.249 (Ans -6)
Last address = 211.17.180.254
(Ans -7)
(As total host is 256,
x.x.x.255 is reserved for broadcast in this case)
In a subnet mask, network bits are written at first, then host bits are written.
As the given network address is Class B network address, it has 16 bit network address and 16 bit host address. So, for 512 subnets, I have to borrow 9 bits (as 2^9 = 512) from the 3rd and 4th octet.
And the rest bits will remain 0 for host addresses.
(As 100 hosts is greater than 2^6 = 64 and lower than 2^7 = 128, the rest all bits need to be 0)
So, subnet mask = 255.255.255.10000000
= 255.255.255.128 (Ans)
13. What subnet mask would you use for the 172.16.0.0 network, such that you can get 230 subnets and 170 hosts per subnet?
Solution:
172.16.0.0 is a Class B IP address where in 16 bit network ID & 16 bit host ID.
For 230 sub-networks you need to borrow 8 bits from 3rd octet in other words entire 3rd octet because 2^8 =256, you can accommodate 230 in 256.
Since you are leaving last octet as host ID, you get (2^8)-2 = 254 host IP addresses. First number is Network address & last number is Broadcast address in any subnet which can’t be assigned to any host so we do -2.
When you do subnetting , you don’t get the exact number of subnetworks & hosts that you wanted. you have to go for next higher available number. you asked for 230 subnetworks but you got 256 subnetworks. you asked for 170 hosts per subnet but you got 254 hosts per subnet.
So, Use the subnet mask 255.255.255.0 (Ans)
14. You have been asked to create a subnet mask for the 172.16.0.0 network. Your organization requires 900 subnets, with at least 50 hosts per subnet. What subnet mask should you use?
Solution:
Given network address is Class B, so 16 bit network address and 16 bit host address.
900 subnets need minimum 10 bits for 3rd and 4th octet. The rest 6 bits (4th octet) is enough for 50 hosts.
So, subnet mask = 255.255.11111111.11000000
= 255.255.255.192 (Ans.)
15. You are designing a subnet mask for the 172.25.0.0 network. You want 2200 subnets with up to 8 hosts on each subnet. What subnet mask should you use?
Solution:
2200 subnets need minimum 12 bits in 3rd + 4th octet. The rest 4 bit is enough for 8 hosts.
So, Subnet mask = 255.255.255.11110000
= 255.255.255.240 (Ans)
The benefits of using sub-netting are :
- Reduction in the overall network traffic which increases the network performance.
- Easy to manage and troubleshoot small network.
- Increased control on address space in a network.