No history yet

PBR Decision Logic

Routing by Intent, Not by Destination

A router's primary job is to act like a postal service for data. It looks at the destination address on a packet, consults its map—the Routing Information Base (RIB)—and forwards the packet along the best path. This destination-based logic is efficient and straightforward. But what if you need to route traffic based on who sent it, or what kind of data it is, rather than just where it's going?

This is where Policy-Based Routing (PBR) comes in. PBR is a routing exception. It allows you to create rules that inspect packets for more than just their destination. Think of it as giving special handling instructions. While the RIB provides the default public roads, PBR creates a private, unlisted route for specific traffic that needs it.

PBR intercepts packets early, making routing decisions based on criteria you define, effectively overriding the standard routing table for that specific traffic.

The Order of Operations

To understand PBR, you need to know when it acts. Its power comes from its position in the router's decision-making process. PBR rules are checked before the router performs a standard RIB lookup.

Here's the sequence when a packet arrives on an interface where a PBR policy is applied:

This pre-emptive check is what gives PBR its power. If a packet matches a policy, it's sent on its way without ever consulting the main routing table. If it doesn't match any policy rules, it simply falls through to the normal routing process as if PBR wasn't there.

Traffic Classification Criteria

A PBR policy is built using route-map configurations, which function like if-then statements. A contains match conditions (the "if") and set actions (the "then"). You can classify traffic using a wide range of criteria.

Match CriteriaCommon Use Case
match ip address [acl]Route traffic from a specific server through a faster, more expensive link, while sending general user traffic over a standard link.
match length [min] [max]Send small, interactive packets (like SSH) over a low-latency path, and large bulk transfers (like FTP) over a high-throughput path.
match ip protocol [protocol]Isolate voice traffic (e.g., UDP for VoIP) onto a dedicated link with guaranteed quality of service.
match ip precedence/dscpHonor Quality of Service (QoS) markings by routing high-priority traffic over premium paths.

PBR can also be applied in two ways: on an interface or locally on the router. Interface PBR affects traffic entering a specific interface from the network. Local PBR affects traffic generated by the router itself, such as management traffic or packets from routing protocol updates.

Impact on Switching Performance

There's a critical performance trade-off to consider when implementing PBR. Modern routers don't use the main CPU for every forwarding decision. Instead, they use specialized hardware and a pre-computed forwarding table. This method, known as (CEF), is extremely fast.

Standard destination-based lookups are CEF-switched. However, because PBR introduces complex, conditional logic, it can force the router to bypass the fast hardware path. The router's main CPU must then inspect the packet and make a forwarding decision, a much slower method called .

While many modern platforms can now hardware-accelerate certain PBR policies, complex route-maps often force a fallback to slower process switching. This can create a performance bottleneck if applied to high-volume traffic flows.

Therefore, PBR should be used strategically. It is an excellent tool for special cases and policy exceptions, but it is not a replacement for a well-designed, destination-based routing architecture. Understanding its impact on the forwarding plane is key to using it effectively without unintentionally degrading network performance.

Quiz Questions 1/5

What is the primary function of Policy-Based Routing (PBR)?

Quiz Questions 2/5

When a packet arrives on an interface with a PBR policy applied, what is the first major step the router takes in the forwarding process for that packet?