CIDR Notation, Subnetting and Mathematics

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
I"m really struggling to understand the maths behind this one. I have to get this sorted out as soon as possible.

I do understand this part though - say for example you have a 2^6 - 2. That's easy. It's 62.

It is the part where you have to calculate an higher number. it's nearly impossible to calculate 2^32 on a calculator. Also when you write the exam at a Pearson Vue testing center, you're not even allowed to have a calculator with you. At least last time it was in the fine print after purchasing the exam online. Counting on my fingers will not make things go any faster as there's a time limit on the exam and I have to complete it within that time frame. The exam centers do provide white boards and whiteboard pens.

Memorizing the whole table might be easier but at my age, I don't remember things as well as I used to. It took me a year to memorize my cell phone number (where 10 years ago I would be able to memorize it within a few weeks of constant use).

Maths has never been a strong subject - I've always failed it at school.

Any tips how to work it out in a short frame of time without a calculator or having to count on fingers?

PS. CIDR Notation sheet attached for reference. This is what I am supposed to be able to work on without the need for calculators or finger counting (which is probably inevitably involved anyway)
 

Attachments

  • 2018-06-08_11-57-24-b43b39665963f818d49609459d652f04.png
    2018-06-08_11-57-24-b43b39665963f818d49609459d652f04.png
    15.9 KB · Views: 19

Papa Smurf

Well-Known Member
Joined
Mar 20, 2020
Messages
2,132
Location
3rd Rock From The Sun
Screw this shit – I'll be a stripper – Motivate Us Not
 
R

[)roi(]

Guest
I"m really struggling to understand the maths behind this one. I have to get this sorted out as soon as possible.

I do understand this part though - say for example you have a 2^6 - 2. That's easy. It's 62.

It is the part where you have to calculate an higher number. it's nearly impossible to calculate 2^32 on a calculator. Also when you write the exam at a Pearson Vue testing center, you're not even allowed to have a calculator with you. At least last time it was in the fine print after purchasing the exam online. Counting on my fingers will not make things go any faster as there's a time limit on the exam and I have to complete it within that time frame. The exam centers do provide white boards and whiteboard pens.

Memorizing the whole table might be easier but at my age, I don't remember things as well as I used to. It took me a year to memorize my cell phone number (where 10 years ago I would be able to memorize it within a few weeks of constant use).

Maths has never been a strong subject - I've always failed it at school.

Any tips how to work it out in a short frame of time without a calculator or having to count on fingers?

PS. CIDR Notation sheet attached for reference. This is what I am supposed to be able to work on without the need for calculators or finger counting (which is probably inevitably involved anyway)
Working with binary, hexadecimal and octal is just something I had to learn in the early 80s when I started programming; still don't need a calculator for that.

The key to learn the table is the bit values, because the rest is derived from that. I.e. Once you tabulated your bit values you can easily populate the other columns.

Bit values are simple to learn; 1st bit has a value of 1 and the next bit is double that e.g. 2, 4, 8, 16, 32, etc...
 
Last edited by a moderator:

Tribs

Well-Known Member
Joined
Mar 29, 2020
Messages
8,977
Location
Centurion
Surely no one would be expected to work that out in the real world. Try and stick to information that is actually useable. Have you looked into getting the practice tests ?
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Can you work in binary, will be much easier?
Honestly, no. I still can't get a grasp on it.

However I think I may have nailed a part of it.

This website explains it so beautifully

CIDR Available Networks (subnetting)

How many /29 networks can fit into a /24 network? Or how many /21 networks can fit into a /17 network? The best way to explain the formula is to show it. The following illustrates how many /21 networks can fit into a /17 network.
  1. Subtract the network bits from 32.
    /17 = 32-17 and /21 = 32-21
  2. Raise 2 to that power.
    2^32-17 and 2^32-21
  3. Divide the larger network by the smaller one.
    2^32-17 / 2^32-21 = 2^15 / 2^11 = 2^15-11 = 24 = 16
As the example shows, a /17 network could be divided into sixteen /21 networks. Spot the shortcut in the steps? How many /29 networks in a /24?
  • 28-3 = 25 = 32

Source: https://erikberg.com/notes/networks.html

I think the rest of this website can help me out in this.

I would like to leave this open for others to learn from if they are ever in the same position as I am.

@Papa Smurf ditto. This is why I have been putting off writing the exam for so long.
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Surely no one would be expected to work that out in the real world. Try and stick to information that is actually useable. Have you looked into getting the practice tests ?
I have everything at my disposal with my online course. I have Labs, practice tests (at least a zillion different ones) and quizzes. They do ask you to do CIDR Notations and etc... Unfortunately it is part of my exam objectives.
 
R

[)roi(]

Guest
Only really tricky column is the subnet mask, 4 octets (binary number made of 8 bits); meaning the IP4 address range is derived from 32 bits.

If you represent the mask portion as binary as biometrics suggested, starting at the right most octet; it's eight bits can be 1 or 0; reading from right to left, it's bit values are worth 1, 2, 4, 8, 16, 32, 64, 128 -- the next octet starts where that ends its first bit value (read right to left) is worth, 256, then 512, 1024, 2048, 4096, and so on.

