# Sub netting help!!

Posts: 20Member ■□□□□□□□□□
Given 10.5.3.0 /20

This is what i got

1111 1111.1111 1111.1111|0000.0000 0000

255.255.240.0

# of available hosts = 4094

1) First available IP?
2) Last Available IP?

im not too sure how to do this part if its not a class C address within the range of 255... so could someone explain this part to me

i've used a subnet calculator and it gave me 10.5.0.1 to 10.5.15.254

«1

• Posts: 423Member
10.5.0.1 is your 1st available host IP (the Network IP is 10.5.0.0)

The Broadcast is 10.5.15.255 and the last available host IP is one less than the Broadcast = 10.5.15.254

When working with CIDR notation, don't worry about the 'Class', as it's 'Classless'

Also, when you're looking at the binary, try to stick to the Octets...

Mask = 1 1 1 1 1 1 1 1|1 1 1 1 1 1 1 1|1 1 1 1 0 0 0 0|0 0 0 0 0 0 0 0
No longer an active member
• Posts: 896Member ■■■■□□□□□□
the long way,
the network address bits that match up to the subnet bits you keep and the ones that match up to the hosts bits you drop (or zero out).

So being the subnet mask is 255.255 for the first two octets. the network bits are kept. so the first two octets are 10.5.
and the 4th octet is all host bits. so the 4th octet is zero.

so we have 10.5.x.0 right away. so we match the subnet bits for the 3 octet.

3= 0000 0011
s= 1111 0000

match up the bits that are both 1's. there are none so the 3rd octet is 0.
10.5.0.0 is the first /20 subnet.

10.5.0.1

the 3rd octet has the last 4 bits as host bits set thost to 1 and the 4th octet has all host bits, so set those to all 1's
0000 1111. 1111 1111
10.5.15.254.
• Posts: 896Member ■■■■□□□□□□
a shorter way.

you should know the 1st, 2nd, and 4th octets for the network by examination.
the 3rd octet has the last 4 bit as host bits. that gives a subnet size of 16. divide the the 3rd octet by the subnet size.
3/16 that is zero + a remainder. the remainder is just host bits. and host bits are all set to zero for the network address. so forget about the remainder.
take the 0 * 16 for the network number. that is 0. so 10.5.0.0 is the network address.

fine the next subnet address. add the subnet size to the previous network. 0 + 16. 10.5.16.0 is the next subnet address.
• Posts: 423Member
clarson wrote: »
a shorter way.

you should know the 1st, 2nd, and 4th octets for the network by examination.
the 3rd octet has the last 4 bit as host bits. that gives a subnet size of 16. divide the the 3rd octet by the subnet size.
3/16 that is zero + a remainder. the remainder is just host bits. and host bits are all set to zero for the network address. so forget about the remainder.
take the 0 * 16 for the network number. that is 0. so 10.5.0.0 is the network address.

fine the next subnet address. add the subnet size to the previous network. 0 + 16. 10.5.16.0 is the next subnet address.

Cool! That's a nice way to work it out. I'd not thought of it like that. Cheers.
No longer an active member
• Posts: 20Member ■□□□□□□□□□
"3= 0000 0011
s= 1111 0000

match up the bits that are both 1's. there are none so the 3rd octet is 0.
10.5.0.0 is the first /20 subnet.

10.5.0.1

the 3rd octet has the last 4 bits as host bits set thost to 1 and the 4th octet has all host bits, so set those to all 1's
0000 1111. 1111 1111
10.5.15.254."

up until this part i get but i dont really understand what you're doing here im new to network subnetting from a networking class and my professor didn't really explain to me how to do this and its on my assignment i would really like to understand it but its not making any sense to me
• Posts: 20Member ■□□□□□□□□□
i mainly dont understand why you compare 3rd octet with the subnet and try to find 1s?

