Simple Ip subnet question

pob579pob579 Member Posts: 51 ■■□□□□□□□□
Why 32? and not 30.

Question: How many subnets and hosts can you get from the network 172.28.0.0/21?

Answer: 32 subnets and 2046 hosts

Comments

  • rjbarlowrjbarlow Member Posts: 411
    pob579 wrote:
    Why 32? and not 30.

    Question: How many subnets and hosts can you get from the network 172.28.0.0/21?

    Answer: 32 subnets and 2046 hosts
    32 total, but usable are 30.
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • iprouteiproute Member Posts: 269
    pob579 wrote:
    Why 32? and not 30.

    Question: How many subnets and hosts can you get from the network 172.28.0.0/21?

    Answer: 32 subnets and 2046 hosts

    If the "ip subnet-zero" command has been issued: 32 usable. If not, 30 usable. This is enabled by default on modern Cisco IOS.
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
  • rjbarlowrjbarlow Member Posts: 411
    iproute wrote:
    If the "ip subnet-zero" command has been issued: 32 usable. If not, 30 usable. This is enabled by default on modern Cisco IOS.

    Th ip subnet-zero command allow also for use of broadcast subnet?
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • markzabmarkzab Member Posts: 619
    rjbarlow wrote:
    iproute wrote:
    If the "ip subnet-zero" command has been issued: 32 usable. If not, 30 usable. This is enabled by default on modern Cisco IOS.

    Th ip subnet-zero command allow also for use of broadcast subnet?

    No, it doesn't. I think IProute just made a little mistake there. 32 subnets with 31 usable, not 32.
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    HUH? 31 usable? How do you get that? You can use the all ones subnet if you want.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • LOkrasaLOkrasa Member Posts: 343 ■■■□□□□□□□
    Someone pls clarify... my fragile mind is getting tottaly confused. lol
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    I have never seen anyone only subtract 1 when using ip subnet-zero and I have not read it anywhere either. From all the reading I have done and experiences in configuring my SIM, I have always used the all ones subnet...which is the "broadcast subnet". I have always either subtracted 2 when using the no ip subnet-zero command or not subtract anything from the subnet formula when using the ip subnet-zero command. It's that simple.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • iprouteiproute Member Posts: 269
    I'm trying to find a command to enable the all 1's subnet. I just assumed ip subnet-zero enabled both the all 0's and the all 1's subnet. icon_scratch.gif
    CCNP Progress
    ROUTE [X] :: SWITCH [X] :: TSHOOT [X]
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    here check out this article. Read the subnetting examples section of this article for a difinitive answer.
    http://www.cisco.com/warp/public/701/8.html

    I'm not sure if the ip subnet-zero actually activates the all ones subnet but you can use it.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • rjbarlowrjbarlow Member Posts: 411
    After I have read that link, I think the all-ones-subnet are always usable in theory, the subnet zero instead no, if ip subnet-zero command is not issued, but the causes for which they are discouraged are not clear for me...
    However the original question seems to be more simple then this stuff...
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    RFC 950:
    "It is useful to preserve and extend the interpretation of these special (network and broadcast) addresses in subnetted networks. This means the values of all zeros and all ones in the subnet field should not be assigned to actual (physical) subnets."

    RFC 1878:
    "This practice (of excluding all-zeros and all-ones subnets) is obsolete. Modern software will be able to utilize all definable networks."

    The original layout of IPv4 addressing defined in RFC 950 and it's related documents basically restricted the use of the all zero's and all one's subnets to prevent confusion within the addressing space. For example you can have a network which is 192.168.1.0/24 with subent 192.168.1.0/27. This can be confugsing, consider protocols like RIPv1 which do not carry the mask in the updates and you can begin to see why they were excluded.

    As for the "ip subnet-zero" command:

    You can use the all 1's subnet even if ip subnet-zero is turned off, however it would till violate RFC 950 (which if you have older devices on the network that follow RFC 950 you should not do it). If you want to use the all zero's subnet you must turn it on (in ios 12.0 it is the default)

    Would you ever subtract 1 instead of 2? no because that still would violate RFC 950 and therefore it is pointless to subtract just one (all zero's) and not the all one's. Bottom line is in today's networks and for the current exams all subnets are useable unless otherwise stated.

    HTH
    The only easy day was yesterday!
  • pob579pob579 Member Posts: 51 ■■□□□□□□□□
    so, for subnets calcul we don't have to -2 ?
  • NetstudentNetstudent Member Posts: 1,693 ■■■□□□□□□□
    yes unless specified otherwise.
    There is no place like 127.0.0.1 BUT 209.62.5.3 is my 127.0.0.1 away from 127.0.0.1!
  • markzabmarkzab Member Posts: 619
    I think I got a little confused between allowed and logically.

    The original question was: How many subnets and hosts can you get from the network 172.28.0.0/21?

    I stated 31 with ip subnet-zero, not 32, because...

    172.28.0.0
    172.28.8.0
    172.28.16.0
    172.28.24.0
    172.28.32.0
    172.28.40.0
    172.28.48.0
    172.28.56.0
    172.28.64.0
    172.28.72.0
    172.28.80.0
    172.28.88.0
    172.28.96.0
    172.28.104.0
    172.28.112.0
    172.28.120.0
    172.28.128.0
    172.28.136.0
    172.28.144.0
    172.28.152.0
    172.28.160.0
    172.28.168.0
    172.28.176.0
    172.28.184.0
    172.28.192.0
    172.28.200.0
    172.28.208.0
    172.28.216.0
    172.28.224.0
    172.28.232.0
    172.28.240.0
    172.28.248.0
    172.28.256.0

    I don't think I've ever seen a subnet start with 256. Start at 0 yes, but not 256.

    Wait...I just added them all up and got 33. What's happening...error, error. icon_confused.gif
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
  • markzabmarkzab Member Posts: 619
    And iproute, I apologise for my earlier statement. I was incorrect obviously.
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
  • rjbarlowrjbarlow Member Posts: 411
    markzab wrote:
    I don't think I've ever seen a subnet start with 256. Start at 0 yes, but not 256.

    Wait...I just added them all up and got 33. What's happening...error, error. icon_confused.gif
    Oh no! All-ones-subnet is not 256, but 248, You have to consider only the space for subnet bits which they are 5:
    NNNNNNNN. NNNNNNNN. SSSSSHHH.HHHHHHHH
    XXXXXXXX. XXXXXXXX. 11111XXX. XXXXXXXX

    Wich they take value of 248.
    Also 256 is an invalid number because You have to consider values from 0 to 255 if You have 8 subnet bits, which they takes 256 values, but with values from 0 to 255. I'm sure just You were lost in thought. :)
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • markzabmarkzab Member Posts: 619
    Yeah man. I woke up this morning thinking, what the hell did I write last night. icon_eek.gif

    Evil thread. icon_lol.gif
    "You, me, or nobody is gonna hit as hard as life. But it ain't how hard you hit; it's about how hard you can get hit, and keep moving forward. How much you can take, and keep moving forward. That's how winning is done!" - Rocky
Sign In or Register to comment.