What is a Network Prefix (CIDR)?

A network prefix is a block of contiguous IP addresses that are routed as a single unit. Prefixes are written in CIDR notation — the starting IP address followed by a slash and the prefix length. For example, 8.8.8.0/24 represents all 256 addresses from 8.8.8.0 to 8.8.8.255.

CIDR Notation Explained

CIDR stands for Classless Inter-Domain Routing, introduced in 1993 to replace the old class-based system (Class A, B, C). The number after the slash indicates how many bits of the address are the "network" part:

Each additional bit in the prefix length halves the number of addresses. A /23 has 512 addresses, a /24 has 256, a /25 has 128, and so on.

Prefixes in BGP

BGP routes traffic based on prefixes. Each autonomous system announces the prefixes it is responsible for. When multiple prefixes overlap, routers use the longest prefix match rule — the most specific (longest) prefix wins.

For example, if one AS announces 8.8.0.0/16 and another announces 8.8.8.0/24, traffic destined for 8.8.8.8 would follow the /24 route because it is more specific.

This is why BGP hijacks can be effective: an attacker can announce a more specific prefix than the legitimate holder, attracting traffic. RPKI helps prevent this by allowing prefix holders to cryptographically specify the maximum prefix length that should be accepted.

Prefix Size Conventions

Most networks follow conventions about which prefix sizes they will accept:

These filtering policies exist to prevent the global routing table from growing unmanageably large. If every /32 (single IP) were announced individually, the routing table would contain billions of entries instead of roughly one million.

See Prefixes in Action

When you look up any IP address, the result shows the most specific prefix covering that address. Look up an ASN to see all the prefixes that network announces:

See BGP routing data in real time

Open Looking Glass
More Articles
What is BGP? The Internet's Routing Protocol Explained
What is an Autonomous System (AS)?
What is a BGP Looking Glass?
How to Look Up an IP Address's BGP Route
Understanding BGP AS Paths
What is RPKI? Securing BGP Routing
What is DNS? The Internet's Phone Book
What is an IP Address?
IPv4 vs IPv6: What's the Difference?
What is an Internet Exchange Point (IXP)?
What is Peering? How Networks Interconnect
How Does Traceroute Work?
What is a CDN? Content Delivery Networks Explained
What is DNS over HTTPS (DoH)?
What is a BGP Hijack?
What are TLDs? Top-Level Domains Explained
What is Anycast? One IP, Many Servers
What is a Subnet? IP Subnetting Explained