Host Address Range in IP Subnetting

Host Address Range in IP Subnetting

I have this IP address: 10.65.211.46 subnet mask 255.255.254.0

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
jskfanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Paul MacDonaldDirector, Information SystemsCommented:
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.
Kent WSr. Network / Systems AdminCommented:
IP Address:      10.65.211.46
Network Address:      10.65.210.0
Usable Host IP Range:      10.65.210.1 - 10.65.211.254
Broadcast Address:      10.65.211.255
Total Number of Hosts:      512
Number of Usable Hosts:      510
Subnet Mask:      255.255.254.0
Wildcard Mask:      0.0.1.255
Binary Subnet Mask:      11111111.11111111.11111110.00000000
IP Class:      B
CIDR Notation:      /23
IP Type:      Private
 
Short:      10.65.211.46 /23
Binary ID:      00001010010000011101001100101110
Integer ID:      172086062
Hex ID:      0xa41d32e
in-addr.arpa:      46.211.65.10.in-addr.arpa
IPv4 Mapped Address:      ::ffff:0a41.d32e
6to4 Prefix:      2002:0a41.d32e::/48
nociSoftware EngineerCommented:
tool of the trade for this ipcalc.
$ ipcalc 10.65.211.46/255.255.254.0
Address:   10.65.211.46         00001010.01000001.1101001 1.00101110
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
Broadcast: 10.65.211.255        00001010.01000001.1101001 1.11111111
Hosts/Net: 510                   Class A, Private Internet

Open in new window

SolarWinds® IP Control Bundle (IPCB)

Combines SolarWinds IP Address Manager and User Device Tracker to help detect IP conflicts, quickly identify affected systems, and help your team take near instantaneous action. Help improve visibility and enhance reliability with SolarWinds IP Control Bundle.

atlas_shudderedSr. Network EngineerCommented:
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.
masnrockCommented:
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.
jskfanAuthor 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
masnrockCommented:
In that case, see noci's answer.
Paul MacDonaldDirector, Information SystemsCommented:
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)
jskfanAuthor 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 :

We have an IP address: 10.65.211.46 subnet mask 255.255.254.0
What would be the the first host and last host in the range and give step by step how you get to the result.
Paul MacDonaldDirector, Information SystemsCommented:
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.
masnrockCommented:
As I've mentioned before, noci posted the exact answer you were looking for:
https://www.experts-exchange.com/questions/29128476/Host-Address-Range-in-IP-Subnetting.html#a42749652
jskfanAuthor 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
Paul MacDonaldDirector, Information SystemsCommented:
"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.
masnrockCommented:
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).

Address:   10.65.211.46      00001010.01000001.1101001 1.00101110
Netmask:   255.255.254.0  11111111.11111111.1111111 0.00000000
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)

Last address:   10.65.211.255       00001010.01000001.1101001 1.11111111

The last host address is the last address - 1. In this case, it will be 10.65.211.254
jskfanAuthor 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.
jskfanAuthor 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 ?
masnrockCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Thank you Guys
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.