Overview: IP routing
- Bellman-Ford
- Spanning Tree
- OSPF
- BGP
- Multicast Routing
Bellman-Ford routing
- Distance Vector:
- router knows how far destination D is
- router knows which on port to send packets for D
- router only knows first hop to deliver D
- RIP: Routing Information Protocol
- Distributed algorithm: no router has a complete "map"
- overall idea: routers exchange routing tables, adding cost
of reaching that router to see if route is better than what we have
Bellman-Ford data structures
- links table:
port | neighbor | metric |
0 | A | 10 |
1 | C | 2 |
2 | F | 3 |
3 | A | 1 |
|
- routing table:
destination | port | metric |
C | 1 | 2 |
F | 2 | 3 |
A | 3 | 1 |
X | 3 | 11 |
Y | 2 | 4 |
|
Bellman-Ford algorithm
- send my routing table to all my neighbors whenever my link table changes
- when I get a routing table from a neighbor on port P with link metric M:
- add L to each of the neighbor's metrics
- for each entry (D, P', M') in the updated neighbor's table:
- if I do not have an entry for D, add (D, P, M') to my routing table
- if I have an entry for D with metric M", add (D, P, M') to my
routing table if M' < M"
- if my routing table has changed, I send all the new entries to all
my neighbors
OSPF
- Open Shortest Path First
- within ASs
- Dijkstra shortest path algorithm
- flooding to distribute maps
- multiple metrics: shortest path algorithm applied with each metric
OSPF Flooding
- links table, as for distance vector (only neighbors and metrics,
port information is not needed)
- each router keeps a counter i of messages sent
- messages from router R have format:
(R, i, link table)
- each router keeps the most recent message received from every
other router
- when I get a message (R, i, link table):
- if I already have a message from R with sequence number i', and if
i' >= i, I discard the message
- otherwise I update my map from the message (discarding the old
information from R), and forward the message to all my neighbors
BGP
- Boundary Gateway Protocol
- between ASs
- Distance Vector with route information:
- instead of just sending you the metric to a destination,
I send you the metric and the route used to get there
- you can detect loops in the route and ignore it
- quickly catches loops, obsolete information
- also allows choices based on trust, cost, reliability
- an AS may have multiple border routers: one is selected
as the BGP speaker
Routing Questions
- How fast do Link-State, Distance-Vector converge initially?
- How fast do Link-State, Distance-Vector converge after a change?
- How much traffic is needed to maintain routing information
for Distance-Vector, Link-State, and BGP?