cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2779
Views
0
Helpful
5
Replies

Calculate the address range between two random addresses

rahaisley
Level 1
Level 1

Hi folks, I'm studying for the CCNA exam and I'd appreciate some clarification on this (see subject above). I don't want to know how many IP addresses are in a subnet from network address all the way to broadcast address. What I want to know is how many addresses exist between one random address in the subnet to another random address in the same subnet.

For example: what is the number of addresses between 132.168.212.7 and 132.168.224.6 in the same /16 network?.....Better yet! What is the number of addresses between 132.168.212.7 and 132.168.224.6 in a /18 network? How do you calculate this?

5 Replies 5

Glenn Matthys
Level 1
Level 1

Convert both addresses to binary, then binary subtract them. Convert the result back to decimal to know how many addresses there are in between.

Thanks Glenn. Do you think a question like this could appear on the CCNA exam? I ask because solving it the way you suggest would probably take me a long time and I know I won't have much time to play with on the exam.

Does anyone know a reasonably quick way to solve this problem?

You've got 12 x /24 subnets, so you've got 12 x 255 addresses =3060

Your /16 and /18 doesn't even come in to it because that mask stays well left of the bits your working with. Even the /18 would give you 132.168.192.0 - 132.168.255.255, so the addresses you've provided to calculate the addresses between are contained well within that mask.

.

And no, can't really see you getting that kind of question in the CCNA. It's been a long time, but they test a general understanding, not your ability to do mental arithmetic particularly.

bikespace wrote:

You've got 12 x /24 subnets, so you've got 12 x 255 addresses =3060

Your /16 and /18 doesn't even come in to it because that mask stays well left of the bits your working with. Even the /18 would give you 132.168.192.0 - 132.168.255.255, so the addresses you've provided to calculate the addresses between are contained well within that mask.

.

And no, can't really see you getting that kind of question in the CCNA. It's been a long time, but they test a general understanding, not your ability to do mental arithmetic particularly.

wow bikespace, I actually have no idea what you are saying. All I want to know is how to determine the number of addresses between two addresses that are in the same subnet when the difference between those two addresses is so great that it transcends a single octet. (A difference of more than 256).

In other words: the difference can't be deduced simply by subtracting

the last octet in one address from the last octet in the other address.

Can anyone help me with this?

ebarticel
Level 4
Level 4

When you learn subnetting, you should pay attention to the major subnet boundries that are appearing regardless of the number of bits you borrow to subnet. This will help you work out the range just by looking at it.

Example: x.x.x.128 is a subnet that you will find on most subnets indiferent the mask you use for subnetting or the octet it appears on.

Hope this helps

Eugen

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card