Networking

IP subnetting made easy

George Ou explains IP subnetting using his own graphical approach. It's a great primer for students and a nice refresher for others.

IP subnetting is a fundamental subject that's critical for any IP network engineer to understand, yet students have traditionally had a difficult time grasping it. Over the years, I've watched students needlessly struggle through school and in practice when dealing with subnetting because it was never explained to them in an easy-to-understand way. I've helped countless individuals learn what subnetting is all about using my own graphical approach and calculator shortcuts, and I've put all that experience into this article.

IP addresses and subnets

Although IP stands for Internet Protocol, it's a communications protocol used from the smallest private network to the massive global Internet. An IP address is a unique identifier given to a single device on an IP network. The IP address consists of a 32-bit number that ranges from 0 to 4294967295. This means that theoretically, the Internet can contain approximately 4.3 billion unique objects. But to make such a large address block easier to handle, it was chopped up into four 8-bit numbers, or "octets," separated by a period. Instead of 32 binary base-2 digits, which would be too long to read, it's converted to four base-256 digits. Octets are made up of numbers ranging from 0 to 255. The numbers below show how IP addresses increment.

0.0.0.0

0.0.0.1

...increment 252 hosts...

0.0.0.254

0.0.0.255

0.0.1.0

0.0.1.1

...increment 252 hosts...

0.0.1.254

0.0.1.255

0.0.2.0

0.0.2.1

...increment 4+ billion hosts...

255.255.255.255

The word subnet is short for sub network--a smaller network within a larger one. The smallest subnet that has no more subdivisions within it is considered a single "broadcast domain," which directly correlates to a single LAN (local area network) segment on an Ethernet switch. The broadcast domain serves an important function because this is where devices on a network communicate directly with each other's MAC addresses, which don't route across multiple subnets, let alone the entire Internet. MAC address communications are limited to a smaller network because they rely on ARP broadcasting to find their way around, and broadcasting can be scaled only so much before the amount of broadcast traffic brings down the entire network with sheer broadcast noise. For this reason, the most common smallest subnet is 8 bits, or precisely a single octet, although it can be smaller or slightly larger.

Subnets have a beginning and an ending, and the beginning number is always even and the ending number is always odd. The beginning number is the "Network ID" and the ending number is the "Broadcast ID." You're not allowed to use these numbers because they both have special meaning with special purposes. The Network ID is the official designation for a particular subnet, and the ending number is the broadcast address that every device on a subnet listens to. Anytime you want to refer to a subnet, you point to its Network ID and its subnet mask, which defines its size. Anytime you want to send data to everyone on the subnet (such as a multicast), you send it to the Broadcast ID. Later in this article, I'll show you an easy mathematical and graphical way to determine the Network and Broadcast IDs.

The graphical subnet ruler

Over the years, as I watched people struggle with the subject of IP subnetting, I wanted a better way to teach the subject. I soon realized that many students in IT lacked the necessary background in mathematics and had a hard time with the concept of binary numbers. To help close this gap, I came up with the graphical method of illustrating subnets shown in Figure A. In this example, we're looking at a range of IP addresses from 10.0.0.0 up to 10.0.32.0. Note that the ending IP of 10.0.32.0 itself is actually the beginning of the next subnet. This network range ends at the number right before it, which is 10.0.31.255.

Figure A

Note that for every bit increase, the size of the subnet doubles in length, along with the number of hosts. The smallest tick mark represents 8 bits, which contains a subnet with 256 hosts--but since you can't use the first and last IP addresses, there are actually only 254 usable hosts on the network. The easiest way to compute how many usable hosts are in a subnet is to raise 2 to the power of the bit size minus 2. Go up to 9 bits ,and we're up to 510 usable hosts, because 2 to the 9th is 512, and we don't count the beginning and ending. Keep on going all the way up to 13 bits, and we're up to 8,190 usable hosts for the entire ruler shown above.

Learning to properly chop subnets

Subnets can be subdivided into smaller subnets and even smaller ones still. The most important thing to know about chopping up a network is that you can't arbitrarily pick the beginning and ending. The chopping must be along clean binary divisions. The best way to learn this is to look at my subnet ruler and see what's a valid subnet. In Figure B, green subnets are valid and red subnets are not.

Figure B

