The Magic of Subnetting

Thetech

Senior member
Mar 12, 2005
571
0
0

I've tried to learn the "Magic" of subnetting but I can't figure out how to
calculate everything.

when asked which I.P. Addresses are valid for the /27 subnet, I have no clue
what to do?


Thanks in advance.
 

Jeff7181

Lifer
Aug 21, 2002
18,368
11
81
A subnet mask tells you which portion of the IP address is the network address and which portion is the client address.

Take the network address 192.168.1.0 for example

It's a class C address, so it can be written 192.168.1.0/24 or 192.168.1.0 and then you specify a subnet mask of 255.255.255.0

The /24 is how many bits (starting from the left) are used for the network portion.

A subnet mask is actually binary...

11111111.11111111.11111111.00000000 = 255.255.255.0 = /24

Lets say you want to subnet that... split it into two networks... you need to borrow bits from the client portion...

11111111.11111111.11111111.10000000 = 255.255.255.128 = /25

Now one of your network addresses is 192.168.1.0/25 and the client range is 192.168.1.1 - 192.168.1.126 (192.168.1.127 becomes the broadcast address for that network)

Your second network address is 192.168.1.128/25 and the client range is 192.168.1.129 - 192.168.1.254 (192.168.1.255 is the broadcast address)

Hope that helps.

*EDIT*
To add a little more info...

You can use a simple formula to calculate subnets...

2^n-2=X where n = the number of bits you borrow from the client portion of the mask and X >= the total number of subnets that will be provided

So if you have a class A address, 10.0.0.0/8 and you want to divide it into at least 10 subnets...

2^n-2 >= 10 (solve for n)

n = 4

So your first network address now becomes 10.0.0.0/12 which can be also written as 10.0.0.0 with a subnet mask of 255.240.0.0

