# How did they get the answer for what is the last valid ip address?

Member Posts: 1,118
Ok, working again with subnettingquestions.com and also using the subnetting calculator from this website and I'm not sure how they are getting this answer of:

Valid Host Range: 172.31.216.1 - 172.31.223.254

What is the last valid host on the subnetwork

Convert both to binary:

10101100.00011111.11011000.00000000
11111111.11111111.11111000.00000000

I understand how to get the network address, for the IP Address on the third octet, add together 128+64+16+8 to get the network address: 172.31.216.0

As for getting the broadcast address, I'm not sure, and I think I'm in the dark:

EDIT: Ok, I worked backwards into 172.31.223.225. I did this to get the broadcast address: Add the third octet 216+4+2+1 = 223.
AND, for the fourth octet, it has to be 255, since it is broadcast.

Thus an IP address of 172.31.223.255.

I think I'm on the right path here, if anyone can offer any suggestions, I'm all ears.

thanks
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown

• Member Posts: 556
172.31.x.x = Class B address and a /21 is 255.255.248.0, which means an increment of 8

So, you here are your ranges
• ......
• 172.31.200.0 - 172.31.207.255
• 172.31.208.0 - 172.31.215.255
• 172.31.216.0 - 172.31.223.255
• 172.31.224.0 - 172.31.231.255
172.31.223.255 is the broadcast address of the 172.31.216.0/21 subnet, so the last usable ip in the range is 172.31.223.254
• Member Posts: 1,118
pham0329 wrote: »
172.31.x.x = Class B address and a /21 is 255.255.248.0, which means an increment of 8

So, you here are your ranges
• ......
• 172.31.200.0 - 172.31.207.255
• 172.31.208.0 - 172.31.215.255
• 172.31.216.0 - 172.31.223.255
• 172.31.224.0 - 172.31.231.255
172.31.223.255 is the broadcast address of the 172.31.216.0/21 subnet, so the last usable ip in the range is 172.31.223.254

I'm not sure why your using a range. I'm using Chris Bryant's method to get subnetting, and he never talks about or uses a range.

thanks
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
• Member Posts: 556
err, I'm not sure what Chirs Bryant's method is, but can't be all binaries, can it? Does he not talk about increments/block size, and network range? If you're only doing binaries, you may be hard press for time when taking the exam.
• Banned Posts: 703
Chris Bryant's method looks slow if that's it?

if you have 172.31.216.0/21

256 - 248 = 8 our block size is 8 which is how wide our subnet is since our hosts per subnet is 2^11 = 2048 and our subnet
I mean you cant fit 2046 hosts into a subnet without a range like pham said. The "range" is one subnet

so the subnet
• 172.31.216.0 - 172.31.223.255 < -- one subnet last usable is 223.254 the quickest way to have figured that out would be just increment by 8 as suggested so 172.31.216.0 + 8 (which is the next subnet) = 172.31.224.0 we minus 1 to get the broadcast 223.255 and -1 to get the last valid host 254 -- doing it all in binary seems like a pain in the butt
• Member Posts: 262
I'm with drkat

**** the Chris Bryant method. It's useful to do Binary to understand what is really happening but there is much quicker math noted noted above.

To basically repeat what was already posted.

/21 = 255.255.248.0
I get it mainly by memory now but to get the math
Each octet is 8 so take 21 minus 16 you get 5 and you have 255.255
to get the interesting octet number add each of the following numbers from left to right for the number you have left which is 5
Start at 128 and half it until you get to one. If you add them all up you get 255 128+64+32+16+8+4+2+1=255

128+64+32+16+8 = 248

So now we have 255.255.248.0 which is the subnet mask

All you have to do now is take 256 and subtract 248 = 8
(256 is a non changing number. You always subtract the interesting octet from 256 to get you network range number.)

Now in this case we were given the network ID so we could skip this step but for practice I'd do it. Also it's required if you are given an IP address in the range and a mask.

