Subnetting help

Mark_Co
Mark_Co used Ask the Experts™
on
Can anyone help me understand how to do this exercise? It's not homework, it's an exercise to help me with subnetting for my networking class. It's not to be turned in, I just a want to learn how to so this worksheet.
photo-1--8-.JPG
photo-2--6-.JPG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. Security Consultant
Commented:
Subnetting is all about powers of two.  With IPv4 you have a 32 bit number or 4 octets (for ease of calculating).  The 32 bit IPv4 address is broken into two parts... The left most bits are the network, the rightmost bits are the host.  The subnet mask shows you where to break them.

Examples to allow you to work through your sheet:

A 255.255.255.0 mask indicates that there are 24 bits of network and 8 bits of address.  8 bits of address (2^8) gives you 256 addresses, but you take away two - one for the network and one for the broadcast.  That leaves you with 254 usable hosts.  

25 bits of network gives you 255.255.255.128 (11111111.11111111.11111111.10000000) leaving you 7 bits of hosts (2^7)or 128 addresses with 126 hosts.

So on and so forth down to two "special cases".  31 bits of network only leaves you with 2 possible addresses, the network and the broadcast with no usable addresses, so not useful for real networks (although can be used for access control lists and the like).  32 bits of network is a single address which can be used in special conditions like loopback addresses for routers that don't need a network per se, but allow you to use a single address efficiently.

For your worksheet, you will need to figure out how to create sub networks that allow 20 hosts.  Using powers of two, find the number of bits that will give you sufficient usable addresses to fit your 20 hosts within.  Remember to subtract two addresses for the network and broadcast.

2^2 = 4 addresses, 2 hosts
2^3 = 8 addresses, 6 hosts
2^4 = 16 addresses, 14 hosts
...

The paper gives you 24 bits of network and 8 bits of host so you have to divide up 256 addresses to have at least 5 subnets.

Once you've broken it up, the next part is to determine if two hosts are on the same network (do you have to go through a router or not).  The way a router determines this is to take the address and the mask to see if it is local to the network or not.  To calculate this by hand you have to use bitwise operations of Exclusive OR and AND.  Exclusive or functions like this:

1 XOR 1 = 0
1 XOR 0 = 1
0 XOR 1 = 1
0 XOR 0 = 0

AND works like this:

1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0

First you have to calculate the subnet address for the network.  To do so, you "AND off" the host bits by ANDing the subnet mask with the address:

132.241.158.130 in binary is:
10000100.11110001.10011110.10000010 AND with subnet mask of 255.255.255.0:
11111111.11111111.11111111.00000000
-------------------------------------
10000100.11110001.10011110.00000000
which is
132.241.158.0

Take another address you want to check and see if it's on the same network:
1.1.1.1 in binary is:
00000001.00000001.00000001.00000001 AND with subnet mask of 255.255.255.0:
11111111.11111111.11111111.00000000
-------------------------------------
00000001.00000001.00000001.00000000
which is
1.1.1.0

Last, exclusive OR the two networks.  If they're on the same network, you'll get a zero.  Anything else and you have to "route" it to that network.

10000100.11110001.10011110.00000000 132.241.158.0 XOR with
00000001.00000001.00000001.00000000 1.1.1.0
-------------------------------------
10000101.11110000.10011111.00000000          Non-zero, therefore not local, has to go through a router...

Hopefully this will get you started...


Just a note:

Even though your sheet says to assume classful addressing, nobody actually does that any more as has been (long since) replaced by CIDR (classless inter-domain routing) which simply allows you to subnet your ranges efficiently.  It's used mainly as "shorthand notation" for subnet masks rather than actual use.

Author

Commented:
Wow. I didn't even read it all but I can tell you really helped me out before I even took the time to read it. If I have any other Q's, will ask. Thanks!
gt2847cSr. Security Consultant

Commented:
No problem.  BTW, if you're really getting into networking especially with IPv4, memorizing the powers of two up to 2^16 helps.  I thought my professor was kidding when he said that, but he was wasn't.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
:). I'm just taking an intro networking class. I find it interesting though
gt2847cSr. Security Consultant

Commented:
Get good at it and it can be a lucrative field... Especially with carriers and large corporations...  Network Engineers are at a premium at the moment.

Author

Commented:
hmmm, thanks for the tip

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial