PDA

View Full Version : IP Subnetting question.


Jiggy
02-04-2006, 11:13 AM
I having trouble getting my head around this.

Diagram shows four subnets (one at each corner, connecting to a box in the middle, could be router, doesnt say)

Class C Network 192.168.0.0 (IP`s just for purpose of question.)

Default subnet 255.255.255.0 the first 3 octets (24bit) are the network and the last octet (8bits) are the host, wich gives me 254 hosts or addressed space, I wont to brake up the 254 hosts into four departments (4 Subnets), so I change the last octet to .192

Mum.
192.168.101.1
255.255.255.192

Dad.
192.168.101.2
255.255.255.192

Son.
192.168.101.3
255.255.255.192

Daughter.
192.168.101.4
255.255.255.192

My questions,

Why are the subnet numbers 255.255.255(.192) kept the same for the four subnets ?

Why isnt the last octet (.192) different (190, 191, 192, 193) for each subnet ?
I understand that the more bits you use, the fewer hosts per subnet.

Variable
02-04-2006, 06:39 PM
hmm, thats a really bad example. A subnet mask just shows you what IP addresses are in your subnet. The problem is your not thinking in binary. Try this tutorial
http://www.firewall.cx/ip-subnetting-intro.php

Erik
02-04-2006, 06:45 PM
192 = 11000000 in binary

So you will be using the last 6 bits as host addresses.

That subnet mask allows for (2^6)-2 hosts per subnet, and (2^2)-2 subnets of the class C network. So that subnet mask won't let you get enough subnets for what you want. Remember that you need to allow for the broadcast subnet and zero subnet. (I am coming from a Cisco CCNA perspective here anyway, and Cisco recommends as a best practice to not use those subnets).

Assuming that you do use the zero and broadcast subnets it would look something like this:
2^6 = 64 - so we need to count by 64 to get the subnet addresses

192.168.101.0
192.168.101.64
192.168.101.128
192.168.101.192

So to assign the first available address from each subnet to a different department you would need to do:
192.168.101.1
192.168.101.65
192.168.101.129
192.168.101.193

When you do a binary AND with any of those subnet address and the subnet mask you should end up back the the subnet address:
192.168.101.193 - 11000001 (just the .193 in binary)
255.255.255.192 - 11000000 (just the .192 in binary)
11000000 (.192)

192.168.101.129 - 10000001 (.129)
255.255.255.192 - 11000000 (.192)
10000000 (.128)

And so on.

The subnet mask can only ever be a power of 2. So you can use .128 .192. .224 .240 .248 .252 .254 .255 as valid subnet masks. Anything else is impossible because it needs to borrow bits starting from left to right, and can't skip bits.

juniper
02-06-2006, 10:50 AM
and (2^2)-2 subnets of the class C network. You can drop the -2 on the subnets this was only used for legacy IP addressing support (compatibility with legacy non-cisco devices). In cisco there is a command called "IP subnet zero" which is enabled by default that allows for the use of the all 1's and 0's subnets and is used heavily in VLSM/CIDR. In CCNAv1 test you had to subtract the -2, in CCNAv2 test you would get the answer wrong if you did -2, I never took the CCNAv3 test, but can tell you the CCNP tests will mark you wrong if you use the -2.

quote from cisco...
On the issue of using subnet zero and the all-ones subnet, RFC 1878 states, "This practice (of excluding all-zeros and all-ones subnets) is obsolete.

found here at the bottom.

http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080093f18.shtml

here is a how to subnet for beginners..
http://www.cisco.com/warp/public/701/3.html

Erik
02-07-2006, 02:44 AM
It is some tricky business deciding on whether to drop those two subnets or not. I just recently got my CCNA (last May), and everything I read in preperation said to drop the two subnets. In the accompanying practice tests you needed to drop them too. I don't recall having any number of possible subnets on my actual exam so I couldn't say how it would have actually works out.

In real life, as I mentioned and worked out they are available, and in fact are actually available by defauly on Cisco equuipment. So why they tell you to study for some exams without them, and others with I will never know. My guess is that as network addresses grow shorter they will change over to use of all available subnets and stop the nonsense of drop two.

juniper
02-07-2006, 01:22 PM
Out of curiosity what study guides did you use for your ccna that still says to do this? the modification to this is in RFC 1878 which was written in 1995 and quoted in the RFC is

"Many vendors only support subnetting based upon this
premise. This practice is obsolete! Modern software will be able to
utilize all definable networks."

keep in mind that was written in 1995 so modern software means after 1995 LOL!

There should be no confusion on when to not use these subnets basicly only if you have legacy pre 1995 software thats about it. It is note worthy to mention this for legacy applications but the use of VLSM / classless routing (also written in 1995) assumes the use of the all 1's and 0's subnets as the whole point was to expand the life of IPv4 addressing (why waiste 2 subnets?). basicly what Im trying to say is using ip subnet zero is part of using VLSM/CIDR. they go hand in hand.

juniper
02-07-2006, 01:35 PM
Now Im really curious what materials you used. I just pulled out my CCIE book from cisco press "routing TCP/IP Volume I" written in 1998 and shows to start using the all 1's and zero's networks as VLSM has made it possible to distinguish between the networks. Page 288. as well in the CIDR section it says not using the all 1's and zeros for supernetting could cause routing loops.

Erik
02-08-2006, 02:14 AM
I honestly can't really remember where I read it. My main source of study information was the Cisco Press CCNA Study Guide. But I also took some of the CCNA Networking Academy courses while I was still in school (only a year or two ago) too. It might have been there that I read to not include those subnets, but they do exist and are usable. Also I do think that the requirments for the CCNA, CCNP, and CCIE are slightly different so that might be a cause too.

bassman
02-08-2006, 10:14 AM
Jiggy my lad, did you get this worked out yet??

You smart guys sure like to make simple things difficult :D ;)

A subnet mask simply defines how many IP licenses you can have! A class C license (255.255.255.0 ) allows you 256 total licenses with two being used as described above.
A class B license (255.255.0.0 ) allows about 65000 licenses (254X256). A class A license (255.0.0.0 ) would be 254X256X256.
You do not change the segment values of a subnet mask to gain different sub-networks.

juniper
02-08-2006, 12:00 PM
Why are the subnet numbers 255.255.255(.192) kept the same for the four subnets ?

simple answer is 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary you barrow two bits from the host portion qand get 1111111.1111111.1111111.11000000 or 255.255.255.192 the last 2 bits you barrowed can be toggled on or off in combinations to create the subnets, the mask tells the computer how far in the address to look for a network address.
binary compilation = one octet = eight 1's or zero's (a bit) mathmaticly each bit represents a decimal number so starting from LEFT to RIGHT each bit equals
128, 64, 32, 16, 8, 4, 2, 1

the first two bits added together in decimal is 128+64=192 which is your new mask. so 192 says look at the first two bits to determine network portion, we do this conversion because computers only know binary and humans like decimals so adding human decimals together tells the computer which binary bits to use. so a mask of 224 would say look at the first 3 bits in any combination.(left to right) ie 128+64+32=240

this is why the mask stays the same since 128+64 will always be 192

Im not trying to make things difficult it just struck me odd to see someone still subtracting the zero and 1's subnets which will later confuse people. Im not trying to be nit picky either I think someone new to networking would appreciate the correct terms and use of current IPv4 addressing. Using the terminology of classes A,B and C ranges is also legacy as described by bassman. This was also eliminated by CIDR/VLSM which is now classless routing. you could not call up and request a class C range of addresses any more the correct current terminology is to use slash definitions. for example 192.168.0.0 mask 255.255.255.0 would be written 192.168.0.0/24 pronounced "192.168.0.0 slash 24" so basicly there really is no subnetting of classful addressing it is rather a classless IP addressing scheme. (CIDR = classless inter-domain routing) Looking at it this way I believe eliminates confusion for new networking people as thinking they have to subnet a class range when in reality the internet is classless, so when you call up for a /24 address space it very well could be 12.1.1.0/24 that you recieve.

quote from RIPE


"Can I obtain a class C address block?

Classful addressing (class A, class B, class C, etc) is now redundant and the RIPE NCC no longer uses that terminology. The original model for distributing IP addresses, based on classful addressing strategies, did not take into account the massive expansion of Internet use and was unable to scale to meet this expansion. Classless Inter Domain Routing (CIDR) is now one of the fundamental requirements for eligibility to receive IP address ranges."

Dont get me wrong though I do beleive the classful system should still be taught for legacy applications like RIPv1, but should be taught as such legacy not as a current design strategy. as It is not uncommon today to walk into a site that uses 10.0.0.0/24 as their addressing scheme.

wertep_1
02-12-2006, 03:25 AM
Try this soft: IPMonitor.

tsarfin

Edit to remove link...

Jiggy
02-12-2006, 12:20 PM
I`m getting there very slowly reading the site Variable posted, i`ve started reading the network section from the start and trying to get to the end, i`m having to reread most of it (read a bit, do something else, read more and then it sinks in) as I like to learn hands on, but not always possible.

I asked the question after watching a CBTnugget for N+ on IPs / Subnets, the nugget are put together assuming you have the basics of networking (a big no).

On the 2^2 -2 thing, you -2 on the host side of the IP address, the 2 that you take away are 0 (network address) and 255 (broadcast address).

The site Variable posted brakes it down into Jiggy speak and simple terms, though I do have to reread most of it, and I must say I am learning.

Thanks.

Variable
02-12-2006, 06:41 PM
(Jiggy this is a long read but will help you)

Glad the site is helping, I think it does a good job. The problem with subnetting is that it is basically alien to how most people think of things. That's because that binary is based on only two things: on and off. To get meaningful data in binary requires a complex and long string of zeroes and ones. Another issue with studying subnetting was touched on by Juniper. That is, that you will never use this type of subnetting in the real world. CIDR is what most people use now.

One of the ways I got through my CCNA section on subetting was by creating a simple table (think graph paper). The start of the table was a line for the basics 128,64,32,16,8,4,2,1 in a row. Above it I put the corresponding power of two, above that the corresponding CIDR i.e. /28, /29, /30 etc. Below the basic line I had a line for the octet like 240,248,252, below that the corresponding # of networks, below that the corresponding # of hosts. Understanding the table helps you to see how this stuff all works. Once you have a grip on Class C you can expand the table to include class B addresses.

You can find the corresponding numbers for each line in the table easy enough online. I copied the table on a sheet of paper over and over, until I could write it down easily. When I took my test the first thing I did was copy my table down on the erase board they provide in the testing center. By using this simple device I was able to breeze through any subnetting question with 100 percent accuracy. It completely diffused all concerns I had about subnetting and let me focus on other parts of the test. It also gave me a reference point in my head that allowed me to associate the different lines in the table with each other in the future. It helped me understand what the binary meant in relation to real things, like subnets, hosts and CIDR /'s and octets like 240 16 subnets 14 hosts /28

A basic part of seeing binary is understanding how limiting the whole 0 and 1 thing is. Imagine trying to make the computer compile what I wrote in this post? Imagine how many lines of ones and zero's it takes to get accross this simple bit of information in the form of text. Subnetting is simple math compared to that. Routers do basic mathmatical calculations based on binary to figure out what to do. It is called "and'ing" Routers and computers, for the most part, do simple mathmatical equations over and over very quickly. It seems complicated because the point of reference for the average human is not based on the power of 2. Binary is much simpler. You have the right of it when you say you read some and come back after it sinks in, that is because it is alien to how your brain is wired. Our brains are tricky beasts. It seems silly to go into that now but, I will say that the graph above works with how your brain is wired now. It associates the disparate data with the relevent bits ;)

When I was going through the web looking for subnetting help it seemed all a jumble of unassociated pieces. No site I found put it all together like my graph did. I was going to create a web site to help people along the cert paths I was on but I became too damn busy. So I come here, when I can, to regurgitate data in an ad hoc way. I also use it as a way of taking a break from studying something. I also learned that by teaching concepts to people it helped to cement the associations in my own head. When you try to learn something new write it down by hand, type it, read it and speak it. Explain it to your wife. She won't have a clue what you are talking about but it helps you to learn it. When I teach a class I always try to get across that it takes a lot of work to really understand the logic behind all this IT stuff. The only magic bullet is determination.

I hope this helped and it gave me a short break of chapter 11 in my SQL book.
:)

V

Jiggy
02-12-2006, 08:03 PM
Thanks for your help.

I think this may be along the same lines, chart from the forums at Firewall.cx, Simple Subnetting (http://www.firewall.cx/ftopict-2145.html), I`ve read through most of this page and made my own chart on the pc, on paper and I will be reading it again.

juniper
02-13-2006, 11:24 AM
I copied the table on a sheet of paper over and over, until I could write it down easily. When I took my test the first thing I did was copy my table down on the erase board they provide in the testing center.

This is very good to do, If new to subnetting learn the table, and first thing when you sit for the test write down the table before even starting the tutorial this will save lotsa time (you dont want to waite for the first question before making the table as you are under the clock and some people panic and forget). The white boards kinda smear alot and the markers are rarely fine point, when taking your test ask for pen and paper they should have no problems with this.