Subnetting question..

Joined
Apr 5, 2009
Messages
878
Hi guys, I am currently in my first cisco class, working on my networking degree. Now I am taking this class online so I dont have a chance to ask questions in class, I usually am pretty good at figuring out stuff by reading about it.
But right now I dont know if its the ribs I ate at the bbqfest or I am not seeing something, but I am having a bit of trouble understanding subnet masking and the way it works. I have read thru my study materials but its not clicking. I guess the issue I dont understand is how the masking actually works? Lol sorry if I am not really clear on what I mean, trying to put it in writing is a bit harder than I thought.
 
See the following thread for more info:

http://hardforum.com/showthread.php?t=1354377

The basics of what you need to know:

each network is a string of 32 bits
this string of 32 is typically split into 4 sets of 8 bits (dotted decimal notation)
the subnet mask (or cidr) is a string of 32 bits, starting with the cidr's length of 1's, and ending with 0's
-> if cidr is a /27, there's 27 1's, followed by 5 0's (a subnet mask will ALWAYS start with 1's and end with 0's, and are never intermixed... ie. 1100111011.... is not a valid subnet mask)
these 27 1's are matched against the binary network string
the first 27 bits of the network string is then defined as the "network" portion
the last 5 bits of the network string is then defined as the "host" portion
for the most part, router's only care about the network portion
 
Last edited:
As I understand it, a subnet mask is just a simplified (yea, right) way of indicating the network and host portions of an address when using CIDR - that is, as opposed to writing /xx after the IP.
*Waits to be corrected by some uber CCIE pro* :p

So it's easy when you have, say, 255.255.255.0 because the entire first three octets are network and the last is host (a class C network, yes?).
The idea is that you can also subdivide the octets and use just a few more bits for the network or host portions to make the most use of the available addresses. So 255.255.254.0 would give an extra bit over to the host portion, giving... 511 host addresses per subnet?
Uggh sorry, it's been a while and i'm sketchy on a lot of the details. Thought I'd get the thread going :p
 
As I understand it, a subnet mask is just a simplified (yea, right) way of indicating the network and host portions of an address when using CIDR - that is, as opposed to writing /xx after the IP.
*Waits to be corrected by some uber CCIE pro* :p

So it's easy when you have, say, 255.255.255.0 because the entire first three octets are network and the last is host (a class C network, yes?).
The idea is that you can also subdivide the octets and use just a few more bits for the network or host portions to make the most use of the available addresses. So 255.255.254.0 would give an extra bit over to the host portion, giving... 511 host addresses per subnet?
Uggh sorry, it's been a while and i'm sketchy on a lot of the details. Thought I'd get the thread going :p


while i'm not a ccie, yeah, you are pretty much correct. a subnet mask is just that... a *mask*. it just tells the router which portion of the bits are for network and which are for hosts.


a little info on the class a,b, c thing...

it has become (at least where i work) very common to refer to any /24 network as a class C. this is, however, technically incorrect. classful routing was the first form of routing before subnet masks existed. any network starting with a 0 would be considered a class A (00000000 - 01111111, or 0 - 127). any network starting with a 10 would be a class B (10000000 - 10111111, or 128 - 191), and anything starting with a 110 would be class C (11000000 - 11011111, or 192 - 223). then there were the class D and E, which were reserved. class D is typically used for multicast, and starts with 1110 (11100000 - 11101111, or 224 - 239). class E, as far as i know, is not really used and is the remainder of the bits (11110000 - 11111111, or 240 - 255).

So, that said, before there was actual "subnetting" (ie. no way to 'break up' a classful network), routers would do nothing more than look at the first few bits to determine what "class" the route was. This vastly simplified the storage required for routing tables, which back in the day, was a huge limitation of hardware.

i'm sure someone else can fill in more info, but that's the basics of what it means to say a network is a "class X".
 
thanks guys thats helping alot..sometimes its hard to get something from a textbook or site, even though its supposed to be written for the newbie =) you guys have helped alot. Thanks!
 
As you become better and more experienced in networking, you won't even think of the math anymore. You can just look at it and instantly understand what it is.
 
As you become better and more experienced in networking, you won't even think of the math anymore. You can just look at it and instantly understand what it is.


just because i dream in binary now doesnt mean anything.................:eek:
 
Back
Top