• Review: routing algorithms. – Choose the appropriate paths. – Routing algorithms • Flooding • Shortest path routing (example). – Dijkstra algorithm. – Bellman-Ford algorithm. • Shortest path routing algorithm is perfect if we know the precise network topology. – How to maintain the global network state information? This is also an important part of practical routing algorithms. • Distance Vector Routing: – used at ARPANET till 1979, still used in WAN(RIP) • Each router maintains a routing table, where each node in the network has an entry in the table. • Each entry contains two parts, the outgoing line for the destination (node) and the distance (time, cost, whatever) to the destination. • Each router knows the distance to its neighbors • In a certain period of time, each router sends the table to each of its neighbors. • When a router receives a table from each of its neighbors, it updates its routing table, determines the new minimum distance and the outgoing link for the destination. B A C A E D A B C D E B (0, -) (8, C) (4, B) (0, - ) (2, C) (5, C) (5, E) (3, D) (2, E) (9, A) Routing table for node A C D (5, A) (3, B) (0, - ) (3, B) (8, A) (4, E) (3, C) (2, C) (0, - ) (3, E) E (3, A) (3, D) (2, D) (1, D) (0, - ) Routing table for node D. Let dist(B, A) = 4, dist(B, D) = 1, dist (B, C) = 10, what is B’s routing table in the next cycle? • The count-to-infinity problem. A B # 1 1 1 1 C # # 2 2 2 D E # # # # # # 3 # 3 4 A B C D E 1 2 3 4 3 2 3 4 3 4 3 4 5 4 5 4 5 6 5 6 7 6 7 6 7 8 7 8 …... Good news propagates fast, bad news propagates slow. Some heuristics (split horizon). But the heuristics do not solve the problem. • link state routing (currently used in the internet, OSPF): » The distance vector algorithm converges too slow. • 1) discover its neighbors • 2) measure the distance to each neighbor • 3) construct a packet telling all that is learned • 4) send the packet to all other nodes -- flooding • 5) each node computes the shortest path to all other nodes -- Dijsktra algorithm. B 1 4 A 2 4 2 E Link state packets 5 C Node A: (A, seq, age, ((B, 4), (C, 4),(E, 2)) 6 Node B: (B, seq, age, ((A, 4), (D, 2), (C, 1)) D …. Node E: (E, seq, age, ((A, 2), (D, 5)) • If everything goes ok, every node will have the whole information of the network in the next step, algorithm converges faster than the distance vector method. • The count to infinite problem? • Some of current research on the link state algorithm. – Use broadcast tree instead of flooding – Use local update to the fix the routing table instead of running the full shortest path algorithm – When the send the link state packet » periodical or sudden change?