Subnetting questions

Posted on 2005-03-14
Medium Priority
Last Modified: 2010-04-10

Im taking some CCNA practice exams. The ONLY part thats giving me trouble are these two types of subnetting questions:

1. Enter the number of networking bits that would give a network with 2 host addresses.

I know the answer, but I dont know how I got it lol
or 30bits. I only know that from subnetting in real environments. How do you properly answer this question?

2. Enter the subnet mask dotted decimal value that would give a network with 2,046 host addresses
Question by:dissolved
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2

Accepted Solution

minmei earned 1200 total points
ID: 13541658

subnet mask defines what is network and what is host. If only last 2 bits are host, then 00 01 10 11 are the only possibilities. Since each subnet has a network address (00) and a broadcast address (11) , that only gives two addresses left (01 and 10)

if subnet mask is



then you have 2 to the 11th power hosts (11 zeros) which is 2048. Subtract the two for network and broadcast (00000000000 11111111111) and you have 2046.

Make more sense?

Author Comment

ID: 13541728
q1: is there a formula for this? I noticed they said number of hosts and not host bits. Im only used to questions that ask something in bits etc.

q2 is actually trial and error? You play with 2^x-2=your answer
Thats what I figured... I guess you just try all types of combos with questions like this.
LVL 11

Assisted Solution

-Leo- earned 800 total points
ID: 13541978
Q1: I would not say its a formula, but I do like this:

1. Convert number of hosts to the binary
2. Check if this number consists of all "1", if yes - add one more bit
3. Substract number of resulting bits from 32 (total possible number of networking bits)
4. Convert this to the dotted binary or decimal notation, if you need (question was how many networking bits ...)

If you need 2 hosts:

1. 2 = 10
2. All "1" - ? No!, number of bits = 2
3. 32 - 2 = 30
4. 11111111.11111111.11111111.11111100 =

if you need 3 hosts:

1.  3 = 11
2.  All "1" - ? Yes!, number of bits = 3 (2 + 1)
3. 32 - 3 = 29
4. 11111111.11111111.11111111.11111000 =

And so on ...

Q2: Same calculation:

1. 2046 = 11111111110
2. All "1" = ? No!, number of bits = 11
3. 32 - 11 = 21
4. 11111111.11111111.11111000.00000000 =

Hope this will help you!
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.


Author Comment

ID: 13543335
Leo, thanks. Where did you get the numbers "3=11" in questions 1?
LVL 11

Expert Comment

ID: 13543346

3 will be 11 in binary
2 will be 10 in binary
255 wil be 11111111 in binary

You know the joke: there is 10 types of people in the world: who understand the binary and who is not :)

Author Comment

ID: 13543557
oh 3 is 00000011
2 is 00000010

Gotcha. thanks man

Author Comment

ID: 13544229
so if you want 510 hosts, you would need 16 host bits?

Is this correct?

Expert Comment

ID: 13544728

510 and add 2 (network and broadcast) = 512

512 = 2 to the 9th power = 9 bits for hosts

11111111.11111111.11111110.00000000 - hosts are zeros

subnet mask is

Do the math for 30 hosts. I'll check you.

Author Comment

ID: 13544950
Wait I think I see. When ever they ask:
 "enter the number of networking bits that would give a network with 1022 hosts"

The first thing you do is add +2 to 1022. This is because one is reserved for network, the other reserved for broadcast. This gives us 1024.

Now, I just have to do the formula 2^x=y  to find the 1024.
2*2*2*2*2*2*2*2*2*2*2 =1024
Thats eleven "2s", or eleven host bits

255            255           248             0

eh, is this right?

Expert Comment

ID: 13544993

2 to the 10th power is 1024, not eleventh.  So what would the mask be now?

Author Comment

ID: 13545183

22 networking bits  10 host bits

Is this correct?

Expert Comment

ID: 13545203

Author Comment

ID: 13545625
thanks!  finally the light has come on. Let's hope it doesnt go out LOL

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question