95
1 © 2003 Cisco Systems, Inc. All rights reserved. 1 Border Gateway Protocol Chapter 8

Border Gateway Protocol

  • Upload
    glora

  • View
    58

  • Download
    0

Embed Size (px)

DESCRIPTION

Border Gateway Protocol. Chapter 8. Learning Objectives. Explain when and where you would use BGP, and how you can avoid using BGP Describe how BGP operates Explain how BGP aggregates routes. BGP Background. An Exterior Gateway Protocol (EGP) Routes packets between Autonomous systems - PowerPoint PPT Presentation

Citation preview

Page 1: Border Gateway Protocol

1© 2003 Cisco Systems, Inc. All rights reserved.1

Border Gateway Protocol

Chapter 8

Page 2: Border Gateway Protocol

222© 2003, Cisco Systems, Inc. All rights reserved.2

Learning Objectives

• Explain when and where you would use BGP, and how you can avoid using BGP

• Describe how BGP operates• Explain how BGP aggregates routes

Page 3: Border Gateway Protocol

333© 2003, Cisco Systems, Inc. All rights reserved.3

BGP Background

• An Exterior Gateway Protocol (EGP)• Routes packets between Autonomous systems• Based on distance-vector routing protocols• Does not require hierarchical design• Current version BGP-4 contains enhancements,

is more stable, and uses less bandwidth and CPU time

Page 4: Border Gateway Protocol

444© 2003, Cisco Systems, Inc. All rights reserved.4

IBGP and EGBP

• May be used both inside and outside Autonomous System

• Used inside, it is called Internal BGP (IBGP)Exchanges information about external Autonomous SystemsCan exchange routing information between different portions of very large Autonomous System

• Used outside, it is called External BGP (EBGP)

Page 5: Border Gateway Protocol

555© 2003, Cisco Systems, Inc. All rights reserved.5

Routing Between Autonomous Systems

• Autonomous System is cohesive unit with clear definition of routes it contains

EGP will be unable to route packets to all sections in Autonomous System if it is not contiguous

• BGP uses Autonomous System numbers to avoid routing loops

Internet Assigned Numbers Authority (IANA) ultimately responsible for allocating numbersIANA delegated responsibility to number of regional organizations

Page 6: Border Gateway Protocol

666© 2003, Cisco Systems, Inc. All rights reserved.6

Autonomous System Numbers

• Autonomous System numbers are limited• AS Number field is 16 bits long• Maximum of 65,535 possible AS numbers• Some ranges of numbers have been set aside

From 64,512 to 65,535

• BGP called path vector routing protocol because it stores routes that AS passes through

Page 7: Border Gateway Protocol

777© 2003, Cisco Systems, Inc. All rights reserved.7

Using BGP

• BGP adds complexity to routing• Consider carefully before using BGP• Reasons to use BGP

Your AS is multihomed (has multiple connections to other Autonomous Systems)

Other Autonomous Systems use your AS as a transit AS

You need to control traffic entering and leaving your AS

Page 8: Border Gateway Protocol

888© 2003, Cisco Systems, Inc. All rights reserved.8

Reasons to Avoid BGP

• Your AS has a lone connection to the Internet or to another AS

• Your routers do not have enough memory or a CPU to handle thousands of routes

• You do not need to worry about routing policy or controlling traffic as it enters and leaves your AS

• You do not have much bandwidth between Autonomous Systems

• You do not understand BGP well

Page 9: Border Gateway Protocol

999© 2003, Cisco Systems, Inc. All rights reserved.9

How to Avoid Using BGP

• Use static or default routes and redistribute them

See Figure 8-1

Customer uses default route propagated through its OSPF AS with the default-information originate always command

ISP uses static route to get to customer’s AS

Page 10: Border Gateway Protocol

101010© 2003, Cisco Systems, Inc. All rights reserved.10

Connecting to an ISP with a Default Route

Page 11: Border Gateway Protocol

111111© 2003, Cisco Systems, Inc. All rights reserved.11

Using Two Simultaneous Internet Connections

• Two routers may connect to two different Internet Service Providers

See Figure 8-2

• Disadvantage is asymmetric routingPackets take different routes to same destination

Some applications cannot handle packets arriving out of order

Makes troubleshooting more difficult

Page 12: Border Gateway Protocol

121212© 2003, Cisco Systems, Inc. All rights reserved.12

Connecting to Two Different Internet Service Providers

Page 13: Border Gateway Protocol

131313© 2003, Cisco Systems, Inc. All rights reserved.13

Avoiding Asymmetric Routing

• Use one ISP as primary ISP and other as back-up ISP

• Use floating static route• May not provide enough flexibility

Cannot do load balancing

• Can use BGP to get around limitations

Page 14: Border Gateway Protocol

141414© 2003, Cisco Systems, Inc. All rights reserved.14

BGP Protocol Operation

• BGP routers must communicate with each other

Establish neighbor relationships

Exchange routing information

• When routers exchange information, they are called neighbors or peers

Page 15: Border Gateway Protocol

151515© 2003, Cisco Systems, Inc. All rights reserved.15

BGP Neighbor Relationships

• BGP routers, also known as BGP speakers, use TCP port 179 to communicate

All communication between two BGP speakers will be reliable

• Different types of messages used to exchange BGP peer routing information

Page 16: Border Gateway Protocol

161616© 2003, Cisco Systems, Inc. All rights reserved.16

BGP Messages

• Each BGP message has header16-byte Marker field used to authenticate messages from other routers2-byte Length field indicates length of entire message, from 19 bytes to maximum of 4096 bytes1-byte Type field indicates message type

• See Figure 8-3

Page 17: Border Gateway Protocol

171717© 2003, Cisco Systems, Inc. All rights reserved.17

BGP Message Header Format

Page 18: Border Gateway Protocol

181818© 2003, Cisco Systems, Inc. All rights reserved.18

Four Types of BGP Messages

• Open messages used to initiate neighbor relationships and negotiate BGP parameters

• Notification messages used to reset peer relationships between two routers

• Update message used to send information about a single route

• Keepalive messages used to indicate that router accepted an open message and to make sure neighbors are still responding; similar to a hello packet

Page 19: Border Gateway Protocol

191919© 2003, Cisco Systems, Inc. All rights reserved.19

Establishing Neighbor Relationships

• BGP router opens TCP connection and sends open message to find potential BGP peer

IBGP Peers can be anywhere within the AS EBGP are typically adjacent to each other

If not adjacent, they require additional configuration

• See Figure 8-4

Page 20: Border Gateway Protocol

202020© 2003, Cisco Systems, Inc. All rights reserved.20

Format of Open Message

Page 21: Border Gateway Protocol

212121© 2003, Cisco Systems, Inc. All rights reserved.21

Fields in Open Message

• Version - 1-byte field identifying version of BGP• My AS number - 2-byte field containing AS number of sending router• Hold time - maximum time in seconds that router waits between

keepalive or update packets• BGP Identifier - 4-byte field identifying BGP router• Optional parameter length field - 1-byte field containing length of

optional parameters field or set to 0 indicates no optional parameters• Optional parameters - only current one is authentication; more may be

added in future

Page 22: Border Gateway Protocol

222222© 2003, Cisco Systems, Inc. All rights reserved.22

States During Neighbor Negotiation

• BGP routers pass through several states during process of becoming neighbors

Idle - BGP router refuses all incoming until a Start event is initiated

Connect - Waits for TCP connection to complete

Active - Attempts to initiate connection with peerOpenSent - Has sent message; waits for reply

OpenConfirm - Waits for keepalive or notification message from neighbor

Established - Has completed negotiations with its peer

Page 23: Border Gateway Protocol

232323© 2003, Cisco Systems, Inc. All rights reserved.23

BGP Neighbors

• If router jumps between Connect and Active states, it usually means two routers have a communication problem

• BGP does not allow for dynamic discovery of neighborsMust manually configure them

Prevents unwanted routers from injecting routes into BGP routing tables

Makes Internet more stable

Page 24: Border Gateway Protocol

242424© 2003, Cisco Systems, Inc. All rights reserved.24

Notification Messages

• If BGP router encounters error while establishing peer relationships, it may send a notification message

Router closes TCP connection to peer

• Notification message is 1-byte Error Code field and variable-length Data field

See Figure 8-5 for format of notification messageSee Table 8-1 for BGP error codes

Page 25: Border Gateway Protocol

252525© 2003, Cisco Systems, Inc. All rights reserved.25

Notification Message Format

Page 26: Border Gateway Protocol

262626© 2003, Cisco Systems, Inc. All rights reserved.26

BGP Error Codes

continued

Page 27: Border Gateway Protocol

272727© 2003, Cisco Systems, Inc. All rights reserved.27

BGP Error Codes

Page 28: Border Gateway Protocol

282828© 2003, Cisco Systems, Inc. All rights reserved.28

Exchanging Routing Information

• BGP peers exchange full routing tables only when they first become peers

• Afterwards, they send incremental routing updates

Page 29: Border Gateway Protocol

292929© 2003, Cisco Systems, Inc. All rights reserved.29

Update Messages

• May contain information about single route or withdrawn route(s) that are no longer reachable

• May contain Network Layer Reachability Information (NLRI)

1-byte field shows length of prefix followed by prefix with trailing bits to end on octet boundarySee Figure 8-6

• May contain path attributesVarious information about a route such as NEXT_HOP

Page 30: Border Gateway Protocol

303030© 2003, Cisco Systems, Inc. All rights reserved.30

Update Message Format

Page 31: Border Gateway Protocol

313131© 2003, Cisco Systems, Inc. All rights reserved.31

Update and Withdrawal Messages

• Withdrawal Routes Message has 1-byte Length field followed by route prefix

Length field must also include length field of path attributes

If Length field of path attributes is set to 0, it indicates no path attributes

• In theory, minimum size of update message packet is 23 bytes

19 bytes for header

2 bytes for each length field

Page 32: Border Gateway Protocol

323232© 2003, Cisco Systems, Inc. All rights reserved.32

Path Attributes

• Path attributes determine which routes to include in routing tables and which routes to filter

Numerous path attributes

All BGP-4 routers agree on some path attributes

• See Figure 8-7 for format of path attributes within an update message

Page 33: Border Gateway Protocol

333333© 2003, Cisco Systems, Inc. All rights reserved.33

Format of Path Attributes

Page 34: Border Gateway Protocol

343434© 2003, Cisco Systems, Inc. All rights reserved.34

Attribute Flags Field

• Attribute Flags field indicate four possible classes of each attribute

Well-known mandatory attributes

Well-known discretionary attributes

Optional transitive attributes

Optional nontransitive attributes

• See Table 8-2

Page 35: Border Gateway Protocol

353535© 2003, Cisco Systems, Inc. All rights reserved.35

Attribute Flags Field

Page 36: Border Gateway Protocol

363636© 2003, Cisco Systems, Inc. All rights reserved.36

Path Attributes

• Three parts for each attribute• Attribute type—contains 1-byte attribute

flag and 1-byte attribute type codeSee Table 8-3

• Attribute length• Attribute value

Page 37: Border Gateway Protocol

373737© 2003, Cisco Systems, Inc. All rights reserved.37

Attribute Type Codes

Page 38: Border Gateway Protocol

383838© 2003, Cisco Systems, Inc. All rights reserved.38

BGP Table

• BGP router tracks various protocol-specific parameters in BGP table

Includes information about attributes of each path

• BGP table version increases by one each time the table changes

Provides some indication of stability of BGP sessionsMay change frequently because of Internet changes

Page 39: Border Gateway Protocol

393939© 2003, Cisco Systems, Inc. All rights reserved.39

Types of Path Attributes

• BGP routers make routing decisions and filter routes based on path attributes

• Some common attributes includeORIGIN Attribute

AS_PATH Attribute

NEXT_HOP Attribute

MED AttributeWeight Attribute

Page 40: Border Gateway Protocol

404040© 2003, Cisco Systems, Inc. All rights reserved.40

ORIGIN Attribute

• Mandatory attribute that indicates source of particular route

• Three possible valuesEGP - route learned from another AS through Exterior Gateway Protocol; indicated with “e”IGP - route learned from same AS through Interior Gateway Protocol; indicated with “I”Incomplete - route’s source is unknown or learned through another means; indicated with “?”

Page 41: Border Gateway Protocol

414141© 2003, Cisco Systems, Inc. All rights reserved.41

AS_PATH Attribute

• Indicates path a particular route took to reach routerShows whether route is loop freeEach AS prepends or places its own AS number at beginning of route’s AS_PATH attributeIf router sees its own AS number in AS_PATH attribute, route is a loop and will be rejectedAlso contains information about summarized routes

• See Figure 8-8

Page 42: Border Gateway Protocol

424242© 2003, Cisco Systems, Inc. All rights reserved.42

BGP Routers Add AS Numbers to AS_PATH Attribute

Page 43: Border Gateway Protocol

434343© 2003, Cisco Systems, Inc. All rights reserved.43

NEXT_HOP Attribute

• In EBGP, indicates next hop router• Several factors affect this attribute

EBGP routers consider next hop peer that sent update about route

IBGR routers must keep NEXT_HOP attribute for routes learned from EBGP, even when advertising them to IBGR peers

• See Figure 8-9

Page 44: Border Gateway Protocol

444444© 2003, Cisco Systems, Inc. All rights reserved.44

Setting NEXT_HOP Attribute

Page 45: Border Gateway Protocol

454545© 2003, Cisco Systems, Inc. All rights reserved.45

Third-party Next Hop

• Third-party next hop specifies the destination router on multiaccess network to avoid extra hop

• See Figure 8-10

Page 46: Border Gateway Protocol

464646© 2003, Cisco Systems, Inc. All rights reserved.46

NEXT_HOP Attribute on Multiaccess Networks

Page 47: Border Gateway Protocol

474747© 2003, Cisco Systems, Inc. All rights reserved.47

MED Attribute

• MULTI_EXIT_DISC attribute helps routers distinguish between multiple connections to same external AS

Optional nontransitive attribute; also called the BGP metricPropagated to neighboring Autonomous Systems but not beyondUsed by routers outside AS to decide how to enter ASControls how traffic leaves ASMust be configured manually

• See Figure 8-11

Page 48: Border Gateway Protocol

484848© 2003, Cisco Systems, Inc. All rights reserved.48

MED Attribute Advertised Between Autonomous Systems

Page 49: Border Gateway Protocol

494949© 2003, Cisco Systems, Inc. All rights reserved.49

Other Attributes

• LOCAL_PREF – discretionary attribute used by routers inside an AS to choose an exit path

• ATOMIC_AGGREGATE – discretionary attribute used in BGP’s handling of CIDR address blocks

• AGGREGATOR – optional transitive attribute router may add to summarized routes

Page 50: Border Gateway Protocol

505050© 2003, Cisco Systems, Inc. All rights reserved.50

COMMUNITY Attribute

• COMMUNITY Attribute – gives BGP routers a mechanism to filter routes by tagging a group of routes into a BGP community

Optional transitive attribute defined in RFC 1997

Consists of one or more community values consisting of 32-bit fields

Values may be well known or private

Page 51: Border Gateway Protocol

515151© 2003, Cisco Systems, Inc. All rights reserved.51

Weight Attribute

• Configure weight of routes to influence path selection on that router only

Weight attribute is not propagated to any BGP internal or external peer

Can configure weight value from 0-65,535

Acts as metric with higher value preferred over lower value

Page 52: Border Gateway Protocol

525252© 2003, Cisco Systems, Inc. All rights reserved.52

BGP Routing Decisions

• BGP router selects only one route per destination network based on path attributes

• BGP synchronization refers to process of waiting until all routes are received from IGP

Maintains consistent routing information within an AS

Helps prevent black hold routes where router advertises routes it cannot reach

Page 53: Border Gateway Protocol

535353© 2003, Cisco Systems, Inc. All rights reserved.53

BGP Rules for Propagating Routes

• When synchronization rules are turned on, source of routing information determines whether routes are propagated

Local origin – propagated to all peers, both EBGP and IBGP

EBGP peers – forwarded to all peers

IBGP peers – propagated to EBGP peers, but not to IBGP peers

Page 54: Border Gateway Protocol

545454© 2003, Cisco Systems, Inc. All rights reserved.54

Turning Off BGP Synchronization

• Can safely turn off BGP synchronization when

All transit routers in AS are running BGP

AS is not serving as transit point between two or more Autonomous Systems

Page 55: Border Gateway Protocol

555555© 2003, Cisco Systems, Inc. All rights reserved.55

BGP Synchronization

• If EIGRP is not configured to learn routes from BGP through redistribution, Autonomous Systems may not be able to reach each other

• See Figure 8-12 • Solution may be to redistribute BGP routes

into EIGRP or to turn off synchronization

Page 56: Border Gateway Protocol

565656© 2003, Cisco Systems, Inc. All rights reserved.56

BGP Synchronization

Page 57: Border Gateway Protocol

575757© 2003, Cisco Systems, Inc. All rights reserved.57

Route Selection with Multiple Paths to Destination

• To choose best path to destination, Cisco routers

Ignore routes learned from IBGP and ignore routes with unreachable next hops

Choose route with highest weight, highest LOCAL_PREF attribute, shortest AS_PATH attribute; lowest ORIGIN attribute, lowest MED attribute,

Choose external paths over internal paths, shortest path through AS to next BGP peer, oldest path to external AS, route that goes through peer with lowest BGP Identifiers through peer’s lowest IP address

Page 58: Border Gateway Protocol

585858© 2003, Cisco Systems, Inc. All rights reserved.58

BGP, CIDR, and Aggregate Addresses

• BGP-4 added support for CIDR and summary routes

• BGP update messages carry route prefix and length of prefix to support CIDR

• AS_PATH can include unordered list of all Autonomous Systems that individual routes pass through

Page 59: Border Gateway Protocol

595959© 2003, Cisco Systems, Inc. All rights reserved.59

AS_PATH Attribute

• Consists of triplet containing Path segment type – 1-byte field that may include AS_SEQUENCE or AS_SETPath segment length – 1-byte field contains number of Autonomous Systems included in path segment valuePath segment value – contains number of 2-byte Autonomous System numbers indicated by path segment value

• Router uses AS_SET and AS_SEQUENCE values to find routing loops

Page 60: Border Gateway Protocol

606060© 2003, Cisco Systems, Inc. All rights reserved.60

Aggregate Routes

• BGP router receives aggregate route in update message with ATOMIC_AGGREGATE attribute set

Tells router receiving update that route was summarized and information in AS path may be incomplete

• See Figure 8-13• Route aggregation can result in suboptimal path

selection and routing problems

Page 61: Border Gateway Protocol

616161© 2003, Cisco Systems, Inc. All rights reserved.61

Aggregate Route Example

Page 62: Border Gateway Protocol

626262© 2003, Cisco Systems, Inc. All rights reserved.62

Chapter Summary

• BGP is Exterior Gateway Protocol used to route packets between Autonomous Systems

• It is primary routing protocol used on Internet BGP routers, also known as BGP speakers

• Two BGP neighbors use an open message to initiate a connection and negotiate parameters

• If error occurs during BGP session, router sends notification message to terminate session

Page 63: Border Gateway Protocol

636363© 2003, Cisco Systems, Inc. All rights reserved.63

Chapter Summary

• BGP speakers use update messages to exchange information about advertised or withdrawn routes

• Path attributes may be well-known mandatory, well-known discretional, optimal transitive, or optimal nontransitive

• BGP speakers use path attributes to avoid routing loops

• Synchronization prevents routers running IBGP from learning routes from other IBGP routers until another source verifies route

• Synchronization may be disabled

Page 64: Border Gateway Protocol

646464© 2003, Cisco Systems, Inc. All rights reserved.64

Chapter Summary

• If synchronization will not allow Cisco routers to choose a route, they look at the Cisco proprietary weight attribute, followed by local preferences, the length of the AS path, the origin attribute, and the MED attribute.

• BGP route aggregation supports Classless InterDomain Routing

• The AS path attribute can include all Autonomous Systems that a route passes through to help avoid routing loops

Page 65: Border Gateway Protocol

656565© 2003, Cisco Systems, Inc. All rights reserved.65

Case Project 2Wiley Pharmaceuticals’ Autonomous System

Page 66: Border Gateway Protocol

666666© 2003, Cisco Systems, Inc. All rights reserved.66

Case Project 3Wisconsin Fund for Teachers Autonomous System

Page 67: Border Gateway Protocol

676767© 2003, Cisco Systems, Inc. All rights reserved.67

BGP• Border Gateway

Protocol is used to route between Autonomous Systems (AS)

• BGP is a simple protocol with lots of options- the options add complexity

• There a four version of BGP, all are supported on Cisco equipment. The current version is version 4, written as BGP4

Page 68: Border Gateway Protocol

686868© 2003, Cisco Systems, Inc. All rights reserved.68

BGP4

• The capability of BGP4 to guarantee routing delivery and the complexity of the routing decision process endure that BGP will be widely used in large IP routing environments, such as the Internet.

• The Internet consists of over 80,000 BGP network entries, and there is no doubt that only BGP can handle such a complex routing table.

Page 69: Border Gateway Protocol

696969© 2003, Cisco Systems, Inc. All rights reserved.69

BGP Background

• An Exterior Gateway Protocol (EGP)• Routes packets between Autonomous

