SlideShare a Scribd company logo
1 of 57
BGP 
EE 122, Fall 2013 
Sylvia Ratnasamy 
http://inst.eecs.berkeley.edu/~ee122/ 
Material thanks to Ion Stoica, Scott Shenker, 
Jennifer Rexford, and many other colleagues
BGP: The story so far 
 Destinations are IP prefixes (12.0.0.0/8) 
 Nodes are Autonomous Systems (ASes) 
 Links represent both physical connections and 
business relationships 
 customer-provider or peer-to-peer 
 BGP 
 path-vector protocol 
 policy-driven route selection
BGP: Today 
 BGP policy 
 typical policies, how they’re implemented 
 BGP protocol details 
 Issues with BGP
Policy imposed in how routes are 
selected and exported 
Route selection 
 Selection: Which path to use? 
Can reach 
128.3/16 
blah blah 
 controls whether/how traffic leaves the network 
 Export: Which path to advertise? 
 controls whether/how traffic enters the network 
Customer 
Competitor 
1 
5 
10 
Route export
Typical Selection Policy 
 In decreasing order of priority 
 make/save money (send to customer > peer > provider) 
 maximize performance (smallest AS path length) 
 minimize use of my network bandwidth (“hot potato”) 
 … 
 …
Typical Export Policy 
Destination prefix 
advertised by… 
Export route to… 
Customer 
Everyone 
(providers, peers, 
other customers) 
Peer Customers 
Provider Customers 
We’ll refer to these as the “Gao-Rexford” rules 
(capture common -- but not required! -- practice!)
Gao-Rexford 
providers 
peers 
customers 
With Gao-Rexford, the customer-provider graph is a 
DAG (directed acyclic graph) and routes are “valley free”
BGP: Today 
 BGP policy 
 typical policies, how they’re implemented 
 BGP protocol details 
 stay awake as long as you can… 
 BGP issues
Who speaks BGP? 
Border router 
Internal router 
Border routers at an Autonomous System
What does “speak BGP” mean? 
 Implement the standardized BGP protocol 
 read more here: http://tools.ietf.org/html/rfc4271 
 Specifies what messages to exchange with other BGP “speakers” 
 message types: e.g., route advertisements 
 message syntax: e.g., first X bytes for dest prefix; next Y for AS path, etc. 
 And how to process these messages 
 e.g., “when you receive a message of type X, apply this selection rule, then…” 
 as per BGP state machine in the protocol spec + policy decisions, etc.
BGP “sessions” 
“eBGP session” 
A border router speaks BGP with 
border routers in other ASes
BGP “sessions” 
“iBGP session” 
A border router speaks BGP with other 
(interior and border) routers in its own AS
eBGP, iBGP, IGP 
 eBGP: BGP sessions between border routers in different ASes 
 Learn routes to external destinations 
 iBGP: BGP sessions between border routers and other 
routers within the same AS 
 distribute externally learned routes internally 
 assume a full all-to-all mesh of iBGP sessions 
 IGP: “Interior Gateway Protocol” = Intradomain routing protocol 
 provide internal reachability 
 e.g., OSPF, RIP
Some Border Routers Don’t Need BGP 
 Customer that connects to a single upstream ISP 
 The ISP can advertise prefixes into BGP on behalf of customer 
 … and the customer can simply default-route to the ISP 
Provider 
Install routes 130.132.0.0/16 pointing to Customer 
Install default routes 0.0.0.0/0 
pointing to Provider 
Customer 
130.132.0.0/16
Putting the pieces together 
6 
2 
3 
4 9 2 
3 1 
1. Provide internal reachability (IGP) 
2. Learn routes to external destinations (eBGP) 
3. Distribute externally learned routes internally (iBGP) 
4. Travel shortest path to egress (IGP)
Basic Messages in BGP 
 Open 
 Establishes BGP session 
 BGP uses TCP [will make sense in 1-2weeks] 
 Notification 
 Report unusual conditions 
 Update 
 Inform neighbor of new routes 
 Inform neighbor of old routes that become inactive 
 Keepalive 
 Inform neighbor that connection is still viable