Your second network address will be 10.15.0.0/12
We get that by looking at the second octet (because this is a class A address so we're borrowing bits from the second octet)... 11110000
If we invert that, we get 00001111 which happens to be 15
The third network address will be 10.30.0.0/12
And the forth... 10.45.0.0/12

So...

Network Address * Subnet Mask * Client Range * Broadcast address
10.0.0.0/12 * 255.240.0.0 * 10.0.0.1-10.14.255.254 * 10.14.255.255
10.15.0.0/12 * 255.240.0.0 * 10.15.0.1-10.29.255.254 * 10.29.255.255
10.30.0.0/12 * 255.240.0.0 * 10.30.0.1-10.44.255.254 * 10.44.255.255

etc. etc.


**EDIT**

One more thing... if you want to know how many clients are in each subnet, use the forumula 2^y-2 where y = the total number of bits used for the client portion of the address. So using the above example...

2^20-2 = 1048574
 

drebo

Diamond Member
Feb 24, 2006
7,034
1
81
Next you get to learn IPv6 addressing and subnetting! Woo!

FD00:1000:1:1::1/64 is a different network than FD00:1000:1:2::1/64.

How fun is that?

IPv6 was designed by the devil.
 

Jeff7181

Lifer
Aug 21, 2002
18,368
11
81
Originally posted by: drebo
Next you get to learn IPv6 addressing and subnetting! Woo!

FD00:1000:1:1::1/64 is a different network than FD00:1000:1:2::1/64.

How fun is that?

IPv6 was designed by the devil.

I was told if you ignore it, it will go away. That's not true?
 

mcmilljb

Platinum Member
May 17, 2005
2,144
2
81
Originally posted by: drebo
Next you get to learn IPv6 addressing and subnetting! Woo!

FD00:1000:1:1::1/64 is a different network than FD00:1000:1:2::1/64.

How fun is that?

IPv6 was designed by the devil.

It wasn't designed by the devil. The people who get trailing 0's intead of leading 0's just get screwed I also like the built-in IP Sec and the new headers.
 

Thetech

Senior member
Mar 12, 2005
571
0
0
Originally posted by: Jeff7181
A subnet mask tells you which portion of the IP address is the network address and which portion is the client address.

Take the network address 192.168.1.0 for example

It's a class C address, so it can be written 192.168.1.0/24 or 192.168.1.0 and then you specify a subnet mask of 255.255.255.0

The /24 is how many bits (starting from the left) are used for the network portion.

A subnet mask is actually binary...

11111111.11111111.11111111.00000000 = 255.255.255.0 = /24

Lets say you want to subnet that... split it into two networks... you need to borrow bits from the client portion...

11111111.11111111.11111111.10000000 = 255.255.255.128 = /25

Now one of your network addresses is 192.168.1.0/25 and the client range is 192.168.1.1 - 192.168.1.126 (192.168.1.127 becomes the broadcast address for that network)

Your second network address is 192.168.1.128/25 and the client range is 192.168.1.129 - 192.168.1.254 (192.168.1.255 is the broadcast address)

Hope that helps.

*EDIT*
To add a little more info...

You can use a simple formula to calculate subnets...

2^n-2=X where n = the number of bits you borrow from the client portion of the mask and X >= the total number of subnets that will be provided

So if you have a class A address, 10.0.0.0/8 and you want to divide it into at least 10 subnets...

2^n-2 >= 10 (solve for n)

n = 4

So your first network address now becomes 10.0.0.0/12 which can be also written as 10.0.0.0 with a subnet mask of 255.240.0.0

Your second network address will be 10.15.0.0/12
We get that by looking at the second octet (because this is a class A address so we're borrowing bits from the second octet)... 11110000
If we invert that, we get 00001111 which happens to be 15
The third network address will be 10.30.0.0/12
And the forth... 10.45.0.0/12

So...

Network Address * Subnet Mask * Client Range * Broadcast address
10.0.0.0/12 * 255.240.0.0 * 10.0.0.1-10.14.255.254 * 10.14.255.255
10.15.0.0/12 * 255.240.0.0 * 10.15.0.1-10.29.255.254 * 10.29.255.255
10.30.0.0/12 * 255.240.0.0 * 10.30.0.1-10.44.255.254 * 10.44.255.255

etc. etc.


**EDIT**

One more thing... if you want to know how many clients are in each subnet, use the forumula 2^y-2 where y = the total number of bits used for the client portion of the address. So using the above example...

2^20-2 = 1048574



Cool, thx a lot.

 

Antoneo

Diamond Member
May 25, 2001
3,911
0
0
For a fantastic presentation of subnetting and TCP/IP networking in general, I highly recommend tcpipguide.com. That site is both a great pathway and reference to the topic.
 

regbreeze

Junior Member
May 16, 2010
2
0
0
So if I have 10.0.0.0 and i want a subnet mask for 2048 subnets, i do 2^12=4096-2=4094.
Default Subnet mask for a class A address is 11111111.00000000.00000000.00000000 plus the 12 bits I need to borrow, so thats 11111111.11111111.11110000.00000000 which is 255.255.240.0
Can someone confirm?
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
So if I have 10.0.0.0 and i want a subnet mask for 2048 subnets, i do 2^12=4096-2=4094.
Default Subnet mask for a class A address is 11111111.00000000.00000000.00000000 plus the 12 bits I need to borrow, so thats 11111111.11111111.11110000.00000000 which is 255.255.240.0
Can someone confirm?

Using the subnet Calculator I linked to, yes, that is correct.
 

jackace

Golden Member
Oct 6, 2004
1,307
0
0
Your second network address will be 10.15.0.0/12
We get that by looking at the second octet (because this is a class A address so we're borrowing bits from the second octet)... 11110000
If we invert that, we get 00001111 which happens to be 15
The third network address will be 10.30.0.0/12
And the forth... 10.45.0.0/12

So...

Network Address * Subnet Mask * Client Range * Broadcast address
10.0.0.0/12 * 255.240.0.0 * 10.0.0.1-10.14.255.254 * 10.14.255.255
10.15.0.0/12 * 255.240.0.0 * 10.15.0.1-10.29.255.254 * 10.29.255.255
10.30.0.0/12 * 255.240.0.0 * 10.30.0.1-10.44.255.254 * 10.44.255.255

etc. etc.

Great post and some good help for OP, but I think you meant 16 instead of 15 for your block size.

So Network addresses would be:

10.0.0.0/12
10.16.0.0/12
10.32.0.0/12
etc

Edit - for those of you looking for an easy method for doing subnets in your head (for a certification exam or something) here is a link to a great method.

http://www.techexams.net/forums/ccna-ccent/38772-subnetting-made-easy.html
 
Last edited:

EnzoLT

Golden Member
Jul 18, 2005
1,843
4
91
A subnet mask tells you which portion of the IP address is the network address and which portion is the client address.

Take the network address 192.168.1.0 for example

It's a class C address, so it can be written 192.168.1.0/24 or 192.168.1.0 and then you specify a subnet mask of 255.255.255.0

The /24 is how many bits (starting from the left) are used for the network portion.

A subnet mask is actually binary...

11111111.11111111.11111111.00000000 = 255.255.255.0 = /24

Lets say you want to subnet that... split it into two networks... you need to borrow bits from the client portion...

11111111.11111111.11111111.10000000 = 255.255.255.128 = /25

Now one of your network addresses is 192.168.1.0/25 and the client range is 192.168.1.1 - 192.168.1.126 (192.168.1.127 becomes the broadcast address for that network)

Your second network address is 192.168.1.128/25 and the client range is 192.168.1.129 - 192.168.1.254 (192.168.1.255 is the broadcast address)

Hope that helps.

*EDIT*
To add a little more info...

You can use a simple formula to calculate subnets...

2^n-2=X where n = the number of bits you borrow from the client portion of the mask and X >= the total number of subnets that will be provided

So if you have a class A address, 10.0.0.0/8 and you want to divide it into at least 10 subnets...

2^n-2 >= 10 (solve for n)

n = 4

So your first network address now becomes 10.0.0.0/12 which can be also written as 10.0.0.0 with a subnet mask of 255.240.0.0

Your second network address will be 10.15.0.0/12
We get that by looking at the second octet (because this is a class A address so we're borrowing bits from the second octet)... 11110000
If we invert that, we get 00001111 which happens to be 15
The third network address will be 10.30.0.0/12
And the forth... 10.45.0.0/12

So...

Network Address * Subnet Mask * Client Range * Broadcast address
10.0.0.0/12 * 255.240.0.0 * 10.0.0.1-10.14.255.254 * 10.14.255.255
10.15.0.0/12 * 255.240.0.0 * 10.15.0.1-10.29.255.254 * 10.29.255.255
10.30.0.0/12 * 255.240.0.0 * 10.30.0.1-10.44.255.254 * 10.44.255.255

etc. etc.


**EDIT**

One more thing... if you want to know how many clients are in each subnet, use the forumula 2^y-2 where y = the total number of bits used for the client portion of the address. So using the above example...

2^20-2 = 1048574

oh man, I had to read it twice to understand it. i guess you learn something new everyday. thanks!

wish AT had a REP system.
 

airdata

Diamond Member
Jul 11, 2010
4,987
0
0
when asked which I.P. Addresses are valid for the /27 subnet, I have no clue
what to do?



Thanks in advance.

One trick I learned is this... If that is for a class c address w\ default /24 mask, than you can easily find the ranges.

11111111.11111111.11111111.11100000 = /27 and we really only care about the last octet here.

128.64.32.16.8.4.2.1

You take the lowest bit value of the borrowed bits ( 3rd octet ) which is 32. So, 32 is your subnet increment. (magic number... or whatever you want to call it )

0-31
32-63
64-95
96-127
128-159
160-191
192-223
224-255

So, if you can remember that trick, you can quickly break down the available subnets and see where the address belongs or if it's valid.

With subnetting, I recommend finding a couple different sources for learning because sometimes it can take a bit to really sink in.
 

her209

No Lifer
Oct 11, 2000
56,336
11
0
Here's a tip to subnetting without having to convert to binary and back.

Memorize: 0 (00000000), 128 (10000000), 192 (11000000), 224 (11100000), 240 (11110000), 248 (11111000), 252 (11111100), 254 (11111110), 255 (11111111)

Note: I underlined 240 because its in the middle, i.e., has four 1's and four 0's.

Since you were given the subnet mask in slash notation notation, you'll have to convert that into decimal, which is 255.255.255.224.

Since the last octet is the one of interest, i.e., not 255, take the difference of that number and 256, or 256-224=32.

This tells you that the subnetworks go up every 32.

For example, say you were given the IP address with subnet mask: 192.168.1.0 /27

The subnetworks are:
192.168.1.0
192.168.1.32
192.168.1.64
192.168.1.96
192.168.1.128
192.168.1.160
192.168.1.192
192.168.1.224

You can double check to make sure its right because 2^3=8 subnets.
 
Last edited:

Emulex

Diamond Member
Jan 28, 2001
9,759
1
71
boolean math is fun. use bit shifting to multiply and divide in low power mcu's that do not have fast division hardware.

if you look at 255 in binary , a left shift moves the ones over; specifically a left shift Without carrying the leftmost 1 back around to the rightmost position (an option).

two's complement is used in such low tech equipment as a method of verifying the integrity of the ram/rom when error correction does not exist.

Fun stuff
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |