Network Prefixes


  • IPv4 address provides two pieces of information encoded within the same value:
    • network number (network ID)
      • common to all hosts on the same IP network
    • host number (host ID)
      • identifies a host within a particular IP network
  • the two are distinguished by combining the address with a network prefix
    • is a 32-bit value with a given number of contiguous bits all set to 1
      • E.g., prefix with 24 bits is the following binary value:
        • 11111111 11111111 11111111 00000000
    • Can be written in slash notation in the form /24
    • can also be written in dotted decimal as a subnet mask: 255.255.255.0

Info

The name “subnet mask” comes about because a single IP network can be divided into multiple logical subnetworks (subnets) using this method.

  • When combined with an IP address, the prefix masks the host ID portion to reveal the network ID portion
  • Where there is a binary 1 in the prefix, the corresponding binary digit in the IP address is part of the network ID

Info

Slash notation is used to refer to network IDs, while the subnet mask is typically used in host configuration dialogs.

  • For example,
    • 192.168.0.0/24 refers to an IP network
    • while 192.168.0.1/255.255.255.0 refers to a host address on that IP network