Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subnetting 4

Status
Not open for further replies.

Assimilator

Technical User
Dec 26, 2002
33
CA
As my sig lamely states I'm working on my MCSE

I'm at a part I can't figure out.

Subnetting.

I'm totally confused as to why I'd want to take lets say a Class B network which supports 65,000+ hosts and break it up into different subnets.

As well as the following paragraph out of the book confuses me alot.


The simplest type of subnetting is when you take a Class A
or Class B address and borrow an entire byte from the host
identifier to form a subnet identifier. For example, if you
take a Standard Class C network address 172.16.0.0 you
would normally use the last two bytes for your host
identifiers, with a subnet mask of 255.255.0.0. To Subnet
this address you can use the third byte for a subnet
identifier and the fourth byte for you rhost identifiers,
as follows (Where N=Network, S=Subnet, and H=Host)

NNNNNNNN NNNNNNNN SSSSSSSS HHHHHHHH

The subnet mask value then becomes 255.255.255.0 because
the third byte is no longer part of your host identifier.

With the new subnet mask you can then create up to 25
subnets by using varying values for the third byte of the
address with up to 254 hosts per subnet.


If anyone could either shed some light on this for me or
point me to something that might help me better understand
about subnetting a bit better as the book is driving me
nuts, it would be GREATLY appreciated.

(I don't think this is considered homework as it's
something I'm doing independantly of school considering I'm
not in school and have a full time job) --------------------
-----------
MCSE in training.
Currently I've gone through the following books:
70-210 Win2K Professional
70-215 Win2K Server
 
Assimilater,

Let's say you have to deliver a pacakge to someone. Think of the NETWORK as the 'street' address and the HOST as the 'house number' on the 'street'. You see if you know the street, but not the house number, you can't deliver the package, and if you know the house number but not the street, than again, you can't deliver the package either. So you see that you have to know both in order to complete the delivery.

When looking at an IP address without a subnet mask, there is no way to determine which portion of the IP address indicates the NETWORK and which portion indicates the HOST...however, when looking at the two of them together, (the IP address and the subnet mask), you can easily identify the NETWORK from the HOST.

Assuming you understand decimal/binary conversion...

Let's say you own the class B address 154.200.0.0/16

The /16 says to turn on the 16 LEFTMOST bits in the subnet mask...

11111111.11111111.00000000.00000000 (Binary)

255 . 255 . 0 . 0 (Decimal)

Any bits in the subnet mask that are turned on (1) indicate that the corresponding bits in the IP address should be considered part of the NETWORK address and any bits in the subnet mask that are OFF (0) should be considered part of the HOST address.
So, looking at this example, the NETWORK address is 154.200 (or the first two octects of the IP address). This leaves the last two octects available to assign as HOSTS on your NETWORK.

Now if you have a PC with the IP address of 154.200.0.15/16 this says that...any deliveries to this machine will be sent to NETWORK/STREET 154.200, and once there, will be direct to HOST/HOUSE NUMBER 0.15

Ok, now moving on...

If you own the address 154.200.0.0/16 you can have 1 NETWORK with 65,534 HOSTS on it (2 to the 16th -2). However, maybe you don't need 65,000+ HOSTS, but instead you would like the opportunity to have 10 additional NETWORKS. No problem, simple 'borrow' from your neighbor like this.

First, you already know that the NETWORK portion of the address is 154.200 and the HOST portion is 0.0...So, go to the first octect to the right of the NETWORK (which in this case is the third octect) and this is where you will begin to borrow.
Since you need 10 networks, you will need to borrow 4 bits from the third octect (2 to the 4th - 2 = 14 new NETWORKS can be made using these 4 bits).

So now instead of having 154.200.0.0/16 you will have
154.200.0.0/20 (you borrowed 4 bits from the HOSTS to give to the NETWORK so now you have a /20 instead of the /16 you had before. (16 + 4 = 20)

Okay, if I now turn on the LEFTMOST 20 bits in the subnet mask it would look like this

11111111.11111111.11110000.00000000 (Binary)

255. 255. 240. 0 (Decimal)

Now you have 20 bits representing the NETWORK (all the ones) and the last 12 bits (all the zeros) to represent the HOSTS on your networks. Each of your new NETWORKS can now support 4094 HOSTS, (2 to the 12th -2).

Your possible networks would be:

154.200.0.0
154.200.16.0
154.200.32.0
154.200.48.0
154.200.64.0
154.200.80.0
154.200.96.0
154.200.112.0
154.200.128.0
154.200.144.0
154.200.160.0
154.200.176.0
154.200.192.0
154.200.208.0
154.200.224.0
154.200.240.0

So by 'subnetting' you have increased the number of NETWORKS you can have by simply 'borrowing' a few bits from those available for HOSTS.

So in summary, when you only used /16 bits in the subnet mask you could have 1 NETWORK with 65,000+ HOSTS...after borrowing 4 bits from the third octect and going to a subnet mask of /20 you have an additional 14 new NETWORKS but each one can only have 4094 HOSTS instead of 65,000+. It's a trade off...

Hope that I didn't confuse you further...it's not as hard as it sounds, just takes some playing around with the numbers and bits.

Have fun,

Patty [ponytails2]


 
I can not explain it better than the green eyed lady... well you know what they say, beauty beats a beast ... :)
 
