Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

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
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

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.
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
Avatar of noci
noci

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

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.
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.
Avatar of jskfan

ASKER

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
In that case, see noci's answer.
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)
Avatar of jskfan

ASKER

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.
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.
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
Avatar of jskfan

ASKER

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
"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.
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
Avatar of jskfan

ASKER

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.
Avatar of jskfan

ASKER

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 ?
ASKER CERTIFIED SOLUTION
Avatar of masnrock
masnrock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Thank you Guys