The ruler was constructed like any other ruler, where we mark it down the middle and bisect it. Then, we bisect the remaining sections and with shrinking markers every time we start a new round of bisecting. In the sample above, there were five rounds of bisections. If you look carefully at the edge of any valid (green) subnet blocks, you'll notice that none of the markers contained within the subnet is higher than the edge's markers. There is a mathematical reason for this, which we'll illustrate later, but seeing it graphically will make the math easier to understand.

The role of the subnet mask

The subnet mask plays a crucial role in defining the size of a subnet. Take a look at Figure C. Notice the pattern and pay special attention to the numbers in red. Whenever you're dealing with subnets, it will come in handy to remember eight special numbers that reoccur when dealing with subnet masks. They are 255, 254, 252, 248, 240, 224, 192, and 128. You'll see these numbers over and over again in IP networking, and memorizing them will make your life much easier.

Figure C

I've included three class sizes. You'll see the first two classes, with host bit length from 0 to 16, most often. It's common for DSL and T1 IP blocks to be in the 0- to 8-bit range. Private networks typically work in the 8- to 24-bit range.

Note how the binary mask has all those zeros growing from right to left. The subnet mask in binary form always has all ones to the left and all zeros to the right. The number of zeros is identical to the subnet length. I showed only the portion of the binary subnet in the octet that's interesting, since all octets to the right consist of zeros and all octets to the left consist of ones. So if we look at the subnet mask where the subnet length is 11 bits long, the full binary subnet mask is 11111111.11111111.11111000.00000000. As you can see under mask octet, the subnet mask transitions from 1 to 0 in the third octet. The particular binary subnet mask translates directly to base-256 form as 255.255.248.0.

The "mask" in subnet mask

The subnet mask not only determines the size of a subnet, but it can also help you pinpoint where the end points on the subnet are if you're given any IP address within that subnet. The reason it's called a subnet "mask" is that it literally masks out the host bits and leaves only the Network ID that begins the subnet. Once you know the beginning of the subnet and how big it is, you can determine the end of the subnet, which is the Broadcast ID.

To calculate the Network ID, you simply take any IP address within that subnet and run the AND operator on the subnet mask. Let's take an IP address of 10.20.237.15 and a subnet mask of 255.255.248.0. Note that this can be and often is written in shorthand as 10.20.237.15/21 because the subnet mask length is 21. Figure D and Figure E show the Decimal and Binary versions of the AND operation.

Figure D
Decimal math

Figure E
Binary math

The binary version shows how the 0s act as a mask on the IP address on top. Inside the masking box, the 0s convert all numbers on top into zeros, no matter what the number is. When you take the resultant binary Network ID and convert it to decimal, you get 10.20.232.0 as the Network ID. One thing that's always bothered me about the way subnetting is taught is that students are not shown a simple trick to bypass the need for binary conversions when doing AND operations. I even see IT people in the field using this slow and cumbersome technique to convert everything to binary, run the AND operation, and then convert back to decimal using the Windows Calculator. But there's a really simple shortcut using the Windows Calculator, since the AND operator works directly on decimal numbers. Simply punch in 237, hit the AND operator, and then 248 and [Enter] to instantly get 232, as shown in Figure F. I'll never understand why this isn't explained to students, because it makes mask calculations a lot easier.

Figure F

Since there are 11 zeros in the subnet mask, the subnet is 11 bits long. This means there are 2^11, or 2,048, maximum hosts in the subnet and the last IP in this subnet is 10.20.239.255. You could compute this quickly by seeing there are three zeros in the third octet, which means the third octet of the IP address can have a variance of 2^3, or 8. So the next subnet starts at 10.20.232+8.0, which is 10.20.240.0. If we decrease that by 1, we have 10.20.239.255, which is where this subnet ends. To help you visualize this, Figure G shows it on my subnet ruler.

Figure G

IP classes made simple

For an arbitrary classification of IP subnets, the creators of the Internet chose to break the Internet into multiple classes. Note that these aren't important as far as your subnet calculations are concerned; this is just how the Internet is "laid out." The Internet is laid out as Class A, B, C, D, and E. Class A uses up the first half of the entire Internet, Class B uses half of the remaining half, Class C uses the remaining half again, Class D (Multicasting) uses up the remaining half again, and whatever is left over is reserved for Class E. I've had students tell me that they struggled with the memorization of IP classes for weeks until they saw this simple table shown in Figure H. This is because you don't actually need to memorize anything, you just learn the technique for constructing the ruler using half of what's available.