Looking at just the right most octet, ignoring the first 3 (i.e. Ignoring 255.255.255)
You can represent 192 in binary by looking at which bit values will total to 192; I suggest rewriting the bit values right to left (as they are stored in the computer), for example:
128, 64, 32, 16, 8, 4, 2, 1

So to represent 192; we use 128+64; or written in binary that's 11000000; the 1's indicating that we are using the 128 and 64 bit positions. The 0 part of this binary representation of the right most octet is your device portion the sum of its value values is how many devices you can support on that subnet mask.
 
Last edited by a moderator:

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
For @Tribs

Try answer this one question that is being asked in one of my Practice Tests (currently doing it now)

Question 4: How many hosts per subnet are provided by a subnet mask of 255.255.255.192?

A: 64
B: 126
C: 128
D: 62
 
R

[)roi(]

Guest
Look
For @Tribs

Try answer this one question that is being asked in one of my Practice Tests (currently doing it now)
Look at my updated post and see if you can answer that.
Hint: the sum of the1st 6 bit positions is the value of the 7th bit minus 1.
Correction: last IP value in a range is broadcast, so minus 1 more
 
Last edited by a moderator:

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Look

Look at my updated post and see if you can answer that.
Hint: the sum of the1st 6 bit positions is the value of the 7th bit minus 1. Add 1 for zero.
Yeah I got it now. the number of bits in between is the CIDR notation answer.

255.255.255.192
11111111.11111111.11111111.11000000 = 8+8+8+2 = /26

2^32-26 = 62 available hosts

Oh another question for you @[)roid(]

How do you determine which IP addresses are reserved in each range? And which ones are the broadcast and multicast addresses?

The 169.254 /16 range is easy - those are APIPA addresses.
 
Last edited:

Tribs

Well-Known Member
Joined
Mar 29, 2020
Messages
8,977
Location
Centurion
You guys are much smarter than I am. I have only ever used 255.255.255.0 😂 Though I do understand what you did there. I had no idea how binary worked - though I use a binary to text or ansii or hex decoder often

Mmmm I wonder if this is useful for virtual networks - though I think you select the IP range but it issues the subnet. Need to check on that. Still learning.
 
R

[)roi(]

Guest
Oh another question for you @[)roid(]

How do you determine which IP addresses are reserved in each range? And which ones are the broadcast and multicast addresses?

The 169.254 /16 range is easy - those are APIPA addresses.
Pick an example subnet and/or question and let's work on that.
 

Lupus

Active Member
Joined
May 4, 2020
Messages
114
Working with binary, hexadecimal and octal is just something I had to learn in the early 80s when I started programming; still don't need a calculator for that.

The key to learn the table is the bit values, because the rest is derived from that. I.e. Once you tabulated your bit values you can easily populate the other columns.

Bit values are simple to learn; 1st bit has a value of 1 and the next bit is double that e.g. 2, 4, 8, 16, 32, etc...
Thankfully I live in an era where I can go to handy websites to work out CIDR for me :). Also my math teacher in school was wrong, I do have a calculator with me all the time :p
 

BloodrayneZA

Well-Known Member
Joined
May 2, 2020
Messages
2,822
Location
Helheim
Thankfully I live in an era where I can go to handy websites to work out CIDR for me :). Also my math teacher in school was wrong, I do have a calculator with me all the time :p

I wish it was that simple these days - I've always had trouble with maths.
 
R

[)roi(]

Guest
Class A subnetting
0.0.0.0 - 127.255.255.255
Usually an example would be to break up a specified ip address using a given subnet mask or for example... how many networks with xx hosts can be created from a given ip address i.e. derive the subnet mask and ranges.

As for subnetting class A; the one most often used internally by corporates is 10.x.x.x (because it's strictly private) -- so why not pick an example from that. I'd suggest breaking up a class C subnet; to reduce the number of ranges to be calculated.

PS. I was told that it's usually the first address and last address reserved. Is it that so?
Yes, 1st and last of each subnet.

Got some errands to do. I'll log in later this evening again.
 

Sinbad

Well-Known Member
Joined
Jun 23, 2020
Messages
1,736
For @Tribs

Try answer this one question that is being asked in one of my Practice Tests (currently doing it now)
There's a trick to this, for subnets of greater than 24 bits. (ie smaller subnets than /24)

Subtract the subnet mask's last significant octet from 256, gives you the size of the subnet.
One address for network, one address for broadcast (always).

So 255.255.255.192
256 - 192 = 64 addresses. Subtract 2 for network and broadcast, 62 available.

255.255.255.252
256 -252 = 4, so 2 addresses available. That's why that subnet mask is used for point to point links...

255.255.255.224
256-224 = 32, so 30 usable addresses.

For subnets bigger than a /24 it's a little more complex. You do the same maths but multiply by 256 in the middle.

Eg 255.255.252.0
256 - 252 = 4
4x256 = 1024
So 1022 usable addresses. Always first ip is network and last is broadcast.

Similar logic for a subnet bigger than 16.

255.252.0.0
4x256x256 = 262144, so 262142 available ips in the subnet.


Make the sense?
 
Last edited:
Top