secondly, i dont get why you set all the host bits to 1 to find the last available ip?
• Posts: 896Member ■■■■□□□□□□
we are separating the network bits from the host bits.
as another example, lets say the network was 10.5.19.64 /20

ok we know the 10.5 is going to be part of the network address. and the 64 is part of the host bits. and when finding the subnet address the host bits are set to zero. so the 4th octet is 0.

now for the 3rd octet

19= 0001 0011
sn= 1111 0000

where a one in the network number matches a one in the subnet mask that is part of the network address. So, matching up the ones we get
0001 0000
so the network portion for a /20 subnet is 16. for the 10.5.3.0 example none of the subnet masks one matched up with any of the network address's ones. so the network portion for a /20 subnet was 0.

secondly, i dont get why you set all the host bits to 1 to find the last available ip?

• CCNA 200-120 Posts: 484Member ■■■□□□□□□□
Ah jeezus... Ok, time for Mikey's annual "how to subnet in your head in 45 seconds or less" lesson

The concept 'octets" was introduced earlier in this thread and that was a plus. Let's toss in a couple of other facts that are necessary for the subnet world. In a subnet, you have a subnet ID and a subnet broadcast address. The subnet ID is *always* an even number. The broadcast address is always an odd number. In the subnet world, the number 0 is considered even. To make life simple, we will use an analogy and call the subnet ID the name of your gang or club. Also you must know your block sizes which can be 4, 8, 16, 32 or 64) (192.168.0.0 - 192.168.0.15 is a block size of 16 because it includes the 0. This example of a block size of 16 would be called 192.168.0.0 /28. This club, or gang is called the 192.168.0.0/28 gang. The next gang is the 0.16 gang (recall, network IDs are always even numbered and in this example our gang or cluib size is a /20 in the third octet..

Ready? (Standy, let me get some Guns 'N Roses going) Let's go with a couple of examples

The subnet mask is 255.255.240.0 The third octet is where all out work will happen. It will be called 240 (/20) (why? because the first two octets are 255, third octet, as a /20 means only 4 bits are being used so from left to right 1111000)

OK? So 256 - 240 =16 How many 16s can you fit in a 20? ( the ip third octets address) One!!

There's the name of your club!! Its 172.16.16.0!!

The first IP address? Duh!! 172.16.16.1

The last IP address. 172.16.31.254 (remember, block size of 16 - 1 kinda hard to explain, just accept it)

OK let's make the second example a little bit harder

Let; see, hmm how about 209.165.200.1 /19 Cool number

A /19 is basically a 224. The /19 is working in the third octet again. So 256 - 224 = 32 How many 32s can you fit in the 200 that is the IP address in the 3rd octet? Definately not 7 because that would be over 210. How about 6? 6 times 32 = 192!!!

That's the name of your gang!! It's the 209.165.192.0

What's the first IP address of the member of your gang? It's 209.165.192.1!

What's the last? Well we got a block size of 32 so add that number to 192, subtract one and put a 254 in the fourth octet and you have
209.165.223.254

The size of your gang? Going from right to left your have 8 bits in the fourth octet and 5 bits in the third so 2^13 = 8192 (but you have ta subtract 2 for the gang ID plus the broadcast address so you are at 8190)

Just know your block sizes (4, 8, 16, 32, 64, 12 and numeric subnet masks ( 240, 224, 24 and you can figure it out it in your brain fast
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University
• Posts: 20Member ■□□□□□□□□□
• Posts: 896Member ■■■■□□□□□□
yes it would be
and the next subnet would be 16 + 16 or 10.5.32.0
and the last ip is 10.5.31.254
• Posts: 20Member ■□□□□□□□□□
k thanks now that i understand that part back to my question could you show me how i would allocate 300 IP addresses to one building and 300 other IP addresses to another building using the first usable = 10.5.0.1
• CISSP, CEH, CCNA, Sec+ Posts: 312Member ■■■■□□□□□□
If you want more info, I think one of the best videos I watched on subnetting was done by ITProTV. Yes, it does cost but it was really helpful. Actually, I have learned a lot from their other videos too. I've watched other videos like Professor Messer and various youtube ones, but ITProTV was more helpful (I'm not associated with them at all. )
• Posts: 896Member ■■■■□□□□□□
well from your original question the subnets were /20. and each /20 subnet can have 4094 hosts.

So, are we using a /20 subnet or using something else?
• Posts: 20Member ■□□□□□□□□□
yes were using /20 subnet

10.5.3.0 /20

im suppose to allocate this into 4 deparments (300 students in each department and 10 teachers (must have different subnets)) and then i have to allocate into 3 dorms (400 students per dorm)
• Posts: 896Member ■■■■□□□□□□
i'm thinking your wanting to further subnet the 10.5.0.0 /20 subnet.

start with the largest amount of hosts, 400. a subnet that has 512 hosts will work, that is /23.
3rd octet has one host bit. so subnet size is 2 in the 3rd octet
10.5.0.0 1st dorm
10.5.2.0 2nd dorm this is where 10.5.3.0 is. don't know if you can reuse this.
10.5.4.0 3rd dorm

300 students, still need 512 hosts in subnet. /23 again

10.5.6.0 1st students
10.5.8.0 2nd students
10.5.10.0 3rd students
10.5.12.0 4th students

10 teachers. 16 hosts in a subnet. /28 subnet size is 4 bits in the 4th octet, that is 16 in the 4th octet.
for the first subnet you need to add 2 to the 3rd octet because that is the size of the 4th students subnet
then add 16 in the 4th octet because that is the size of the teachers subnet

10.5.16.0 1st teachers
10.5.16.16 2nd teachers
10.5.16.32 3rd teachers
10.5.16.48 4th teachers
• Posts: 20Member ■□□□□□□□□□
1) Why did you choose /23 and not /21?

2) instead of giving me the first usable one could you give me the range?
• Posts: 423Member
ExamHelpMe wrote: »
1) Why did you choose /23 and not /21?

2) instead of giving me the first usable one could you give me the range?