Figure H

Remember that all subnets start with EVEN numbers and all subnet endings are ODD. Note that 0.0.0.0/8 (0.0.0.0 to 0.255.255.255) isn't used and 127.0.0.0/8 (127.0.0.0 to 127.255.255.255) is reserved for loopback addresses.

All Class A addresses have their first octet between 1 to 126 because 0 and 127 are reserved. Class A subnets are all 24 bits long, which means the subnet mask is only 8 bits long. For example, we have the entire 3.0.0.0/8 subnet owned by GE, since GE was lucky enough to get in early to be assigned 16.8 million addresses. The U.S. Army owns 6.0.0.0/8. Level 3 Communications owns 8.0.0.0/8. IBM owns 9.0.0.0/8. AT&T owns 12.0.0.0/8. Xerox owns 13.0.0.0/8. HP owns 15.0.0.0/8 and 16.0.0.0/8. Apple owns 17.0.0.0/8.

All Class B addresses have their first octet between 128 and 191. Class B subnets are all 16 bits long, which means the subnet masks are 16 bits long. For example, BBN Communications owns 128.1.0.0/16, which is 128.1.0.0 to 128.1.255.255. Carnegie Mellon University owns 128.2.0.0/16.

All Class C addresses have their first octet between 192 and 223. Class C subnets are all 8 bits long, so the subnet mask is only 24 bits long. Note that ARIN (the organization that assigns Internet addresses) will sell blocks of four Class C addresses only to individual companies and you have to really justify why you need 1,024 Public IP addresses. If you need to run BGP so you can use multiple ISPs for redundancy, you have to have your own block of IP addresses. Also note that this isn't the old days, where blocks of 16.8 million Class A addresses were handed out for basically nothing. You have to pay an annual fee for your block of 1,024 addresses with a subnet mask of /22, or 255.255.252.0.

The concept of subnet classes can cause harm in actual practice. I've actually seen people forget to turn classes off in their old Cisco router and watch large subnet routes get hijacked on a large WAN configured for dynamic routing whenever some routes were added. This is because a Cisco router will assume the subnet mask is the full /8 or /16 or /24 even if you define something in between. All newer Cisco IOS software versions turn off the concept of subnet classes and uses classless routing by default. This is done with the default command "IP Classless."

Public versus private IP addresses

Besides the reserved IP addresses (0.0.0.0/8 and 127.0.0.0/8) mentioned above, there are other addresses not used on the public Internet. These private subnets consist of private IP addresses and are usually behind a firewall or router that performs NAT (network address translation). NAT is needed because private IP addresses are nonroutable on the public Internet, so they must be translated into public IP addresses before they touch the Internet. Private IPs are never routed because no one really owns them. And since anyone can use them, there's no right place to point a private IP address to on the public Internet. Private IP addresses are used in most LAN and WAN environments, unless you're lucky enough to own a Class A or at least a Class B block of addresses, in which case you might have enough IPs to assign internal and external IP addresses.

The following blocks of IP addresses are allocated for private networks:

  • 10.0.0.0/8  (10.0.0.0 to 10.255.255.255)
  • 172.16.0.0/12  (172.16.0.0 to 172.31.255.255)
  • 192.168.0.0/16  (192.168.0.0 to 192.168.255.255)
  • 169.254.0.0/16  (169.254.0.0 to 169.254.255.255)*

*Note that 169.254.0.0/16 is a block of private IP addresses used for random self IP assignment where DHCP servers are not available.

10.0.0.0/8 is normally used for larger networks, since there are approximately 16.8 million IP addresses available within that block. They chop it up into lots of smaller groups of subnets for each geographic location, which are then subdivided into even smaller subnets. Smaller companies typically use the 172.16.0.0/12 range, chopped up into smaller subnets, although there's no reason they can't use 10.0.0.0/8 if they want to. Home networks typically use a /24 subnet within the 192.168.0.0/16 subnet.

The use of private IP addresses and NAT has prolonged the life of IPv4 for the foreseeable future because it effectively allows a single public IP address to represent thousands of private IP addresses. At the current rate that IPv4 addresses are handed out, we have enough IPv4 addresses for approximately 17 years. ARIN is much more stingy now about handing them out, and small blocks of IP addresses are relatively expensive compared to the old days, when companies like Apple were simply handed a block of 16.8 million addresses. The next version of IP addresses, called IPv6, is 128 bits long--and there are more than 79 thousand trillion trillion times more IP addresses than IPv4. Even if you assigned 4.3 billion people on the planet with 4.3 billion IP addresses each, you would still have more than 18 million trillion IPv6 addresses left!

Related:

45 comments
ap.shuaib
ap.shuaib

Superb. Previously I had a doubt of subnetting with ClassB and ClassA. This article Helped me to figure out the mistake I did and helped me to Understand it in a better way

Darren B - KC
Darren B - KC

IP subnetting has always been excruciatingly confusing for me... but this article, even after reading through it for the third time, has made the concept of subnetting even MORE confusing than ever! OMG!! :(

wangning100
wangning100

Everytime I studied IP subbneting.I feel I know how to do it ,but I always forget the methods somedays later.

rbees
rbees

Can this be made into a pdf download. I don't need the info often but it sure would be nice to have it stored for offline access.

Photogenic Memory
Photogenic Memory

Plain and simple; I don't know where to begin to explain my confusion. Let me start. I understand what subnetting is and does. Subnetting defines what's network and host on network block of ip's. My confusion lies in having problems calculating them. Yes, there is the binary method of ANDing. There's also the CIDR method is seems a bit easier on the brain and faster too. Math makes me anxious. No lie. I can balance my check book down to the last cent but this stuff seems overly complicated, yes? Why is it everyone has a different way of solving the calculations and further complicating matters with shortcuts. I would love to learn this coveted networking concept and add it to my skill base. Any recommendation on easier ways to calculate networks than the above article? The author means well and the article is a nice primer for general understanding. But, it's still confusing and I don't know why? I think that bothers me the most. Any response would be appreciated.

chris_thamm
chris_thamm

I often get graduating IT students asking me if I need another tech for my consulting business. After having gone through several graduates whose skills were sorely lacking, I now just ask anyone who inquires to explain IP subnetting. If they can explain it correctly, they get an interview. If I had to guess, I'd say about 1 in 50 are able to do so, and that helps me quickly weed out unsuitable candidates.

prasadjain1
prasadjain1

This article is very useful.Every network Engineer must read this article and clear all his confusions

johan.erasmus
johan.erasmus

A base 2 number consists of 2 digits 0 and 1 A base 8 number consists of 8 digits 0..7 A base 10 (decimal) number consists of 10 digits 0..9 A base 16 (hex) number consists of 16 digists 0..F Thus a base 256 number must have 256 unique digits, therefore this a decimal number!

JimTeach
JimTeach

I have been doing subnetting for a long time and I have taught it for seven years to various levels of students. I have seen a lot of tricks on how to do subnetting. Each requires memorizing a table, chart, etc. As tperkins said above, the easiest I have found is in the CCNA study guide. To Me, knowing binary is the easiest. Everyone knows 2^2=4. You can make the binary table from that. Usually, I show my students 2 or three ways and they try them. Eventually, the majority drops back to binary because it is easier to remember than all of the tables and charts. They also start to do the calculations in their head. There are a lot of good tricks in this article. I use a lot of them such as, the network ID is always even, the broadcast is always odd, memorize the subnetmask values, 252, 248, etc, each subnet size must be a value of binary. I use a pie cut in half, then quarters,then eighths, etc to graphically show subnet sizes and boundaries. The students seem to get it. I also use the pie when teaching VLSM. What is amazing however, is when we do VLSM, CIDR, and route summarization, several months after we do subnetting, all of the students that even try, finally learn how to subnet. I think it just takes time to sink in, just like any new material we learn. Then, repetition, repetition, repetition.

bkrateku
bkrateku

I may have missed it, but while you mentioned the concept of CIDR, I didn't see it mentioned. Forgive me if I overlooked it, but I was just curious why it wasn't mentioned.

The DOBC
The DOBC

Since IP addresses are so valuable, why not force many of the old class A's to justify or give back their big subnets? I can see A.T.& T. needing a class A since they are an ISP, but does HP or IBM really need that many addresses? I would guess that over half of them couldn't justify needing them anymore. With NAT, does any company besides an ISP need more than 1024 public addresses? Even 512? 256?

Craig_B
Craig_B

[I just tried posting and I rcvd an error so I will try again]. The cool ip calculator is the best IPv4 subnet calculator that I have seen. Simply enter an ip address, then move the slider and look at the subnet info below. I have used it for years. http://www.novell.com/communities/node/559/cool+ip+calculator

compguy
compguy

"Instead of 32 binary base-2 digits, which would be too long to read, it?s converted to four base-256 digits." Um... no. It's actually converted to four 8-bit octets, which is what you said in the prior sentence. What you're trying to say is that "The value of each octet is written as a base 10 number ranging from 0 to 255."

SKDTech
SKDTech

I have recent first hand knowledge of the ignorance of many young folk these days when it comes to the mathematics of networking. I am somewhat gifted in having the ability to subnet in my head. But for me it comes as much from having to learn binary, octal and hexadecimal when I was attending electronics school in the Navy as natural ability with mathematics. When I was attending CCNA prep classes most of the folk in the class had continued difficulty figuring out subnetting, with a couple floaters never even trying.

Ferris86d
Ferris86d

This article did help me with my understanding of subnetting, but some parts of it confused me. The way our instructors are teaching it have made it understandable for me. Everyone understands things their own way. I draw from a lot of different sources.

jmarkovic32
jmarkovic32

Everyone sees things differently. No way of seeing something is the de facto method. Do what works for you. I have my own method that works and that's what I use.

georgeou
georgeou

It's for registered users, but registration on TechRepublic is free.

georgeou
georgeou

Lets say you want to find the Network ID for host address 10.2.4.143 with a subnet mask of 255.255.255.252. You simply open up calc.exe. Type in 143, click the "AND" button, then type in 252. The result is 140. That means 10.2.4.140 is the Network ID of the subnet. Where is the binary conversion? We only put in the binary conversion as an explanation of how this works at a deeper level, but it is not necessary for routine operation.

JimTeach
JimTeach

An excellent phone interview question. Techs that understand subnetting, and I would add route summarization, usually have a very good understanding of networking. I have worked with a lot of techs that did not understand how and why a network is subnetted, but were good equipment configurators, simple troubleshooters, etc. In class we say subnetting is the difference between a tech and an Engineer.

georgeou
georgeou

It's thirty-two base-2 digits or four base-256 digits. Here is an IP written with thirty-two base-2 digits. 11111111 11111111 11111111 11111111 Note how there are 32 digits in the number above, each digit is a base-2 digit. Here is an IP written with four base-2 digits. Decimal representation - 255.255.255.255 Hex representation - FF.FF.FF.FF Note how there are 4 digits in the two examples above separated by the PERIOD character. Now some people get tripped up by me calling this base-256 because I'm using decimal or hex characters to represent the number, but they need need to look beyond the cosmetics of what characters I use to represent a base-256 number. There's no formal characters for anything beyond base-16, so I have to use something else to represent it. I realize this is getting into some harry mathematics, but you really do need to understand how numbers in different bases work if you really want to understand how subnetting works.

don
don

"Thus a base 256 number must have 256 unique digits" Your right here, "therefore this a decimal number!" your wrong here. You already said it, a decimal number has 10 digits (0-9), the range of addresses is not 0-999, it's 0-255. The base 256 does have 256 unique "digits" (where 255 is a digit, not hundreds, tens and ones). The numbers shown are referred as dot-decimal notation, which is just easier for us to write and read. Do a little internet research on base 256 and you'll find a better explanation than what I can give here.

wnfaknd
wnfaknd

They have subnet calculators on the app store for the iphone. Some are free and they work pretty well. I use subnetCalc.

Duluth Networker
Duluth Networker

I'm aware of several colleges/universities that still have full Class B public addresses, and they're not firewalled or using NAT in any way. Everyone gets a routable public address. What a waste.

IT_Juggler
IT_Juggler

I worked on a contract once with a guy that claimed to have a class A subnet that he registered (for free) back in the early 90's when they handed them out like candy. Of course, that claim has all of the validity of a high school locker room dating tale, but it could be true. It does lead one to question the wisdom of jumping to TCP IPv6 when there could be a lot of Class A waste in IPv4.

david.g.white
david.g.white

Any large corportae that hosts its own WEB server farm will want to utilise multiple ISP connection to ensure 'true' resilience. ISPs generally require a minimum mask size to be used before they will include your own IP space in their advertisements to their peers. However I agree with your general comment in that I don't think too many such organisations do exist.

TheProfessorDan
TheProfessorDan

I just installed that and I like that. I teach a class at a technical school in Baltimore and I will suggest that to my students.

JimTeach
JimTeach

I don't let my students use a calculator because a calculator cannot be used during the CCENT or CCNA certification exams. Testers need to be able to calculate the addresses. On the job of course, using a calculator is perfect to check your calculations.

IT_Juggler
IT_Juggler

Nice. The installer's a bit long in the tooth, but it runs fine on Win7 x64. I'll be adding this to my repertoire. Thanks!

CodeCurmudgeon
CodeCurmudgeon

Wouldn't the whole thing have been a lot easier and less confusing if they had just used 8 hex digits, instead of representing 32 bits as four decimal numbers between 0 and 255? The easy translation of hex to binary would have made the binary patterns a whole lot more obvious.

elnRTanalog
elnRTanalog

Um... well really the four 8-bit octets are four base-256 numbers that are written as four base-10 numbers ranging from 0 to 255. So "Instead of 32 binary base-2 digits, which would be too long to read, it?s converted to four base-256 digits." would be correct if followed by "The base-256 digits are always written as base-10 numbers ranging from 0 to 255."

cousintroy
cousintroy

I think once you get subnetting down its just like riding a bike...sometimes you fall but you will always know. I personally love the approach that I learned from reading the CCENT/CCNA study guides from Ciscopress that showed a easy way to subnet that has helped me nail it every time.

dpicollege
dpicollege

hi thanks about your replay i wanna now what's your method and why do Subnetting and how can find how-many sub network we need for break network range could u explain me more thanks alot my email address is dpicollege@yahoo.com

AdamB29
AdamB29

I've used a manual calculator on all of my cert tests. It's easy to make and works everytime. And the only thing you have to memorize is how to make the calculator. There are no numbers or tricks to remember. Start with a sheet of paper, starting from the right side, write a 1. Then going towards the left, double that number till you get to 128 (this row is your 8 bits): 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 Now, on TOP of that row, starting from the left side, write 128. Then going towards the right, add the number below on the next row to your number (128 + 64 = 192) till you get to the end of the row with 255 (this row is your subnet mask): 128 | 192 | 224 | 240 | 248 | 252 | 254 | 255 128 | 064 | 032 | 016 | 008 | 004 | 002 | 001 (I had to add 0's to the number in order to make everything line up correctly in the post. normally you would just write 2, not 002) Now, how do you use this calculator? IP address of 192.168.10.187 Subnet mask of 255.255.255.224 Questions on this data are numerous, so we will start with, how many hosts and how many networks can be on this subnet? First, input your bits (the .187. we are not concerned with the others as their octets are full, as signified by the 255.255.255. we are only concerned with the one ocetet we can manipulate, the 4th one). This number only breaks down 1 way in this calculator (remember to use the bits line, line #2 to do this). What we end up with is a bit (using an II for a marker) below the following numbers, 128, 32, 16, 8, 2, 1 (add these numbers up and you get 187, you can not get 187 from any other combination of bits in this calculator, there is only 1 way to write out any octect) 128 | 192 | 224 | 240 | 248 | 252 | 254 | 255 128 | 064 | 032 | 016 | 008 | 004 | 002 | 001 _II_ | ___ | _II_ | _II_ | _II_ | ___ | _II_ | _II_ Next, draw a line to the right of the subnet mask number from your problem (in this case 224, indicated by the slash in this instance as I don't have a piece of paper to demonstrate this on for you) 128 | 192 | 224 / 240 | 248 | 252 | 254 | 255 128 | 064 | 032 / 016 | 008 | 004 | 002 | 001 _II_ | ___ | _II_ / _II_ | _II_ | ___ | _II_ | _II_ On the left side of our line are our networks, on the right side of the line are our hosts. In bit form, .187 is host 27 on network 160 (add the bits together for each side of the line) 27 = 16 +8 +2 +1 160 = 128 +32 So, by looking above we can answer several questions: Q. How many networks are available on this subnet? A. We have 3 unmasked network bits (3 bits to the left of the line)(2 to the power of unmasked bits -2). 2^3 = 8, -2 = 6 Q. How many hosts are available on this subnet? A. We have 5 unmasked host bits (5 bits to the right of the line)(2 to the power of unmasked bits -2). 2^5 = 32, -2 = 30 Q. Why can't a host with an address of 192.168.10.198 communicate with our original host of .187? A. They are on different networks. Plot out your .198 host on the calculator (I'll use "II" for our .187 host and "00" for our .198 host, don't forget to draw your line down the sheet of paper to the right of your subnet mask) 128 | 192 | 224 / 240 | 248 | 252 | 254 | 255 128 | 064 | 032 / 016 | 008 | 004 | 002 | 001 _II_ | ___ | _II_ / _II_ | _II_ | ___ | _II_ | _II_ 00_ | 00_ | ___ / ___ | ___ | 00_ | 00_ | ___ As you can see from the calculator above, the .187 host in bit form is host 27 on network 160. The .198 host in bit form is host 6 on network 192. The reason they can't talk is because they are on different networks (you can just glance at the calculator for this answer rather than figureing out the bit form of the address). And there you have it. I've used this manual calculator on every one of my Microsoft and Cisco tests. It's not cheating as it came out of my brain and onto a sheet of paper. All you need to know is how to create the calculator (from the left, double a 1 until 128, above that take 128 and add it to the next bit number below), and how to use it (mark your bits and draw the line to the right). I'll do my best to answer any questions if any come up. Later! (I've gone insane from trying to get the calculator to line up correctly! All of the double I's and 0's and underscores!!!!! I tried 6 times to get the calculator to line up correctly, if it is not displaying properly on your screen, just whip out a sheet of paper and make sure everything lines up. The lining up is key!)

