border gateway protocol – bgp4 (2)

25
159.334 Computer Networks 159.334 Computer Networks Border Gateway Protocol BGP4 (2) Professor Richard Harris School of Engineering and Advanced Technology (SEAT)

Upload: others

Post on 03-Feb-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Border Gateway Protocol – BGP4 (2)

159.334 Computer Networks159.334 Computer Networks

Border Gateway Protocol – BGP4 (2)

Professor Richard Harris

School of Engineering and AdvancedTechnology (SEAT)

Page 2: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/22

159.334 Computer Networks159.334 Computer Networks

Presentation Outline

Border Gateway Protocol - Continued

Page 3: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/33

159.334 Computer Networks159.334 Computer Networks

Learning Objectives

You will be able to:

Discuss the operation of the BGP4 protocol

Determine when it is appropriate for use in networking

Page 4: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/44

159.334 Computer Networks159.334 Computer Networks

References

Tanenbaum, “Computer Networks”, 4th Edition

Forouzan, “Data Communications and Networking”, 4th

Edition

Cisco CCNA1 Module 10 - part 1

Stallings, William 2000 ‘Data and ComputerCommunications’, Prentice Hall, Sixth Edition

Russell, Travis 1997 ‘Telecommunications Protocols’,McGraw Hill

Page 5: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/55

159.334 Computer Networks159.334 Computer Networks

BGP Path Selection Overview

Unlike other routing protocols, BGP doesn’t use shortestpath technology.

BGP is regarded as a path vector protocol since it worksby sending route advertisements.

A route advertisement indicates the reachability of anetwork, viz:

A network address and a netmask representing a block ofcontiguous IP addresses.

It also contains the list of all the transit AS’s that must be usedto reach the announced network.

It can also contain some optional attributes.

Page 6: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/66

159.334 Computer Networks159.334 Computer Networks

BGP Attributes – 1

Unlike other routing protocols, BGP does not usea single routing metric to decide the preferredroute.

It uses multiple parameters that have differentdegrees of significance as well as differences inthe way they are distributed within BGP.

These metric parameters are called pathattributes.

Attributes are classified into two types:Well-known

Optional

Page 7: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/77

159.334 Computer Networks159.334 Computer Networks

BGP Attributes – 2

Attributes

Well-known Optional

Mandatory Discretionary Transitive Non-transitive

Page 8: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/88

159.334 Computer Networks159.334 Computer Networks

Summary of Attributes

The following attributes have been identified for use withBGP:

AS-Path

Origin

Next-hop

Weight

Local Preference

Metric (Multi Exit Discriminator – MED)

Community

Page 9: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/99

159.334 Computer Networks159.334 Computer Networks

Simplified Operation of BGP Router[3]

Inboundfilter

Attributemanipulation

Inboundfilter

Attributemanipulation

Inboundfilter

Attributemanipulation

Outboundfilter

Attributemanipulation

Outboundfilter

Attributemanipulation

Outboundfilter

Attributemanipulation

BGP routing table

BGP Decision Process

1. Highest LOCAL-PREF2. Shortest AS-PATH3. Lowest MED4. eBGP over iBGP5. Nearest IGP neighbour

Forwarding table

…..

Peer1

PeerN …..

Peer1

PeerN

Selectsacceptable

advertisements

Selectbest route

based on decision list.Place in the forwarding table

Selectsacceptable

routes to advertise

Page 10: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1010

159.334 Computer Networks159.334 Computer Networks

Brief Review of Attributes

The following slides will review what is meant by the keyattributes that have been identified for use with BGP.

At the conclusion of these discussions, a hierarchicalstructure will be presented that shows in more detail thepolicy based approach used to identify routes employedby BGP.

The simplified operation of BGP slide shown previouslygave a general overview of the strategy that is used.

Page 11: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1111

159.334 Computer Networks159.334 Computer Networks

AS-Path Attribute – 1

As a BGP update passes through an AS, that AS numbergets appended as an update.

