Advertisement

Trying to understand Subnets

Started by November 25, 2003 01:20 PM
5 comments, last by AcidInjury 21 years, 2 months ago
My textbook does a horrible job explaining how subnets work, and how the subnet mask/ip combination is used. Can anyone help, or point me to a good resource? Heres how I understand it: The subnet mask is built, and its value corresponds to the size of the subnet (based on ammount of trailing zero bits). 255.255.255.0 gives a subnet of size 256. The valid IP range for this subnet could be say. 172.16.1.0, to 172.16.1.255. So far I think all the above is valid. I know at some point a subnet mask and an IP address are ANDed together, what does the result mean? Also, if the subnet mask is 255.255.255.0, than the result of ANDing for all IP''s in this subnet will be the exact same. (172.16.1.0 for instance) However, if the subnet mask is 255.255.255.128, there are two results (172.16.1.0, and 172.16.1.128). What are the implications of this? Also, how does superneting relate to all this? I''m just trying to piece it all together, thanks for any help. Will
Your lucky i ran into this forum by accident :-D

ok, here is how subenetting works:

you have a class b network (from the look of your mask) with an ip address of 172.16.1.0

ok, you want to subnet this network. why? well perhaps you want teachers on one network and students on the other (that way they can''t "see" each other).

ok, so let''s say you want 6 subnets. take a look at our free octets:

172.16. our 3rd free octet . our 4th free octet

so we have 8 bits per subnet, for a total of 16 bits we can use

_ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _

hopefully ur not lost yet :-D
now, a little binary math coming up: we need to represent 6 in binary. how many bits do we need to "borrow" for our network?
1? no, that''s 2^1 = 1, not correct
2^2? no, that''s 4. we need 6
2^3? yes, we have 8 here. perfect
so we borrow 3 bits for our subnet

N N N _ _ _ _ _ . _ _ _ _ _ _ _ _

so as you can see, we now are taking 3 bits for our subnets and leaving 13 for our hosts. lost yet? lol

ok, so what does the subnet mask mean?

this is used by a router to figure out what bits are borrowed to make the subnets.

so 255.255.255.0 means that the network portion of the address is the entire first 3 octects.

in my example, 255.255.224.0 is the subnet mask. what a router does is "and" the results of a ip address that is sent with the mask that the router was given.

ok, maybe i wasn''t as helpful as i thought. if you really really need some help, i could give you a detailed lesson on it, since i''m a networking student. just post if you need clarification (i expect you will, it''s a tough concept to understand at first)
Advertisement
quote:
Original post by BriW111
you have a class b network (from the look of your mask) with an ip address of 172.16.1.0


It''s a class C subnet. A class B subnet shares only the first 2 octets.

Halo7
172.16.1.0 would likely be a class b network, because there is no such thing as a host with an ip address of zero (at least there shouldn''t be). that means that the host address must be in the 3rd octet. actually the ip address would likely represent the first network''s ip address (the zero in the last octet representing the network ip). plus he mentioned that a valid range for the SUBNET would be 1.0 to 1.255, which to me says that the entire 3rd octet is the network portion. If they are allowed to mess with the network portion (ie create 256 possible subnets from it), then they''d have to have a class B address. Not to start a flame war, but that''s the way i interpreted it.
As lucky as we all undoubtedly are that you stumbled across this post (?) you do not even recognise the difference between a class B mask and a class C mask.

Amazingly by searching on Google, I found lots of references to subnets - here seems to be quite a good example with diagrams:

http://www.johnscloset.net/primer/subnet.html
quote:
Original post by AcidInjury
My textbook does a horrible job explaining how subnets work, and how the subnet mask/ip combination is used. Can anyone help, or point me to a good resource?

Heres how I understand it:
The subnet mask is built, and its value corresponds to the size of the subnet (based on ammount of trailing zero bits).

255.255.255.0 gives a subnet of size 256.

The valid IP range for this subnet could be say. 172.16.1.0, to 172.16.1.255.

So far I think all the above is valid.


quote:
Not quite - the valid IP range would actually be 172.16.1.1 to 172.16.1.254.

I know at some point a subnet mask and an IP address are ANDed together, what does the result mean? Also, if the subnet mask is 255.255.255.0, than the result of ANDing for all IP''s in this subnet will be the exact same. (172.16.1.0 for instance)

However, if the subnet mask is 255.255.255.128, there are two results (172.16.1.0, and 172.16.1.128). What are the implications of this?

Also, how does superneting relate to all this?

I''m just trying to piece it all together, thanks for any help.

Will


It is quite a complicated subject to discuss like this without a couple of nice diagrams. It''s probably a good idea to check on the web for some tutorials with pretty piccies.



"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
Advertisement
quote:
Original post by Anonymous Poster
As lucky as we all undoubtedly are that you stumbled across this post (?) you do not even recognise the difference between a class B mask and a class C mask.



I don''t normally get involved in flame wars, but it''s amazing these days how quick people are to criticize someone without even having their own facts straight.

briW111 is correct in calling it a Class-B network.

It is a Class-B network (not subnet). The first octet determines the class, not the subnet mask. All the subnet mask does is allow you to chop the network up into smaller subnetworks. But, it does not change the class of the network. The fact that it is using a 24-bit subnet mask does not change it into a Class-C network. The 24 bit subnet mask allows it to emulate a Class-C network, but it is still by definition a Class-B network. Also, it is not using a Class-C mask. It is using a 24-bit subnet mask. Technically not the same thing.

Also, the range in the example would be 172.16.1.0 - 172.16.1.255 (0=subnet address, 255=broadcast). The "usable" range would be 172.16.1.1 - 172.16.1.254. The "0" and "255" are still used by the network just not by the people.

Address ranges for network classes:
Class-A: 1.0.0.0 - 127.255.255.255
Class-B: 128.0.0.0 - 191.255.255.255
Class-C: 192.0.0.0 - 223.255.255.255

Default Network Masks (not the same as Subnet masks)
Class-A: 255.0.0.0
Class-B: 255.255.0.0
Class-C: 255.255.255.0

This is why it is common to not even use classful networks anymore. Classless is used, since everything is subnetted anymore.

Instead of calling 172.16.1.0 a Class-B with a 255.255.255.0 mask, it is simply written 172.16.1.0/24. The class annotation is rarely used anymore. Everyone pretty much uses CIDR.

Yeah, some of this is just semantics and technicalities; but if you''re going to flame someone, at least get your info right.




Bierhunter
Bierhunter

This topic is closed to new replies.

Advertisement