AdamB29
AdamB29

I disagree that this is a very complex way for a test. This is the entire method that I learned, a first step, before cider, and, etc... As a method that does not rely on Windows calculators, I feel that it is very simplistic, especially given the complex original article on subnetting. Once you learn how to make the calculator, which takes all of 5 minutes of instruction, and how to use it, another 5 minutes, anyone can subnet. So I don't feel at all that the manual subnet calculator is a complex way for a test.

georgeou
georgeou

So we have: IP address of 192.168.10.187 Subnet mask of 255.255.255.224 As I explained in the article, easiest way to break this down is to use the AND operator in Windows Calculator on 187 and 224 which yields 160 as the "Network ID". Computing number of hosts is fairly simple and you can do it by 256 - 224 = 32. That would make the next network start at 160 + 32 = 192. So the subnet range for this network is 160 to 191, and 198 would obviously be outside of this subnet range. With 32 hosts in the subnet, that means 5 bits (2^5=32) out of 32 were allocated to hosts. That would mean 27 bits can be used to networks meaning 2^27 networks which CALC.exe outputs 134,217,728.

ITDirectorSTX
ITDirectorSTX

I came up with a similar calculator, but never could explain it to my techs the way you just did. I'll certainly use this vs. the original post. The author of IP Subnetting made Easy is making it difficult for others to learn by providing wrong information. 11 bits cannot result in 2048 values. 2^11 actually uses 12 bits and results in 2048 values. I really think his post should be pulled or revised to include this.

JimTeach
JimTeach

Thanks. I show the students the same thing. When they are ready to take the tests they only need to put the binary table on their scrap paper at the start of the test. No need for a real calculator.

AdamB29
AdamB29

While what you say is true, you can't use an online calculator in a test. By creating this manual calculator at the beginning of an exam, you have it with you to help quickly answer questions. There are better tools when you have a computer and internet access, but this manual calculator is just plain awesome for exams!

mddavis
mddavis

I learded the "manual calculator" that Adam defined and that's what I used for my cert tests. I'm usually pretty good at getting my subnetting correct by doing it manually but I also have a tool I use to double check my calculations: http://www.subnet-calculator.com/ It works pretty well.

seanferd
seanferd

Yeah, spaces are not persistent in the displayed post. You'd have to use zeroes as you did, or use the non-breaking space code (& n b s p)for each space you want to maintain, which makes your original hard to read.

Editor's Picks