
Network Layer (Routing) Where we are in the Course • Moving on up to the Network Layer! Application Transport Network Link Physical CSE 461 University of Washington 2 Topics • Network service models • Datagrams (packets), virtual circuits • IP (Internet Protocol) • Internetworking • Forwarding (Longest Matching Prefix) • Helpers: ARP and DHCP • Fragmentation and MTU discovery • Errors: ICMP (traceroute!) • IPv6, scaling IP to the world • NAT, and “middleboxs” • Routing Algorithms CSE 461 University of Washington 3 Dijkstra’s Algorithm Edsger W. Dijkstra (1930-2002) • Famous computer scientist • Programming languages • Distributed algorithms • Program verification • Dijkstra’s algorithm, 1969 • Single-source shortest paths, given network with non-negative link costs By Hamilton Richards, CC-BY-SA-3.0, via Wikimedia Commons CSE 461 University of Washington 5 Dijkstra’s Algorithm Algorithm: • Mark all nodes tentative, set distances from source to 0 (zero) for source, and ∞ (infinity) for all other nodes • While tentative nodes remain: • Extract N, a node with lowest distance • Add link to N to the shortest path tree • Relax the distances of neighbors of N by lowering any better distance estimates CSE 461 University of Washington 6 Dijkstra’s Algorithm (2) • Initialization F ∞ 4 2 E ∞ 3 G 10 ∞ 3 2 4 0 1 ∞ D A 4 B ∞ We’ll compute 2 2 shortest paths H ∞ from A ∞ 3 C CSE 461 University of Washington 7 Dijkstra’s Algorithm (3) • Relax around A F ∞ 4 2 E ∞ 3 10 G 10 3 2 0 4 ∞ 4 1 D A 4 B 2 2 H ∞ ∞ 3 C CSE 461 University of Washington 8 Dijkstra’s Algorithm (4) • Relax around B Distance fell! F 7 4 2 7 3 E 8 G 10 3 2 0 4 ∞ 4 1 D A 4 B 2 2 H 6 ∞ 3 C CSE 461 University of Washington 9 Dijkstra’s Algorithm (5) • Relax around C F Distance fell 7 again! 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 10 Dijkstra’s Algorithm (6) • Relax around G (say) Didn’t fall … F 7 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 11 Dijkstra’s Algorithm (7) • Relax around F (say) Relax has no effect F 7 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 12 Dijkstra’s Algorithm (8) • Relax around E F 7 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 13 Dijkstra’s Algorithm (9) • Relax around D F 7 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 14 Dijkstra’s Algorithm (10) • Finally, H … done F 7 4 2 7 3 E 7 G 10 3 2 8 0 4 4 1 D A 4 B 2 2 H 6 9 3 C CSE 461 University of Washington 15 Dijkstra Comments • Finds shortest paths in order of increasing distance from source • Leverages optimality property • Runtime depends on cost of extracting min-cost node • Superlinear in network size (grows fast) • Gives complete source/sink tree • More than needed for forwarding! • But requires complete topology CSE 461 University of Washington 16 Distance Vector Routing Distance Vector Routing • Simple, early routing approach • Used in ARPANET, and RIP • One of two main approaches to routing • Distributed version of Bellman-Ford • Works, but very slow convergence after some failures • Link-state algorithms are now typically used in practice • More involved, better behavior CSE 461 University of Washington 18 Distance Vector Setting Each node computes its forwarding table in a distributed setting: 1. Nodes know only the cost to their neighbors; not topology 2. Nodes can talk only to their neighbors using messages 3. All nodes run the same algorithm concurrently 4. Nodes and links may fail, messages may be lost CSE 461 University of Washington 19 Distance Vector Algorithm Each node maintains a vector of distances (and next hops) to all destinations 1. Initialize vector with 0 (zero) cost to self, ∞ (infinity) to other destinations 2. Periodically send vector to neighbors 3. Update vector for each destination by selecting the shortest distance heard, after adding cost of neighbor link 4. Use the best neighbor for forwarding CSE 461 University of Washington 20 Distance Vector (2) • Consider from the point of view of node A • Can only talk to nodes B and E F To Cost 4 2 A 0 E B ∞ 3 G 10 Initial C ∞ vector 3 2 D ∞ 4 E ∞ 1 D F ∞ A 4 B G ∞ 2 2 H ∞ H 3 C CSE 461 University of Washington 21 Distance Vector (3) • First exchange with B, E; learn best 1-hop routes F B E B E A’s A’s To 4 2 says says +4 +10 Cost Next A ∞ ∞ ∞ ∞ 0 -- 3 E G 10 B 0 ∞ 4 ∞ 4 B 3 2 C ∞ ∞ ∞ ∞ ∞ -- 4 D ∞ ∞ ∞ ∞ ∞ -- 1 D E ∞ 0 ∞ 10 10 E A 4 B F ∞ ∞ ∞ ∞ ∞ -- 2 2 G ∞ ∞ ∞ ∞ ∞ -- H H ∞ ∞ ∞ ∞ ∞ -- 3 C Learned better route 22 Distance Vector (4) • Second exchange; learn best 2-hop routes F B E B E A’s A’s To 4 2 says says +4 +10 Cost Next E A 4 10 8 20 0 -- 3 G 10 B 0 4 4 14 4 B 3 2 C 2 1 6 11 6 B 4 D ∞ 2 ∞ 12 12 E 1 D E 4 0 8 10 8 B A 4 B F 3 2 7 12 7 B 2 2 G 3 ∞ 7 ∞ 7 B H H ∞ ∞ ∞ ∞ ∞ -- 3 C CSE 461 University of Washington 23 Distance Vector (4) • Third exchange; learn best 3-hop routes F B E B E A’s A’s To 4 2 says says +4 +10 Cost Next E A 4 8 8 18 0 -- 3 G 10 B 0 3 4 13 4 B 3 2 C 2 1 6 11 6 B 4 D 4 2 8 12 8 B 1 D E 3 0 7 10 7 B A 4 B F 3 2 7 12 7 B 2 2 G 3 6 7 16 7 B H H 5 4 9 14 9 B 3 C CSE 461 University of Washington 24 Distance Vector (5) • Subsequent exchanges; converged F B E B E A’s A’s To 4 2 says says +4 +10 Cost Next E A 4 7 8 17 0 -- 3 G 10 B 0 3 4 13 4 B 3 2 C 2 1 6 11 6 B 4 D 4 2 8 12 8 B 1 D E 3 0 7 10 8 B A 4 B F 3 2 7 12 7 B 2 2 G 3 6 7 16 7 B H H 5 4 9 14 9 B 3 C CSE 461 University of Washington 25 Distance Vector Dynamics • Adding routes: • News travels one hop per exchange • Removing routes: • When a node fails, no more exchanges, other nodes forget • But partitions (unreachable nodes in divided network) are a problem • “Count to infinity” scenario CSE 461 University of Washington 26 DV Dynamics (2) • Good news travels quickly, bad news slowly (inferred) X Desired convergence “Count to infinity” scenario CSE 461 University of Washington 27 DV Dynamics (3) • Various heuristics to address • e.g., “Split horizon, poison reverse” (Don’t send route back to where you learned it from.) • But none are very effective • Link state now favored in practice • Except when very resource-limited CSE 461 University of Washington 28 RIP (Routing Information Protocol) • DV protocol with hop count as metric • Infinity is 16 hops; limits network size • Includes split horizon, poison reverse • Routers send vectors every 30 seconds • Runs on top of UDP • Time-out in 180 secs to detect failures • RIPv1 specified in RFC1058 (1988) CSE 461 University of Washington 29 Flood Routing Flooding • Rule used at each node: • Sends an incoming message on to all other neighbors • Remember the message so that it is only flood once • Inefficient because one node may receive multiple copies of message CSE 461 University of Washington 31 Flooding (2) • Consider a flood from A; first reaches B via AB, E via AE F E G D A B H C CSE 461 University of Washington 32 Flooding (3) • Next B floods BC, BE, BF, BG, and E floods EB, EC, ED, EF F gets 2 copies F E E and B send to G each other D A B H C CSE 461 University of Washington 33 Flooding (4) • C floods CD, CH; D floods DC; F floods FG; G floods GF F gets another copy F E G D A B H C 34 Flooding (5) • H has no-one to flood … and we’re done F Each link carries the message, and in at E least one direction G D A B H C CSE 461 University of Washington 35 Flooding Details • Remember message (to stop flood) using source and sequence number • So next message (with higher sequence) will go through • To make flooding reliable, use ARQ • So receiver acknowledges, and sender resends if needed CSE 461 University of Washington 36 Link-State Routing Link-State Routing • One of two approaches to routing • Trades more computation than distance vector for better dynamics • Widely used in practice • Used in Internet/ARPANET from 1979 • Modern networks use OSPF and IS-IS CSE 461 University of Washington 38 Link-State Setting Nodes compute their forwarding table in the same distributed setting as for distance vector: 1.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages57 Page
-
File Size-