BGP Question

Unanswered Question
Mar 10th, 2008
User Badges:

As a general rule...

BGP selects the shorts prefix match or the longest prefix match..

And could you provide me with some documentation to support your answer..


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
royalblues Mon, 03/10/2008 - 06:37
User Badges:
  • Green, 3000 points or more

Any routing protocol would always prefer the longest mask or the more specific route

This is mentioned in the RFC

Have a look at section Route Resolvability Condition (RFC 4721)

The route resolvability condition is defined as follows:

1) A route Rte1, referencing only the intermediate network address, is considered resolvable if the Routing Table contains

at least one resolvable route Rte2 that matches Rte1's ntermediate network address and is not recursively resolved directly or indirectly) through Rte1. If multiple matching routes are available, only the longest matching route SHOULD be considered.



Mavrick25 Mon, 03/10/2008 - 06:49
User Badges:


Thanks for the information..

I could have sworn that it was the shortest prefix length..

I made mistake..


Harold Ritter Mon, 03/10/2008 - 08:41
User Badges:
  • Cisco Employee,


Actually the routing protocols as such don't really care about shorter or longer prefixes. If a shorter and longer prefix are learnt by a routing protocol, they are considered as two different entities and are both installed in the RIB.

It is at the data plane level that the distinction is made and that the longest prefix match will apply.


Mavrick25 Mon, 03/10/2008 - 09:12
User Badges:

Thanks again..

I just want to get this straight..

If R1 is populating a route through aggregation...


R2 is populating a BGP without aggregation..

The non-aggregated route will be perfered down the chain..


Harold Ritter Tue, 03/11/2008 - 13:36
User Badges:
  • Cisco Employee,

That is correct. If both routes are installed in the RIB, the non-aggregated route will be used for forwarding packets, assuming the destination address matches this non-aggregated routes obviously.



This Discussion