LOGBOOK

HELP

1 / 27
Other keys: showSpace: good1-4: rate0: skip5: flag

Question

What are the two parts of an IPv4 address and how does the subnet mask determine them?

Answer

An IPv4 address has a network portion and a host portion; the subnet mask marks which bits are which — 1s mark network bits, 0s mark host bits.

Subnet mask splits an IPv4 address into network and host portions

* The mask's 1-bits mark the network portion, its 0-bits the host portion. *

IPv4 Address Structure:

Part Description
Network portion Identifies the network; same for all devices on that network
Host portion Identifies the specific device on that network

The subnet mask determines which bits belong to which portion:

  • Subnet mask bits set to 1 = Network portion
  • Subnet mask bits set to 0 = Host portion

Example:

  • IP: 192.168.10.10
  • Subnet mask: 255.255.255.0
  • Network portion: 192.168.10 (first 24 bits)
  • Host portion: .10 (last 8 bits)

Key insight: The subnet mask is essential - without it, you cannot determine which portion is network vs host.

Go deeper:

The concept of subnetting the IPv4 address space 200.100.10.0/24, which contains 256 addresses, into two smaller address spaces, namely 200.100.10.0/25 and 200.100.10.128/25 with 128 addresses each
The concept of subnetting the IPv4 address space 200.100.10.0/24, which contains 256 addresses, into two smaller address spaces, namely 200.100.10.0/25 and 200.100.10.128/25 with 128 addresses each
Michel Bakni · CC BY-SA 4.0 · Wikimedia Commons
or press any other key

Question

What is the prefix length notation and how does it relate to the subnet mask?

Answer

Prefix length is the count of 1-bits in the subnet mask, written as a slash (e.g. /24 = 255.255.255.0); it is just a compact way to write the mask.

Prefix length to dotted-decimal subnet mask, each step adds one network bit

* Each longer prefix adds one network bit, lengthening the mask. *

Prefix Length (Slash Notation): A shorthand way to express the subnet mask by indicating the number of bits set to 1.

Prefix Subnet Mask Network Bits
/8 255.0.0.0 8 bits
/16 255.255.0.0 16 bits
/24 255.255.255.0 24 bits
/25 255.255.255.128 25 bits
/26 255.255.255.192 26 bits
/27 255.255.255.224 27 bits
/28 255.255.255.240 28 bits

Example:

  • 192.168.10.10/24 means:
    • IP address: 192.168.10.10
    • Subnet mask: 255.255.255.0
    • First 24 bits are network, last 8 bits are host

Context: Prefix notation is more concise and commonly used in network documentation and router configurations.

Go deeper:

Illustration
IP_Address_Match.png: Baccala@freesoft.org derivative work: Zapyon (talk) · CC BY-SA 3.0 · Wikimedia Commons
or press any other key