Course contents

Module 3: Stability and SecurityLesson 3.4 (4 of 4 in this module)11 of 14 in the Advanced BGP course

Lab: redundant reflectors, BFD and prefix limits

One reflector is one failure away from a blind network. This lab builds a pair that share a cluster ID, removes one on purpose, and then protects the ISP link with fast failure detection and a limit on what the provider can send.

Advanced · 25 min read

You'll learn to configure two route reflectors with a shared cluster ID, show that clients keep their routes when one fails, enable BFD on an eBGP session, and use maximum-prefix to protect against a provider leak.

The goal

You are extending the route reflector design from the first BGP course. The company AS 64500 now has two reflectors, RR1 with the loopback 10.255.0.9 and the router ID 9.9.9.1, and RR2 with the loopback 10.255.0.10 and the router ID 9.9.9.2. R1 is the border router, with eBGP to ISP A at 192.0.2.1. C1 (10.255.0.11) and C2 (10.255.0.12) are inside clients. All loopbacks are reachable through OSPF.

By the end, losing one reflector costs the clients nothing, a silent failure on the ISP link is noticed in under a second, and a provider that sends too many prefixes cannot fill the routing table.

Diagram
The advanced lab: two reflectors, one cluster ID, BFD to the ISP
The advanced lab: two reflectors, one cluster ID, BFD to the ISP
The advanced lab: two reflectors, one cluster ID, BFD to the ISPTwo route reflectors, RR1 with loopback 10.255.0.9 and RR2 with loopback 10.255.0.10, share the cluster ID 9.9.9.9. Three clients, the border router R1, C1 and C2, each have an iBGP session to both reflectors. R1 also has an eBGP session to ISP A with BFD running on the link.RR110.255.0.9RR210.255.0.10Cluster ID9.9.9.9R1border, 10.255.0.1C110.255.0.11C210.255.0.12eBGP with BFD, 300 ms x 3ISP AAS 64501

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each client has two sessions, so losing one reflector removes one copy of each route, not the routes themselves. BFD guards the ISP link, where a silent failure would otherwise take the whole hold time to notice.
Diagram
Four failures, four protections
Four failures, four protections
FailureWhat the clients seeWhat handles itWhere to check
One reflector downOne path left, route keptA second reflector and a second sessionshow ip bgp summary on a client
Both reflectors downRoutes learned through them are removedNothing in this lab; a third reflector or a full mesh wouldshow ip bgp summary on a client
Silent failure of the ISP linkSession stays up until the hold time endsBFD with fall-overshow bfd neighbors on R1
Provider sends too many prefixesTable grows, memory and CPU risemaximum-prefixshow ip bgp summary on R1
The lab builds the first, third and fourth protection. The second row is the limit of a pair, so know it before you rely on one.

Step 1: build both reflectors with one cluster ID

A cluster ID names the group of reflectors that serve the same clients. A reflector adds its cluster ID to each route it reflects and drops a route that already carries its own. With the same ID on both, a reflector ignores a copy that the other one reflected, which is correct here because both hear every route directly from the clients.

Diagram
One cluster ID or two
One cluster ID or two

With one shared cluster ID, a reflector drops a route that carries its own ID, so the pair keeps less state but each client needs a session to both. With two IDs, each reflector accepts what the other reflects, so there are more copies and more protection against a broken client session.

Shared IDOwn ID in the listmeans dropFewer copies
Separate IDsCopy from the otherreflector is keptMore copies
Both are valid. This lab uses one ID, and the two reflectors do not peer, so the choice shows only in the cluster list.
router bgp 64500 bgp router-id 9.9.9.1 bgp cluster-id 9.9.9.9 neighbor CLIENTS peer-group neighbor CLIENTS remote-as 64500 neighbor CLIENTS update-source Loopback0 neighbor 10.255.0.1 peer-group CLIENTS neighbor 10.255.0.11 peer-group CLIENTS neighbor 10.255.0.12 peer-group CLIENTS address-family ipv4 unicast neighbor CLIENTS route-reflector-client neighbor 10.255.0.1 activate neighbor 10.255.0.11 activate neighbor 10.255.0.12 activate

RR1. On RR2, use router-id 9.9.9.2 and the same cluster ID 9.9.9.9. Everything else is identical.