I don't like to interfere, but, why do you think clarson used /23 and not /21? {hint: look at the # of hosts}

Also, you've been given all the information you need to be able to to workout for yourself the range.

Don't expect peeps to hand you it all on a plate; you have to be prepared to do SOME work.

Sorry if I'm posting out of turn here, but I feel I just had to 'say' something.
No longer an active member
• Posts: 20Member ■□□□□□□□□□
rob42 wrote: »
I don't like to interfere, but, why do you think clarson used /23 and not /21? {hint: look at the # of hosts}

Also, you've been given all the information you need to be able to to workout for yourself the range.

Don't expect peeps to hand you it all on a plate; you have to be prepared to do SOME work.

Sorry if I'm posting out of turn here, but I feel I just had to 'say' something.

to be honest him spoon feeding me isn't really helping... i just want to understand how it works.. I won't be able to get spoon fed on my final either so I'm trying to figure it out myself with his work. I'm pretty sure I'm old enough to know whats beneficial to me and whats not if i understand what he's doing i wouldn't be asking but its not making any sense to me and my prof didn't teach it very well or why else would i try to look for answers myself? I'm trying to pass my god dam class thats all...
• Posts: 423Member
ExamHelpMe wrote: »
to be honest him spoon feeding me isn't really helping... i just want to understand how it works.. I won't be able to get spoon fed on my final either so I'm trying to figure it out myself with his work. I'm pretty sure I'm old enough to know whats beneficial to me and whats not if i understand what he's doing i wouldn't be asking but its not making any sense to me and my prof didn't teach it very well or why else would i try to look for answers myself? I'm trying to pass my god dam class thats all...

Okay, now that I'm sure that you really are trying and not just having someone else do you work for you, let me see if I can help you.

Lets start with the basics. The nuts & bolts of any digital computer system are the zeros and ones (just electrical signals, off & on) that are used on logic circuits. You understand 'logic gates', right? You know what a logical 'AND' does?

Without that basic knowledge, I don't know how anyone can make sence of it, as that's how the IP Mask works; is uses 'AND' logic. What you are doing with IP Addresses is in essence programming some computer logic circuits with zeros and ones, but in a more 'human friendly' way.

The smallest unit of addressable computer storage is called a 'byte' and holds eight data bits. We use the name 'Octet', from the Latin octõ meaning "eight" when talking about IP Addresses (and also in other areas of computer science).

So, rather than having to enter an IP Address, in four memory locations (Octets) as 00111111 00011000 01011001 00010101, you can instead use 63 24 89 21. The computer will do the math and convert it to the zeros and ones.

The Mask is used to separate the Network part of the IP Address from the Host part. If we apply the Mask 255.255.255.0 to the IP Address 63.24.89.21, what pops out is the Network IP, we call the Network ID.

IP Address: 00111111 00011000 01011001 00010101 = 63.24.89.21
Mask......: 11111111 11111111 11111111 00000000 = 255.255.255.0
'AND'.....: 00111111 00011000 01011001 00000000 = 63.24.89.0

This is written as 63.24.89.0/24 because we've used 24 bits in the Mask.

With the above example, you can see that the first 3 Octets address a Network and the forth Octet addresses Hosts, so the first usable IP Address has to be 63.24.89.1; you need an electrical signal, so it can't be 0 as that would not give you any signal.

Sometimes computer networks need to be able to grab the attention of more than one host, so a special part of the IP Address has been made available as a 'Broadcast' Address and all hosts 'listen' for Broadcasts on the last available Address; 255, so the Broadcast Address for the above example is 63.24.89.255.

This leaves us with a usable range of 63.24.89.1 to 63.24.89.254.

You with me so far?
No longer an active member
• Posts: 20Member ■□□□□□□□□□
That part i understand it starts getting confusing when its not the last octet im not sure how to assign like 400 ips is it like x.x.0.1 - x.x.0.255 but since its at the end do i increase the 3rd octet by 1 so x.x.1.1 - x.x.1.255 until i reach my 400 ips? Because in class he showed us an example but he was working with the last octet and allocating small amounts of ips at a time which i understood but im not sure how to do it if its past 255 on the last octet.
• Posts: 423Member
Okay, we're getting to that. In the interests of continuate, for now, I'm going to be using the above IP Address.

That range gives us 254 addressable hosts. But what if we want to address more than 254 hosts?

Well, we can alter the mask to suit; the more bits you have 'unmasked', the more Hosts you can address. There's a math formula you can use which is '2 to the power of the number of unmasked bits'. With this example we have 8 unmasked bits...

2^8=256. Always take off two addresses (do you know why?), which leaves 254 Host Addresses.

2^9=512 - 2 = 510 Host Addresses.

If we now look at this new 23 bit Mask...

IP Address: 00111111 00011000 01011001 00010101 = 63.24.89.21
Mask......: 11111111 11111111 11111110 00000000 = 255.255.254.0
'AND'.....: 00111111 00011000 01011000 00000000 = 63.24.88.0

Have you noticed, the Network ID? Our IP 63.24.89.21 is now apart of the Network 63.24.88.0.

This is because we've moved the boundary between the Network part and the Host part of the IP Address, one bit to the left. Remember what I said before, "Any Octet with a 255 Mask is addressing a Network and any Octet with a 0 Mask is addressing a Host.", well the host part is not only the forth Octet, but it also spans the first bit of the third Octet {bits are always counted from right to left; least significant to most significant}. So, anywhere that you see a 'zero' in the Mask, the IP protocol is addressing a host, and anywhere that you see a 'one' in the Mask, the IP protocol is addressing the Network. All that the decimal numbers are doing, is changing the 'bits'.