nice explanation patty, i have one question. i understand all what u wrote but how did u come up with "your possible networks"? the pattern is by 16? what if it was a class a network u were subnetting? would the pattern be 8? Thanks, PAUL

 
Thanks for all the info. Now I'm starting to get it and the binary conversion is making more sense now (Even if I don't yet understand it 100% yet)

I've got so many numbers floating in my head that whenever I go to the store now and buy something I've been calculating what the price is in relation to a Subnet Mask (by using the first three useable digits) and then trying to figure out how many hosts I could use in regards to all Three clases. I think it's time I checked myself into a looney bin ..... -------------------------------
MCSE in training.
Currently I've gone through the following books:
70-210 Win2K Professional
70-215 Win2K Server
 
Paul123456,

In the scenario described above, there was a need to 'borrow' 4 bits from the those reserved for the HOSTS portion of the IP address in order to make the 10 new NETWORKS. Now, in order to do this, we borrowed from the third octect by 'turning on' four bits (starting from the left).

If you were to add the decimal value assigned to these bits
(128 + 64 + 32 + 16), you would come up with the value 240, (which is the number you 'plug into' the subnet mask in the third octect.


11111111.11111111.11110000.00000000 (Binary)

255. 255. 240. 0 (Decimal)

Ok, now about the NETWORK 'pattern'...if you look at the RIGHTmost bit that you borrowed, you can see that it holds the decimal value of 16...this is where your 'pattern' comes from. Your NETWORK will change ever 16.


IP (decimal) 3rd Octect (binary)
154.200.16.0/20 0001 0000
154.200.32.0/20 0010 0000
154.200.48.0/20 0011 0000
154.200.64.0/20 0100 0000
154.200.80.0/20 0101 0000
154.200.96.0/20 0110 0000

So you can see that every 16, the bits in the NETWORK portion change to reflect a new NETWORK. Remember the computer reads only the bits designated as NETWORK to determine the NETWORK ID...so if you have 154.200.16.0/20, then the computer reads the first 20 bits from the left.

As you can see on the first NETWORK listed (154.200.16.0/20), the 16 in the third octect is represented in binary as 0001000. The second NETWORK (154.200.32.0/20), the 32 in the third octect is represented in binary as 0010000.

Since they are not IDENTICAL, you can surmise that they are seperate networks.



Network ID:
154.200.16.0

Valid address on this network: NET | HOST

154.200.16.1 thru 154.200.16.254 0001 0000
154.200.17.1 thru 154.200.17.254 0001 0001
154.200.18.1 thru 154.200.18.254 0001 0010
154.200.19.1 thru 154.200.19.254 0001 0011
154.200.20.1 thru 154.200.20.254 0001 0100
154.200.21.1 thru 154.200.21.254 0001 0101
154.200.22.1 thru 154.200.22.254 0001 0110
154.200.23.1 thru 154.200.23.254 0001 0111
154.200.24.1 thru 154.200.24.254 0001 1000
154.200.25.1 thru 154.200.25.254 0001 1001
154.200.26.1 thru 154.200.26.254 0001 1010
154.200.27.1 thru 154.200.27.254 0001 1011
154.200.28.1 thru 154.200.28.254 0001 1100
154.200.29.1 thru 154.200.29.254 0001 1101
154.200.30.1 thru 154.200.30.254 0001 1110
154.200.31.1 thru 154.200.31.254 0001 1111



154.200.32.0 0010 0000


Notice that when the third octect changed to 32 (00100000), the NETWORK portion of the IP address no longer matches EXACTLY with those listed above (00010000). When this happens, a new NETWORK begins.



Oh, also if you had only borrowed 3 bits from the third octect insead of 4...

11111111.11111111.11100000.00000000 (Binary)

255. 255. 224. 0 (Decimal)

Then the RIGHTmost bit borrowed would hold the value of 32 and the NETWORK would change every 32 in the same fashion as described above.


I hope this makes sense...

Patty [ponytails2]
 
Patty.....you couldn't of said it better. I understand now how this works, and now that i do i find it very simple.. When u figure it out it feels like..."Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.......I seeee"



Thanx Patty Thanks, PAUL

 
Paul,

I felt the same way when the 'light' finally went on for me. I couldn't believe how easy it really was!

Patty [ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top