# Host Address Range in IP Subnetting

on
Host Address Range in IP Subnetting

how can I calculate The host address range to come up with first host:10.65.210.1  and the last host: 10.65.211.254

Thank you
Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Director, Information Systems

Commented:
With a subnet mask of 255.255.254.0, the last two octets in binary are 11111110.00000000.  The zeros are the host IP range.

As there are 9 "host" bits, and 2^9 = 512, there are 512 possible host addresses.  You can't use the first address (all zeros), and you can't use the last address (all ones), so that leaves you with 510 possible host IPs using that subnet mask.

I'm not sure this answers your question, but it may be a start.

Commented:
Usable Host IP Range:      10.65.210.1 - 10.65.211.254
Total Number of Hosts:      512
Number of Usable Hosts:      510
IP Class:      B
CIDR Notation:      /23
IP Type:      Private

Short:      10.65.211.46 /23
Binary ID:      00001010010000011101001100101110
Integer ID:      172086062
Hex ID:      0xa41d32e
6to4 Prefix:      2002:0a41.d32e::/48
Software Engineer
Distinguished Expert 2018

Commented:
tool of the trade for this ipcalc.
``````\$ ipcalc 10.65.211.46/255.255.254.0
Netmask:   255.255.254.0 = 23   11111111.11111111.1111111 0.00000000
Wildcard:  0.0.1.255            00000000.00000000.0000000 1.11111111
=>
Network:   10.65.210.0/23       00001010.01000001.1101001 0.00000000
HostMin:   10.65.210.1          00001010.01000001.1101001 0.00000001
HostMax:   10.65.211.254        00001010.01000001.1101001 1.11111110
Hosts/Net: 510                   Class A, Private Internet
``````
Sr. Network Engineer

Commented:
All the above is good info however, since you are using a /23 mask (255.255.254.0), you are subnetting on every second net (e.g. 0-1, 2-3, 4-5, ...etc).  Each range will begin on the even, end on the next odd of the third octet (.211 of 10.65.211.46).  The third octect is odd, thus the top end of the range, so your range is?  .210.0 - .211.255.  First IP of any network is HA!, the network address (210.0) and unusable.  The last IP (.211.255) is the broadcast and unusable.  All other IP's are usable so first usable IP?  That's right, 210.1.  Last usable, 211.254.
Distinguished Expert 2018

Commented:
You've already given the host address range. And as you may recall, the first and last addresses in the subnet's IP address range aren't hosts.

Commented:
I know first and last host are known.. you can just use Subnet calculator online and it will give you that... I am trying to understand how to find the first and last host without using a subnet calculator

any clear step by step will be very much appreciated
Thanks
Distinguished Expert 2018

Commented:
In that case, see noci's answer.
Director, Information Systems

Commented:
010.065.210.000         00001010.01000001.11010010.00000000
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000000.00000000 = 0 (this is the network address and not assigned to a host)

010.065.210.001         00001010.01000001.11010010.00000001
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000000.00000001 = 1

010.065.211.047         00001010.01000001.11010011.00101111
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000001.00101111 = 303

010.065.211.079         00001010.01000001.11010011.01001111
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000001.01001111 = 335

010.065.211.250         00001010.01000001.11010011.11111010
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000001.00101111 = 506

010.065.211.255         00001010.01000001.11010011.11111111
255.255.254.000         11111111.11111111.11111110.00000000
Host number         00000000.00000000.00000001.11111111 = 511 (this is the broadcast address and not assigned to a host)

Commented:
Probably I put the answer as a question...this is why I did not get the answer I am looking for.

Let's say the Question states :

What would be the the first host and last host in the range and give step by step how you get to the result.
Director, Information Systems

Commented:
If you look at my post immediately above yours, you can see how the computer does this calculation, from the first address, several middle values, to the last address. The first valid host number is 1, the last valid host number is 510.  The respective IP addresses are 10.065.210.1 and 10.065.211.254.
Distinguished Expert 2018

Commented:
As I've mentioned before, noci posted the exact answer you were looking for:

Commented:
If I remember the trick : 10.65..211.46   255.255.254.0

you take 256-254 =2
then you go fro 0,2,4..............210,212,.................
so  10.65.211.46 , the third octet (211)will fit between 210 and 212
from that step forward, I forgot how the trick works to find the host range
Director, Information Systems

Commented:
"If I remember the trick : 10.65..211.46   255.255.254.0
you take 256-254 =2
then you go fro 0,2,4..............210,212,.................
so  10.65.211.46 , the third octet (211)will fit between 210 and 212
from that step forward, I forgot how the trick works to find the host range
"

• Knowing the subnet mask is 255.255.254.0 means you have 9 bits for host numbers (the zeros in the subnet mask).
• 2^9 = 512.
• Since you can't use the first and last host numbers, 512-2 = 510 available host numbers.
Distinguished Expert 2018

Commented:
To calculate the number of hosts in a subnet:
1) Subtract the number of bits in the subnet mask from 32. Since the subnet mask is 23 bits, 32 - 23 = 9.
2) 2 to the X power (figured out in last step) will tell you number of total number addresses in the subnet (including unusable ones): 2^9 = 512
3) Number of hosts = number of addresses - 2. 512 - 2 = 510

For host range (this borrows very heavily from noci's response I was describing answered what you've been asking)....
1) Figure out the network ID. (Use bitwise AND) This is the first address (note that it is NOT usable).

Network:   10.65.210.0       00001010.01000001.1101001 0.00000000

The first host address is the network ID + 1. So in this case, it will be 10.65.210.1

2) To figure out the last address (also not usable)  in the network, take the network ID and change all of the bits outside of the subnet mask to 1s. (Remember the step 1 from calculating number of hosts)

The last host address is the last address - 1. In this case, it will be 10.65.211.254

Commented:
the method I described above, we'll help you determine the IP of the first host and the last host in the range.
I forgot  after you  increment by 2 till you find where 211 sits, in our case   between subnet 210 and 212
from there on... I  cannot remember the rest  in order to determine  the IP of the first host and the last host in the range.

Commented:
I believe  it is this way.
Since the calculation is based on the 3rd octet of the subnet 255.255.254.0
you do substract 254 from 256 , 256 -254=2

you increment by 2,   0,2,4,6,8,10......................................210,212,214.........................
Since 211 sits between 210 and 212  and the number of hosts you can get from 2^9-2=510  then
the first host will be  10.65.210.1  and the last will be 10.65.211.254

Though still not sure how to explain 210 hosts........since on 210.1 to 210.254 will be 254 hosts and on 211.1 to 211.254 will be another 254 hosts , you would think it makes 508 Hosts...
Am I missing something there ?
Distinguished Expert 2018
Commented:
Though still not sure how to explain 210 hosts........since on 210.1 to 210.254 will be 254 hosts and on 211.1 to 211.254 will be another 254 hosts , you would think it makes 508 Hosts...
Am I missing something there ?
Yes you are. You're also looking at it incorrectly. The 512 addresses include everything in 210.x AND 211.x. You only eliminate the first (210.0) and last (211.255) from the entire range. So yes, 210.255 and 211.0 are valid addresses in this particular case.

you do substract 254 from 256 , 256 -254=2
This applies if the subnet mask is 255.255.255.0. Remember in this case, your subnet mask is 255.255.254.0 ... that one bit difference doubles the number of addresses per subnet.

Commented:
Thank you Guys

Do more with