logo elektroda
logo elektroda
X
logo elektroda

Calculating Number of Possible Subnets for Masks: /24, /27, /16, /8 - IP Addressing

Arek15111 19932 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 14568742
    Arek15111
    Level 16  
    Hello!

    Well, for several days I have been browsing the Internet and trying to figure out how to calculate the number of possible subnets.
    I have the following examples of masks:
    255.255.255.0/24
    255.255.255.224/27
    255.255.0.0/16
    255.0.0.0/8

    I will calculate the number of possible hosts e.g. for the mask / 24 - 2 ^ 8 = 256 - 2 = 254

    But I can't figure out how to calculate the number of possible subnets.
    I know you borrow bits, but I don't understand the principle that you can borrow so much here and so much here.
    Could somebody help me understand this?
  • ADVERTISEMENT
  • #2 14568930
    Felix76
    Level 12  
    [quote = "Arek15111"] Hello!
    Welcome..
    //
    I will calculate the number of possible hosts e.g. for the mask / 24 - 2 ^ 8 = 256 - 2 = 254
    //
    for only hosts yes, but more correctly 256 -3 = 253
    network address, broadcast, Gateway.

    The number of possible IP addresses in a given subnet is calculated as follows:
    I. to the expected number of H hosts; add the number 3 (because there must be three additional addresses per subnet, broadcast and gateway address); as a result you got the number A; needed IP addresses.

    II. if the number A; is a power of two (i.e., it is 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, ...) then go to the next step; if it is not, replace the number "A" with the nearest number which is a power of two (but upwards), e.g. if A = 13, then we change it to A = 16

    II. obtained number A; is the number of possible IP addresses in the given subnet, that is, how many IP addresses can be used in the given subnet (the maximum number of hosts is less than 3 than this number).

    The network mask and address depend on the obtained number of possible IP addresses

    Greetings.
  • ADVERTISEMENT
  • #3 14568992
    Arek15111
    Level 16  
    Thanks for the answer.
    However, this I can do, I mean how to calculate the number of possible subnets in the given examples.
  • ADVERTISEMENT
  • #4 14570230
    smario11
    Level 31  
    There are no specified address pools, so it is impossible to determine the maximum number of subnets.
    What you entered is a subnet mask.
    The smallest mask is / 30

    So if you have, for example, addresses 192.168.0.0/24 and you want to divide it into the max, you will do 64 subnets with mask / 30
    For PPPoE, the mask can be as high as / 32
  • ADVERTISEMENT
  • #5 14570318
    Arek15111
    Level 16  
    smario11 wrote:
    So if you have, for example, addresses 192.168.0.0/24 and you want to divide it into the max, you will do 64 subnets with mask / 30

    Ok, from this pool I can make max 64 subnets, but how did you calculate it?
    As I understand on one example, I should be able to do another.
  • #6 14570370
    zuczek1987
    Level 23  
    Here you have a link to a cool LAN calculator that helped me understand it: Link

    and here based on your example:

    Quote:


    decimal binary
    IP address 192.168.1.1 11000000.10101000.00000001 .00000001 private network RFC1918
    mask 255.255.255.0 = 24 11111111.11111111.11111111 .00000000
    network address 192.168.1.0/24 11000000.10101000.00000001 .00000000 old class C
    broadcast address 192.168.1.255 11000000.10101000.00000001 .11111111
    254 network hosts
    host min 192.168.1.1 11000000.10101000.00000001 .00000001
    host max 192.168.1.254 11000000.10101000.00000001 .11111110


    and broken down into the maximum mask from 24 to 30

    Quote:
    The smallest network including these addresses is: 192.168.1.0 with mask / 24
    It can be divided into the following subnets:
    number of subnets: 1
    usage: 99.22% (254 IP)
    number of effective subnets: 1
    usage: 99.22% (254 IP)
    number of hosts to use on each subnet: 254
    list of subnets:
    192.168.1.0/24
    number of subnets: 2
    usage: 98.44% (252 IP)
    number of effective subnets: 0
    Usage: 0.00% (0 IP)
    number of hosts to use for each subnet: 126
    list of subnets:
    192.168.1.0/25 192.168.1.128/25
    number of subnets: 4
    usage: 96.88% (248 IP)
    number of effective subnets: 2
    usage: 48.44% (124 IP)
    number of hosts to use on each subnet: 62
    list of subnets:
    192.168.1.0/26 192.168.1.64/26 192.168.1.128/26 192.168.1.192/26
    number of subnets: 8
    usage: 93.75% (240 IP)
    number of effective subnets: 6
    usage: 70.31% (180 IP)
    number of hosts to use on each subnet: 30
    list of subnets:
    192.168.1.0/27 192.168.1.32/27 192.168.1.64/27 192.168.1.96/27 192.168.1.128/27 192.168.1.160/27 192.168.1.192/27 192.168.1.224/27
    number of subnets: 16
    usage: 87.50% (224 IP)
    number of effective subnets: 14
    usage: 76.56% (196 IP)
    number of hosts to use on each subnet: 14
    list of subnets:
    192.168.1.0/28 192.168.1.16/28 192.168.1.32/28 192.168.1.48/28 192.168.1.64/28 192.168.1.80/28 192.168.1.96/28 192.168.1.112/28 192.168.1.128/28 192.168.1.144/28 192.168.1.160/28 192.168.1.176/28 192.168.1.192/28 192.168.1.208/28 192.168.1.224/28 192.168.1.240/28
    number of subnets: 32
    usage: 75.00% (192 IP)
    number of effective subnets: 30
    usage: 70.31% (180 IP)
    number of hosts to use on each subnet: 6
    list of subnets:
    192.168.1.0/29 192.168.1.8/29 192.168.1.16/29 192.168.1.24/29 192.168.1.32/29 192.168.1.40/29 192.168.1.48/29 192.168.1.56/29 192.168.1.64/29 192.168.1.72/29 192.168.1.80/29 192.168.1.88/29 192.168.1.96/29 192.168.1.104/29 192.168.1.112/29 192.168.1.120/29 192.168.1.128/29 192.168.1.136/29 192.168.1.144/29 192.168.1.152/29 192.168.1.160/29 192.168.1.168/29 192.168.1.176/29 192.168.1.184/29 192.168.1.192/29 192.168.1.200/29 192.168.1.208/29 192.168.1.216/29 192.168.1.224/29 192.168.1.232/29 192.168.1.240/29 192.168.1.248/29
    number of subnets: 64
    Usage: 50.00% (128 IP)
    number of effective subnets: 62
    usage: 48.44% (124 IP)
    number of hosts to use on each of the subnets: 2
    list of subnets:
    192.168.1.0/30 192.168.1.4/30 192.168.1.8/30 192.168.1.12/30 192.168.1.16/30 192.168.1.20/30 192.168.1.24/30 192.168.1.28/30 192.168.1.32/30 192.168.1.36/30 192.168.1.40/30 192.168.1.44/30 192.168.1.48/30 192.168.1.52/30 192.168.1.56/30 192.168.1.60/30 192.168.1.64/30 192.168.1.68/30 192.168.1.72/30 192.168.1.76/30 192.168.1.80/30 192.168.1.84/30 192.168.1.88/30 192.168.1.92/30 192.168.1.96/30 192.168.1.100/30 192.168.1.104/30 192.168.1.108/30 192.168.1.112/30 192.168.1.116/30 192.168.1.120/30 192.168.1.124/30 192.168.1.128/30 192.168.1.132/30 192.168.1.136/30 192.168.1.140/30 192.168.1.144/30 192.168.1.148/30 192.168.1.152/30 192.168.1.156/30 192.168.1.160/30 192.168.1.164/30 192.168.1.168/30 192.168.1.172/30 192.168.1.176/30 192.168.1.180/30 192.168.1.184/30 192.168.1.188/30 192.168.1.192/30 192.168.1.196/30 192.168.1.200/30 192.168.1.204/30 192.168.1.208/30 192.168.1.212/30 192.168.1.216/30 192.168.1.220/30 192.168.1.224/30 192.168.1.228/30 192.168.1.232/30 192.168.1.236/30 192.168. 1.240 / 30 192.168.1.244/30 192.168.1.248/30 192.168.1.252/30
ADVERTISEMENT