Advertising BGP Routes to Neighbors

Advertising BGP Routes to Neighbors

The antecedent area focused on the accoutrement that BGP can use to inject routes into a bounded router’s

BGP table. BGP routers booty routes from the bounded BGP table and acquaint a subset of those routes

to their BGP neighbors. This area continues absorption on the BGP table because the BGP route

advertisement action takes routes from the BGP table and sends them to adjoining routers,

where the routes are added to the neighbors’ BGP tables. Later, the final aloft area in the

chapter, “Building the IP Acquisition Table,” focuses on the rules apropos how BGP places routes

into the IP acquisition table.

BGP Amend Message

Once a BGP table has a account of routes, paths, and prefixes, the router needs to acquaint the

information to adjoining routers. To do so, a router sends BGP Amend letters to its

neighbors. Figure 11-5 shows the accepted architecture of the BGP Amend message.

368 Chapter 11: BGP

Figure 11-5 BGP Amend Bulletin Format

Each Amend bulletin has three capital parts:

■ The Aloof Routes acreage enables BGP to acquaint its neighbors about bootless routes.

■ The Aisle Attributes acreage lists the PAs for anniversary route. NEXT_HOP and AS_PATH are sample

values for this field.

■ The Prefix and Prefix Breadth fields ascertain anniversary alone NLRI.

The axial abstraction in an alone Amend bulletin is the set of PAs. Then, all the prefixes

(NLRIs) that allotment the exact aforementioned set of PAs and PA ethics are included at the end of the Update

message. If a router needs to acquaint a set of NLRIs, and anniversary NLRI has a altered ambience for

at atomic one PA, again abstracted Amend letters will be appropriate for anniversary NLRI. However, when

many routes allotment the aforementioned PAs—typical of prefixes endemic by a accurate ISP, for instance—

multiple NLRIs are included in a distinct Update. This reduces router CPU amount and uses beneath link

bandwidth.

Determining the Capacity of Updates

A router builds the capacity of its Amend letters based on the capacity of its BGP table.

However, the router charge accept which subset of its BGP table entries to acquaint to each

neighbor, with the set acceptable capricious from acquaintance to neighbor. Table 11-8 summarizes the rules

about which routes BGP does not accommodate in acquisition updates to anniversary neighbor; anniversary aphorism is

described added absolutely afterward the table.

Length (Bytes) of Aloof Routes Section

Withdrawn Routes (Variable)

Length (Bytes) of Aisle Attributes Section

Path Attributes (Variable)

Prefix Breadth Prefix (Variable)

Prefix Breadth Prefix (Variable)

...

2 Bytes Wide

Building the BGP Table 369

BGP alone advertises a avenue to ability a accurate subnet (NLRI) if that avenue is advised to be

the best route. If a BGP router learns of alone one avenue to ability a accurate prefix, the decision

process is absolute simple. However, aback allotment amid assorted paths to ability the aforementioned prefix,

BGP determines the best avenue based on a diffuse BGP accommodation process, which is alfresco the

scope of this book. Assuming that none of the routers has configured any acquisition behavior that

impact the accommodation process, the accommodation timberline reduces to a four-step action that is mainly

comprised of tie-breakers, as follows:

1. Accept the avenue with the beeline AS_PATH.

2. If AS_PATH breadth is a tie, adopt a distinct eBGP-learned avenue over one or added iBGP routes.

3. If the best avenue has not yet been chosen, accept the avenue with the everyman IGP metric to the

NEXT_HOP of the routes.

4. If the IGP metric ties, accept the iBGP-learned avenue with the everyman BGP RID of the

advertising router.

Additionally, BGP rules out some routes from actuality advised best based on the amount of the

NEXT_HOP PA. For a avenue to be a applicant to be advised best, the NEXT_HOP charge be either:

■ 0.0.0.0, as the aftereffect of the avenue actuality injected on the bounded router.

■ Attainable according to that router’s accepted IP acquisition table. In added words, the NEXT_HOP

IP abode charge bout a avenue in the acquisition table.

Because the NEXT_HOP PA is so important with attention to BGP’s best of its best aisle to reach

each NLRI, this area summarizes the argumentation and provides several examples. The argumentation is

separated into two genitalia based on whether the avenue is actuality advertised to an iBGP or eBGP peer.

By default, aback sending to an eBGP peer, the NEXT_HOP is afflicted to an IP abode on the

advertising router—specifically, to the aforementioned IP abode the router acclimated as the antecedent IP abode of

the BGP Amend message, for anniversary corresponding neighbor. Aback sending to an iBGP peer, the default

action is to leave the NEXT_HOP PA unchanged. Both of these absence behaviors can be changed

via the commands listed in Table 11-9.

Table 11-8 Arbitrary of Rules Apropos Which Routes BGP Does Not Accommodate in an Update

iBGP and/or eBGP Routes Not Taken from the BGP Table

Both Routes that are not advised “best”

Both Routes akin by a abjure article in an outbound BGP filter

iBGP iBGP-learned routes*

eBGP Routes whose AS_PATH includes the ASN of the eBGP associate to which

a BGP Amend will be sent

*This aphorism is airy or afflicted as a aftereffect of application avenue reflectors or confederations.

370 Chapter 11: BGP

Note that the NEXT_HOP PA cannot be set via a avenue map; the alone way to change the

NEXT_HOP PA is through the methods listed in Table 11-9.

Example: Impact of the Accommodation Action and NEXT_HOP on BGP Updates

The abutting several examples calm appearance a arrangement of contest apropos the advancement of

network 31.0.0.0/8 by BGP throughout the arrangement of Figure 11-4. R6 originated the routes in the

30s (as in Archetype 11-4) by redistributing EIGRP routes abstruse from R9. The purpose of this

series of examples is to explain how BGP chooses which routes to accommodate in Updates under

various conditions.

The aboriginal example, Archetype 11-9, focuses on the commands acclimated to appraise what R6 sends to R1,

what R1 receives, and the consistent entries in R1’s BGP table. The additional example, Archetype 11-10,

then examines those aforementioned routes broadcast from R1 to R3, including problems accompanying to R1’s

default behavior of not alteration the NEXT_HOP PA of those routes. Finally, Archetype 11-11

shows the band-aid of R1’s use of the acquaintance 3.3.3.3 next-hop-self command, and the impact

that has on the capacity of the BGP Updates in AS 123.

Table 11-9 Altitude for Alteration the NEXT_HOP PA

Type of

Neighbor Absence Action for Advertised Routes

Command to Switch to

Other Behavior

iBGP Do not change the NEXT_HOP neighbor… next-hop-self

eBGP Change the NEXT_HOP to the amend antecedent IP abode neighbor… next-hopunchanged

Example 11-9 R6 Sending the 30s Networks to R1 Application BGP

! R6 has injected the three routes listed below; they were not abstruse from

! addition BGP neighbor. Agenda all three appearance up as >, acceptation they are the best

! (and alone in this case) routes to the destination NLRIs.

R6# appearance ip bgp

BGP table adaptation is 5, bounded router ID is 6.6.6.6

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 10.1.69.9 156160 32768 ?

*> 32.0.0.0 0.0.0.0 32768 i

*> 32.1.1.0/24 10.1.69.9 156160 32768 ?

! R6 now lists the routes it advertises to R1—sort of. This command lists R6’s

! BGP table entries that are advised to be sent, but R6 can (and will in this

! case) change the advice afore announcement to R1. Pay accurate attention

! to the Abutting Hop column, against accessible commands on R1. In effect, this command

shows R6’s accepted BGP table entries that will be beatific to R1, but it shows them

Building the BGP Table 371

before R6 makes any changes, including NEXT_HOP.

R6# appearance ip bgp acquaintance 172.16.16.1 advertised-routes

BGP table adaptation is 5, bounded router ID is 6.6.6.6

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 10.1.69.9 156160 32768 ?

*> 32.0.0.0 0.0.0.0 32768 i

*> 32.1.1.0/24 10.1.69.9 156160 32768 ?

Total cardinal of prefixes 3

! The abutting command (R1) lists the advice in the accustomed BGP amend from R6. Note

! that the NEXT_HOP is different; R6 afflicted the NEXT_HOP afore sending the

! update, because it has an eBGP associate affiliation to R1, and eBGP defaults to set

! NEXT_HOP to itself. As R6 was application 172.16.16.6 as the IP abode from which to

! accelerate BGP letters to R1, R6 set NEXT_HOP to that number. Additionally agenda that R1 lists

! the adjoining AS (678) in the Aisle cavalcade at the end, blame the AS_PATH

! for the route.

R1# appearance ip bgp acquaintance 172.16.16.6 received-routes

BGP table adaptation is 7, bounded router ID is 111.111.111.111

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 172.16.16.6 156160 0 678 ?

*> 32.0.0.0 172.16.16.6 0 0 678 i

*> 32.1.1.0/24 172.16.16.6 156160 0 678 ?

Total cardinal of prefixes 3

! The appearance ip bgp arbitrary command lists the accompaniment of the acquaintance until the

! acquaintance becomes established; at that point, the State/PfxRcd cavalcade lists the number

! of NLRIs (prefixes) accustomed (and still valid) from that neighbor.

R1# appearance ip bgp arbitrary | activate Neighbor

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 123 55 57 7 0 0 00:52:30 0

3.3.3.3 4 123 57 57 7 0 0 00:52:28 3

172.16.16.6 4 678 53 51 7 0 0 00:48:50 3

! R1 has additionally abstruse of these prefixes from R3, as apparent below. The routes through

! R6 accept one AS in the AS_PATH, and the routes through R3 accept two autonmous systems, so the

! routes through R6 are best. Also, the iBGP routes accept an “i” for “internal”

! aloof afore the prefix.

R1# appearance ip bgp

BGP table adaptation is 7, bounded router ID is 111.111.111.111

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

continues

Example 11-9 R6 Sending the 30s Networks to R1 Application BGP (Continued)

372 Chapter 11: BGP

Example 11-9 showed examples of how you can appearance the capacity of the absolute Updates beatific to

neighbors (using the appearance ip bgp acquaintance advertised-routes command) and the capacity of

Updates accustomed from a acquaintance (using the appearance ip bgp acquaintance received-routes command).

RFC 1771 suggests that the BGP RIB can be afar into apparatus for accustomed Updates from

each acquaintance and beatific Updates for anniversary neighbor. Most implementations (including Cisco IOS)

keep a distinct RIB, with notations as to which entries were beatific and accustomed to and from each

neighbor.

These appearance ip bgp acquaintance commands with the advertised-routes advantage account the BGP table

entries that will be advertised to that neighbor. However, agenda that any changes to the PAs inside

each access are not apparent in the command output. For example, the appearance ip bgp neighbor

172.16.16.1 advertised-routes command on R6 listed the NEXT_HOP for 31/8 as 10.1.69.9,

which is accurate of that access in R6’s BGP table. R6 again changes the NEXT_HOP PA afore sending

the absolute Update, with a NEXT_HOP of 172.16.16.6.

By the end of Archetype 11-9, R1 knows of both paths to anniversary of the three prefixes in the 30s

(AS_PATH 678 and 45-678), but has called the beeline AS_PATH (through R6) as the best path

in anniversary case. Agenda that the > in the appearance ip bgp achievement designates the routes as R1’s best routes. Next,

Example 11-10 shows some possibly hasty after-effects on R3 accompanying to its choices of best routes.

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

* i31.0.0.0 3.3.3.3 0 100 0 45 678 ?

*> 172.16.16.6 156160 0 678 ?

* i32.0.0.0 3.3.3.3 0 100 0 45 678 i

*> 172.16.16.6 0 0 678 i

* i32.1.1.0/24 3.3.3.3 0 100 0 45 678 ?

*> 172.16.16.6 156160 0 678 ?

NOTE For the received-routes advantage to work, the router on which the command is acclimated must

have the acquaintance neighbor-id soft-reconfiguration entering BGP subcommand configured

for the added neighbor.

Example 11-10 Examining the BGP Table on R3

! R1 now updates R3 with R1’s “best” routes

R1# appearance ip bgp acquaintance 3.3.3.3 advertised-routes | activate Network

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 172.16.16.6 156160 0 678 ?

*> 32.0.0.0 172.16.16.6 0 0 678 i

*> 32.1.1.0/24 172.16.16.6 156160 0 678 ?

Example 11-9 R6 Sending the 30s Networks to R1 Application BGP (Continued)

Building the BGP Table 373

Example 11-10 credibility out a aberration with some analogue in the appearance ip bgp command output, as

well as an important architecture best with BGP. First, the command achievement lists * as acceptation valid;

however, that appellation artlessly agency that the avenue is a applicant for use. Afore the avenue can

be absolutely acclimated and added to the IP acquisition table, the NEXT_HOP charge additionally be reachable. In

some cases, routes that the appearance ip bgp command considers “valid” ability not be accessible routes,

with Archetype 11-10 assuming aloof such an example.

Each BGP route’s NEXT_HOP charge be attainable for a avenue to be absolutely valid. With all default

settings, an iBGP-learned avenue has a NEXT_HOP IP abode of the aftermost eBGP router to advertise

the route. For example, R3’s avenue to 31.0.0.0/8 through R1 lists R6’s IP abode (172.16.16.6) in

the NEXT_HOP field. Unfortunately, R3 does not accept a avenue for 172.16.16.6, so that route

cannot be advised “best” by BGP.

There are two accessible choices to break the problem:

■ Make the eBGP neighbor’s IP abode attainable by announcement that subnet into the IGP.

■ Use the next-hop-self advantage on the acquaintance command that credibility to iBGP peers.

Total cardinal of prefixes 3

! R3 accustomed the routes, but R3’s best routes to anniversary prefix point aback to

! R4 in AS 45, with AS_PATH 45-678, which is a best path. The avenue through R1

! cannot be “best” because the NEXT_HOP was beatific banausic by iBGP acquaintance R1.

R3# appearance ip bgp

BGP table adaptation is 7, bounded router ID is 3.3.3.3

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 4.4.4.4 0 45 678 ?

* i 172.16.16.6 156160 100 0 678 ?

*> 32.0.0.0 4.4.4.4 0 45 678 i

* i 172.16.16.6 0 100 0 678 i

*> 32.1.1.0/24 4.4.4.4 0 45 678 ?

* i 172.16.16.6 156160 100 0 678 ?

! Proof that R3 cannot ability the next-hop IP abode is apparent next.

R3# ping 172.16.16.6

Type escape arrangement to abort.

Sending 5, 100-byte ICMP Echos to 172.16.16.6, abeyance is 2 seconds:

.....

Success amount is 0 percent (0/5)

Example 11-10 Examining the BGP Table on R3 (Continued)

374 Chapter 11: BGP

The aboriginal advantage about can be calmly implemented. Because abounding eBGP neighbors use interface

IP addresses on their acquaintance commands, the NEXT_HOP exists in a subnet anon connected

to the AS. For example, R1 is anon affiliated to 172.16.16.0/24, so R1 could artlessly advertise

that affiliated subnet into the IGP central the AS.

However, this advantage ability be ambiguous aback loopback addresses are acclimated for BGP neighbors.

For example, if R1 had been configured to accredit to R6’s 6.6.6.6 loopback IP address, and it was

working, R1 charge accept a avenue to ability 6.6.6.6. However, it is beneath acceptable that R1 would already

be announcement a avenue to ability 6.6.6.6 into ASN 123.

The additional advantage causes the router to change the NEXT_HOP PA to one of its own IP addresses—

an abode that is added acceptable to already be in the neighbor’s IP acquisition table, which works well

even if application loopbacks with an eBGP peer. Archetype 11-11 credibility out such a case, with R1 using

the acquaintance next-hop-self command, announcement itself (1.1.1.1) as the NEXT_HOP. As a result,

R3 changes its best of best routes, because R3 has a avenue to ability 1.1.1.1, advantageous the

“NEXT_HOP unreachable” problem.

Example 11-11 credibility out how an iBGP associate can set NEXT_HOP to itself. However, it’s additionally a

good archetype of how BGP decides aback to acquaint routes to iBGP peers. The archetype follows

