2,070 views
0 votes
0 votes

Consider the following IP address and subnet mask.
IP Address : 201.59.60.138
Subnet Mask : 255.255.255.240
What is the IP address for last host of subnet to which given IP belongs?

Given Answer : 201.59.60.142

My solution :

1 0 0 0 1 0 1 0  AND
1 1 1 1 0 0 0 0      <---- SUBNET MASK last octact

1 0 0 0 0 0 0 0 <--- Network ID of given IP  

last system wil have IP address 201.59.60.255
.255 cannot be used

So , 201.59.60.254

What is the mistake with my approach ?
 

2 Answers

Best answer
12 votes
12 votes

1 0 0 0 1 0 1 0  
1 1 1 1 0 0 0 0      <---- SUBNET MASK last octact

1 0 0 0 0 0 0 0 <--- Network ID of given IP (Red--Subnet bits,Blue Host bits)

In Subnet mask you have four 1's ,it means 4 bit have been borrowed from host.

So total no of subnet possible is 2^4-2

And Total Host Possible is 2^4-2---> given that it's a Class C IP Address.

In the Network Id Don't change the Subnet part because it doesn't belong to host.

So finally the Last host of the Subnet will be 10001110==142

We can't put all 1's to the Host bits because it belongs to the broadcast address.

Finally 201.69.60.142 is the last host of the Subnet.

As in the question it was not mentioned Last Host of the last subnet,you can't put all 1's to the Subnet part.

selected by
0 votes
0 votes
Lets dive into the basics.
given ip is 201.59.60.138.

255.255.255.240 . subnet mask

first you should find the subnet id for the above ip address so that you can get to the last ip address of that subnet correct?

approach is simple.

subnetId=ipAddress(BIT WISE AND) Subnetmask.

after permforming bit wise AND you would find out that the ip address  201.59.60.138 belongs to 201.59.60.128  subnet Id

Here (128) is the subnet to which your asked Ip address belongs.
now we come to 2nd step. Now you should have some idea about host configuration it goes like 2^n - 2 where n is the number of host bits. just plug that you would find out that you can have 14 host in a subnet. Now  128+14 = 142 here we are.

201.59.60.142 is the last ip address for subnet Id 201.59.60.128

Related questions

0 votes
0 votes
2 answers
2
0 votes
0 votes
1 answer
3
abhinowKatore asked Jun 2, 2022
522 views
For a class C network if IP address of a computer is 200.99.39.112 and subnet mask is 255.255.255.224 the decimal value of last octet of last host of sixth subnet is ____...
0 votes
0 votes
5 answers
4
Venkata Krishna Redd asked Apr 7, 2015
5,075 views
1. 10.100.100.100 & 10.100.100.1002. 10.100.100.100 & 255.255.255.2553. 10.100.100.100 & 127.1.100.14. 127.100.100.100 & 10.100.100.100