团队文章互联网怎样运作

Why ISPs and enterprises rely on CIDR for routing efficiency

How CIDR groups addresses and summarizes routes: a worked /22 example, prefix lengths, routing benefits and the limits of aggregation.

目录

Four white homes with separate blue paths join a single blue approach road.
One direction can lead towards a whole group of destinations. The more detailed paths still matter inside that group.

A delivery driver does not need directions to every room in a building before reaching its entrance. Networks can use the same kind of simplification: one route can point towards a group of destinations, while routers closer to them handle the detail. CIDR makes that grouping possible without the old fixed address classes.

First, read the number after the slash

CIDR stands for Classless Inter-Domain Routing. In 192.168.0.0/24, the /24 means that the first 24 of an IPv4 address’s 32 bits form the shared prefix. Eight bits remain, so the block contains 256 addresses. A /25 contains 128; a /22 contains 1,024. A larger number after the slash means a smaller block.

These are total address counts, not a promise of that many devices. An ordinary IPv4 LAN subnet reserves network and broadcast addresses, and gateways also need addresses. For example, a conventional /25 has 126 host addresses before allowing for the gateway and other infrastructure. Our IPv4 address-structure guide explains the arithmetic.

Four routes can become one useful summary

Consider four private subnets inside a company network:

  • 192.168.0.0/24
  • 192.168.1.0/24
  • 192.168.2.0/24
  • 192.168.3.0/24

Together they exactly fill 192.168.0.0/22, from 192.168.0.0 through 192.168.3.255. An upstream router can use one summary towards the network serving all four, instead of carrying four separate entries. Routers inside that network still need the more detailed paths. This is an internal example: private address ranges must not be advertised onto the public Internet.

The boundary matters. Combining only the last three subnets into that /22 would also cover 192.168.0.0/24. Aggregation is not simply a matter of choosing a large enough box. Check every address the summary includes, the routes behind it and whether you are entitled to announce the block.

What providers and enterprises gain

For a provider, aggregating compatible customer routes can reduce the routing information that other networks must carry. BGP, the protocol networks use to exchange reachability information, supports these prefixes. The benefit is manageable routing state and fewer separate announcements; it does not guarantee that every packet or web page will become faster.

For an enterprise, prefix lengths make it possible to plan subnets that fit actual needs, with room for growth, instead of choosing only the historical class A, B or C sizes. Planning addresses and summarizing routes are related tasks, but dividing a block into subnets does not automatically create a useful summary everywhere in the network.

A summary must still lead to the right place

In the forwarding table, a more specific matching route wins over a broader one. If both a /22 and a matching /24 are present, the /24 directs that traffic. A customer connected to several providers or a deliberate traffic-engineering choice may therefore require separate, more specific announcements.

The router originating a summary also needs a discard route for destinations covered by the summary but lacking a more specific path. Otherwise, a missing subnet could send packets back towards an upstream router and create a loop. These aggregation rules are described in RFC 4632.

Efficiency without confusing coordination with control

CIDR lets networks describe where traffic can go with less repetitive information. It does not settle ownership, transfer rights or who should control number resources. Keeping the technical mechanism clear makes those wider questions easier to examine. Start with public and private address scope, then read Lu Heng’s Note 29 for his argument about operator autonomy and IPv4 assets.