this sequence, with the command achievement assuming affirmation of these events:

1. The archetype begins like the end of Archetype 11-10, with R1 announcement routes with R6 as the

next hop, and with R3 not actuality able to use those routes as best routes.

2. Because R3’s best routes are eBGP routes (through R4), R3 is accustomed to acquaint those

routes to R2.

3. R1 again changes its agreement to use NEXT_HOP SELF.

4. R3 is now able to amusement the routes abstruse from R1 as R3’s best routes.

5. R3 can no best acquaint its best routes to these networks to R2, because the new best routes

are iBGP routes.

Example 11-11 R3 Advertises the 30s Networks to R2, and Again R3 Withdraws the Routes

! (Step 1): At this point, R3 still believes its best avenue to all three prefixes

! in the 30s is through R4; as those are eBGP routes, R3 advertises all three

! routes to iBGP associate R2, as apparent next.

R3# appearance ip bgp acquaintance 2.2.2.2 advertised-routes

BGP table adaptation is 7, bounded router ID is 3.3.3.3

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Building the BGP Table 375

Network Abutting Hop Metric LocPrf Weight Path

*> 31.0.0.0 4.4.4.4 0 45 678 ?

*> 32.0.0.0 4.4.4.4 0 45 678 i

*> 32.1.1.0/24 4.4.4.4 0 45 678 ?

Total cardinal of prefixes 3

! (Step 2) R2 lists the cardinal of prefixes abstruse from R3 abutting (3).

R2# appearance ip bgp arbitrary | activate Neighbor

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

1.1.1.1 4 123 212 210 7 0 0 03:27:59 3

3.3.3.3 4 123 213 211 7 0 0 03:28:00 3

! (Step 3) R1 now changes to use next-hop-self to associate R3.

R1# conf t

Enter agreement commands, one per line. End with CNTL/Z.

R1(config)# router bgp 123

R1(config-router)# neigh 3.3.3.3 next-hop-self

! (Step 4) R3 now lists the routes through R1 as best, because the new

! NEXT_HOP is R1’s amend antecedent IP address, 1.1.1.1, which is attainable by R3.

R3# appearance ip bgp

BGP table adaptation is 10, bounded router ID is 3.3.3.3

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Abutting Hop Metric LocPrf Weight Path

* 31.0.0.0 4.4.4.4 0 45 678 ?

*>i 1.1.1.1 156160 100 0 678 ?

* 32.0.0.0 4.4.4.4 0 45 678 i

*>i 1.1.1.1 0 100 0 678 i

* 32.1.1.0/24 4.4.4.4 0 45 678 ?

*>i 1.1.1.1 156160 100 0 678 ?

! (Step 5) First, agenda aloft that all three “best” routes are iBGP routes, as acclaimed by the “i”

! anon afore the prefix. R3 alone advertises “best” routes, with the added

! claim that it charge not acquaint iBGP routes to added iBGP peers. As a

! result, R3 has aloof the routes that had aforetime been beatific to R2.

R3# appearance ip bgp acquaintance 2.2.2.2 advertised-routes

Total cardinal of prefixes 0

! The abutting command confirms on R2 that it no best has any prefixes abstruse from

! R3.

R2# appearance ip bgp arbitrary | activate Neighbor

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

1.1.1.1 4 123 213 211 7 0 0 03:28:44 3

3.3.3.3 4 123 214 211 7 0 0 03:28:46 0

Example 11-11 R3 Advertises the 30s Networks to R2, and Again R3 Withdraws the Routes (Continued)

Summary of Rules for Routes Advertised in BGP Updates

The afterward account summarizes the rules dictating which routes a BGP router sends in its Update

messages:

■ Accelerate alone the best avenue listed in the BGP table.

■ To iBGP neighbors, do not acquaint paths abstruse from added iBGP neighbors.

■ To eBGP neighbors, do not acquaint paths for which the neighbor’s AS is already in the

AS_PATH PA.

■ Do not acquaint suppressed or abject routes.

■ Do not acquaint routes filtered via configuration.

The aboriginal two rules accept been covered in some abyss in this section. The actual rules are outside

the ambit of this book.