router bgp 64500 neighbor 10.255.0.9 remote-as 64500 neighbor 10.255.0.9 update-source Loopback0 neighbor 10.255.0.10 remote-as 64500 neighbor 10.255.0.10 update-source Loopback0 address-family ipv4 unicast neighbor 10.255.0.9 activate neighbor 10.255.0.10 activate

C1 and C2. Two ordinary iBGP sessions, one to each reflector. On R1, add next-hop-self for both neighbours, because R1 learns the ISP routes over eBGP.

Example output written for this lesson, not a router capture
C1#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.255.0.9      4 64500      45      44       12    0    0 00:12:31        1
10.255.0.10     4 64500      44      44       12    0    0 00:12:29        1
Two Established sessions, each carrying the one prefix the ISP sends. The client has two sources for every route, which is the whole benefit of the design.
Example output written for this lesson, not a router capture
C1#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 12
Paths: (2 available, best #1, table default)
  64501
    10.255.0.1 (metric 20) from 10.255.0.9 (9.9.9.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 1.1.1.1, Cluster list: 9.9.9.9
  64501
    10.255.0.1 (metric 20) from 10.255.0.10 (9.9.9.2)
      Origin IGP, metric 0, localpref 100, valid, internal
      Originator: 1.1.1.1, Cluster list: 9.9.9.9
The same route arrives twice, once from each reflector. Both copies name R1 as the originator and list the shared cluster ID. The first wins on the lower router ID, 9.9.9.1.
Diagram
Build order for the reflector pair
Build order for the reflector pair

Reflectors first, then clients, then verification.

  1. Reflectorssame cluster ID,client flag
  2. Clientstwo sessionseach
  3. Verifytwo paths,one cluster list
If a client shows one path instead of two, the fault is on the second reflector or its session.

Step 2: fail one reflector

Take RR1 out of service by shutting its loopback. With default timers the clients notice when the hold time of 180 seconds expires, so give it three minutes. While you wait, keep a ping running from C1 to 203.0.113.1.

Example output written for this lesson, not a router capture
C1#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.255.0.9      4 64500      60      59       12    0    0 00:00:20 Idle
10.255.0.10     4 64500      75      74       12    0    0 00:21:45        1
The session to RR1 is down. The session to RR2 is untouched and still holds the route.
Example output written for this lesson, not a router capture
C1#show ip bgp 203.0.113.0
BGP routing table entry for 203.0.113.0/24, version 12
Paths: (1 available, best #1, table default)
  64501
    10.255.0.1 (metric 20) from 10.255.0.10 (9.9.9.2)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      Originator: 1.1.1.1, Cluster list: 9.9.9.9
One path remains, through RR2, and it is valid and best. The ping did not need to be interrupted for the route to survive. Compare this with the single-reflector lab, where losing the reflector removed the routes.
Example output written for this lesson, not a router capture
C1#show logging | include BGP
%BGP-3-NOTIFICATION: sent to neighbor 10.255.0.9 4/0 (hold time expired) 0 bytes
%BGP-5-ADJCHANGE: neighbor 10.255.0.9 Down BGP Notification sent
The client gave up on RR1 because no keepalive arrived for the whole hold time. Keep this wording in mind: step 3 produces a different reason for the ISP link.
Diagram
What C1 does while RR1 is gone
What C1 does while RR1 is gone

The loopback is shut, the session stays up until the hold time ends, then C1 removes the copy from RR1 and keeps the copy from RR2.

  1. RR1 loopback shutNo keepalives reach C1Session still shows Established
  2. Hold time endsDefault 180 secondsC1 closes the session to RR1
  3. C1 recalculatesThe copy from RR1 is removedThe copy from RR2 becomes best
  4. Traffic continuesSame next hop 10.255.0.1No change on the forwarding path
Both copies name the same next hop, 10.255.0.1, so the forwarding path does not change. Only the source of the best path does.

Run no shutdown on RR1's loopback and wait for both sessions to be Established again.

Step 3: add BFD to the ISP link

Three minutes is a long time for a provider link that fails without the interface going down. BFD sends small packets many times a second and tells BGP quickly when they stop. On R1, set the timers on the interface to ISP A and tell the BGP neighbour to follow BFD. ISP A must run BFD on its side too.

interface GigabitEthernet0/0 bfd interval 300 min_rx 300 multiplier 3 router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 fall-over bfd

R1. 300 ms times a multiplier of 3 gives a detection time of 900 ms. fall-over bfd makes BGP close the session when BFD declares the neighbour down.

Example output written for this lesson, not a router capture
R1#show bfd neighbors
NeighAddr          LD/RD     RH/RS     State   Int
192.0.2.1          1/1       Up        Up      Gi0/0
State Up on both sides means the BFD session is running. If the ISP stops answering, BFD declares it down after about 900 ms, and BGP logs the reason.
Example output written for this lesson, not a router capture
R1#show logging | include ADJCHANGE
%BGP-5-ADJCHANGE: neighbor 192.0.2.1 Down BFD adjacency down
The reason says BFD, not hold timer expired. That wording is how you tell later which mechanism noticed the failure.
Example output written for this lesson, not a router capture
R1#show bfd neighbors details
NeighAddr                              LD/RD         RH/RS     State     Int
192.0.2.1                                1/1         Up        Up        Gi0/0
Session state is UP and not using echo function.
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 300000, MinRxInt: 300000, Multiplier: 3
Received MinRxInt: 300000, Received Multiplier: 3
Holddown (hits): 900(0), Hello (hits): 300(4212)
Registered protocols: BGP
The timers are in microseconds, so 300000 is 300 ms. Holddown 900 is the detection time in milliseconds. The last line shows that BGP is registered with the session, which is what fall-over bfd does.
Diagram
BFD timers and detection time
BFD timers and detection time
SettingDetection timeFitsRisk
BGP default, keepalive 60 and hold 180180 secondsNo BFD configuredA silent failure waits three minutes
BFD interval 1000, multiplier 33 secondsLinks with jitter or a busy CPUSlow, few false alarms
BFD interval 300, multiplier 51.5 secondsThe same link with more tolerance600 ms slower than this lab
BFD interval 300, multiplier 3 (this lab)900 msRouted Ethernet to a providerA short burst of loss can trigger it
BFD interval 100, multiplier 3300 msOnly where the platform supports itFlaps if the link drops a few packets
Detection time is the interval multiplied by the multiplier. A faster setting finds a failure sooner and also reacts to a short loss burst that would have healed itself.
Diagram
Detection time with and without BFD
Detection time with and without BFD

Without BFD a silent failure is found when the hold timer expires. With BFD it is found in under a second.

Hold timer180 secondsdefault
BFD 300 ms x 3900 millisecondstunable
BFD changes only how fast the failure is noticed. The backup path still has to exist.

Step 4: cap what the provider can send

A provider leak or a mistake can send hundreds of thousands of prefixes into a router that expected a handful. maximum-prefix sets a ceiling. In this lab ISP A is expected to send fewer than 100 prefixes, so warn at 80 and close the session at 100.

router bgp 64500 address-family ipv4 unicast neighbor 192.0.2.1 maximum-prefix 100 80

R1. The first number is the limit and the second is the warning threshold as a percentage. After the limit is passed, the session is closed and stays closed until you clear it.

Now make ISP A leak 101 prefixes and watch what happens.

Example output written for this lesson, not a router capture
R1#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.0.2.1       4 64501     210     190        0    0    0 00:00:08 Idle (PfxCt)
Idle (PfxCt) means the session was closed because the prefix count exceeded the limit. The table version is 0 because the routes were removed. Clear the session only after the provider confirms the leak is fixed.
Example output written for this lesson, not a router capture
R1#show logging | include MAXPFX|ADJCHANGE
%BGP-4-MAXPFX: Number of prefixes received from 192.0.2.1 (afi 0) reaches 80, max 100
%BGP-3-MAXPFXEXCEED: Number of prefixes received from 192.0.2.1 (afi 0): 101 exceeds limit 100
%BGP-5-ADJCHANGE: neighbor 192.0.2.1 Down BGP Notification sent
Two messages tell the story in order: the warning at 80, then the close at 101. The warning is the early signal. If it appears in production, find out why the provider is sending more before the limit is reached.
Diagram
The prefix limit in three stages
The prefix limit in three stages

Normal, then the warning at 80 prefixes, then the session closes when the count passes 100.

  1. Below 80normal, nomessage
  2. At 80warning islogged
  3. Above 100session closed,routes removed
Set the limit above the normal count with room to grow, and read the warning as an alarm, not noise.
Diagram
Choosing the reaction to the limit
Choosing the reaction to the limit
OptionWhat happens at the limitRecoveryWhen it fits
Default (this lab)The session is closedStays down until clear ip bgpA leak must be fixed before the link returns
restart 5The session is closed and retried after 5 minutesReturns by itselfUnattended sites; a leak that continues closes it again
warning-onlyOnly a log message, the session stays upNothing to recoverMeasuring first; the table can still fill
restart takes minutes, as in neighbor 192.0.2.1 maximum-prefix 100 80 restart 5. The choice is about who fixes the cause and how fast.

Troubleshooting prompts

Diagram
Where a BFD session stays Down
Where a BFD session stays Down

The other side has BFD off, the timers or addresses do not match, UDP port 3784 is blocked, or the interface itself is not passing traffic.

BFD session Down
  • Far side offno bfd on theISP interface
  • Mismatchwrong neighbouror interface
  • Port blockedUDP 3784 onthe path
  • Link probleminterface dropsor errors
Check the far side first, then the path. A BFD session needs both ends.
C1 shows one path instead of two when both reflectors are up

Check the sessions on C1 first. If both are Established, run show ip bgp neighbors 10.255.0.11 | include Reflector on RR2. A missing line means RR2 does not treat C1 as a client and will not reflect the route to it.

The two copies show different cluster lists

The cluster IDs differ. Without bgp cluster-id, each reflector uses its router ID, 9.9.9.1 and 9.9.9.2. Set 9.9.9.9 on both. The result is not wrong, since two IDs are a valid design, but it is not the one this lab builds.

BFD stays Down

Compare the timers on both ends: the slower of the two sides is used, but one side with BFD turned off keeps it Down. Confirm that UDP port 3784 is not blocked on the path to ISP A.

The ISP session flaps after BFD is turned on

Read the log for BFD adjacency down messages and note how long the session stays down. If the link is healthy but a short burst of loss closes the session, the timers are too tight for it. Raise the multiplier first, for example to 5, then the interval, and retest. A faster setting is only useful if the link and the router CPU can sustain it.

Idle (PfxCt) returns straight after clear ip bgp

The provider is still sending more than the limit. Read show ip bgp neighbors 192.0.2.1 | include prefixes for the count, ask the provider to fix the leak, and clear the session only then. Raising the limit to get the session up removes the protection you added it for.

Technical references: RFC 4456, BGP Route Reflection, RFC 5880, BFD and RFC 4486, Cease subcodes (maximum prefixes reached). Output above is an example written for this lesson.

Check what you learned

Predict · scenario 1

RR1 fails. Why does C1 keep the route to 203.0.113.0/24?

Predict · scenario 2

BFD runs with an interval of 300 ms and a multiplier of 3. How long until a silent failure is detected?

Predict · scenario 3

State/PfxRcd shows Idle (PfxCt). What happened?

Predict · scenario 4

A route reflected by RR1 reaches RR2 over a session between the two reflectors. Both use cluster ID 9.9.9.9. What does RR2 do with it?

Predict · scenario 5

BFD runs with an interval of 500 ms and a multiplier of 4. What is the detection time?

Predict · scenario 6

maximum-prefix 100 80 restart 5 is set and the provider keeps leaking. What do you see?

FAQ

Do the two reflectors need a session with each other?
Not in this design. Every client peers with both, so each reflector already hears every route directly from the client that injected it. A session between the reflectors is common in larger designs, where they act as non-clients of each other.
Why is BFD applied to the ISP link and not to the loopback sessions?
Single-hop BFD works between directly connected neighbours. Loopback sessions between routers several hops apart need multihop BFD, or BFD on the IGP links so the route to the loopback disappears quickly. This lab uses the directly connected link.
What does maximum-prefix 100 80 do?
It logs a warning when 80 percent of 100 prefixes have been received and closes the session when the limit is passed. It protects the routing table from a provider leak or a mistake.