Networking - Subnetting - Discussion
Discussion Forum : Subnetting - Subnetting (Q.No. 1)
1.
Your router has the following IP address on Ethernet0: 172.16.2.1/23. Which of the following can be valid host IDs on the LAN interface attached to the router?
- 172.16.1.100
- 172.16.1.198
- 172.16.2.255
- 172.16.3.0
Answer: Option
Explanation:
The router's IP address on the E0 interface is 172.16.2.1/23, which is 255.255.254.0. This makes the third octet a block size of 2. The router's interface is in the 2.0 subnet, and the broadcast address is 3.255 because the next subnet is 4.0. The valid host range is 2.1 through 3.254. The router is using the first valid host address in the range.
Discussion:
34 comments Page 1 of 4.
Waseem said:
5 years ago
(Q).Given ip 172.16.2.1/23
(A). by default the given IP is class B(N.N.H.H), slash notation for Class B is /16 but from given it is /23, so the converted network bits are 7 (23-16).
formula for subnets is 2^n (note:- it indicates how many parts we need to divide a N/w)
Here n represents no. of converted N/w bits
n=7
from formula 2^7=128
Formula for Hosts is 2^h-2 (note:- it indicates how many IP's consists in a N/w)
Here h represents no. of host bits
-2 represents (one is N/W IP and another one is Broadcast IP, we can't use
these 2 IP's these are default)
h=32-23
=9
from formula 2^h
2^9=512
The given IP is defaultly class B(N.N.H.H) we should vary Host bits only,N/W bits are constant in every N/W.
So the range starts from 172.16.0.0.
As we got hosts from hosts formula we should divide our N/W with 512 hosts
so the range is as bellow
(1st subnet). 172.16.0.0 to 172.16.1.255
(2nd subnet). 172.16.2.0 to 172.16.3.255
(3rd subnet). 172.16.4.0 to 172.16.5.255
From given
The given ip 172.16.2.1 belongs to 2nd subnet range, we should neglect 1st and last IP's in this range those are 172.16.2.0 and 172.16.3.255(N/W ID and Broad cast ID).
Finally the valid IP's are 172.16.2.1 to 172.16.3.254
From given option's only option C belongs to above range.. So answer is 'C'.
(A). by default the given IP is class B(N.N.H.H), slash notation for Class B is /16 but from given it is /23, so the converted network bits are 7 (23-16).
formula for subnets is 2^n (note:- it indicates how many parts we need to divide a N/w)
Here n represents no. of converted N/w bits
n=7
from formula 2^7=128
Formula for Hosts is 2^h-2 (note:- it indicates how many IP's consists in a N/w)
Here h represents no. of host bits
-2 represents (one is N/W IP and another one is Broadcast IP, we can't use
these 2 IP's these are default)
h=32-23
=9
from formula 2^h
2^9=512
The given IP is defaultly class B(N.N.H.H) we should vary Host bits only,N/W bits are constant in every N/W.
So the range starts from 172.16.0.0.
As we got hosts from hosts formula we should divide our N/W with 512 hosts
so the range is as bellow
(1st subnet). 172.16.0.0 to 172.16.1.255
(2nd subnet). 172.16.2.0 to 172.16.3.255
(3rd subnet). 172.16.4.0 to 172.16.5.255
From given
The given ip 172.16.2.1 belongs to 2nd subnet range, we should neglect 1st and last IP's in this range those are 172.16.2.0 and 172.16.3.255(N/W ID and Broad cast ID).
Finally the valid IP's are 172.16.2.1 to 172.16.3.254
From given option's only option C belongs to above range.. So answer is 'C'.
(7)
Chandni said:
5 years ago
Thanks for sharing this Subnetting problem, I was looking for idea for solving these kind of problems. Finally I got it.
Anish said:
7 years ago
23 is a prefix length. So IPV4 has 32 bit of address.
32 - 23 = 9. Now IP address of ethernet 0 is 172.62.2.1/23.
If we want to find out first address than we have to set 9 (32 - 23 = 9) rightmost bit as zero.
10101100.00111110.00000010.00000000 = 172.62.2.1.
So, the first address is 172.62.2.1.
last address -> put 9 rightmost bit as 1.
10101100.00111110.00000011.11111111 = 172.62.3.255.
So the range = 172.62.2.1 to 172.62.3.255.
32 - 23 = 9. Now IP address of ethernet 0 is 172.62.2.1/23.
If we want to find out first address than we have to set 9 (32 - 23 = 9) rightmost bit as zero.
10101100.00111110.00000010.00000000 = 172.62.2.1.
So, the first address is 172.62.2.1.
last address -> put 9 rightmost bit as 1.
10101100.00111110.00000011.11111111 = 172.62.3.255.
So the range = 172.62.2.1 to 172.62.3.255.
Shipukangra@gmail.com said:
7 years ago
How can be 172.168.3.0 is a host id? It is a network id.
Shahnas said:
6 years ago
What means of /23?
Can we take it as subnet mask? and why we want to calculate 32-23=9?
Guys! can you tell me the in IP address and subnet mask of this?
Can we take it as subnet mask? and why we want to calculate 32-23=9?
Guys! can you tell me the in IP address and subnet mask of this?
Datta Ikhe said:
6 years ago
Answer C is correct because;
Given IP- 172.16.2.1/23.
First IP used as Network Id: 172.16.00000010.00000000(172.16.2.0).
First Valid Host IP: 172.16.00000011.00000000(172.16.3.0).
Broadcast IP: 172.16.3.255 & NOT 172.16.2.255.
So, 172.16.2.255 is a valid Host IP.
Given IP- 172.16.2.1/23.
First IP used as Network Id: 172.16.00000010.00000000(172.16.2.0).
First Valid Host IP: 172.16.00000011.00000000(172.16.3.0).
Broadcast IP: 172.16.3.255 & NOT 172.16.2.255.
So, 172.16.2.255 is a valid Host IP.
Sundha said:
6 years ago
How it is. Can you explain me clearly?
Kapil said:
6 years ago
Can any one help me to understand subnetting?
Ansar said:
6 years ago
According to me, the answer will be 172.16.2.255.
Basir said:
6 years ago
I'm not getting this. Please anyone help it to me.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers