-
Notifications
You must be signed in to change notification settings - Fork 3
/
Lecture-7.txt
181 lines (150 loc) · 6.03 KB
/
Lecture-7.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
###Lecture 7
#####BGP
---
####Interdomain Routing: Setup
- Destinations are IP prefixes (12.0.0.0/8)
- Nodes are Autonomous Systems (ASes)
- Internals of each AS are hidden
- Links represent both physical links and business relationships
- BGP (Border Gateway Protocol) is the Interdomain routing protocol
- Implemented by AS border routers
####BGP: Basic Idea
- An AS advertises its best routes to one or more IP prefixes
- Each AS selects the "best" route it hears advertises for a prefix
- Loop
####BGP inspired by Distance Vector
- Per-destination route advertisements
- No global sharing of network topology information
- Iterative and distributed convergence on paths
- **With four crucial differences!**
####Differences between BGP and DV
#####1) Not picking shortest path routes
- BGP selects the best route based on policy, not shortest distance (least cost)
#####2) Path vector routing
- Key idea: advertise the entire path
- Distance vector: send **distance metric** per destination
- Path vector: send the **entire path** for each destination
- Benefits
- Loop avoidance is easy
#####3) Selective route advertisement
- For policy reasons, an AS may choose not to advertise a route to a destination
- Hence, reachability is not guaranteed even if graph is connected
#####4) BGP may aggregate routes
- For scalability, BGP may aggregate routes for different prefixes
---
####Policy policy
#####Policy imposed in how routes are selected and exported
- **Selection**: Which path to use?
- Controls whether/how traffic leaves the network
- **Export**: Which path to advertise?
- Controls whether/how traffic enters the network
#####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
- With Gao-Rexford, the AS policy graph is a DAG (directed acyclic graph) and routes are "valley free"
---
####BGP protocol details
#####Who speaks BGP?
- Border routers at an Autonomous System
#####What does "speak BGP" mean?
- Implement the BGP protocol standard
- Specifies what messages to exchange with other BGP "speakers"
- message types (e.g., route advertisements, updates)
- message syntax
- And how to process these messages
- e.g., "when you receive a BGP update, do..."
- follows BGP state machine in the protocol spec + policy decisions, etc.
#####BGP "sessions"
- A border router speaks BGP with border routers in other ASes
- A border router speaks BGP with other (interior and border) routers in its own AS
#####Types of BGP
- **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
- Distributed externally learned routes internally
- **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
#####Putting the pieces together
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
- 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
####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
- Some attributes are propagated with eBGP route announcements
- There are many standardized attributes in BGP
#####Attributes
- ASPATH
- Carried in route announcements
- Vector that lists all the ASes a route advertisement (in reverse order)
- 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
- 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
- AS receiving prefix (optionally!) uses MED to select link
- IGP cost
- Used for hot-potato routing
- Each router selects the closest egress point based on the path cost in intra-domain protocol
#####BGP UPDATE Processing
1. Apply Import Policies
2. Best Route Selection
3. Best Route Table -> IP Forwarding Table (Data plane)
4. Apply Export Policies
---
####BGP Issues
- Reachability
- In normal routing, if graph is connected then reachability is assured
- With policy routing, this does not always hold
- Security
- An AS can claim to serve a prefix that they 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 may 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!