So an arriving update at a router will have passedthrough a number of AS’s and these will be stored in theAS-path

The AS-path attribute is a well-known mandatoryattribute. It is recognised by all BGP implementations.

Page 12: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1212

159.334 Computer Networks159.334 Computer Networks

Sequence of AS’s a route hastraversed.

Provides a mechanism for loopdetection.

Policies may be applied

based on the AS path.

Local AS added only when

sent to external peer.

* Shortest AS path preferred

AS3847207.240.0.0/16 AS1673

140.222.0.0/16

AS701192.67.95.0/24

AS3561204.70.0.0/15

192.67.95.0/24 3847 701 i140.222.0.0 3847 1673 i204.70.0.0/15 3847 3561 i207.240.0.0/16 3847 iAS6201

E

C

FG

D

B

A

AS-Path Attribute – 2

Page 13: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1313

159.334 Computer Networks159.334 Computer Networks

Origin

This attribute is included in all BGP routing updates andits purpose is to indicate the origin of the pathinformation. It is permitted to have one of only threevalues, viz:

IGP: Network was redistributed from and IGP to BGP

EGP: The origin is EGP (almost obsolete now)

INCOMPLETE: The origin is unknown.

The Origin attribute is a well-known mandatory attribute.It is recognised by all BGP implementations.

Page 14: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1414

159.334 Computer Networks159.334 Computer Networks

Next-hop

It is the IP address of the nexthop associated with a BGPupdate.

The Next-hop attribute is a well-known and mandatory attribute.

Router A will advertise198.3.97.0/24 to router B with anext-hop of 207.240.24.202.

AS 6201

AS 3847

198.3.97.0/24A

B

207.240.24.200/30

.201

A

B

.202

C

Page 15: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1515

159.334 Computer Networks159.334 Computer Networks

Weight

This influences path selection from a router when more than one route tothe destination is present.

It is configurable on a per-neighbour basis but has no significance outsideof that router.

It is classified as an optional attribute and is not transitiveThe default weight on a Cisco router for a route that is originated by the localrouter is 32,768 and it is 0 for all other routes.

BGPAS670

140.1.0.0

W=30

W=20R1

R3

R2

Page 16: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1616

159.334 Computer Networks159.334 Computer Networks

Local Preference

An often-used attribute,local_pref (normally 100)overrides AS_PATH, and istransitive throughout yournetwork. It is neveradvertised to an eBGP peer.

For example, you canexpress the policy “preferprivate interconnects” bysetting the local_pref to 150and leaving all other peers at100. AS 6201

208.1.1.0/24

A B

208.1.1.0/24 100Preferred by allAS3847 routers

208.1.1.0/24 80

AS 3847

GF E

C D

Page 17: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1717

159.334 Computer Networks159.334 Computer Networks

Metric (Multi Exit Discriminator –MED)

Indication to external peers of the preferred pathinto an AS.

Affects routes with the same AS path.

Advertised to external neighbours

Usually based on IGP metric

* Note that the lowest MED is preferred

The MED (multi-exit discriminator) is a commonlyused attribute. It comes after the AS_PATH inevaluation sequence.

Commonly, MED is used to append a distance onBGP routes as they move within your network.

Page 18: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1818

159.334 Computer Networks159.334 Computer Networks

Community

This attribute is a means of grouping a set ofdestinations so that a common policy can be applied tothem.

The attribute is an optional transitive attribute. (If arouter receives this and doesn’t understand it it simplypasses it on transparently in its own update.)

This attribute is largely used by ISPs to set routingpolicies.

Page 19: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/1919

159.334 Computer Networks159.334 Computer Networks

BGP Attributes – Summary

Attributes

Well-known Optional

Mandatory Discretionary Transitive Non-transitive

AS-Path

Origin

Next-hop

Local Preference Metric - MEDWeight

Community

Page 20: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2020

159.334 Computer Networks159.334 Computer Networks

