Options

IP subnetting not computing

kacperkacper Member Posts: 7 ■□□□□□□□□□
I've been practicing IP subnetting. I created a scenario where I have an IP of 220.16.1.0, class C. I need 4 networks.

The amount of bits required for decimal 4 is 3 bits (4 = 100).
Our binary subnet mask would be 11111111.11111111.11111111.11100000. Our decimal subnet mask would be 255.255.255.224 or /27.

Checking the results with a subnet calculator and according to the calculator the subnet mask required to give 4 networks is 255.255.255.192 or /26.

Something must be wrong with my math, since I doubt that every subnet caluclator is faulty. I fail to see the problem with my calculation other than that it didn't give me the correct results. Can anyone shed some light to what I'm doing wrong?

Comments

  • Options
    FloOzFloOz Member Posts: 1,614 ■■■■□□□□□□
    /26 is the correct answer. The increments would be by 64.

    226.16.1.0
    226.16.1.64
    226.16.1.128
    226.16.1.192

    A /27 would give you an increment of 32.
    226.16.1.0
    226.16.1.32
    226.16.1.64
    .
    .
    .
  • Options
    TheNewITGuyTheNewITGuy Member Posts: 169 ■■■■□□□□□□
    Quick and dirty way of looking at it:

    220.16.1.0/24 you need 4 networks

    256/4 = 64

    remembering our binary table of: 128 64 32 16 8 4 2 1
    1 1 0 0 0 0 0 0

    24+2 = 26

    /26 is your answer
  • Options
    CyanicCyanic Member Posts: 289
    I think you are getting confused between the binary representation and the amount of values of the bits. Let me see if I can explain this without making things worse.

    Yes, decimal 4 is represented as 100 in binary. However, the amount of value represented by those 3 bits is 8. In other words 3 bits will give you 8 possible values 000, 001, 010, 011, 100, 101, 110, 111, or 8 possible networks.

    Since you are looking to have 4 networks you only need 2 bits as they will have 4 possible values 00, 01, 10, 11.
  • Options
    TechGuru80TechGuru80 Member Posts: 1,539 ■■■■■■□□□□
    kacper wrote: »
    I've been practicing IP subnetting. I created a scenario where I have an IP of 220.16.1.0, class C. I need 4 networks.

    The amount of bits required for decimal 4 is 3 bits (4 = 100).
    Our binary subnet mask would be 11111111.11111111.11111111.11100000. Our decimal subnet mask would be 255.255.255.224 or /27.

    Checking the results with a subnet calculator and according to the calculator the subnet mask required to give 4 networks is 255.255.255.192 or /26.

    Something must be wrong with my math, since I doubt that every subnet caluclator is faulty. I fail to see the problem with my calculation other than that it didn't give me the correct results. Can anyone shed some light to what I'm doing wrong?

    Networks go in multiples of 2 for each bit.

    1 bit = 2 networks, 2 = 4 networks, and so on. So your process was correct except you only need 2 bits.../26...255.255.255.192. You could also go further for hosts to check your work.

    3 bits would be a range of 32 with 30 hosts. How many times does that go into 256 (including 0)? 8 times.
Sign In or Register to comment.