Now that we have nine bits for the Host IPs, we have a new range. The first usable IP is now 63.24.88.1. Nothing else has changed; the last usable IP is still 63.24.89.254 and the Broadcast is still 63.24.89.255. But, we added 63.24.88.1 through 63.24.88.255 to our Host IP range. So the new range is...

63.24.88.1 to 63.24.89.254

Okay, let's work on 10.5.3.0/20

IP Address: 00001010 00000101 00000011 00000000 = 10.5.3.0
Mask......: 11111111 11111111 11110000 00000000 = 255.255.240.0
'AND'.....: 00001010 00000101 00000000 00000000 = 10.5.0.0

You tell me...
How many Network bits and how many host bits do you have?
What is the Host range?
No longer an active member
• Posts: 20Member ■□□□□□□□□□
1) # of network bits = 20 | # of host bits = 12

2) Range = 10.5.0.1 to 10.5.15.254 (by setting all the 0 in the mask address to 1 and adding them up so (1+2+4+8 = 15 | 1+2+4+8+16+32+64+128 = 255 -1 = 254?)

3) 10.5.15.255 (last usable + 1?)
• Posts: 423Member
Bang on!

With the Broadcast Address, all the bits have to be 'set' (or 'one')

We can see from the Mask, that we have 12 bits for the Host part. If we 'set' all the Host bits to one, we get this...

IP Address: 00001010 00000101 00001111 11111111 = 10.5.15.255
Mask......: 11111111 11111111 11110000 00000000 = 255.255.240.0
'AND'.....: 00001010 00000101 00000000 00000000 = 10.5.0.0

Can you see that we now can't 'set' any more Host bits? So that has to be the Broadcast.

No longer an active member
• Posts: 423Member
So, the /20 Mask is giving us 4094 Hosts (2^12=4096 - 2 = 4094).

No longer an active member
• Posts: 20Member ■□□□□□□□□□
this is where it confused me not sure why he used /23 wouldn't /21 or /22 work aswell? since that would give 2046 hosts and 1022 hosts? why do we use the 510 hosts? Is it because thats the closest to 400?

If thats the case than would my mask be

[FONT=&quot]11111111 11111111 11111110 00000000 = 255.255.254.0?[/FONT]
• Posts: 423Member
Exactly that.

The /23 works nice as each Network is looking neat.

1st ID: 10.5.0.0
2nd ID: 10.5.2.0
3rd ID: 10.5.4.0
4th ID: 10.5.6.0

and so on...

Each Network supporting up to 510 Hosts. This offers some (but not much) scalability.
No longer an active member
• Posts: 20Member ■□□□□□□□□□
So is this why the range is from

1st ID: 10.5.0.1 to 10.5.1.254 (255+255 = 510? since 10.5.1.255 is broadcast)
2nd ID: 10.5.2.1 to 10.5.3.254
3rd ID: 10.5.4.1 to 10.5.5.254
4th ID: 10.5.6.1 to 10.5.7.254

and say if i need 20 ips would it be /27

11111111 11111111 11111111 11100000 = 255.255.255.224?

if this is the case i think i got it
• Posts: 423Member
I think you've got it as well.

Way-to-go man
No longer an active member
• Posts: 20Member ■□□□□□□□□□
thanks !
• Posts: 423Member
One thing I would add; be careful when using a Mask with fewer than 8 Host bits, as the Broadcast will NOT always end in 255. Starting with a Network ID of 10.5.6.0/27

1st ID B/Cast 10.5.6.31
2nd ID B/Cast 10.5.6.63
3rd ID B/Cast 10.5.6.95
4th ID B/Cast 10.5.6.127
5th ID B/Cast 10.5.6.159
6th ID B/Cast 10.5.6.191
7th ID B/Cast 10.5.6.223
8th ID B/Cast 10.5.6.255
No longer an active member