Search code examples
network-programmingsubnetcidr

What is the subnet (network and CIDR) for "half" of the IPv4 address space?


What is the subnet (network and CIDR) for "half" of the IPv4 address space? I do not mind if this includes (it inevitable will) private/reserved IP subnets. To put it even more in context: the subnet/CIDR for the whole IPv4 range is 0.0.0.0/0


Solution

  • The two ranges 0.0.0.0/1 and 128.0.0.0/1 cover the whole IPv4 space. CIDR format is a.b.c.d/x where a, b, c and d are the decimal representation of the 4 bytes in the IPv4 address and x is the length of the subnet mask.

    To divide the whole range

    00000000.00000000.00000000.00000000 to 11111111.11111111.11111111.11111111

    in two parts you just consider the ranges

    00000000.00000000.00000000.00000000 to 01111111.11111111.11111111.11111111
    +
    10000000.00000000.00000000.00000000 to 11111111.11111111.11111111.11111111

    I hope this answers your question.