BGP Route Selection - Detail

The following hierarchical rule set is followed for BGP:The path is ignored if the next hop is inaccessible

Highest weight is preferred (if this optional proprietaryattribute is in use on the router).

Highest local preference is preferred.

Prefer a route that has originated from the router that isadvertising it.

Shortest AS path.This means the path with the least number of AS entries in it.

Lowest Origin Code (IGP > EGP > INCOMPLETE).

Lowest Metric or MED valueExternal path is preferred to internal. The administrative distancefor an EGP path is 20 and 200 for an IBGP route

If only internal paths exist and IGP synchronisation is turnedoff, the path through the closest IGP neighbour is preferred.

Choose the path through the router with the lowest BGProuter ID.

Page 21: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2121

159.334 Computer Networks159.334 Computer Networks

Comment on Selection Criteria

These criteria act as filters, and the Nth criterion isonly evaluated if more than one route has passedthe (N – 1)th criterion.

It should be noted that most BGP implementationsallow the network administrator to optionallydisable some of the criteria of the BGP decisionprocess.

Also note that we continue to process thesecriteria only if more than one path satisfies theprevious criterion.

Page 22: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2222

159.334 Computer Networks159.334 Computer Networks

Control of Outgoing Traffic [3] - 1

Two approaches have been used:1. Use local_pref to be manipulated based on passive or active

measurements.

These solutions usually measure the load on each inter-domainlink, and some rely on active measurements to evaluate theperformance of inter-domain paths.

Based on these measurements and some knowledge of the Internettopology (obtained either through a central server or from the BGProuter to which they are attached), they attach appropriate valuesof the local_pref attribute to indicate which route should beconsidered as the best route by the BGP routers.

Page 23: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2323

159.334 Computer Networks159.334 Computer NetworksControl of Outgoing Traffic [3] - 2

As shown in the slide depicting BGProuter operation, the BGP decisionprocess will select the nearest IGPneighbour when comparing severalequivalent routes received via iBGP.

For example, suppose router R27 receivesone packet whose destination is R45: TheBGP decision process of router R27 willcompare two routes toward R45, onereceived via R28 and the other receivedvia R26.

By selecting router R28 as the exit borderrouter for this packet, AS2 will ensurethat this packet will consume as fewresources as possible inside its ownnetwork.

If a transit AS relies on a tuning of theweights of its intra-domain routingprotocol this tuning will indirectlyinfluence its outgoing traffic.

R51

R11

R14R13

R12

R21

R27

R22

R23

R25

R28

R24

R26

R31 R32

R33 R34

R35R36

R61

R43

R44

R45

R42R41

AS 5

AS 1

AS 2AS 3

AS 4AS 6

2. Use the intra-domain routing protocol to influence howa packet crosses the transit ISP.

Page 24: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2424

159.334 Computer Networks159.334 Computer Networks

Control of Incoming Traffic [3] – 1

The first method that can be usedto control the traffic that entersan AS is to rely on selectiveadvertisements and announcedifferent route advertisements ondifferent links.

Another method would be toallow an AS to indicate a rankingamong the various routeadvertisements that it sends.

Based on the utilisation of thelength of the AS-path as the thirdcriteria in the BGP decisionprocess, a possible way toinfluence the selection of routesby a distant AS is to artificiallyincrease the length of the AS pathattribute.

R51

R11

R14R13

R12

R21

R27

R22

R23

R25

R28

R24

R26

R31 R32

R33 R34

R35R36

R61

R43

R44

R45

R42R41

AS 5

AS 1

AS 2AS 3

AS 4AS 6

Page 25: Border Gateway Protocol – BGP4 (2)

Computer NetworksComputer Networks -- 1/1/2525

159.334 Computer Networks159.334 Computer Networks

Conclusions

BGP4 is a complex routing protocol and requiressignificant expertise to tune the path selection.

Powerful and widely used within the industry.

A number of potential problems that can causedifficulties for network managers.