View
219
Download
0
Category
Tags:
Preview:
Citation preview
BGP4 - Border Gateway Protocol
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”
Types of Autonomous Systems
• Single-homed
• Multi-homed non-transit
• Multi-homed transit
ASN Numbers
• 16-bit Integer, 1 thru 65535
• Public ASNs 1 thru 64511– Assigned by ARIN requires multihoming
• Private ASNs 64512 thru 65535
Typical ASN Connections100
600
300200
400
500
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
FSU ASN Connections
2553FSU
6912Hayes 209
Qwest
701UUNET
3447Sprint-TLH
1239Sprint-Bbone
2379Sprint-WnPk
3996FIRN
8103DMS
10490GIT-I2
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#
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#
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
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
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
EBGP
• BGP routers in different ASNs speak EBGP to each other
• Normally are directly connected
• Sometimes use EBGP Multihop
EBGP - IBGP
EBGP
EBGP
EBGP
EBGP
IBGP
Public Tools
• Route Servers, Traceroute Servers, Looking Glass servers at www.traceroute.org
• Digex Looking-Glass nitrous.digex.net
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
BGP attributes• Origin• ASPATH• Weight• Local Preference• Multi-Exit Descriminator (MED)• Communities• Origin Type• Next-Hop
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
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
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.
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
Weight Attribute
• Cisco specific
• Default 32768
• Highest weight preferred when multiple paths to a destination exist
• Local relevance (not propogated)
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
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
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
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
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
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
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
References
• Internet Routing Architectures 2/e - Halabi
• RFC1771
• BGP4 Case Studies - Halabi
Recommended