Help a guy out? (Network +)

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Hey everyone. I'm studying to take the Network+ exam next month and I'm really struggling in the addressing area, which is obviously a huge part.

I understand CIDR and I can do the conversions to determine the subnet mast from the /xx and such, but where I really get stuck is on questions like..."What is the last usable host IP address for the 172.45.120.0/23 network?"

So I can figure that a /23 is 172.45.120.0 255.255.254.0 (11111111.11111111.11111110.00000000) (I hope I've got that down) but I just can't seem to get it to click how to find the first and last usable. I know the first is the network adress +1 and the last is broadcast address -1, but I struggle to get the networks right.

Anyone have some good knowledge you can drop on me about finding first/last, or some good videos to watch? All the videos I've been able to find on first/last is all using non subnetted stuff so it doesn't really help.

I feel like this last bit of addressing and knowing all the different connection speeds are the two things holding me back from really feeling confident about it.
 

Kestrel

Registered User
Jan 30, 2005
5,814
129
Hey everyone. I'm studying to take the Network+ exam next month and I'm really struggling in the addressing area, which is obviously a huge part.

I understand CIDR and I can do the conversions to determine the subnet mast from the /xx and such, but where I really get stuck is on questions like..."What is the last usable host IP address for the 172.45.120.0/23 network?"

So I can figure that a /23 is 172.45.120.0 255.255.254.0 (11111111.11111111.11111110.00000000) (I hope I've got that down) but I just can't seem to get it to click how to find the first and last usable. I know the first is the network adress +1 and the last is broadcast address -1, but I struggle to get the networks right.

Anyone have some good knowledge you can drop on me about finding first/last, or some good videos to watch? All the videos I've been able to find on first/last is all using non subnetted stuff so it doesn't really help.

I feel like this last bit of addressing and knowing all the different connection speeds are the two things holding me back from really feeling confident about it.

I haven't studied this in about 15 years, and I'm headed out the door for awhile - but if it's still unanswered by the time I get home, I'll take a crack and remembering this stuff :laugh:
 

Osprey

Registered User
Feb 18, 2005
27,288
9,753
If the prefix is /23, then take 32 (IPv4 addresses are 4 8-bit values separated by dots, so 32 bits total) and subtract 23 from it. You get 9. Put that as the power over 2, so 2^9 (or "2 to the 9th power"). A very helpful reminder is that 2^10 is 1024, so 2^9 would be half that, or 512. Just for reference, 2^8 would be half that again, so 256, and 2^11 would be double 1024, or 2048. You get the picture.

Anyways, /23 gives you 512 addresses, as we just calculated. The address that you were given is actually the starting address, so you need to add 512 addresses to it. 512 is 256x2, so, if your given address-prefix pair is 172.45.120.0/23, then the range represented is 172.45.120.0->172.45.121.255 (0.0->0.255 is one 256 and 1.0->1.255 is the other 256). As you already know, the first and last addresses are reserved for the network and broadcast addresses, respectively, so, the actual valid range of addresses that can be assigned to hosts is 172.45.120.1->172.45.121.254. So, the answer to the "last usable host address for 172.45.120.0/23" question would be 172.45.121.254.

Boiled down: subtract the given prefix (ex. /23) from 32, calculate 2 to that power, add that number of addresses to the given network address and discount the first and last addresses to get the valid host range.

BTW, this also works with IPv6 addresses, but you need to subtract the prefix from 64, instead. Yes, IPv6 IPs are 128-bit, but only half of the bits are used for the host portion.
 
Last edited:

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
That was my biggest misunderstanding, Osprey. I wasn't allowing myself to make a bigger network. I was only thinking in terms of 254 addresses and not 512.

Lightbulb kind of moment. I appreciate you taking the time to type that up.
 

Osprey

Registered User
Feb 18, 2005
27,288
9,753
You're welcome. You can think of IP addresses almost like decimal numbers. In the same way that you count a decimal digit up to 9 and then add a 1 to the left of it and reset that original digit to 0 (i.e. 9+1=10), count an octet up to 255, then add 1 to the octet to the left of it and reset to 0 (ex. 120.255 + 1 = 121.000). Each number in an octet equals the maximum value + 1 of the octet to the right of it.

BTW, if you're given the subnet mask, you can figure out the address range even more easily. For example, notice that the subnet mask for /23 is 255.255.254.0. Simply subtract that from 255.255.255.255 and you wind up with 1.255. That's the size of the address range. Add that to your given address, 172.45.120.0, and you get 172.45.121.255, the broadcast address and last available host address + 1 in the range. So, that's a second way to do it if you find it more comfortable or you happen to forget the method above.
 
Last edited:

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Osprey, how about finding the network address? I thought I had this down, but apparently not.

"What is the network address for the 154.24.67.147/22 host?"

Answer given: 154.24.64.0/22
My answer: 154.24.66.0

The way I was attempting to figure it:
154.24.67.147/22 255.255.252.0 (11111111.11111111.11111100.00000000)

1024 addresses per network. 1024/256=4. 4 Networks per set of addresses. This would have the .67 fall within a range of .66-.70

From that thought, can you tell where I'm going off the rails?
 

Osprey

Registered User
Feb 18, 2005
27,288
9,753
I believe that it's 64 because that's the highest multiple of 4 that is less than 67. Imagine starting at 154.24.0.0. If each set is 1024 or 4 x 256 addresses, then the first set is 154.24.0.0->154.24.3.255, the second is 154.24.4.0->154.24.7.255 and so on. Keep that up and you eventually wind up with 154.24.64.0->154.24.67.255.
 

Butchered

I'm with Kuch
Apr 30, 2004
6,338
1
Yeesh. Had the right idea just wasn't doing the math right. Guess all the numbers were blending together. Thanks again! Gotta just slow down sometimes.
 

Osprey

Registered User
Feb 18, 2005
27,288
9,753
Yeah, you were close. You were just making it a bit more complicated than it really is. If you have the prefix, you usually don't need the subnet mask, which could just confuse you and put you on the wrong track, anyways. Just use the 2^(32-prefix) trick and you have the size of your address range, and, then, as I just showed, you can add them up end to end from 0 to get the starting address of the range that the given address is in.
 

SolidSnakeUS

HFBoards Sponsor
Sponsor
Aug 13, 2009
48,983
12,612
Baldwinsville, NY
I got mine just over a year ago, and even when I tried the CCNA, I always thought I was actually good at subnetting.

When I usually do subnetting, I usually throw out the wildcard early, even though I shouldn't. But I use the wildcard instead of doing binary because I'll do most of the math in my head. Weird, I know haha.

But just saying now that you'll get more used to it, especially the more you use it and at least test yourself.
 

Ad

Upcoming events

Ad

Ad