bgp4 - border gateway protocol. autonomous systems routers under a single administrative control are...

30
BGP4 - Border Gateway Protocol

Upload: winfred-singleton

Post on 03-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

BGP4 - Border Gateway Protocol

Page 2: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Autonomous Systems

• Routers under a single administrative control are grouped into autonomous systems

• Identified by a 16 bit Autonomous System Number (ASN)

• Normally BGP chooses the route with shortest AS PATH as “best”

Page 3: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Types of Autonomous Systems

• Single-homed

• Multi-homed non-transit

• Multi-homed transit

Page 4: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

ASN Numbers

• 16-bit Integer, 1 thru 65535

• Public ASNs 1 thru 64511– Assigned by ARIN requires multihoming

• Private ASNs 64512 thru 65535

Page 5: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Typical ASN Connections100

600

300200

400

500

Page 6: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Sample ASNs

2553 FSU 209 Qwest

3447 Sprint-TLH 701 UUNET

6912 Hayes 3996 FIRN

8103 DMS 22909 Comcast

2379 Sprint-Orld 3506 CSIT

1239 Sprint-BB 10490 GIT-I2

Page 7: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

FSU ASN Connections

2553FSU

6912Hayes 209

Qwest

701UUNET

3447Sprint-TLH

1239Sprint-Bbone

2379Sprint-WnPk

3996FIRN

8103DMS

10490GIT-I2

Page 8: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

sh ip bgp neighborHCS-TLH-2#sh ip bgp sum

BGP router identifier 204.194.39.157, local AS number 6912

BGP table version is 37851125, main routing table version 37851125

BGP activity 2780683/27562509 prefixes, 23934532/23593311 paths

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

157.130.64.213 4 701 9884946 287646 37851089 0 0 07:09:12 113693

157.130.68.173 4 701 9704492 294562 37851067 0 0 4d09h 113702

157.130.81.185 4 701 10456245 293187 37851089 0 0 4d09h 113702

204.90.26.101 4 8103 292617 9817792 37851089 0 0 3d00h 82

204.194.39.133 4 6912 295291 292759 37851120 0 0 3w1d 37

204.194.39.158 4 2553 292764 12413184 37851089 0 0 4d09h 4

HCS-TLH-2#

Page 9: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

sh ip bgp nei 204.194.39.158 routesHCS-TLH-2#sh ip bgp neighbor 204.194.39.158 routes

BGP table version is 37851272, local router ID is 204.194.39.157

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

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

Network Next Hop Metric LocPrf Weight Path

*> 128.186.0.0 204.194.39.158 0 0 2553 2553 i

*> 144.174.0.0 204.194.39.158 0 2553 2553 3506 i

*> 146.201.0.0 204.194.39.158 0 0 2553 2553 i

*> 192.80.53.0 204.194.39.158 86 0 2553 2553 i

Total number of prefixes 4

HCS-TLH-2#

Page 10: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Route Servers

• To figure out Internet backbone problems, there are several public route servers

• Many can be found at www.traceroute.org

• On the next slide, we look at one route server’s entries for the FSU ASN

Page 11: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

sh ip bgp 128.186.0.0route-views.oregon-ix.net>sh ip bgp 128.186.0.0

BGP routing table entry for 128.186.0.0/16, version 1501796

Paths: (51 available, best #6)

6539 3561 1239 2379 3447 2553

216.18.63.137 from 216.18.63.137 (216.18.63.137)

Origin IGP, localpref 100, valid, external

5056 701 6912 2553 2553

167.142.3.6 from 167.142.3.6 (167.142.225.101)

Origin IGP, localpref 100, valid, external

267 2914 701 6912 2553 2553

204.42.253.253 from 204.42.253.253 (204.42.253.253)

Origin IGP, localpref 100, valid, external

Community: 267:2914 2914:420 2914:2000 2914:3000

11537 10490 2553

198.32.8.252 from 198.32.8.252 (198.32.8.252)

Origin IGP, localpref 100, valid, external, best

Community: 11537:950

Page 12: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

IBGP

• BGP routers within the same AS speak IBGP with each other

• BGP routers that speak to each other are called “peers” or “neighbors”

• IBGP speakers within an AS need not be directly connected to each other, but must be fully meshed or use a route reflector

Page 13: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

EBGP

• BGP routers in different ASNs speak EBGP to each other

• Normally are directly connected

• Sometimes use EBGP Multihop

Page 14: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

EBGP - IBGP

EBGP

EBGP

EBGP

EBGP

IBGP

Page 15: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Public Tools

• Route Servers, Traceroute Servers, Looking Glass servers at www.traceroute.org

• Digex Looking-Glass nitrous.digex.net

Page 16: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Protocol

• BGP peers speak using tcp/179• Initially send full routing table, followed by

periodic updates• Updates are incremental• BGP table version keeps track of the state• Routing entries include subnet and support

CIDR• Table entries also have associated attributes

Page 17: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

BGP attributes• Origin• ASPATH• Weight• Local Preference• Multi-Exit Descriminator (MED)• Communities• Origin Type• Next-Hop

Page 18: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

BGP Attributes 2

• Both mandatory and optional attributes

• Route Maps used to manipulate attributes

• Eg: Can use route maps to prepend the ASPATH on routing annoucements

Page 19: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Route Maps

• Manipulate routes and their attributes

• See Doyle vol 1, chapter 14, p805

• Each has a line number and is processed sequentially (similar to BASIC)

• Match on IP address, next hop, metric, etc.

• Can set various attributes

Page 20: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

BGP Net Advertisements

• Normally, use a NETWORK statement for networks to be advertised

• BGP will only advertise a network to its BGP peers if there is a local route for the network.

• Local routes are often added to the NULL 0 device for this purpose

• Can disable synchronization but not recommended.

Page 21: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

BGP Advertisments 2

router bgp 2553

network 128.186.0.0 mask 255.255.0.0

ip route 128.186.0.0 255.255.0.0 null 0

Page 22: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Weight Attribute

• Cisco specific

• Default 32768

• Highest weight preferred when multiple paths to a destination exist

• Local relevance (not propogated)

Page 23: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Local Preference Attribute

• Only applies when multiple routes to a destination all with the same weight

• Default is 100

• Attribute exchanged within AS

• Highest local preference is preferred

• Used to control exit point when your AS has mulitple EBGP connections

Page 24: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Metric / MED Attribute

• MED=Multi Exit Descriminator

• Gives external AS hints as to your preferred entry to your network

• Not always honored, ASPATH prepend may be better

• Low value is preferred

Page 25: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Community Attribute

• Used for grouping destinations

• Allows applying routing decisions to according to communities.

• Must explicitly send communities

• Also used for other enhancements like MPLS/VPNs

Page 26: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

ASPATHs

• List of ASNs representing the path to a desination

• Use ASPATH filters with regular expressions to match

• “ip as-path 5 permit ^2553”

(Matches routes originating from FSU AS)

• Applied with filter-list or route-map

Page 27: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

ASPATH Regular Expressions

• . Single Character Wildcard

• ^ Beginning of String

• $ End of String

• _ Match beginning,end,comma,brace, or space

• * Zero or more occurances

• + One or more occurances

Page 28: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Regular Expressions Examples

• _2553_ Paths that traverse FSU

• ^2553$ Origin FSU

• ^2553 .* Path from FSU

• ^$ Null path from this AS

• Experiment with:

sh ip bgp regexp REGULAR-EXP

Page 29: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

Internet Backbone Architecture

• Backbone ISPs provide service

• Backbone ISPs peer at the Internet NAPs

• Large backbone ISPs also privately peer

• Peering arrangements are largely determined by finances

Page 30: BGP4 - Border Gateway Protocol. Autonomous Systems Routers under a single administrative control are grouped into autonomous systems Identified by a 16

References

• Internet Routing Architectures 2/e - Halabi

• RFC1771

• BGP4 Case Studies - Halabi