# Subnetting questions

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
its 255.255.255.252
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
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Q1

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)

11111111.11111111.11111000.00000000

or

255.255.248.0

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?
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
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.

Thats what I figured... I guess you just try all types of combos with questions like this.
0
Commented:
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 = 255.255.255.252

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 = 255.255.255.248

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 = 255.255.248.0

0
Author Commented:
Leo, thanks. Where did you get the numbers "3=11" in questions 1?
0
Commented:

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 :)
0
Author Commented:
oh 3 is 00000011
2 is 00000010

Gotcha. thanks man
0
Author Commented:
so if you want 510 hosts, you would need 16 host bits?

255.255.0.0

1111111.11111111.00000000.00000000

Is this correct?
0
Commented:
Nope.

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

11111111.11111111.11111110.00000000 - hosts are zeros

255.255.254.0

Do the math for 30 hosts. I'll check you.
0
Author Commented:
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

11111111.11111111.11111000.00000000
255            255           248             0

eh, is this right?
0
Commented:
Close.

2 to the 10th power is 1024, not eleventh.  So what would the mask be now?
0
Author Commented:
11111111.11111111.11111100.00000000
255.255.252.0

22 networking bits  10 host bits

Is this correct?
0
Commented:
Absolutely.
0
Author Commented:
thanks!  finally the light has come on. Let's hope it doesnt go out LOL
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.