BGP Operations 
Open session on 
TCP port 179 
Exchange all 
active routes 
Exchange incremental 
Updates 
AS1 
BGP session 
AS2 
While connection 
is ALIVE exchange 
route UPDATE messages
Route Updates 
 Format <IP prefix: route attributes> 
 attributes describe properties of the route 
 Two kinds of updates 
 announcements: new routes or changes to existing routes 
 withdrawal: remove routes that no longer exist
Route Attributes 
 Routes are described using attributes 
 Used in route selection/export decisions 
 Some attributes are local 
 i.e., private within an AS, not included in 
announcements 
 e.g., LOCAL PREF, ORIGIN 
 Some attributes are propagated with eBGP route 
announcements 
 e.g., NEXT HOP, AS PATH, MED, etc. 
 There are many standardized attributes in BGP 
 We will discuss a few
Attributes (1): ASPATH 
 Carried in route announcements 
 Vector that lists all the ASes a route 
announcement has traversed (in reverse order) 
 e.g., “7018 88” 
AS 7018 
AT&T 
AS 12654 
128.112.0.0/16 
AS path = 7018 88 
AS 88 
Princeton, 
128.112/16 
IP prefix = 128.112.0.0/16 
AS path = 88
Attributes (2): NEXT HOP 
 Carried in a route update message 
 IP address of next hop router on path to destination 
 Updated as the announcement leaves AS 
AS 88 
Princeton, 
128.112/16 
AS 7018 
AT&T 
IP prefix = 128.112.0.0/16 
AS path = 88 
Next Hop = 192.0.2.1 
12.127.0.121 
AS 12654 
192.0.2.1 
128.112.0.0/16 
AS path = 7018 88 
Next Hop = 12.127.0.121
Attributes (3): LOCAL PREF 
 “Local Preference” 
 Used to choose between different AS paths 
 The higher the value the more preferred 
 Local to an AS; carried only in iBGP messages 
 Ensures consistent route selection across an AS 
AS1 
AS2 AS3 
AS4 
140.20.1.0/24 
BGP table at AS4: 
Destination AS Path Local Pref 
140.20.1.0/24 AS3 AS1 300 
140.20.1.0/24 AS2 AS1 100
Example: iBGP and LOCAL PREF 
 Both routers prefer the path through AS 100 on the left 
AS1 
I-BGP 
AS 4 
AS 3 
AS 2 
Local Pref = 100 Local Pref = 90
Attributes (4): ORIGIN 
 Records who originated the announcement 
 Local to an AS 
 Options: 
 “e” : from eBGP 
 “i” : from iBGP 
 “?” : Incomplete; often used for static routes 
 Typically: e > i > ?
Attributes (5) : MED 
 “Multi-Exit Discriminator” 
 Used when ASes are interconnected 
via 2 or more links to specify how close 
a prefix is to the link it is announced on 
 Lower is better 
 AS announcing prefix sets MED (AS2 
in picture) 
 AS receiving prefix (optionally!) uses 
MED to select link (AS1 in pic.) 
Link B 
Link A 
MED=10 
MED=50 
AS1 
AS2 
AS3 
destination 
prefix
Attributes (6): IGP cost 
 Used for hot-potato routing 
27 
 Each router selects the closest egress point based on 
the path cost in intra-domain protocol 
hot potato 
A 
B 
D 
C 
G 
3 
dst 
F E 
4 
5 
9 
3 
4 
8 10 
8
IGP may conflict with MED 
Dsf 
A 
B 
NEXTHOP=SF 
MED=100 
NEXTHOP=BOS 
MED=500
Using Attributes 
 Rules for route selection in priority order 
Priority Rule Remarks 
1 LOCAL PREF Pick highest LOCAL PREF 
2 ASPATH Pick shortest ASPATH length 
3 MED Lowest MED preferred 
4 eBGP > iBGP Did AS learn route via eBGP 
(preferred) or iBGP? 
5 iBGP path Lowest IGP cost to next hop 
(egress router) 
6 Router ID Smallest router ID (IP address) 
as tie-breaker
BGP UPDATE Processing 
Open ended programming. 
Constrained only by vendor configuration language 
Best Route 
Selection 
Apply Import 
Policies 
Best Route 
Table 
Apply Policy = 
filter routes & 
tweak attributes 
Apply Export 
Policies 
Install forwarding 
Entries for best 
Routes. 
Receive 
BGP 
Updates 
Best 
Routes 
Transmit 
BGP 
Updates 
Filter routes & 
tweak attributes 
Based on 
Attribute 
Values 
IP Forwarding Table
BGP: Today 
 BGP policy 
 typical policies, how they’re implemented 
 BGP protocol details 
 BGP issues
Issues with BGP 
 Reachability 
 Security 
 Convergence 
 Performance
Reachability 
 In normal routing, if graph is connected then 
reachability is assured 
 With policy routing, this does not always hold 
Provider AS 1 AS 3 Provider 
AS 2 
Customer
Security 
 An AS can claim to serve a prefix that they 
actually don’t have a route to (blackholing traffic) 
 Problem not specific to policy or path vector 
 Important because of AS autonomy 
 Fixable: make ASes “prove” they have a path 
 Note: AS can also have incentive to forward 
packets along a route different from what is 
advertised 
 Tell customers about fictitious short path… 
 Much harder to fix!
Convergence 
 Result: If all AS policies follow “Gao-Rexford” 
rules, BGP is guaranteed to converge (safety) 
 For arbitrary policies, BGP may fail to converge!
Example of Policy Oscillation 
36 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0 
“1” prefers “1 3 0” 
over “1 0” to reach “0”
Step-by-Step of Policy Oscillation 
Initially: nodes 1, 2, 3 know only shortest path to 
0 
37 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
38 
1 advertises its path 1 0 to 2 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
39 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
40 
3 advertises its path 3 0 to 1 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
41 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
42 
1 withdraws its path 1 0 from 2 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
43 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
44 
2 advertises its path 2 0 to 3 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0 
advertise: 2 0
Step-by-Step of Policy Oscillation 
45 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
46 
3 withdraws its path 3 0 from 1 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
47 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
48 
1 advertises its path 1 0 to 2 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0
Step-by-Step of Policy Oscillation 
50 
2 withdraws its path 2 0 from 3 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0 
withdraw: 2 0
Step-by-Step of Policy Oscillation 
51 
1 
1 3 0 
1 0 
2 3 
3 2 0 
3 0 
2 1 0 
2 0 
0 
We are back to where we started!
Convergence 
 Result: If all AS policies follow “Gao-Rexford” 
rules, BGP is guaranteed to converge (safety) 
 For arbitrary policies, BGP may fail to converge! 
 Should this trouble us?
Performance Nonissues 
 Internal routing (non) 
 Domains typically use “hot potato” routing 
 Not always optimal, but economically expedient 
 Policy not about performance (non) 
 So policy-chosen paths aren’t shortest 
 Choosing among policy-compliant paths (non) 
 Fewest AS hops has little to do with actual delay 
 20% of paths inflated by at least 5 router hops
Performance (example) 
 AS path length can be misleading 
 An AS may have many router-level hops 
AS 4 
AS 3 
BGP says that 
path 4 1 is better 
than path 3 2 1 
AS 2 
AS 1
Real Performance Issue: Slow 
convergence 
 BGP outages are biggest source of Internet 
problems 
 Labovitz et al. SIGCOMM’97 
 10% of routes available less than 95% of time 
 Less than 35% of routes available 99.99% of the time 
 Labovitz et al. SIGCOMM 2000 
 40% of path outages take 30+ minutes to repair 
 But most popular paths are very stable
BGP Misconfigurations 
 BGP protocol is both bloated and underspecified 
 lots of leeway in how to set and interpret attribute values, 
route selection rules, etc. 
 necessary to allow autonomy, diverse policies 
 but also gives operators plenty of rope 
 Much of this configuration is manual and ad hoc 
 And the core abstraction is fundamentally flawed 
 per-router configuration to effect AS-wide policy 
 now strong industry interest in changing this! [later: SDN]
BGP: How did we get here? 
 BGP was designed for a different time 
 before commercial ISPs and their needs 
 before address aggregation 
 before multi-homing 
• 1989 : BGP-1 [RFC 1105] 
 We don’t get a second chance: `clean slate’ 
designs – Replacement virtually for impossible EGP (1984, RFC to 904) 
deploy 
• 1990 : BGP-2 [RFC 1163] 
• 1991 : BGP-3 [RFC 1267] 
 Thought experiment: how would you design a 
policy-• 1995 driven : BGP-interdomain 4 [RFC 1771] 
routing solution? How 
would – you Support deploy for Classless it? 
Interdomain Routing (CIDR)
Next Time. 
 Wrap up the network layer! 
 the IPv4 header 
 IP routers

More Related Content

What's hot

BGP (border gateway routing protocol)
BGP (border gateway routing protocol)BGP (border gateway routing protocol)
BGP (border gateway routing protocol)Netwax Lab
 
Implementing Internet and MPLS BGP
Implementing Internet and MPLS BGPImplementing Internet and MPLS BGP
Implementing Internet and MPLS BGPPrivate
 
An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)Jasim Alam
 
Equinix IP Address Renumbering in Singapore and Sydney
Equinix IP Address Renumbering in Singapore and SydneyEquinix IP Address Renumbering in Singapore and Sydney
Equinix IP Address Renumbering in Singapore and SydneyAPNIC
 
Troubleshooting BGP
Troubleshooting BGPTroubleshooting BGP
Troubleshooting BGPAPNIC
 
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLEnhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLNutan Singh
 
Border Gateway Protocol
Border Gateway ProtocolBorder Gateway Protocol
Border Gateway ProtocolKashif Latif
 
Study Notes BGP Exam
Study Notes BGP ExamStudy Notes BGP Exam
Study Notes BGP ExamDuane Bodle
 
CCNP Route 642 902 BGP
CCNP Route 642 902 BGPCCNP Route 642 902 BGP
CCNP Route 642 902 BGPIT Tech
 
3 ip routing part b
3 ip routing part b3 ip routing part b
3 ip routing part bSagarR24
 
Border Gateway Protocol (BGP)
Border Gateway Protocol (BGP)Border Gateway Protocol (BGP)
Border Gateway Protocol (BGP)Nutan Singh
 

What's hot (20)

BGP
BGPBGP
BGP
 
BGP (border gateway routing protocol)
BGP (border gateway routing protocol)BGP (border gateway routing protocol)
BGP (border gateway routing protocol)
 
Implementing Internet and MPLS BGP
Implementing Internet and MPLS BGPImplementing Internet and MPLS BGP
Implementing Internet and MPLS BGP
 
Border Gatway Protocol
Border Gatway ProtocolBorder Gatway Protocol
Border Gatway Protocol
 
An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)An Overview of Border Gateway Protocol (BGP)
An Overview of Border Gateway Protocol (BGP)
 
Bigbgp
BigbgpBigbgp
Bigbgp
 
BGP
BGPBGP
BGP
 
Bgp training
Bgp trainingBgp training
Bgp training
 
Equinix IP Address Renumbering in Singapore and Sydney
Equinix IP Address Renumbering in Singapore and SydneyEquinix IP Address Renumbering in Singapore and Sydney
Equinix IP Address Renumbering in Singapore and Sydney
 
Bgp (1)
Bgp (1)Bgp (1)
Bgp (1)
 
Bgp
BgpBgp
Bgp
 
Troubleshooting BGP
Troubleshooting BGPTroubleshooting BGP
Troubleshooting BGP
 
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOLEnhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
Enhanced Interior Gateway Routing Protocol (EIGRP) || NETWORK PROTOCOL
 
Bgp
BgpBgp
Bgp
 
Bgp Toc
Bgp TocBgp Toc
Bgp Toc
 
Border Gateway Protocol
Border Gateway ProtocolBorder Gateway Protocol
Border Gateway Protocol
 
Study Notes BGP Exam
Study Notes BGP ExamStudy Notes BGP Exam
Study Notes BGP Exam
 
CCNP Route 642 902 BGP
CCNP Route 642 902 BGPCCNP Route 642 902 BGP
CCNP Route 642 902 BGP
 
3 ip routing part b
3 ip routing part b3 ip routing part b
3 ip routing part b
 
Border Gateway Protocol (BGP)
Border Gateway Protocol (BGP)Border Gateway Protocol (BGP)
Border Gateway Protocol (BGP)
 

Similar to Lec7

Computer network (14)
Computer network (14)Computer network (14)
Computer network (14)NYversity
 
Dynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGPDynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGPMaximilan Wilhelm
 
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PLNOG15: BGP New Advanced Features - Piotr WojciechowskiPLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PLNOG15: BGP New Advanced Features - Piotr WojciechowskiPROIDEA
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrpSagarR24
 
Chapter 06 - Routing
Chapter 06 - RoutingChapter 06 - Routing
Chapter 06 - Routingphanleson
 
16 bgp
16 bgp16 bgp
16 bgpTCT
 
SANOG23-BGP-Techniques.pdf
SANOG23-BGP-Techniques.pdfSANOG23-BGP-Techniques.pdf
SANOG23-BGP-Techniques.pdfGhulamIbneGhulam
 
ospf.ppt
ospf.pptospf.ppt
ospf.pptSolWeje
 
Chapter7ccna
Chapter7ccnaChapter7ccna
Chapter7ccnarobertoxe
 
Multi-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and ApplicationsMulti-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and ApplicationsVishal Sharma, Ph.D.
 
B G P O S P F Interaction Report
B G P  O S P F  Interaction  ReportB G P  O S P F  Interaction  Report
B G P O S P F Interaction Reportgobed
 

Similar to Lec7 (20)

11 bgp-ethernet
11 bgp-ethernet11 bgp-ethernet
11 bgp-ethernet
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
 
Computer network (14)
Computer network (14)Computer network (14)
Computer network (14)
 
Dynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGPDynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGP
 
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PLNOG15: BGP New Advanced Features - Piotr WojciechowskiPLNOG15: BGP New Advanced Features - Piotr Wojciechowski
PLNOG15: BGP New Advanced Features - Piotr Wojciechowski
 
Routing algorithms
Routing algorithmsRouting algorithms
Routing algorithms
 
3 ip routing eigrp
3 ip routing eigrp3 ip routing eigrp
3 ip routing eigrp
 
B G P Part2
B G P  Part2B G P  Part2
B G P Part2
 
Chapter 06 - Routing
Chapter 06 - RoutingChapter 06 - Routing
Chapter 06 - Routing
 
ENCOR_Chapter_6.pptx
ENCOR_Chapter_6.pptxENCOR_Chapter_6.pptx
ENCOR_Chapter_6.pptx
 
16 bgp
16 bgp16 bgp
16 bgp
 
SANOG23-BGP-Techniques.pdf
SANOG23-BGP-Techniques.pdfSANOG23-BGP-Techniques.pdf
SANOG23-BGP-Techniques.pdf
 
Bgp
BgpBgp
Bgp
 
ospf.ppt
ospf.pptospf.ppt
ospf.ppt
 
Chapter7ccna
Chapter7ccnaChapter7ccna
Chapter7ccna
 
Chapter7ccna
Chapter7ccnaChapter7ccna
Chapter7ccna
 
Mpls Services
Mpls ServicesMpls Services
Mpls Services
 
Multi-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and ApplicationsMulti-Protocol Label Switching: Basics and Applications
Multi-Protocol Label Switching: Basics and Applications
 
B G P O S P F Interaction Report
B G P  O S P F  Interaction  ReportB G P  O S P F  Interaction  Report
B G P O S P F Interaction Report
 
EIGRP CCNA
EIGRP CCNAEIGRP CCNA
EIGRP CCNA
 

Recently uploaded

一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样AS
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理A
 
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证hfkmxufye
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理SS
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Dewi Agency
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirtrahman018755
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理F
 
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformonhackersuli
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27APNIC
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...mikehavy0
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理F
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样AS
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsrahman018755
 

Recently uploaded (20)

一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
 
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirt
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
 

Lec7

  • 1. BGP EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/~ee122/ Material thanks to Ion Stoica, Scott Shenker, Jennifer Rexford, and many other colleagues
  • 2. BGP: The story so far  Destinations are IP prefixes (12.0.0.0/8)  Nodes are Autonomous Systems (ASes)  Links represent both physical connections and business relationships  customer-provider or peer-to-peer  BGP  path-vector protocol  policy-driven route selection
  • 3. BGP: Today  BGP policy  typical policies, how they’re implemented  BGP protocol details  Issues with BGP
  • 4. Policy imposed in how routes are selected and exported Route selection  Selection: Which path to use? Can reach 128.3/16 blah blah  controls whether/how traffic leaves the network  Export: Which path to advertise?  controls whether/how traffic enters the network Customer Competitor 1 5 10 Route export
  • 5. Typical Selection Policy  In decreasing order of priority  make/save money (send to customer > peer > provider)  maximize performance (smallest AS path length)  minimize use of my network bandwidth (“hot potato”)  …  …
  • 6. Typical Export Policy Destination prefix advertised by… Export route to… Customer Everyone (providers, peers, other customers) Peer Customers Provider Customers We’ll refer to these as the “Gao-Rexford” rules (capture common -- but not required! -- practice!)
  • 7. Gao-Rexford providers peers customers With Gao-Rexford, the customer-provider graph is a DAG (directed acyclic graph) and routes are “valley free”
  • 8. BGP: Today  BGP policy  typical policies, how they’re implemented  BGP protocol details  stay awake as long as you can…  BGP issues
  • 9. Who speaks BGP? Border router Internal router Border routers at an Autonomous System
  • 10. What does “speak BGP” mean?  Implement the standardized BGP protocol  read more here: http://tools.ietf.org/html/rfc4271  Specifies what messages to exchange with other BGP “speakers”  message types: e.g., route advertisements  message syntax: e.g., first X bytes for dest prefix; next Y for AS path, etc.  And how to process these messages  e.g., “when you receive a message of type X, apply this selection rule, then…”  as per BGP state machine in the protocol spec + policy decisions, etc.
  • 11. BGP “sessions” “eBGP session” A border router speaks BGP with border routers in other ASes
  • 12. BGP “sessions” “iBGP session” A border router speaks BGP with other (interior and border) routers in its own AS
  • 13. eBGP, iBGP, IGP  eBGP: BGP sessions between border routers in different ASes  Learn routes to external destinations  iBGP: BGP sessions between border routers and other routers within the same AS  distribute externally learned routes internally  assume a full all-to-all mesh of iBGP sessions  IGP: “Interior Gateway Protocol” = Intradomain routing protocol  provide internal reachability  e.g., OSPF, RIP
  • 14. Some Border Routers Don’t Need BGP  Customer that connects to a single upstream ISP  The ISP can advertise prefixes into BGP on behalf of customer  … and the customer can simply default-route to the ISP Provider Install routes 130.132.0.0/16 pointing to Customer Install default routes 0.0.0.0/0 pointing to Provider Customer 130.132.0.0/16
  • 15. Putting the pieces together 6 2 3 4 9 2 3 1 1. Provide internal reachability (IGP) 2. Learn routes to external destinations (eBGP) 3. Distribute externally learned routes internally (iBGP) 4. Travel shortest path to egress (IGP)
  • 16. Basic Messages in BGP  Open  Establishes BGP session  BGP uses TCP [will make sense in 1-2weeks]  Notification  Report unusual conditions  Update  Inform neighbor of new routes  Inform neighbor of old routes that become inactive  Keepalive  Inform neighbor that connection is still viable
  • 17. BGP Operations Open session on TCP port 179 Exchange all active routes Exchange incremental Updates AS1 BGP session AS2 While connection is ALIVE exchange route UPDATE messages
  • 18. Route Updates  Format <IP prefix: route attributes>  attributes describe properties of the route  Two kinds of updates  announcements: new routes or changes to existing routes  withdrawal: remove routes that no longer exist
  • 19. Route Attributes  Routes are described using attributes  Used in route selection/export decisions  Some attributes are local  i.e., private within an AS, not included in announcements  e.g., LOCAL PREF, ORIGIN  Some attributes are propagated with eBGP route announcements  e.g., NEXT HOP, AS PATH, MED, etc.  There are many standardized attributes in BGP  We will discuss a few
  • 20. Attributes (1): ASPATH  Carried in route announcements  Vector that lists all the ASes a route announcement has traversed (in reverse order)  e.g., “7018 88” AS 7018 AT&T AS 12654 128.112.0.0/16 AS path = 7018 88 AS 88 Princeton, 128.112/16 IP prefix = 128.112.0.0/16 AS path = 88
  • 21. Attributes (2): NEXT HOP  Carried in a route update message  IP address of next hop router on path to destination  Updated as the announcement leaves AS AS 88 Princeton, 128.112/16 AS 7018 AT&T IP prefix = 128.112.0.0/16 AS path = 88 Next Hop = 192.0.2.1 12.127.0.121 AS 12654 192.0.2.1 128.112.0.0/16 AS path = 7018 88 Next Hop = 12.127.0.121
  • 22. Attributes (3): LOCAL PREF  “Local Preference”  Used to choose between different AS paths  The higher the value the more preferred  Local to an AS; carried only in iBGP messages  Ensures consistent route selection across an AS AS1 AS2 AS3 AS4 140.20.1.0/24 BGP table at AS4: Destination AS Path Local Pref 140.20.1.0/24 AS3 AS1 300 140.20.1.0/24 AS2 AS1 100
  • 23. Example: iBGP and LOCAL PREF  Both routers prefer the path through AS 100 on the left AS1 I-BGP AS 4 AS 3 AS 2 Local Pref = 100 Local Pref = 90
  • 24. Attributes (4): ORIGIN  Records who originated the announcement  Local to an AS  Options:  “e” : from eBGP  “i” : from iBGP  “?” : Incomplete; often used for static routes  Typically: e > i > ?
  • 25. Attributes (5) : MED  “Multi-Exit Discriminator”  Used when ASes are interconnected via 2 or more links to specify how close a prefix is to the link it is announced on  Lower is better  AS announcing prefix sets MED (AS2 in picture)  AS receiving prefix (optionally!) uses MED to select link (AS1 in pic.) Link B Link A MED=10 MED=50 AS1 AS2 AS3 destination prefix
  • 26. Attributes (6): IGP cost  Used for hot-potato routing 27  Each router selects the closest egress point based on the path cost in intra-domain protocol hot potato A B D C G 3 dst F E 4 5 9 3 4 8 10 8
  • 27. IGP may conflict with MED Dsf A B NEXTHOP=SF MED=100 NEXTHOP=BOS MED=500
  • 28. Using Attributes  Rules for route selection in priority order Priority Rule Remarks 1 LOCAL PREF Pick highest LOCAL PREF 2 ASPATH Pick shortest ASPATH length 3 MED Lowest MED preferred 4 eBGP > iBGP Did AS learn route via eBGP (preferred) or iBGP? 5 iBGP path Lowest IGP cost to next hop (egress router) 6 Router ID Smallest router ID (IP address) as tie-breaker
  • 29. BGP UPDATE Processing Open ended programming. Constrained only by vendor configuration language Best Route Selection Apply Import Policies Best Route Table Apply Policy = filter routes & tweak attributes Apply Export Policies Install forwarding Entries for best Routes. Receive BGP Updates Best Routes Transmit BGP Updates Filter routes & tweak attributes Based on Attribute Values IP Forwarding Table
  • 30. BGP: Today  BGP policy  typical policies, how they’re implemented  BGP protocol details  BGP issues
  • 31. Issues with BGP  Reachability  Security  Convergence  Performance
  • 32. Reachability  In normal routing, if graph is connected then reachability is assured  With policy routing, this does not always hold Provider AS 1 AS 3 Provider AS 2 Customer
  • 33. Security  An AS can claim to serve a prefix that they actually don’t have a route to (blackholing traffic)  Problem not specific to policy or path vector  Important because of AS autonomy  Fixable: make ASes “prove” they have a path  Note: AS can also have incentive to forward packets along a route different from what is advertised  Tell customers about fictitious short path…  Much harder to fix!
  • 34. Convergence  Result: If all AS policies follow “Gao-Rexford” rules, BGP is guaranteed to converge (safety)  For arbitrary policies, BGP may fail to converge!
  • 35. Example of Policy Oscillation 36 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0 “1” prefers “1 3 0” over “1 0” to reach “0”
  • 36. Step-by-Step of Policy Oscillation Initially: nodes 1, 2, 3 know only shortest path to 0 37 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 37. Step-by-Step of Policy Oscillation 38 1 advertises its path 1 0 to 2 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 38. Step-by-Step of Policy Oscillation 39 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 39. Step-by-Step of Policy Oscillation 40 3 advertises its path 3 0 to 1 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 40. Step-by-Step of Policy Oscillation 41 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 41. Step-by-Step of Policy Oscillation 42 1 withdraws its path 1 0 from 2 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 42. Step-by-Step of Policy Oscillation 43 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 43. Step-by-Step of Policy Oscillation 44 2 advertises its path 2 0 to 3 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0 advertise: 2 0
  • 44. Step-by-Step of Policy Oscillation 45 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 45. Step-by-Step of Policy Oscillation 46 3 withdraws its path 3 0 from 1 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 46. Step-by-Step of Policy Oscillation 47 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 47. Step-by-Step of Policy Oscillation 48 1 advertises its path 1 0 to 2 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 48. Step-by-Step of Policy Oscillation 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0
  • 49. Step-by-Step of Policy Oscillation 50 2 withdraws its path 2 0 from 3 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0 withdraw: 2 0
  • 50. Step-by-Step of Policy Oscillation 51 1 1 3 0 1 0 2 3 3 2 0 3 0 2 1 0 2 0 0 We are back to where we started!
  • 51. Convergence  Result: If all AS policies follow “Gao-Rexford” rules, BGP is guaranteed to converge (safety)  For arbitrary policies, BGP may fail to converge!  Should this trouble us?
  • 52. Performance Nonissues  Internal routing (non)  Domains typically use “hot potato” routing  Not always optimal, but economically expedient  Policy not about performance (non)  So policy-chosen paths aren’t shortest  Choosing among policy-compliant paths (non)  Fewest AS hops has little to do with actual delay  20% of paths inflated by at least 5 router hops
  • 53. Performance (example)  AS path length can be misleading  An AS may have many router-level hops AS 4 AS 3 BGP says that path 4 1 is better than path 3 2 1 AS 2 AS 1
  • 54. Real Performance Issue: Slow convergence  BGP outages are biggest source of Internet problems  Labovitz et al. SIGCOMM’97  10% of routes available less than 95% of time  Less than 35% of routes available 99.99% of the time  Labovitz et al. SIGCOMM 2000  40% of path outages take 30+ minutes to repair  But most popular paths are very stable
  • 55. BGP Misconfigurations  BGP protocol is both bloated and underspecified  lots of leeway in how to set and interpret attribute values, route selection rules, etc.  necessary to allow autonomy, diverse policies  but also gives operators plenty of rope  Much of this configuration is manual and ad hoc  And the core abstraction is fundamentally flawed  per-router configuration to effect AS-wide policy  now strong industry interest in changing this! [later: SDN]
  • 56. BGP: How did we get here?  BGP was designed for a different time  before commercial ISPs and their needs  before address aggregation  before multi-homing • 1989 : BGP-1 [RFC 1105]  We don’t get a second chance: `clean slate’ designs – Replacement virtually for impossible EGP (1984, RFC to 904) deploy • 1990 : BGP-2 [RFC 1163] • 1991 : BGP-3 [RFC 1267]  Thought experiment: how would you design a policy-• 1995 driven : BGP-interdomain 4 [RFC 1771] routing solution? How would – you Support deploy for Classless it? Interdomain Routing (CIDR)
  • 57. Next Time.  Wrap up the network layer!  the IPv4 header  IP routers