180 likes | 304 Views
Computer Networks. Chapter 12 – Routing Algorithm Concepts. Routing Algorithm Types. Answer question: Given destination D, where do I send packet next? Distance Vector Track cost to neighbor, neighbor cost to D Bellman-Ford shortest path algorithm Link State Track link costs
E N D
Computer Networks Chapter 12 – Routing Algorithm Concepts CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Routing Algorithm Types • Answer question: Given destination D, where do I send packet next? • Distance Vector • Track cost to neighbor, neighbor cost to D • Bellman-Ford shortest path algorithm • Link State • Track link costs • Run shortest path algorithm on whole graph CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Distance Vector • Each router has its own ID and link costs • Initial DV: dist(self)=0, dist(other)=inf • Tx DV to all neighbors, get neighbor DVs • Compute new DV based on • dist(x)=min{DV[y,x], cost[y]} • Tx new DV periodically and on changes • “triggered updates” • Recompute when detect changes • (link down, different DV from y) CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Count to Infinity • Link dies, neighbors believe stale news A B C A B C B:1,B C:2,B A:1,A C:1,C B:1,B C:2,B A:1,A C:1,C A:2,B B:1,B A:2,B B:1,B B:1,B C:2,B A:1,A C:3,A B:1,B C:4,B A:1,A C:3,A • Make infinity small B:1,B C:4,B A:1,A C:5,A CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Count to Infinity Solutions • Hold Down • If path to D goes down, don’t update for T s. • Advertise distance to D as infinity until T • Report whole path • No loops, but $$$ • Split Horizon (poison reverse) • If A uses B to get to D, tell B that DV[A,D]=inf • Two metrics • Use both hops and other cost function CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Split Horizon Problem C C A B D A B D B:1,B C:1,C D:2,B A:1,A B:1,B D:2,B A:1,A C:1,C D:inf B:1,B C:1,C D:2,B A:1,A B:1,B D:2,B A:1,A C:1,C D:1,D B:1,B C:1,C D:3,C A:1,A B:1,B D:3,A A:1,A C:3,A D:inf B:1,B C:1,C D:inf A:1,A B:1,B D:inf A:1,A C:1,C D:4,A • Count to infinity slower…. B:1,B C:1,C D:5,B A:1,A B:1,B D:5,B A:1,A C:1,C D:4,A CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Link State Protocol • Each router has its own ID and link costs • R meets neighbors, gets their names • Tx special “Hello” packet • Tx Link State Packet (LSP) to all routers • Compute least cost paths based on most recent LSPs from all other routers • Tx new LSP when • New neighbor • Link cost changes • Link fails CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Link State Protocol • Broadcasting LSPs critical • Routers must have consistent graph info • Must avoid LSP storms • How to route LSPs? • Chicken and egg (a.k.a. recursion) • Flooding with hop count or path • Constrained flooding (kill duplicate LSPs) • Timestamps • Needed to determine most recent, duplicates • Sequence number/age schemes CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Timestamps • Knowing most recent LSP critical • Accidental use of large timestamp/seq # • Merging partitioned networks • Timestamps • Sanity checks not possible without global time • Sequence # + Aging • Sequence numbers wrap around – funny < • Age added to LSP, decrement while stored, discard when age reaches zero CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
ARPANET LSP Incident • Source, seq#, age, neighbor list • Age was 3 bits, increments of 8 seconds • Routers required to send LSP every 60 sec • New router listens 90 seconds • One bad router can spoil the whole bunch • Issued LSPs with sequence #s a, b, and c • But a<b<c<a in circular order! • Routers flooded with a, then b, then c, then a… • Had to patch out bad source! CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
New LSP Distribution • Source, seq#, age, neighbor list • Seq# is large (e.g., 32 bits) • No LSP accepted once seq# wraps until TRO • Age field-- in storage & on forwarding • Only store and flag to forward LSPs • Send flag and ACK flag per link per LSP • Check flags round robin • Only one LSP per source per link queue • Newer LSP overwrites LSP before sending • Send when bandwidth available on link CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
LSP with Age=0 • Router deletes LSP data when age=0 • It has expired • Router keeps LSP header to send to nbors • Router deletes LSP when all nbors have ACKed the age=0 LSP • Router must not accept LSP with age=0 unless it already has an LSP for that source • Indefinitely wandering age 0 LSPs… CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
New LSP Distribution • Self-stabilizing • No matter how bad a state is reached, if defective/malicious nodes are disconnected, the network returns to normal “quickly” • Efficient • Low frequency periodic LSP regeneration • Responsive • Don’t have to wait to participate, except when sequence number wraps around (very rare!) CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
DV vs. LS Comparisons • Assume n nodes, k n’bors each • Memory • DV: DVs are O(n), memory is O(nk)*** • LS: LSPs are O(k), memory is O(kn) • Bandwidth consumed • Mixed bag • DV: only propagate as far as effect change; only send to neighbors; DV size depends on n • LS: only router with changed link sends LSPs; LSP size depends only on k, not n; does not have CTI problem CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
DV vs. LS Comparisons • Computation • Dijkstra: O(nk log n); single link change may cause many routing changes; incremental update may be possible…; hash-based sorting can reduce to O(nk) • Bellman-Ford: O(nk) per pass, but many passes; DV change to D only affects cost to D • Functionality • LS gives topology, allows troubleshooting, gives support to source routing, more info overall CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
DV vs. LS Robustness • Both can be killed by single bad router • Misbehaving LS router might: • Claim to have a non-existent link • Claim not to have an existent link • Use strange LSP seq# progression • Fail to forward datagrams correctly • Fail to forward or to ACK LSPs • Corrupt data, seq#s in others’ LSPs • Black Hole DV Router • DV is all 0’s CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
DV vs. LS Convergence Speed • Convergence critical to minimize transients • Critical point of comparison • DV: • Looping problem • Can’t propagate new DV until it is computed • Slower • LS: • New LSP recognized and forwarded quickly • Converges faster CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman
Other Issues • Load splitting – multipath routing • Dynamic link costs • Routing algorithm migration • Run both • Manual • Translation • LAN links • TOS • Directives • Policy Routing • Filters • Partition Repair • Virtual links and tunneling CEN 5501C - Computer Networks - Spring 2007 - UF/CISE - Newman