Take the interesting octet of the ip address 216 and divide by the network range number 8 = 27 now if this was not a whole number just **** the fractional part as it's unimportant. In cases where the number is fractional you'd then multiply the network range number by the whole number in this case 27 = 216 (See how it's not terribly important unless its a rational number) What this gives you on any ip address in a range is the network ID. so you have 172.31.216.0 255.255.248.0 because the network range is 8 start counting 216,(1) 217,(2) 218,(3) 219,(4) 220,(5) 221,(6) 222,(7) 223,( Don't forget the 216 counts as 1. the highest number is 223 and the last octet is 0-255 so you have

172.31.216.0 to 172.31.223.255
We know the very last IP is always broadcast so the last usable IP is 172.31.223.254

I know I basically repeated what was already said but when I was learning I just kept searching until someone explained it the way it made sense to me.

edit: I know this seems like a lot to do but if you do enough practice you memorize a lot and then can skip steps.

HTH

D
• Member Posts: 21 ■□□□□□□□□□
Guys, sorry for jumping in here but just wanted to get something clarified...

@ Tha_dub , To find the network id, what i usually do is perform an AND operation between the ip address and the subnet mask but I have been looking for an alternate solution to finding the network id because i want to do it in my head rather than a scientific calculator/binary conversion.. which is why I found your post interesting but dint quite get it..

In this case, like you said, the network id is provided but if its not, the interesting octet is divided by the block size and then you lost me .
How do we arrive at the network address from the quotient ( In this case, 27) ?

Thanks
Jake
• Member Posts: 1,118
pham0329 wrote: »
err, I'm not sure what Chirs Bryant's method is, but can't be all binaries, can it? Does he not talk about increments/block size, and network range? If you're only doing binaries, you may be hard press for time when taking the exam.

I will probably have to read thru this thread a few times to have this block method sink in. I'm still confused by it.

Lammel's book uses this and I never could get subnetting down, and also confused by his CCNA book too.

I have Bryant's CCNA home videos and at least I can follow his subnetting examples and sometimes get the answers correct. I'm still missing a few from subnetting.com and will start to post my questions here.
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
• Member Posts: 25 ■□□□□□□□□□
Something here does not make sense to me. Maybe because I am dinosaur.
Where does the assumption that the last IP address in a subnet range has to be the
(This is where I think being dinosaur is showing my age) I remember the days where you had to manually set the broadcast IP address in IP configurations.
Based on the following information mentioned earlier in this thread:
Valid Host Range: 172.31.216.1 - 172.31.223.254

• Member Member Posts: 39 ■■■□□□□□□□
This is how i remember it

.128 .192 .224 .240 .248 .252 .254 .255 mask
-128--64---32---16---8
4
2
1- binary ruler- also block size

so a .248 is incrementing by 8
if you do subnetting enough you will be able to look at a mask or cidr value and know what the block size is
• Member Posts: 556
Something here does not make sense to me. Maybe because I am dinosaur.
Where does the assumption that the last IP address in a subnet range has to be the
(This is where I think being dinosaur is showing my age) I remember the days where you had to manually set the broadcast IP address in IP configurations.
Based on the following information mentioned earlier in this thread:
Valid Host Range: 172.31.216.1 - 172.31.223.254

Wasn't a typo. 172.31.223.255 is the broadcast address. The broadcast address is the last ip in the network range....or the address in which all bits in the host portion is set to 1
• Member Posts: 1,745
JockVSJock wrote: »
Ok, working again with subnettingquestions.com and also using the subnetting calculator from this website and I'm not sure how they are getting this answer of:

Valid Host Range: 172.31.216.1 - 172.31.223.254

What is the last valid host on the subnetwork

Convert both to binary:

10101100.00011111.11011000.00000000
11111111.11111111.11111000.00000000

I understand how to get the network address, for the IP Address on the third octet, add together 128+64+16+8 to get the network address: 172.31.216.0

As for getting the broadcast address, I'm not sure, and I think I'm in the dark:

EDIT: Ok, I worked backwards into 172.31.223.225. I did this to get the broadcast address: Add the third octet 216+4+2+1 = 223.
AND, for the fourth octet, it has to be 255, since it is broadcast.

Thus an IP address of 172.31.223.255.

I think I'm on the right path here, if anyone can offer any suggestions, I'm all ears.

thanks

This started off short, and then it became long-winded.

```What is the last valid host on the subnetwork

Convert both to binary:

10101100.00011111.11011000.00000000 = 172.31.216.0
11111111.11111111.11111000.00000000 = 255.255.248.0  (or /21)

Now, all those 0's at the end of the mask, you can play with those for host bits.
i.e.:

10101100.00011111.11011][000.00000000
11111111.11111111.11111][000.00000000   [NOTE:  The demarcation is based upon the subnet mask]

Now, in this case, we see that all of the last 11 zeroes are host bits.
Note:  32-21 = 11
2^11 = 2048.  If you can count by 2048, then fantastic for you, but look at the real rub here:
There are 3 bits to play with there in the INTERESTING octet, and 2^3 = 8 (block size of [IMG]https://us.v-cdn.net/6030959/uploads/images/smilies/icon_cool.gif[/IMG]

To figure out the BROADCAST address, we turn ALL of those trailing HOST bits into ones.

Example:
10101100.00011111.11011][000.00000000  [see the separation]

172.31.223.254 is the last valid host.

This example might not be sufficient, as the subnet mask bit lines up with your network bits.

======================================================================

Let me try a more STARK example, to help drive the concept home.

What is the last valid host on the subnetwork:
172.31.216.0/30

Convert both to binary:

10101100.00011111.11011000.00000000 = 172.31.216.0
11111111.11111111.11111111.11111100 = 255.255.255.252  (or /30)

Now, let's see where the separation occurs:

10101100.00011111.11011000.000000][00
11111111.11111111.11111111.111111][00

See, this mask gives you only TWO bits to play with  (32-30 = 2)
Note:  2^2 = 4
For reference, 32-21 = 11 (see the earlier example)

Anyway, let's see what we have to work with, in this example:

10101100.00011111.11011000.000000][00 = 172.31.216.0 (network)

So, subtract 1 from the broadcast address, and 172.31.216.2 is the last valid host on the network.

===========================================================================

Ok, just for good measure, one more to look at:

What is the last valid host on the subnetwork:
172.31.216.0/23

Convert both to binary:

10101100.00011111.11011000.00000000 = 172.31.216.0
11111111.11111111.11111110.00000000 = 255.255.254.0  (or /23)

Now, let's see where the separation occurs:

10101100.00011111.1101100][0.00000000
11111111.11111111.1111111][0.00000000

In this example, you get 9 bits to play with (32-23 = 9)
Note:  2^9 = 512 (or, 2 x 256).  This may seem a bit worthless, but consider that really, you're only interested in the THIRD octet here.
which really has only one bit to play wth (if you can count by 512 bit easily, more power to you, but consider this. 2^1 = 2)

Anyway, let's write this out:

subtract one, to get the last valid host:  172.31.217.254 is the last valid host address.

=========================================================================================

Now, what some are telling you is QUICKER is to just count the BLOCK SIZE.

In order to count with the block sizes, you only have to remember a few things:
1.  This sequence:
128 - 192 - 224 - 240 - 248 - 252 - 254 - 255
2.  How to find the interesting octet.

Anyway, let's try this last problem, using BLOCK sizes:

What is the last valid host on the subnetwork:
172.31.216.0/23

Well, the mask for a /23 is 255.255.254.0

256-254 = 2 (I have my block size, which is 2.0)

172.031.216.000
000.000.002.000
172.031.218.000

To get the broadcast address, I subtract one from the next network:
172.031.217.255
To get the last host, I subtract one from the broadcast address:
172.031.217.254

======================================================

Anyway, let's try a NEW problem, using the block sizes:

What is the last valid host on the subnetwork:
172.31.216.0/28

The mask of a /28 is 255.255.255.240 (see below for a tip on counting this out quickly.)

Now, to get the block size:

256 - 240 = 16 (block size)

172.31.216.0 > first network
172.31.216.16 > next network
172.31.216.32 > next network
172.31.216.48 > next network
.... and so on

Anyway, since the next network was .16, then I need to subtract one, to get the broadcast

172.31.216.14 = last host

JUST to double-check on the binary method (not that it's necessary, but just for completeness!)

Convert both to binary:

10101100.00011111.11011000.00000000 = 172.31.216.0

(NOTE:  32-28 = 4, and we have 4 bits to play with.
Notice that 2^4 = 16)

Now, let's see where the separation occurs:

10101100.00011111.11011000.0000][0000
11111111.11111111.11111111.1111][0000

==================================================================

============================

A tip with CIDR notation

/8
/16
/24 are all well known
255.0.0.0
255.255.0.0
255.255.255.0

After that, you have this sequence of numbers to know:
128, 192, 224, 240, 248, 252, 254, 255

Doublecheck, by writing out all of the CIDR's from /8 through /32

So, this means these subnet masks are actually SUPER EASY to figure out.

Then, just subtract the farthest right non-zero octet from 256, and you have your block size.

Once you have your block sizes, you can count up networks.
to get a broadcast, it's one minus from the next network
The usable range is always from the first host to the last host  (everything in-between the network and broadcast).

So, for how I figured out the /28?

Well, the /28 is based on the well-known /24
255.255.255.0 = /24
Now, I know that to get to 28, I have to go 25, 26, 27, 28
Now, I then just recall:  128, 192, 224, 240
Boom, I'm there, I just counted four up, and I have the subnet mask already, which is:
255.255.255.240

Now that I have the mask, block sizes and everything else are easy.

=======================
Note:  the block size will be the 2 power of the number of non-zero bits in the farthest right non-zero octet.
If you're counting up blocks in the third octet, be careful to use X.0, versus a .X (if you were in the fourth octet, for a block size)
=================
```

Hope this helps!

EDIT: 8's versus smiley faces with shades, LOL

Good we have [code] tags.
Currently Working: CCIE R&S
• Member Posts: 142
JockVSJock wrote: »
I will probably have to read thru this thread a few times to have this block method sink in. I'm still confused by it.

Lammel's book uses this and I never could get subnetting down, and also confused by his CCNA book too.

I have Bryant's CCNA home videos and at least I can follow his subnetting examples and sometimes get the answers correct. I'm still missing a few from subnetting.com and will start to post my questions here.

Lammel's book wasn't for the just getting to computers by any means. There was IMO a lot of assumed knowledge there. And I agree the chapter on subnets was more confusing then helpful, however his dvd on the topic, the method works. After seeing it - I could grasp the entire concept.
WGU Progress BSIT:NA | Current Term:1 | Transfered To-Do In Progress Completed
EWB2 BAC1 BBC1 TSV1 WFV1 CLC1 LAE1 LUT1 LAT1 AXV1 TTV1 INC1 INT1 TPV1 SST1 SSC1 GAC1 HHT1 TNV1 QLT1 BOV1 LET1 ORC1 IWC1 IWT1 MGC1 ABV1 AHV1 AJV1 TWA1 CPW2 BRV1
Darril Book
• Member Posts: 25 ■□□□□□□□□□
pham0329 wrote: »
Wasn't a typo. 172.31.223.255 is the broadcast address. The broadcast address is the last ip in the network range....or the address in which all bits in the host portion is set to 1

Just to clarify. Are you saying that the broadcast IP address is 172.31.223.255 and that it was a typo when it was listed as 172.31.223.225 by JockVSJock
• Member Posts: 186

Like someone mentioned once you understand the concept that you are using binary numbers, ditch the Lammle method.
The only thing you require to know here is your increment (block) size, from there you can work out anything else.

The quickest way of working out your increment (block) size is to simply look at the value of the last binary digit that belongs the subnet mask.

e.g. for 172.31.216.0 /21 have a look at the binary value of the 21st bit. It has a value of 8, that is your increment.
Click on the the explanation I've attached and have a look, it's very simple. Apologies for the size, I hope your eye site is good.

• Member Posts: 1,118

Ok, I'm starting to get the hang of block sizes. I'm gonna have to read thru this thread a few more times to really get it.

Thanks to instant000 for the tutorial.
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
• Member Posts: 1,118
Quick question.

How do you use block sizes if you have the following?

/8 = 255.0.0.0
/16 = 255.255.0.0
/24 = 255.255.255.0
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
• CASP, MCSA 2016, MCSA 2012, CCNA, Security+, Network+, Project+, Server+ Member Posts: 364 ■■■■□□□□□□
Jock - Chris Bryant does use ranges - you didn't watch the ICND1 videos far enough. He gives SPECIFIC examples on how to find the valid host ranges, broadcasts and networks, and usable subnets with and without "ip subnet-zero".You need to go back and revisit the video's, he does a great job of teaching it.
Order of Certifications to come: CISM, C|EH, CISA
2019 certification tests taken: CISSP (Passed - awaiting endorsement), MCSA: 2016 (Passed), CCNA (Re-certification - Passed)
New Blog: https://jpinit.com/blog
• Member Posts: 273
What is the last valid host on the subnetwork

Convert both to binary:

10101100.00011111.11011000.00000000
11111111.11111111.11111000.00000000

Ok let me take a crack at this:

GIVEN:
172.31.216.0/21

Step by step:

1. /21 = 21 network bits ("on" bits or simply "1") = the following:
11111111.11111111.11111000.00000000
(or, 8.8.5.0 which is 8 + 8 + 5 + 0 = 21 bits)

2. The "1" highlighted indicates the 21st network bit, which is located on the 3rd octet of our network address. Let's isolate the bits in that octet:
.
.11111000.
The highlighted "1" is in the 5th space...
If you recall the binary chart:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
The "8" is in the 5th space, therefore, 8 will be used as our increment for our new subnetted networks on that octet, starting at zero (0). SO, the networks available using the "/21" notation are as follows:
172.31.0.0
172.31.8.0
172.31.16.0
172.31.24.0
......
172.31.208.0
172.31.216.0
172.31.224.0
.....and so on

3. Each subnetted network starts at the the 'network address' (increment of 8 ) - which is non-assignable to a host, and has 'valid' addresses up until the last address - the 'broadcast address', just before the next network number starts, so your actual networks (network ranges) are as follows:
172.31.0.0 - 172.31.7.255
172.31.8.0 - 172.31.15.255
172.31.16.0 - 172.31.23.255
172.31.24.0 - 172.31.24.255
......
172.31.208.0 - 172.31.215.255
*172.31.216.0 - 172.31.223.255
172.31.224.0 - 172.31.231.255
...and so on

*172.31.216.0
COLOR=#0000ff]172.31.216.1 - 172.31.223.254[/COLOR172.31.223.255

Keep in mind how dotted-decimal addresses are incremented - remember, each octet only goes from 0 to 255, then the octet before it increments by 1 plus it starts over at zero... for example:
x.x.0.0
x.x.0.1
x.x.0.2
...
x.x.0.253
x.x.0.254
x.x.0.255
x.x.1.0
x.x.1.1
x.x.1.2
...
x.x.1.254
x.x.1.255
x.x.2.0
...and so on

4. Our network as stated was 172.31.216.0 (/21)...
It is highlighted in orange above. Since the first address - the network address - cannot be assigned to a host, and the last address - the broadcast address - also cannot be assigned to a host, the addresses in between are considered the valid addresses (valid host range, assignable addresses, etc.).

THEREFORE we now have:

Valid Host Range: 172.31.216.1 - 172.31.223.254

That's it! I liked Jeremy's (from CBT Nuggets) method of subnetting best. Soon you'll be able to do this in your head. All this looks much more complicated than it is. Good luck!
• Member Posts: 105
The way I do subnet problems on the test is simple.

When I get to the test, during the tutorial I write down a bunch of notes. On of them I write is a subnet **** sheet and another one is the decimicial values of asubnet mask.

128
+64
192
+32
224
+16
240
+ 8
248
+ 4
252
+ 2
254
+ 1
255

The only thing you need to remember is a /30 has 4 addresses and uses 255.255.255.252 address.
from there, you subtract the CIDR by 1 and double the # of addresses. For the subnet mask, use the decimial chart above and reduce by one value.

when you do your problems, remember that the 1st address in each subnet is the network address, and the last one is the broadcast. so you have 2 less than what this chart says.

I write down from /22 – /30, although that is my personal preference.

CIDR Notation
# of Hosts

/30
4 (2 usable)
255.255.255.252

/29
8 (6 usable)
255.255.255.248

/28
16 (14 usable)
255.255.255.240

/27
32 (30 usable)
255.255.255.224

/26
64 (62 usable)
255.255.255.192

/25
128 (126 usable)
255.255.255.128

/24 (Class C)
256 (254 usable)
255.255.255.0

/23
512 (510 usable)
255.255.254.0

/22
1024 (1022 usable)
255.255.252.0

/21
2048 (2046 usable)
255.255.248.0

/20
4096 (4094 usable)
255.255.240.0

/19
8192 (8180 usable)
255.255.224.0

/18
16,384 (16,382 usable)
255.255.192.0

/17
32,768 (32,766 usable)
255.255.128.0

/16 (Class
65,536 (65,534 usable)
255.255.0.0

Courses Completed at WGU ( 8 ):
Term 1 (April 2011): EWB2, WSV1, BRV1, BSV1 | Term 2 (October 2011): LET1, ORC1 | Term 3 (April 2012): MGC1, TPV1
Courses Required Graduate WGU with BS - IT: SEC ( 8 ):
BOV1, KET1, WDV1, KFT1, ABV1, TWA1, BLV1, CPW4
• Member Posts: 1,118
Jock - Chris Bryant does use ranges - you didn't watch the ICND1 videos far enough. He gives SPECIFIC examples on how to find the valid host ranges, broadcasts and networks, and usable subnets with and without "ip subnet-zero".You need to go back and revisit the video's, he does a great job of teaching it.

Advanex1, I bought Bryant's 4 DVD set, home study course. I'm only past the 1st disk which is only on CCENT, and on Chp 9 where he does the subnetting lesson. He does a great job teaching it and finally gets it across to me after trying to learn this for the last two years.

Do you know where on the other disks he covers more subnetting?
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
• CASP, MCSA 2016, MCSA 2012, CCNA, Security+, Network+, Project+, Server+ Member Posts: 364 ■■■■□□□□□□
CCENT Disk 2 - Video 3, he specifically talks about valid host ranges, etc. etc. (note, this is for his Train Signal courses)
Order of Certifications to come: CISM, C|EH, CISA
2019 certification tests taken: CISSP (Passed - awaiting endorsement), MCSA: 2016 (Passed), CCNA (Re-certification - Passed)
New Blog: https://jpinit.com/blog
• Member Posts: 1,118
CCENT Disk 2 - Video 3, he specifically talks about valid host ranges, etc. etc. (note, this is for his Train Signal courses)

Are you sure?

I have the Trainsignal Cisco CCNA Training, 4 DVD set. I popped in the 2nd disk and the 3rd chp is for the following:

Static Routing and RIP
-static routing theory and configuration
-default static routes purpose
-what is scalability?
-changing the administrative distance of a static route
-distance vector routing protocol behavior - split horizon and route poisoning
-rip theory and version differences
-the joy of "show ip protocols"
-RIP limitations and timers
-floating static routes
***Freedom of Speech, Just Watch What You Say*** Example, Beware of CompTIA Certs (Deleted From Google Cached)

"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown