Presentation is loading. Please wait.

Presentation is loading. Please wait.

Routing: Link State Algorithm

Similar presentations


Presentation on theme: "Routing: Link State Algorithm"— Presentation transcript:

1 Routing: Link State Algorithm
Networking CS 3470, Section 1

2 The University of Adelaide, School of Computer Science
26 May 2018 Routing Forwarding versus Routing Forwarding: To select an output port based on destination address and routing table Routing: Process by which routing table is built Chapter 2 — Instructions: Language of the Computer

3 Forwarding Table vs Routing Table
The University of Adelaide, School of Computer Science 26 May 2018 Forwarding Table vs Routing Table Forwarding table Used when a packet is being forwarded Must contain enough information to forward A row in the forwarding table contains Mapping from a network number to outgoing interface MAC or Ethernet address of the next hop Chapter 2 — Instructions: Language of the Computer

4 Forwarding Table vs Routing Table
Built by the routing algorithm as a precursor to build the forwarding table Generally contains mapping from network numbers to next hops

5 The University of Adelaide, School of Computer Science
26 May 2018 Routing Example rows from (a) routing and (b) forwarding tables Chapter 2 — Instructions: Language of the Computer

6 Routing An autonomous system (AS) is a network that is administrated independently of other ASs Backbone service providers and regional providers form their own ASs Can run their own (different) routing algorithms Also called routing domains

7 NAPs, NSPs, ISPs NAP NSP: National Service Provider (Tier 1 Backbones)
Example: Internet MCI, Sprint Link, UUNET NAP: Network Access Point NAP National Provider Regional Provider customers Here is an illustration of the structure of internet in USA. At the top level, there are national service providers (NSPs) which are essentially the tier 1 backbones. For example, Internet MCI, Sprint Link, UUNET have such national backbone network. These NSP’s connect to each other thru network access points (NAPs). At the second level we have regional internet service providers (ISPs). These ISPs are customers of NSPs. They have contractual agreement between them. They may also connect to NAPs for reliability. There may be some local ISPs that are customers of these regional ISPs and these local ISPs provide connectivity to end customers.

8 NAP and Private Peering
The NAPs are meant for interconnecting the NSPs. But instead of always going thru NAPs, the NSPs may decide to have mutual agreement between them to exchange traffic that is originated from and destined to these NSPs. This is known is private peering. There is a distinction between a customer-provider relationship and peer-peer relationship. Here the regional ISP is customer of NSP A and a provider of local ISP. NSP A charges regional ISP for its service and similarly regional ISP charges local ISP. But ISP A and ISP B do not charge each other for carrying others traffic. Its expected that roughly equal amount of traffic flows between them.

9 Ameritech Exchange Point
Internet Network Leveraging Sprint’s SONET-based, gigabit switch Internet backbone Private Peering MAE-West Exchange Point Pacific Bell Ameritech Exchange Point Sprint Exchange Point MAE-East Here is an example backbone network of a national service provider Sprint. Here MAE refers to metropolitan area exchanges which are essentially NAPs. You can see why this is called NSP. It provides connectivity across the whole nation.

10 Intra-AS and Inter-AS Routing
C.b Gateways: perform inter-AS routing amongst themselves perform intra-AS routers with other routers in their AS B.a A.a b A.c c a a C b a B d c A b

11 Intra-AS and Inter-AS Routing
C.b Gateways: perform inter-AS routing amongst themselves perform intra-AS routers with other routers in their AS B.a A.a b A.c c a a C b a B d c A b network layer inter-AS, intra-AS routing in gateway A.c link layer physical layer

12 Intra-AS and Inter-AS Routing
between A and B a b C A B d c A.a A.c C.b B.a Host h2 Host h1 Intra-AS routing within AS B Intra-AS routing within AS A We’ll now examine both inter-AS and intra-AS Internet routing protocols

13 Intra-AS Routing These routing algorithms only scale for smaller networks (few hundred nodes), but set the stage for the hierarchical Inter-AS routing protocols used in the Internet today

14 The University of Adelaide, School of Computer Science
26 May 2018 Routing Network as a Graph The basic problem of routing is to find the lowest-cost path between any two nodes Where the cost of a path equals the sum of the costs of all the edges that make up the path 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1 Chapter 2 — Instructions: Language of the Computer

15 The University of Adelaide, School of Computer Science
26 May 2018 Routing For a simple network, we can calculate all shortest paths and load them into some nonvolatile storage on each node. Such a static approach has several shortcomings It does not deal with node or link failures It does not consider the addition of new nodes or links It implies that edge costs cannot change Chapter 2 — Instructions: Language of the Computer

16 Routing Instead of a static approach, we need a dynamic way to find the lowest-cost path Node and link failures, changing link costs We would like these algorithms to be distributed so that they can be somewhat scalable

17 Distributed Routing Algorithms
Routers cooperate using a distributed protocol To create mutually consistent routing tables Two standard distributed routing algorithms Link state routing Distance vector routing Now let us how routing algorithms are implemented. We study the typical distributed routing algorithms where routers cooperate using some a distributed protocol to create mutually consistent routing tables at each router. There are two standard distributed routing algorithms. The link state routing algorithm and the distance vector routing algorithm.

