420 likes | 439 Views
Part 4: Network Layer Part A: Algorithms. Summary. The Problem The Dijkstra’s Shortest Path Algorithm Distance Vector Routing Link State Routing Hierarchical Routing Routing in Ad Hoc Networks. 1. The Problem (1). Store-and-Forward Packet Switching
E N D
Summary • The Problem • The Dijkstra’s Shortest Path Algorithm • Distance Vector Routing • Link State Routing • Hierarchical Routing • Routing in Ad Hoc Networks
1. The Problem (1) • Store-and-Forward Packet Switching • Services Provided to the Transport Layer • Connectionless Service • Connection-Oriented Service
1. The Problem (2): Packet Switching fig 5-1 The environment of the network layer protocols.
1. The Problem (3): Connectionless Service Routing within a diagram subnet.
1. The Problem (4): Connection-Oriented Service Routing within a virtual-circuit subnet.
2 Shortest Path Algorithm • The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node.
3 Distance Vector Routing (1) (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
3 Distance Vector Routing (2) The count-to-infinity problem.
3 Distance Vector Routing (3): Loop-Breaking Heuristics • Set infinity to a limited number, e.g. 16. • Split horizon • Split horizon with poison reverse
3 Example: A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 0 0 0 0 Initialization 0
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 10 2 0 1 2 2 2 0 10 0 Direct Neighbours 0 2 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 2 2 0 10 3 Neighbours of neighbours 0 0 11 2 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 10 3 Neighbours of neighbours of neighbours 0 13 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 10 3 0 Stable convergence 13 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 1 10 3 Good news: A new link! 0 13 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 1 10 3 0 Direct endpoints know 1 1 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 10 2 3 0 1 2 3 3 3 2 2 0 1 4 3 Neighbours know 0 1 1 0 3 2 3 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 1 4 3 Neighbours of neighbours know 0 1 1 0 3 2 3 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 1 4 3 A happy and stable network 0 1 1 0 3 2 3 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 4 3 Bad news: Link crash!! 0 1 1 0 3 2 3 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 3 Direct endpoints know 0 0 2 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 10 3 0 0 2 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 3 4 2 3 0 1 2 3 3 3 2 2 0 10 3 Get help from neighbours 0 5 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 7 4 2 3 0 1 2 3 3 7 2 2 0 10 3 Routing loop (due to inconsistent state info) 0 5 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 7 8 2 3 0 1 2 3 3 7 2 2 0 10 3 0 9 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 8 2 3 0 1 2 3 3 11 2 2 0 10 3 Counting to infinity… 0 9 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 11 2 2 0 10 3 0 13 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 10 3 0 13 13 0 11 2 13 2
A A A A A B B B B B D A C C C C C 1 2 D D D D D E E E E E 2 E 10 2 B C 1 0 11 10 2 3 0 1 2 3 3 13 2 2 0 10 3 Stability again 0 13 13 0 11 2 13 2
4 Link State Routing (1) • Each router must do the following: • Discover its neighbors, learn their network address. • Measure the delay or cost to each of its neighbors. • Construct a packet telling all it has just learned. • Send this packet to all other routers. • Compute the shortest path to every other router.
4 Link State Routing (2): Learning about the Neighbors • Nine routers and a LAN. • A graph model of (a).
4 Link State Routing (3): Measuring Line Cost • A subnet in which the East and West parts are connected by two lines.
4 Link State Routing (4): Building Link State Packets • (a) A subnet. (b) The link state packets for this subnet.
4 Link State Routing (5): Distributing the Link State Packets • The packet buffer for router B in the previous slide (Fig. 5-13).
5 Hierarchical Routing • Hierarchical routing.
6. Routing in Ad Hoc Networks (1) • Possibilities when the routers are mobile: • Military vehicles on battlefield. • No infrastructure. • A fleet of ships at sea. • All moving all the time • Emergency works at earthquake . • The infrastructure destroyed. • A gathering of people with notebook computers. • In an area lacking 802.11.
6. Routing in Ad Hoc Networks (2): Route Discovery • (a) Range of A's broadcast. • (b) After B and D have received A's broadcast. • (c) After C, F, and G have received A's broadcast. • (d) After E, H, and I have received A's broadcast. • Shaded nodes are new recipients. Arrows show possible reverse routes.
6. Routing in Ad Hoc Networks (3): Route Discovery • Format of a ROUTE REQUEST packet.
6. Routing in Ad Hoc Networks (4): Route Discovery • Format of a ROUTE REPLY packet.
6. Routing in Ad Hoc Networks (5): Route Maintenance • (a) D's routing table before G goes down. • (b) The graph after G has gone down.