systems• Based on distance-vector routing protocols• Current version BGP4 contains

enhancements, is more stable, and uses less bandwidth and CPU time

Page 70: Border Gateway Protocol

707070© 2003, Cisco Systems, Inc. All rights reserved.70

BGP is a Path Vector Protocol

• BGP carries a sequence of AS numbers to indicate the path it has taken to a remote network

• If using BGP, AS numbers must be registered with IANA (between 1 and 65,535)

• The information is stored so that routing loops are avoided

• If a router sees it’s own AS number, it assumes a loop has occurred

Page 71: Border Gateway Protocol

717171© 2003, Cisco Systems, Inc. All rights reserved.71

BGP Supports

• VLSM• CIDR (Summarization)

Page 72: Border Gateway Protocol

727272© 2003, Cisco Systems, Inc. All rights reserved.72

Reasons to Avoid BGP

• Your AS has a lone connection to the Internet or to another AS

• Your routers do not have enough memory or a CPU to handle thousands of routes

• You do not need to worry about routing policy or controlling traffic as it enters and leaves your AS

• You do not have much bandwidth between Autonomous Systems

• You do not understand BGP well

Page 73: Border Gateway Protocol

737373© 2003, Cisco Systems, Inc. All rights reserved.73

How to Avoid Using BGP

• Use static or default routes and redistribute them

Customer uses default route propagated through its OSPF AS with the default-information originate always command

ISP uses static route to get to customer’s AS

Page 74: Border Gateway Protocol

747474© 2003, Cisco Systems, Inc. All rights reserved.74

Avoiding BGP

Router(config)#ip route 0.0.0.0 0.0.0 s1

Router(config)#router ospf 1

Router(config-router)#default-information originate always

ISPRouter(config)#ip route 210.205.113.0 255.255.255.0 s0

210.205.113.0/24

ISP

Default route

Passes default route to all routers in AS even if route

is unavailable

Static route for ISP to our network

Page 75: Border Gateway Protocol

757575© 2003, Cisco Systems, Inc. All rights reserved.75

Using BGP

• BGP adds complexity to routing• Consider carefully before using BGP• Reasons to use BGP

Your AS is multihomed (has multiple connections to other Autonomous Systems)

Other Autonomous Systems use your AS as a transit AS

You need to control traffic entering and leaving your AS

Page 76: Border Gateway Protocol

767676© 2003, Cisco Systems, Inc. All rights reserved.76

Multihomed

Page 77: Border Gateway Protocol

777777© 2003, Cisco Systems, Inc. All rights reserved.77

BGP updates are reliable

• BGP uses TCP as its layer 4 protocol• No other routing protocol use TCP• This allows TCP to ensure that updates are

sent reliably, leaving BGP to concentrate on gathering information on remote networks and loop-free topology

• Uses TCP port 179 to send updates

Page 78: Border Gateway Protocol

787878© 2003, Cisco Systems, Inc. All rights reserved.78

BGP Terminology

• Routers configured for BGP are typically called speakers.

• Two BGP routers that form a BGP TCP relationship are referred to as peers or neighbors. Must establish a relationship before any routing information is passed.

• Peers exchange full BGP routing tables initially, then only updates when a change occurs.

Page 79: Border Gateway Protocol

797979© 2003, Cisco Systems, Inc. All rights reserved.79

Types of BGP Peer Messages

• Open messages- These message are used when establishing BGP peers.

• Keepalives- These are sent periodically to ensure connections are still active or established.

• Update messages- Any change that occurs, such as loss of network availability, results in an update message.

• Notification-These messages are used only to notify peers of receiving errors.

Page 80: Border Gateway Protocol

808080© 2003, Cisco Systems, Inc. All rights reserved.80

BGP Attributes

• BGP has a number of complex attributes used to determine a path to a remote network.

• These attributes allow greater flexibility and enable a complex routing decision to ensure the path to a remote network is the best possible path.

• These attributes are the metrics BGP uses.

Page 81: Border Gateway Protocol

818181© 2003, Cisco Systems, Inc. All rights reserved.81

BGP Attributes (continued)

• The network designers can manipulate these attributes to influence path selection.

• BGP propogates the best path to any peers.

• BGP attributes are sent in update packets.

Page 82: Border Gateway Protocol

828282© 2003, Cisco Systems, Inc. All rights reserved.82

AS Path

• To guarantee loop free path selection, BGP constructs a graph of autonomous systems based on the information exchanged between BGP neighbors.

• BGP views the whole internetwork as a graph, or tree, of autonomous systems.

• The connection between any two systems forms a path. The collection of path information is expressed as a sequence of AS numbers called the AS Path. This sequence forms a route to reach a specific destination.

Page 83: Border Gateway Protocol

838383© 2003, Cisco Systems, Inc. All rights reserved.83

AS Path (Continued)

• When the Speaker sees it’s number in the path a second time it discards the packet.

Page 84: Border Gateway Protocol

848484© 2003, Cisco Systems, Inc. All rights reserved.84

Path Attributes

• Well-known mandatory • Well-known discretionary • Optional transitive • Optional nontransitive

Page 85: Border Gateway Protocol

858585© 2003, Cisco Systems, Inc. All rights reserved.85

Well-known Mandatory

• An attribute that must exist in the BGP update packet. It must be recognized by all BGP implementations. If a well-known attribute is missing, a notification error will be generated. This ensures that all BGP implementations agree on a standard set of attributes. An example of a well-known mandatory attribute is the AS_Path attribute.

Page 86: Border Gateway Protocol

868686© 2003, Cisco Systems, Inc. All rights reserved.86

Well-known Discretionary

• An attribute that is recognized by all BGP implementations, but may or may not be sent in the BGP update message. An example of a well-known discretionary attribute is the LOCAL_PREF attribute

Page 87: Border Gateway Protocol

878787© 2003, Cisco Systems, Inc. All rights reserved.87

Optional Transitive

• An attribute that may or may not be recognized by all BGP implementations, therefore, it is optional. Because the attribute is transitive, BGP should accept and advertise the attribute even if it is not recognized.

Page 88: Border Gateway Protocol

888888© 2003, Cisco Systems, Inc. All rights reserved.88

Optional Nontransitive

• An attribute that may or may not be recognized by all BGP implementations. Whether or not the receiving BGP router recognizes the attribute, it is nontransitive and is not passed along to other BGP peers.

Page 89: Border Gateway Protocol

898989© 2003, Cisco Systems, Inc. All rights reserved.89

BGP Attribute Codes and Types

Page 90: Border Gateway Protocol

909090© 2003, Cisco Systems, Inc. All rights reserved.90

Two Types of BGP sessions

• Internal BGP (IBGP) -Connection between two BGP speakers in the same AS

• External BGP (EBGP) - Connection between two BGP speakers in different Autonomous Systems

Page 91: Border Gateway Protocol

919191© 2003, Cisco Systems, Inc. All rights reserved.91

IBGP and EBGPAS 1

AS 2

131.108.1.1/24

131.108.1.2/24

IBGP Session

IBGP Session

131.108.255.2/30

131.108.255.2/30Router1

Router 2

Router 3

Page 92: Border Gateway Protocol

929292© 2003, Cisco Systems, Inc. All rights reserved.92

Page 93: Border Gateway Protocol

939393© 2003, Cisco Systems, Inc. All rights reserved.93

Configuring BGP

(IBGP on Router1)Router1(config)#router bgp 1

Router1(config)#network 131.208.2.1 255.255.0

Router1(config-router)#neighbor 131.108.1.2 remote 1

(IBGP/EBGP on Router2)Router2(config)#router bgp 1

Router2(config)#neighbor 131.108.1.1 remote as 1

Router2(config-router)#neighbor 131.108.255.2 remote-as 2

(EBGP on Router3)Router3(config)#router bgp 2

Router3(config-router)#neighbor 131.108.255.1 remote-as 1

AS number

Network to be Advertised

Identifies Peer Routers

Page 94: Border Gateway Protocol

949494© 2003, Cisco Systems, Inc. All rights reserved.94

Verifying and Troubleshooting BGP

• show ip route-view the routing table with best routes

• show ip bgp-show all routes• Show ip bgp summary-shows BGP peers• Show ip bgp neighbors-more detailed

information about BGP peers

Page 95: Border Gateway Protocol

959595© 2003, Cisco Systems, Inc. All rights reserved.95

Verifying and Troubleshooting BGP (continued)

• debug ip bgp-view sending and receiving of open messages

• debug ip bgp 2.2.2.2 updates-view update messages sent between peers

• debug ip bgp events-view routers attempting to become peers

• debug ip bgp keepalives-views keepalives messages• debug ip bgp updates-view update messages