18 Link State vs Distance Vector
Both assume that The address of each neighbor is known The cost of reaching each neighbor is known Both find global information By exchanging routing info among neighbors Differ in info exchanged and route computation LS: tells every other node its distance to neighbors DV: tells neighbors its distance to every other node In both algorithms, we assume that the address of each neighbor is known, and cost of reaching each neighbor is also known. Both algorithms exchange routing information among neighbors to find global routing information. They differ in the information exchanged and how routes are computed. Link state: tell every other nodes its distance to its own neighbors. Distance vector: tells neighbors its distance to all the other nodes.

19 Link State Algorithm Basic idea: Distribute to all routers
Cost of each link in the network Each router independently computes optimal paths From itself to every destination Routes are guaranteed to be loop free if Each router sees the same cost for each link Uses the same algorithm to compute the best path Under link state routing, each router gathers state of all the links in the network and then independently computes paths. Cost can be any generic metric capturing the link characteristics such bandwidth or delay.

20 Topology Dissemination
Each router creates a set of link state packets (LSPs) Describing its links to neighbors LSP contains Router id, neighbor’s id, and cost to its neighbor Copies of LSPs are distributed to all routers Using controlled flooding Each router maintains a topology database Database containing all LSPs What is the cost of controlled flooding? A router would not forward an LSP more than once. Since each LSP carries a sequence number, a router can discard the duplicates by matching the originator and the sequence numbers with its LSP database.

21 Dijkstra’s Algorithm Given the network topology Some notation
How to compute shortest path to each destination? Some notation X: source node N: set of nodes to which shortest paths are known so far N is initially empty D(V): cost of known shortest path from source X from V C(U,V): cost of link U to V C(U,V) =  if not neighbors

22 Algorithm (at Node X) Initialization Loop N = {X} For all nodes V
If V adjacent to X, D(V) = C(X,V) else D(V) =  Loop Find U not in N such that D(U) is smallest Add U into set N Update D(V) for all V not in N D(V) = min{D(V), D(U) + C(U,V)} Until all nodes in N

23 Let’s take a look at an example
Sample network 5 3 B C 5 2 A 2 1 F 3 1 2 D E 1

24 Link State Database Starting global database
Each router has it’s own starting link state database 5 3 B C 5 2 A 2 1 F 3 1 2 D E 1

25 Dijkstra’s Algorithm: Initialization for Node A
Step 1 2 3 4 start N A D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) infinity D(F),p(F) infinity Suppose A wants to compute shortest paths to all other nodes. Initialization is like step 0. We add A itself to N and set the distance to all the neighbors as the cost of direct links and all others as infinity. Here D(B) is set 2 and D(E) set to infinity because B is a neighbor and E is not. D(x) is distance/cost to x p(x) is path to x 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

26 Dijkstra’s algorithm: example
Step 1 2 3 4 start N A AD D(B),p(B) 2,A D(C),p(C) 5,A 4,D D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity Now in step 1, among all those nodes that are not in N, we select a node with the shortest distance. In this case D is that node with distance of 1. First, we add D to the set N. Then we update the distances of other nodes if they can be made shorter by going thru D. In this case we can improve the distance to C from 5 to 4 by going thru D instead of using the direct link. Similarly E can now be reached with distance 2. Now we select the node with the shortest distance to add to set N. Then we update distances of other nodes if they can be made shorter going through D. 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

27 Dijkstra’s algorithm: example
Step 1 2 3 4 start N A AD ADB D(B),p(B) 2,A D(C),p(C) 5,A 4,D D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity B has the next shortest distance from A, so we add it to set N. (could have been E..) Then we update distances of other nodes if they can be made shorter going through B… 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

28 Dijkstra’s algorithm: example
Step 1 2 3 4 start N A AD ADB ADBE D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

29 Dijkstra’s algorithm: example
Step 1 2 3 4 start N A AD ADB ADBE ADBEC D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

30 Dijkstra’s algorithm: example
Step 1 2 3 4 5 start N A AD ADB ADBE ADBEC ADBECF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E This way in each step, we pick the node with the shortest distance, add it to set N and update the distance of all other nodes not in N. After k iterations, shortest paths to nearest k neighbors are known. This process terminates after all the nodes are added to N. This algorithm can be viewed as the construction of shortest paths spanning tree with source node as the root. In such a tree, there is exactly one path from the source node to any other node and that is the shortest path. This process terminates after all the nodes are added to N. 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

31 Routing Table Computation
Now we know how to construct a shortest paths spanning tree. How do we get the routing table from this tree? Routing table is essentially a mapping from destination to next hop. 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1

32 Dijkstra’s algorithm, discussion
Oscillations possible: e.g., link cost = amount of carried traffic A A A 1 A 1+e 2+e 2+e 2+e D B D B D B D 1+e 1 B 1+e 1 e 1 1+e e C C C C 1 1 e … recompute routing … recompute … recompute initially


Download ppt "Routing: Link State Algorithm"

Similar presentations


Ads by Google