liveBook · Manning

Prefix length

As explained in Acing the CCNA Exam: Volume 1 Fundamentals and Protocols

A prefix length is the number of leading bits in an IP address that constitute its network portion, written in slash notation such as /24.

A prefix length states how many leading bits of an IP address form its network portion. Slash notation writes this as /X; the remaining bits form the host portion. For example, 192.168.100.100/24 has 24 network bits and 8 host bits, so devices on the same LAN share the network portion while retaining unique host portions. section 7.3.1

Use the prefix length to determine the network boundary and practical address capacity:

  • Convert the prefix length to a netmask: /24 is 255.255.255.0, with 24 mask bits set to 1 and 8 host bits set to 0. section 7.3.1 section 7.3.2
  • Calculate host capacity with 2^host-bits − 2 for ordinary IPv4 networks; a /24 provides 254 assignable host addresses. section 7.3.3
  • Recognize network and broadcast addresses: the network address has all host bits set to 0, and the broadcast address has them set to 1. section 7.3.3
  • Use prefix lengths when subnetting by borrowing host bits; each added bit doubles the number of subnets and reduces available host bits. section 11.2.1

Splitting a /24 network

Borrowing one host bit from 192.168.1.0/24 creates two /25 subnets: 192.168.1.0/25 and 192.168.1.128/25. Borrowing two bits creates four /26 subnets, including 192.168.1.64/26, whose network address is .64, broadcast address is .127, usable range is .65–.126, and maximum host count is 62. section 11.2.1

Using a prefix to choose a route

PC1 at 192.168.1.11/24 recognizes 192.168.3.11 as outside its local network, so it sends the packet to its default gateway at 192.168.1.1. The prefix length lets the host distinguish local delivery from routed delivery. section 10.1.1

Figure 7.7 An IPv4 address written in both dotted decimal and binary. The 32-bit address is split into four octets consisting of 8 bits each. The address is divided into two parts: the network portion and the host portion. The prefix length indicates the size of the network portion in bits, and the remainder is the host portion.

Use the bit-level diagram to see how a 32-bit IPv4 address divides into octets, network bits, and host bits. section 7.3.1

Prefix lengths also appear in router configuration and verification. Cisco IOS accepts the equivalent dotted-decimal netmask with ip address, while show ip interface brief and show ip interface display configured addresses and prefix lengths. IPv6 uses the same slash notation; /64 divides its 128-bit address into 64 network bits and 64 host bits. section 7.3.2 section 20.3.2

How Acing the CCNA Exam: Volume 1 Fundamentals and Protocols covers it

How deep it goes
Explains bit boundaries, netmasks, host capacity, subnetting, routing decisions, and Cisco configuration, while stopping short of advanced subnetting edge cases.
Examples
Demonstrates /24 LANs, /25 and /26 subnets, /30 and /31 point-to-point links, Cisco IOS commands, and IPv6 /64 addressing.
What it assumes
Assumes basic binary and decimal conversion up to eight bits while building IPv4 network, host, and netmask fundamentals from first principles.
What you can do after
Evaluate network boundaries, calculate usable hosts, create basic subnets, configure Cisco IOS interfaces, and interpret local-versus-remote delivery.
How it connects
Connects network and host portions with netmasks, subnetting, IPv4 addressing, IPv6 addressing, default gateways, and routing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 1 Fundamentals and Protocols. The section links point to the parts of the book it draws on.