Title: Routing Protocols
1Routing Protocols
2Routing
- Forwarding versus Routing
- forwarding to select an output port based on
destination address and routing table - routing process by which routing table is built
- Network as a Graph
3Routing
- Problem Find the lowest cost path between any
two nodes - Factors
- Static topology, SOL delays
- Dynamic load, congestion
- Scalable
4Distance Vector (RIP)
- Each node maintains a set of triples
- (Destination, Cost, NextHop)
- Each node sends updates to (and receives updates
from) its directly connected neighbors - periodically (on the order of several seconds)
- whenever its table changes (called triggered
update) - Used by Routing Information Protocol (RIP)
5Routing
- Each update is a list of pairs
- (Destination, Cost)
- Update local table if receive a better route
- smaller cost
- came from next-hop
- Refresh existing routes delete if they time out
6Example
Routing table at node B
Destination A C D E F G
Cost 1 1 inf inf inf inf
Next Hop A C
7Example
B
C
A
D
E
F
G
Destination A C D E F G
Cost 1 1 2 2 2 3
Next Hop A C C A A A
8Routing Loops
- Example 1
- F detects that link to G has failed
- F sets distance to G to infinity and sends update
to A - A sets distance to G to infinity since it uses F
to reach G - A receives periodic update from C with 2-hop path
to G - A sets distance to G to 3 and sends update to F
- F decides it can reach G in 4 hops via A
9Example 2
- Link from A to E fails
- A advertises distance of infinity to E
- B and C advertise a distance of 2 to E
- B and C both set the distance to E to infinity
- B decides it can reach E in 3 hops through C
advertises this to A - A decides it can reach E in 4 hops through B
advertises this to C - C decides that it can reach E in 5 hops......
10Heuristics to break routing loops
- set infinity to 16
- split horizon
- Dont send routes learned from particular
neighbor to that neighbor (B doesnt send route
E,2,A to A) - split horizon with poison reverse
- Include negative information (B sends route E,?
to A) - Only work with routing loop with simple loop,
more complex techniques later
11Example 2 with poison
- Link from A to E fails
- A advertises distance of infinity to E
- B and C advertise a distance of 2 to E to each
other - B decides it can reach E in 3 hops through C
advertises this to A, sends ? to C, - since C was using B to get to E, C advertises a
distance of ? to E - Since B was using C to get to E, B advertises a
distance of ? to E
12RIP Network
C advertises to router A and D, cost 0 to 2,3,
cost 1 to 5,6,1 and cost 2 to 4
13Summary Distance Vector
- Send entire routing table (Large amount of data
(O(N)) ) - Send it only to directly connected neighbors (to
a few endpoints (O(1)) - Routers do not have global information about
connections in the network
14Link State (OSPF)
- Strategy Send to all nodes (not just neighbors)
information about directly connected links (not
entire routing table). - Link State Packet (LSP)
- id of the node that created the LSP
- cost of link to each directly connected neighbor
- sequence number (SEQNO)
- time-to-live (TTL) for this packet
- Example Open Shortest Path First Protocol (OSPF)
15Reliable Flooding
- store most recent LSP from each node
- forward LSP to all nodes but one that sent it
- generate new LSP periodically increment SEQNO
- start SEQNO at 0 when reboot
- decrement TTL of each stored LSP discard when
TTL0
16Reliable Flooding
17What do you do with LSPs
- Want to calculate shortest path from D to every
other node - Naïve approach explores every possibility
- O(NN)
- NP Complete multicriteria
18Route Calculation (Dijkstras) O(N2)
19Edsger Wybe Dijkstra 1930-2002
- Dijkstra is renowned for the insight that
mathematical logic is and must be the basis for
sensible computer program construction and for
his contributions to mathematical methodology. - thirteen hundred written works
- leader in the abolition of the GOTO statement
from programming - "The question of whether computers can think is
like the question of whether submarines can swim
20Route Calculation (in practice)
- Forward search algorithm
- Each switch maintains two lists
- Tentative and Confirmed
- Each list contains a set of triples
- (Destination, Cost, NextHop)
21(destination, cost, nexthop)
Step 1. 2. 3. 4.
Confirmed (D,0,-) (D,0,-) (D,0,-) (C,2,C) (D,0
,-) (C,2,C)
Tentative (B,11,B) (C,2,C) (B,11,B) (B,5,C) (
A,12,C)
Step 5. 6. 7.
Confirmed (D,0,-) (C,2,C) (B,5,C) (D,0,-) (C,2,C)
(B,5,C) (D,0,-) (C,2,C) (B,5,C) (A,10,C)
Tentative (A,12,C) (A,10,C)
22Link State vs distance-vector
- Distance vector (original ARPANET)
- Node talks to direct neighbors
- Sends everything it has learned
- Link State (Later ARPANET)
- Node talks to everyone
- Only sends what it knows for sure