IPv4 Address Scheme Design


Factors to consider when planning an IPv4 network addressing scheme:

  • number of IP networks and subnetworks required
  • number of hosts per subnet that must be supported
  • network ID must be from a valid public or a private range
    • E.g., not from the loopback, link local reserved range, multicast range, or reserved/experimental range
  • network and/or host IDs cannot be all 1s in binary
    • reserved for broadcasts
  • network and/or host ID cannot be all 0s in binary
    • 0s means “this network”
  • Each host ID must be unique on the IP network or subnet
  • network ID must be unique on the Internet or on your internal system of internetworks
    • for public vs private addressing scheme

When performing subnet calculations, think in terms of the number of mask bits

  • each power of 2 is double previous one
248163264128256
  • memorize the decimal values for the number of bits set to 1 in an octet within a mask:
12345678
128192224240248252254255

Subnetting a Network Address Example

Network address: 172.30.0.0/16

  1. calculate how many subnets are required, then round up to nearest power of 2
  • E.g., if 12 subnets are needed
  • next nearest power of 2 is 16
  • exponent is the number of bits needed to add to default mask
  • = 16, so add 4 bits to mask
  • mask = 255.255.240.0
  1. calculate how many hosts each subnet must support
  • E.g., network address range is in /16 range + using 4 bits for subnetting
  • so 32 (total bits) - 20 (subnet bits) = 12 bits for hosts in each subnet
  • number of hosts per subnet =
    • n = number of bits allocated for host ID
    • = 4,094 hosts in each subnet
  • more bits = more subnets
  • less bits = more hosts per subnet
  1. calculate the subnets
  • deduct the least significant octet in the mask (240 in this example) from 256
  • gives the next subnet ID = 172.30.16.0/20
  1. subsequent subnet IDs are all the lowest subnet ID higher than the one before
  • e.g., 32, 48, 64…
  1. calculate host ranges for each subnet
  • so for first subnet range:
  • take subnet address and add a binary 1 to it for the first host
    • = 172.30.16.1
  • for the last host, take next subnet ID and subtract 2 binary digits
    • = 172.30.31.254