network routing : link state routing and bgp
Post on 21-Jan-2016
44 Views
Preview:
DESCRIPTION
TRANSCRIPT
Network Routing:
Link State Routing and BGP
4/2/2008
Admin.
Course feedback two more written assignments one programming assignment (not assigned
yet, but already linked on the schedule page just in case you want to play with it; read Chapter 7)
Assignment 3
Recap: Distance Vector Routing
Implemented in RIP, IGRP, EIGRPMany properties
Distributed Asynchronous Convergence in finite steps,
independent of initial condition if network is connected
Good news propagate fast
Counting-to-infinity problem
• reverse poison/split horizon
Outline
Recap Distance vector protocols
o synchronous Bellman-Ford (SBF)o asynchronous Bellman-Ford (ABF) destination-sequenced distance vector
(DSDV)
Destination-Sequenced Distance Vector protocol (DSDV)
An extension of distance vector protocol to address the counting-to-infinity problem
Extension DSDV tags each route with a sequence number each destination node D periodically advertises
monotonically increasing even-numbered sequence numbers
when a node realizes that its link to a destination is broken, it advertises the route to D with an infinite metric and a sequence number which is one greater than the previous route (i.e. an odd seq. number)
• the route is repaired by a later even-number advertisement from the destination
DSDV: More Detail
Let’s assume the destination node is D
There are optimizations but we present a simple version: each node maintains only (SB, dB), where SB is the
sequence number at B for destination D and dB is the best distance using a neighbor from B to D
Both periodical and triggered updates periodically: D increases its seq. by 2 and broadcasts
with (SD, 0) if B is using C as next hop to D and B discovers that C
is no longer reachable• B increases its sequence number SB by 1, sets dB to , and
sends (SB, dB) to all neighbors
A B
route update
DSDV: Update
Update after receiving a message assume B sends to A its current state (SB, dB) when A receives (SB, dB)
– if SB > SA, then // always update if a higher seq#
» SA = SB
» if (dB == ) dA = ; else dA= dB + d(A,B)
– else if SA == SB, then
» if dA > dB + d(A,B) // update for the same seq# only if better route dA= dB + d(A,B) and uses B as next hop
A B
route update
Example
When C discovers that C-D link is down, it increases its seq# and broadcasts its cost to be
1
1 1
1
Claim: DSDV Does Not Form Loop
what is a loop? a loop is a global state (consisting of the nodes’ local
states) at a global moment (observed by an oracle) such that there exist nodes A, B, C, … E such that A (locally) thinks B as down stream, B thinks C as down stream, … E thinks A as down stream
Initially no loop (no one has next hop so no loop) Derive contradiction if a loop forms after a node
processes an update, e.g., when A receives the
update from B, A decides to use B as next hop and forms a loop
A B
update
Background: Global Invariants
This is a very effective method in understanding distributed asynchronous protocols
Invariants are defined over the states of the distributed nodes
Consider any node B. Let’s identify some invariants over the
state of node B, i.e., (SB, dB).
Invariants of a Single Node B
Some invariants about the state of a node SB is non-decreasing
dB is non-increasing for the same sequence number
time
Invariants of if A Considers B as Next Hop
Some invariants if A considers B as next hop
SA cannot be an odd number, dA is not
SB SA
because A is having the seq# which B last sent to A; B’s seq# might be increased after B sent its state
• if SB == SA then dB < dA because dA is based on dB which B sent to A some time ago, dB < dA since all link costs are positive; dB might be decreased after B sent its state
A B
Loop Freedom of DSDV
Consider a critical moment A starts to consider B as
next hop, and we have a loop If any link in the loop
(X considers Y as next hop) satisfies SY > SX
• by transition along the loop SB > SB
If all nodes along the loop have the same sequence number
• by transition along the loop dB > dB
A B
X
Y
update
Summary: DSDV
DSDV uses sequence number to avoid routing loops seq# partitions routing updates from different
outside events within same event, no loop so long each node
only decreases its distance
EIGRP: a routing protocol by Cisco routers Diffusive Update Algorithm (DUAL)
Discussion: Distance Vector Routing
What do you like about distance vector routing?
What do you not like about distance vector routing?
Churns of DV: One Example
N+2
…
…1 2 3 N-1 N
N+1
N+3
2N
Initial Conditions + All links have cost 1
Problematic Message sequences1. Node 2 tells 3. Node 3 tells 4…
Node N tells N+1. (N-1 messages)
2. Node N+1 tells N+2, N+2 tells N+3,…,2N. (N-1 messages)
3. Now node N-1 tells node N+14. Step 2 repeats5. Now node N-2 tells node N+16. …
A total of N2 – 2 messages
Question to think about: is this the worst case?
Outline
Recap Distance vector protocols Link state protocols
Link-State Routing
Net topology, link costs are distributed to all nodes all nodes have same info thus can compute any types of routes
Each node computes its shortest paths from itself to all other nodes e.g., use Dijkstra’s algorithm (see backup slides)
Link state distribution accomplished via “link state broadcast”
Link State Broadcast
The hard part is link state broadcast basic approach: forward a link state (link ID,
link status) to all links except the incoming link
Question: what are the problems the link state broadcast needs to handle? broadcast loop (a problem in exam 1) ordering of events (link up and down) network partitioning and then merge
Link State Broadcast
Each link update is given a sequence number: (initiator, seq#, link, status) the initiator should increase the seq# for each
new update If the seq# of an update of a link is not
higher than the highest seq# a router has seen, drop the update
Otherwise, forward it to all links except the incoming link (see backup slides for the real implementation using packet buffer)
Each seq# has an age field (why?) Updates are sent periodically (why?)
OSPF (Open Shortest Path First)
“ Open”: publicly available
Uses Link State algorithm link state (LS) packet dissemination topology map at each node route computation using Dijkstra’s algorithm
http://en.wikipedia.org/wiki/Open_Shortest_Path_First
OSPF “Advanced” Features (not in RIP)
Multiple same-cost paths allowed (only one path in RIP)
For each link, multiple cost metrics for different Type Of Service (eg, satellite link cost set “low” for best effort; high for real time)
Security: all OSPF messages authenticated (to prevent malicious intrusion); TCP connections used
Hierarchical OSPF
Hierarchical OSPF
“ summarize” distances to nets in own area, advertise to other Area Border routers.
run OSPF routing limited to backbone.
- Link-state advertisements only in area each nodes has detailed area topology;- only know direction (shortest path) to nets in other areas.
Two-level hierarchy: local area, backbone.
Information hiding (filtered) => reduce computation, bandwidth, storage
Why Hierarchy?
Discussion: Link State Routing
What do you like about link state routing?
What do you not like about link state routing?
Question to think about: which routing protocol (DV or LS) should the Internet use?
Outline
Recap Distance vector protocols Link state protocols Routing in the Internet
overview
Routing in the Internet
The Global Internet consists of Autonomous Systems (AS) interconnected with each otherAn AS is identified by an AS Number
(ASN), e.g. Yale ASN is 29 try %whois -h whois.arin.net “a
Yale“
Routing with AS Intra-AS
Different AS’s may run different routing protocols A protocol running insides an AS is called an Interior
Gateway Protocol (IGP)• RIP: Routing Information Protocol• OSPF: Open Shortest Path First• IS-IS: very similar to OSPF (or should we say OSPF is very
similar to IS-IS?)• E/IGRP: Interior Gateway Routing Protocol (Cisco)
Inter-AS a protocol runs among AS’s is also called an Exterior
Gateway Protocol (EGP) for global connectivity, a single interdomain routing
protocol
eBGP
b a
AS C(RIP intra routing)
Routing in the Internet: Example
b
AS B(OSPF intra routing)
AS A(OSPF intra routing)
iBGP
inter-AS routing
between A and B
Intra-AS and Inter-AS Routing
Host h2
a
b
b
aaC
A
Bd c
A.a
A.c
C.bB.a
cb
Hosth1
Intra-AS routingwithin AS A
intra-AS routingwithin AS B
border (exterior gateway) routers
interior (gateway) routers
Many Routing Processes on a Single Router
Forwarding Table
OSPFdomain
RIPdomain
BGP
OS kernel
RIP process
RIP routing table
Forwarding Table Manager
OSPF process
OSPF Routing table
BGP process
BGP routing table
Why Partition into Intra- and Inter-AS Routing? This partition allows ASes flexibility to
choose their own intra-AS routing protocols autonomy
By aggregating many destinations inside an AS into a single destination in interdomain routing, it improves scalability the partition is a type of hierarchical routing hierarchical routing improves scalability: only a
small number of routers are involved with outside
Yale Internet Connectivity
Yale
Qwest
default routes 0.0.0.0/0pointing to provider.
132.130.0.0/16128.36.0.0/16
AT&T Internet2
Hierarchical Routing May Pay a Price for Path Quality
AS 4
AS 3
AS 2
AS 1
Outline
Recap Distance vector protocols Link state protocols Routing in the Internet BGP
BGP Setup
Internet Interdomain Routing: BGP BGP (Border Gateway Protocol): the de facto standard Path Vector protocol:
similar to Distance Vector protocol a border gateway sends to a neighbor entire path (i.e.,
a sequence of ASes) to a destination, e.g.,• gateway X sends to neighbor N its path to dest. Z:
path (X,Z) = X,Y1,Y2,Y3,…,Z if N selects path(X, Z) advertised by X, then:
path (N,Z) = N, path (X,Z) XN
Z
BGP Operations (Simplified)
Establish session on TCP port 179
Exchange all active routes
Exchange incremental updates
AS1
AS2
while (connection is ALIVE) exchange UPDATE message select best available route if route changes, export to neigh.
BGP session
BGP Messages
Four types of messages
OPEN: opens TCP connection to peer and authenticates sender
UPDATE: advertises new path (or withdraws old)
KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request
NOTIFICATION: reports errors in previous msg; also used to close connection
Why Path Vector?
Path vector prevents counting-to-infinity problem
Path vector allows an AS to define local policies on the ASes of a given path
BGP Routing Decision Process
routing cacheselect best
path
export path to neighbors
route selection
policy: rank paths
export policy: which paths
export to which
neighbors
BGP Route Selection Policy
Typical (Cisco) routeselection policy Highest local pref Shortest AS path length Prefer eBGP over iBGP …
Yale
Qwest
default routes 0.0.0.0/0pointing to provider.
AT&T Internet2
Policy Interactions
2
0
31
2 1 02 0
1 3 01 0
3 2 03 0
4
3
preferred
lesspreferred
The BAD GADGET example:- 0 is the destination - the route selection policy of each AS is to prefer its counter clock-wise neighbor
Policy interaction causes routing instability !
Backup Slides
44
45
Dijkstra’s Algorithm
See schedule page for animation
46
Dijkstra’s Algorithm
Notation: c(i,j): link cost from node i to j; cost infinite if
not direct neighbors D(v): current value of cost of path from source
to destination v p(v): predecessor node along path from
source to destination v N: set of nodes whose least cost path
definitively known
47
Dijkstra’s Algorithm
1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N
48
Dijkstra’s Algorithm: Example
Step012345
start NA
ADADE
ADEBADEBC
ADEBCF
D(B),p(B)2,A2,A2,A
D(C),p(C)5,A4,D3,E3,E
D(D),p(D)1,A
D(E),p(E)infinity
2,D
D(F),p(F)infinityinfinity
4,E4,E4,E
A
ED
CB
F
2
2
13
1
1
2
53
5
Use Packet Buffer to Distribute Link States
The right figure shows the packet buffer at router BA, C, F are its neighbors
• Add ACK for reliability• Avoid multiple update packets from the same source at the same router• When a router receives a link update from a source S from neighbor X
• if no state for S or seq# higher than current, add the state for S, set Ack for X, set Send for other neighbors; • if has state for S and seq# of the received update is smaller, ignore; • if received seq# equals to the current seq#, set Ack for X, clear Send to X
•Round-robin among the Ack and Send flags
BGP Route Selection Policy
Typical (Cisco) routeselection policy Highest local pref Shortest AS path length Prefer eBGP over iBGP …
50
Yale
Qwest
default routes 0.0.0.0/0pointing to provider.
AT&T Internet2
51
The Gang of Four
Link State Vectoring
EGP
IGP
BGP
RIP(IS-IS)
OSPF
top related