Here’s how it works:
This little chart applies to any subnet mask, simply take the meaningful octet (the octet that is not 255 or 0) and apply what you need to know, such as:
A host has an IP address of 192.168.111.42/27 (/27 being CIDR notation – used literally in the syntax of Cisco NX-OS CLI & universally important to know, see here for more info).
We know that it has a sub-net mask of 27 1’s, shown in binary as:
11111111.11111111.11111111.11100000
(11111111=128+64+32+16+8+4+2+1=255), so (11100000=128+64+32=224) or, .224… and specifically 255.255.255.224.
So from a manually calculated CIDR notation of /27 we have a sub-net mask of 255.255.255.224. If you are studying to be a network engineer one should just strait up memorize each slash notations /1 – /32 corresponding sub-net mask, but don’t forget where it came from.
So, we have our meaningful octet from our sub-net mask, .224, and from that we can gather from the chart that the mask dictates that the class C sub-net is to be broken down into 8 separate blocks who’s network addresses span 32 IPs. **Remember this does not mean that you have 32 IPs available for hosts to use, the 32nd IP address is the second subnet’s network address, the 64th IP address is the third, and so on. The last IP address in a block is always reserved for that sub-nets broadcast address, and you loose one to the next block’s network address. So that’s useful, but how are the numbers tied together?
Well, the top line is just powers of 2 starting with 2. Easy enough
The second line shows the value of the broken down binary octet (8 bits per octet with a 1(power on) meaning network bit and a 0(power off) being a host bit. All 1’s or 0’s are consecutive in sub-net masks, you will never see a 10110101 or anything like it.)
If you had a mask of .224 like above, you have 11100000 (128+64+32) as shown in the chart. The CIDR notation /27 already has 24 single 1’s behind the 3 in the meaningful octet, so you just take 24 & add 3 instead of counting all 27.
The third line shows the actual sub-net mask. It is calculated from adding the block sizes of all columns leading up to the meaningful octet of the sub-net mask.
In the .224 example, this was calculated by adding 128+64+32=224.
So, to write this chart out you don’t need to memorize it. Just know:
1. Powers of 2 starting from 2. (3rd grade math)
2. Binary values of 8 bit numbers used in IP.4 addressing. (Should know this long before you get to sub-net calculations.)
3. Simple addition. (ask a kinder-gardener if you need help)
I made up this little charge about 4 years ago in preparation for the first Cisco exam I ever took. While it’s very useful to jot down before a test begins on your scratch paper, if you use it in conjunction with your multiples of 16, 32, 64(most common sub-net sizes that require thinking) charts enough during study like I did, you’ll find that you don’t even need the scratch pad.
Memorizing this little chart & being able to recite your multiples tables (see below) is all one needs to do IPv.4 subnet calculations in your head.
Excepts from my (Skylar) fishing journal:
2356hrs August 17, 2011
2130hrs August 17, 2011
…Just for the record, I was using a heavy pole with a heavy rig on it. The bait was fresh, dead shad. I had cast out about 20 feet to the south, which was the direction we were slowly drifting. During the time the line was out I had been taking up the slack and probably was still somewhere between 10 to 15 feet out from the boat and sitting on the lake bottom. Dave says that area is somewhere around 15 feet deep and I have no reason to doubt him…
….I felt the boat spinning around and then got the sensation of forward motion. Dave and I began checking poles. The instant I looked at my heavy catfish pole I knew something was up…
…At first reeling in the line wasn’t that difficult and even though the boat was moving I could feel whatever I was hooked on moving toward the boat as well. The boat was almost on top of it and at this point I was still thinking it was a tree branch or something when it made a diving run back under the boat to the north. It was strong and I wasn’t ready for it. The pole pulled out of my right hand (the hand of the crank) and almost out of my left hand on the handle. The tip of my pole bent around to more than a 90-degrees angle and disappeared into the water. I believe it was at this point when I started yelling at Dave, “It something alive!” While I was yelling I shoved the end of the pole between my legs and sit on it while leaning back and pulling with both hands. At this point I was pretty sure my pole was going to break, but it didn’t. I managed to pull it out from under the boat and some of the pressure on the line let up.
By this time Dave had hauled in a catfish of his own and moved forward so that he could now see what was going on… (See Dave’s report)
…From this point on there were no more sideways runs. It was swimming straight down. I would get it coming up when it would start pulling almost straight down. There were several times I got worried my line or pole was going to break and backed off the drag to let it run. It would go straight down and just sit. Ever time I would get it get close to the boat I’d start feeling this throbbing in the pole that would get quicker and quicker. I quickly learned what was coming next and would get ready for the next dive…
…Now my forearms were really starting to ache. I had no idea how long this tug-a-war had been going on, but I was getting worried that I wasn’t being aggressive enough. So this time when the pole started its tell-tell throbbing I decided not to loosen the drag. Instead I moved the end of the pole out from under me and hooked it under the edge of my belt. When the dive came I pulled back hard listening for any signs of my pole breaking. At this point my pole started vibrating violently. I yelled at Dave, “Can you see this!”…
…I got about three turns on the crank when I saw something huge and off white about 2 to 3 feet down in the water and about a foot to the side of where my line disappeared into the water. It was definitely rolling counter clockwise. Then it dove again and I couldn’t keep it up. This time I managed to stop the dive about 5 feet down…
(Continued Next Comment)