Ip address restriction

Discussion in 'Kernel Questions' started by Harsh Shah, Dec 3, 2019.

  1. Harsh Shah

    Harsh Shah Banned

    I want to know that Is it possible that maximum number of hosts in a network, can restrict class of ip address that can be used for network ?
    I have tried to get the answer for it but didn't get proper answer.
    Can anyone please help me ?
    Thanks in advance.
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I admit I do not understand the above question.
    So just some random thoughts here. The maximum number of hosts is restricted by the number of IP-addresses in the subnet. One of the addresses is used by the network address, one is broadcast address and usually one address is for the gateway. So subscract 3 from the number of IP-addresses. The Class A, B, C networks are I believe deprecated nowadays, but C class network is 255 IP-addresses and so allows 252 hosts.
    More info:
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    number of possible hosts/ip's is controlled by the netmask

    eg mask allows 65536 addresses, including the network address and broadcast address, so 65534 possible host IPs' mask ( allows 256 addresses, including network and broadcast, so 254 possible host ip's.

    Basic rules:
    1. The total number of IP addresses in a subnet is a power of two. So that's: 1, 2, 4, 8, 16, ... etc.
    2. The first IP address in a subnet is a multiple (0, 1, 2, 3 ...) of the number of IP addresses in the subnet.
    3. 'x' in netmask '255.255.255.x' is 256 - number of IP addresses in the subnet.
    4. In slash-notation, the netmask is '/y', where y = 32 - n, and 2ⁿ is the number of addresses in the subnet.
    So if we want 4 addresses in our subnet, the first address in this subnet is either 0 or 4 or 8 or 12 or ... etc.
    And 'x' in netmask '255.255.255.x' is: 256 - 4 = 252. So the netmask is: ''.
    4 = 2², so n = 2 and y is 32 - 2 = 30. The slash-notation netmask is therefore: '/30'.

    Note: You can't actually use IP addresses a.b.c.0 or a.b.c.255

    Netmask /
    1 /32
    2 /31
    4 /30
    8 /29
    16 /28
    32 /27
    64 /26
    128 /25
    256 /24

Share This Page