Lecture 2: Routing algorithms

Similar documents
DD2490 p Link-state routing and OSPF. Olof Hagsand KTH/CSC

DD2490 p Link state routing and OSPF. Olof Hagsand KTH/CSC

Redes de Computadores. Shortest Paths in Networks

Description of The Algorithm

Routing. Information Networks p.1/35

CMPE 150: Introduction to Computer Networks

Eulerian Cycle (2A) Walk : vertices may repeat, edges may repeat (closed or open) Trail: vertices may repeat, edges cannot repeat (open)

Lecture 9. Reminder: Homework 3, Programming Project 2 due today. Questions? Thursday, September 22 CS 475 Networks - Lecture 9 1

Unit 3: Dynamic Routing

Outline. Routing. Introduction to Wide Area Routing. Classification of Routing Algorithms. Introduction. Broadcasting and Multicasting

OSPF Protocol Overview on page 187. OSPF Standards on page 188. OSPF Area Terminology on page 188. OSPF Routing Algorithm on page 190

Distance vector and RIP

DD2490 p Link-state routing and OSPF. Olof Hagsand KTH/CSC

Routing. 4. Mar INF-3190: Switching and Routing

Routing Protocols and the IP Layer

Routing. Problem: Given more than one path from source to destination, Features: Architecture Algorithms Implementation Performance

IP Routing Tecnologie e Protocolli per Internet II rev 1

CS IT. Lecture (06) STP (I) Problem statement. By: Dr. Ahmed ElShafee

CSE 461 Routing. Routing. Focus: Distance-vector and link-state Shortest path routing Key properties of schemes

Top-Down Network Design

BTEC Level 3 Extended Diploma

CS350: Data Structures Dijkstra s Shortest Path Alg.

ECE 333: Introduction to Communication Networks Fall 2001

CS 5114 Network Programming Languages Control Plane. Nate Foster Cornell University Spring 2013

CS4450. Computer Networks: Architecture and Protocols. Lecture 11 Rou+ng: Deep Dive. Spring 2018 Rachit Agarwal

Routing Overview for Firepower Threat Defense

CIS 83 Midterm Spring 2004 Answer Sheet Name Score Grade Question Answer Question Answer

Youki Kadobayashi NAIST

C13b: Routing Problem and Algorithms

EITF25 Internet Routing. Jens A Andersson

WDM Network Provisioning

2008 NDP Lectures 7 th Semester

ICS 351: Today's plan. distance-vector routing game link-state routing OSPF

Top-Down Network Design, Ch. 7: Selecting Switching and Routing Protocols. Top-Down Network Design. Selecting Switching and Routing Protocols

3. INTERCONNECTING NETWORKS WITH SWITCHES. THE SPANNING TREE PROTOCOL (STP)

UNIT 2 ROUTING ALGORITHMS

UNIT 3. Greedy Method. Design and Analysis of Algorithms GENERAL METHOD

Lecture 12: Link-state Routing. Lecture 12 Overview. Router Tasks. CSE 123: Computer Networks Chris Kanich. Routing overview

Computer Networks. Routing Algorithms

Network Layer: Routing

Lecture 18 Solving Shortest Path Problem: Dijkstra s Algorithm. October 23, 2009

Fairness Example: high priority for nearby stations Optimality Efficiency overhead

Basic Idea. Routing. Example. Routing by the Network

Routing by the Network

DD2490 p IP Multicast routing. Multicast routing. Olof Hagsand KTH CSC

SWITCHING, FORWARDING, AND ROUTING

Routing, Routing Algorithms & Protocols

Computer Networking. Intra-Domain Routing. RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)

CompSci 356: Computer Network Architectures. Lecture 13: Dynamic routing protocols: Link State Chapter 3.3.3, Xiaowei Yang

EIGRP Features and Operation

Examination IP routning inom enkla datornät, DD2490 IP routing in simple networks, DD2490 KTH/CSC Date: 24 May :00 19:00

Module 8. Routing. Version 2 ECE, IIT Kharagpur

Routing Protocols. The routers in an internet are responsible for receiving and. forwarding IP datagrams through the interconnected set of

Chapter 22 Network Layer: Delivery, Forwarding, and Routing 22.1

Helsinki University of Technology Telecommunications Laboratory. OSPF Routing Protocol Licenciate course seminar paper

DD2490 p Layer 2 networking. Olof Hagsand KTH CSC

CS BGP v4. Fall 2014

Date: June 4 th a t 1 4:00 1 7:00

CompSci 356: Computer Network Architectures. Lecture 12: Dynamic routing protocols: Link State Chapter Xiaowei Yang

Youki Kadobayashi NAIST

IBGP scaling: Route reflectors and confederations

ICS 351: Today's plan. netmask exercises network and subnetwork design dynamic routing RIP distance-vector routing

Examination IP routning inom enkla datornät, DD2490 IP routing in simple networks, DD2490 KTH/CSC. Date: 20 May :00 19:00 SOLUTIONS

Routing in a network

Routing Algorithms. CS158a Chris Pollett Apr 4, 2007.

Link-State Routing OSPF

The fundamentals of Ethernet!

TA: Jade Cheng ICS 241 Recitation Lecture Notes #12 November 13, 2009

Youki Kadobayashi NAIST

Routing. Basic principles. Karst Koymans. Informatics Institute University of Amsterdam. (version 16.4, 2017/02/23 10:58:58)

Inter-networking. Problem. 3&4-Internetworking.key - September 20, LAN s are great but. We want to connect them together. ...

Dijkstra s algorithm for shortest paths when no edges have negative weight.

CSCD 330 Network Programming Spring 2018

Chapter 12. Routing and Routing Protocols 12-1

CSCD 330 Network Programming Spring 2017

Chapter 7: Routing Dynamically. Routing & Switching

IP Multicast Technology Overview

ITEC310 Computer Networks II

CSE 473 Introduction to Computer Networks. Final Exam Review

Introduction to routing

CSEP 561 Routing. David Wetherall

Introduction to OSPF

Exercise 3. RIP and OSPF

Why we need to divide network?

Review of Graph Theory. Gregory Provan

Outline. Addressing on the network layer ICMP IPv6 Addressing on the link layer Virtual circuits

Computer Networks. Routing

IPv6 Routing: OSPFv3

1 Shortest Paths. 1.1 Breadth First Search (BFS) CS 124 Section #3 Shortest Paths and MSTs 2/13/2018

Open Shortest Path First (OSPF)

Lecture 13: Link-state Routing. CSE 123: Computer Networks Alex C. Snoeren

We will discuss about three different static routing algorithms 1. Shortest Path Routing 2. Flooding 3. Flow Based Routing

DD2490 p Lecture 4: OSPF. Link-state routing and Open Shortest Path First. Olof Hagsand KTH CSC

1 Shortest Paths. 1.1 Breadth First Search (BFS) CS 124 Section #3 Shortest Paths and MSTs 2/13/2018

Chapter 3 Part 2 Switching and Bridging. Networking CS 3470, Section 1

Communication Networks I December 4, 2001 Agenda Graph theory notation Trees Shortest path algorithms Distributed, asynchronous algorithms Page 1

Youki Kadobayashi NAIST

Dijkstra s Algorithm and Priority Queue Implementations. CSE 101: Design and Analysis of Algorithms Lecture 5

MikroTik RouterOS Training. Routing. Schedule. Instructors. Housekeeping. Introduce Yourself. Course Objective 7/4/ :00 10:30 Morning Session I

ICMP, ARP, RARP, IGMP

Transcription:

DD490 p4 0 Lecture : Routing algorithms Shortest path, Widest path, and constrained routing Olof Hagsand KTH CSC This lecture contains new material for 0.

Graphs vs networks Algorithms are usually defined on graphs whereas protocols work on networks Graphs have nodes and edges whereas networks have interfaces, boradcast links, addresses, hierarchical layering, etc.

N4 N RT N RT4 8 8 7 RT5 6 8 8 8 N N N RT 6 8 6 RT Ia 7 RT6 N4 Network example N5 Ib 6 6 9 RT0 RT7 N H 0 RT9 RT N9 RT N8 RT8 N6 4 N0 RFC 8 fig N7 Note that the figure is taken from the OSPF RFC. The broadcast links (N, N, N) are denoted somewhat unusually by ellipses. The dotted links denote exernal links (outside the OSPF routing domain). Note that there is one host H. Note also that the link metrics are asymmetrical.

N4 N RT 0 0 0 N 0 RT4 8 8 RT5 7 8 6 8 8 N N N RT RT 8 6 6 RT6 7 N4 Ib 7 (Directed) graph example Ia 5 N5 N H 0 RT9 0 RT 0 N9 0 RT 5 0 N8 RT0 0 6 0 0 N6 0 RT8 9 RT7 N0 4 N7 4 Note the modelling of the broadcast links, such as N. Such a link is modelled by adding a virtual network node (eg N) to which the nodes connect (since all edges connect only two nodes). Since this node is virtual, there is no physical corresponding node, the cost of exiting the node is set to 0. In many protocols such a virtual node (eg N) 'belongs' to a router in the sense that the router announces the network information of the virtual node. Such a router is called the 'designated' router of the network. For example, RT is the designated router of N.

Example graph A B C D E F 5 Simple network with symmetric link metrics. The link with metric is a typical backup path that normally is not used unless an error occurs.

Shortest Path First (SPF) Given link metrics (weights) on each individual link Find the path (sequence of links) where the sum of the metrics of all links (cumulative cost) is lowest ECMP: A set of path with the least cost B D A F C E 6

Bellman-Ford shortest path If it is possible to get from entity i to entity j directly, then a cost, d(i,j), is associated with the hop between i and j. The cost is infinite if i and j are not immediate neighbors. Let D(i,j) represent the metric of the best route from entity i to entity j. Then, the best metric is described by: D i, i =0, for all i. D i, j =min[d i, k D k, j ], otherwise. k j The algorithm: D 0 i,i =0, for alli. D 0 i, j =, otherwise. For h=0 to N- do: D h i,i =0, for alli. D h i, j =min[d i, k D h k, j ], otherwise.. k i In words: Entity i gets estimates from neighbors k of their distances to the destination j. Add d(i,k) to each of the numbers. This is the cost of traversing the network between i and k. Compare the values from all of its neighbors and pick the smallest. 7

Exercise: Bellman-Ford d(i,j) A B C D E F A B C D E F h D(A,F) D(B,F) D(C,F) D(D,F) D(E,F) 0 4 5 8 The example network in earlier slide is used.

The distributed algorithm Keep a table with an entry for each destination N in the network. Store the distance D and next-hop G for each N in the table. Periodically, send the table to all neighbors (the distancevector). For each update that comes in from neighbor G' (to N with a new distance): Add the cost of the link to G' to the new distance to get D'. Replace the route if D' < D. If G = G', always replace the route. 9

Dijkstra's shortest path first From the link-state database, compute a shortest path delivery tree using a permanent set S and a tentative set Q:.Define the root of the tree: the router.assign a cost of 0 to this node and make it the first permanent node..examine each neighbor node of the last permanent node. 4.Assign a cumulative cost to each node and make it tentative. 5.Among the list of tentative nodes: Find the node with the smallest cumulative cost and make it permanent. If a node can be reached from more than one direction, select the direction with the smallest cumulative cost. 6.Repeat steps to 5 until every node is permanent. 0 If you are unsure about Dijkstra, go through the extra material including an example on the web-site

Dijkstra pseudo-code function Dijkstra(Graph, source): for each vertex v in Graph: // Initializations dist[v] := infinity ; // Unknown distance function from source to v previous[v] := undefined ; // Previous node in optimal path from source dist[source] := 0 ; // Distance from source to source Q := the set of all nodes in Graph ; // All nodes in the graph are unoptimized - thus are in Q while Q is not empty: // The main loop u := vertex in Q with smallest dist[] ; remove u from Q ; for each neighbor v of u: // where v has not yet been removed from Q. alt := dist[u] + dist_between(u, v) ; if alt < dist[v]: // Relax (u,v,a) dist[v] := alt ; previous[v] := u ; (from Wikipedia)

Spanning-Tree Protocol In Layer networking (eg Ethernet), there is no 'routing' of individual flows. Instead, a single tree is constructed to avoid loops. This spanning-tree is a shortest path tree to all destinations from a single root. All traffic then follows this single tree, using source address learning: Traffic is initially flooded throughout the tree (up and down the branches), but the nodes learn the location (incoming port) of the sources by inspecting the source address in the frames. Spanning-tree is used in Ethernets including Metro-Ethernets being built today. Very large networks (even global) are being built where spanning-tree is the mechanism used to detect loops.

Spanning-tree algorithm An ID number is assigned to each bridge, and a cost to each port. Process of finding the spanning tree: The bridges choose a bridge to be the root bridge of the tree by finding the bridge with the smallest ID. Each bridge determines its root port, the port that has the least root path cost to the root. The root path cost is the accumulated cost of the path from the port to the root. One designated bridge is chosen for each segment Select ports to be included in the spanning tree (root port plus designated ports) Data traffic is forwarded only to and from ports selected for inclusion in the spanning tree STP (Spanning Tree Protocol) is not a routing protocol since it does not identify individual routes. Instead, it tranforms a general graph to a tree, and uses learning (flood and learn) to distribute information.

Spanning-tree exercise How does traffic go between hosts A and B if learning bridges X, Y, Z are root bridges, respectively? X A Y Z 4 B root port designated blocked/listening/forwarding 4 For generic solution, use priority vectors. Each bridge forms a priority vector on each port/segment it is connected to and sends it out on that port. The lowest priority vector 'succeeds' in the following sense: () Segment: the bridge sending the lowest priority vector on a segment becomes the designated bridge(port) of that segment; () Bridge: among the priority vectors received on all ports on a bridge, the bridge selects port where the lowest was received and assigns that as the root bridge (if not root itself). Priority vector simple form: <rootid, metric, bridgeid>, where: - rootid: id of elected root bridge - metric: accumulated path metric frm sending bridge to root - bridgeid: id of sending bridge Priority vector complete form: <rootid, metric, bridgeid, srcport, dstport> where - srcport: port number of sending port (of the priority vector) - dstport: port number where the priority vector is received. The complete form is only used in cases where there are several ports on the same bridge on a segment.

Minimizing load by adjusting link metric SPF may not utilize a given network well. An operator may be interested in using the network resources better This is called Traffic Engineering A common metric is to minimize load on individual links, i.e., to spread traffic among several links Example: Traffic in the network is as follows: A->E Mb/s D->E Mb/s How does traffic flow given unary weights? What is the optimal solution (using load-balancing)? Can you modify weights(link metrics) to reach the optimal solution? B C A D E 5 Assume equal bandwidth on all links. With unary weights, the D->E link has 4Mb/s The minimal load criteria is to have a smallest maximum load in the network. With generic load-balancing, the optimal solution would be to send: - Mb/s A->B->C->E - Mb/s A->D->E - Mb/s D->E The maximum load on an individual link is then Mb/s. By modifying weights (eg set weight of A->D to ) and ECMP, all you can get is: -.5 Mb/s A->B->C->E -.5 Mb/s A->D->E - Mb/s D->E The maximum load on an individual link is.5mb/s. Thus the optimal solution is not obtainable with ECMP and weight adjustment

Adjusting weights - elaborate exercise Flows: A -> D, A -> E, C -> D, C -> E Each flow 5Mb/s What is the SPF solution? Adjust weights to make the load optimal (smallest max) of at most 0Mb/s 0 B D 5 A C E From A. Gunnar, Aspects of proactive traffic engineering in IP networks, PhD thesis, Feb 0 6 In the solution above, all flows pass via C and E. The best solution is to make the flows from A pass via B and D instead, while keeping the flows from C via E. This can be made by heightening the cost between A-> C to for example 0, and lowering the cost from B -> D to. If you are not careful, though, the traffic from C to D may start leaking over B. Consider also if there are further constraints between other routers, and you see that this is difficult to do, at least intuitively.

Widest path first Both Bellman-Ford and Dijkstra considers the shortest path based on an additive scalar metrics. That is, the shortest path cost is computed by adding all individual link metrics But suppose we need to optimize for bandwidth or load (smallest largest load) of a single link. We should then consider the path with the highest bandwidth / lowest load. Often used: available bandwidth Can be used in conjunction with resource reservation protocols to solve a dynamic traffic engineering problem We may then look at widest path computation It is easy to extend Dijkstra (or Bellman-Ford) with a widestpath computation rather than shortest path. 7 Dijkstra is extended as follows Instead of summing all individual link costs and taking the minimum of all possible paths, The minimum link metric of all possible paths is computed and their maximum selected

Widest path first: exercise Numbers denote width: load or bandwidth What is the widest path from A -> E? B bw:40 D A bw:0 bw:0 bw:5 bw:50 bw:0 C bw:0 E 8 The widest path is A->B->D->E. Its minimal width is 0, which is higher than all other paths from A to E.

Constrained Shortest Path First In traffic engineering a generalization of SPF is normally used: Constrained Shortest Path (CSPF) CSPF is implemented along with MPLS Introduce a boolean condition which may remove links, and compute SPF on that. Examples of conditions: Administrative groups (eg include only gold and silver links) Available bandwidth (No link avbw < min avbw) Available bandwidth ratio (No link utilization > max %) Delay bonds (No path delays > max delay) Hop counts (No path hops > max hc) Resiliency (No common network element w primary path) 9 The constraints can be provided with elaborate configuration syntax, but often general constraints are not implemented. Typical useful constraints are available bandwidth and resilience.

CSPF Example : Available bw A->E with available bandwidth >= 0? A bw:0 B bw:0 bw:40 bw:5 D bw:50 bw:0 C bw:0 E 0 Note: dashed lines do not meet the constraint (bw >= 0) and are therefore removed from the network substrate. Answer: A->B->D->E. Note that this happens to be the same result as the widest path, but this is not generally so, since the underlying protocol is still SPF, not WPF.

CSPF Example : Resiliency Given primary SPF path A->B->E, form a secondary path with resilience constraint A->E This is used in MPLS to compute secondary paths used in fail-over. B D A C E The primary path is given by the dashed lines, and can therefore not be used by the resilient path. The path A->B->E is therefore removed from the network substrate. Answer: the secondary path is A->C->E CSPF with resiliency constraint is similar to k-shortest path: Find a set of (mutually disjoint) shortest paths: Compute SPF in steps, remove a computed path from the substrate for next iteration

Explicit routing Explicit routing is a manual alternative to CSPF Explicit Route Objects (ERO) Provide a set of nodes and compute SPF via this set. Example: A->E via D. B D A C E Answer to the problem: A->B->D->E. Note that the route A->D is not explicitly provided and is therefore computed with SPF.

Summary: Routing algorithms Most routing protocols use Dijkstra or Bellman-Ford IP routing protocols all use SPF L Ethernet uses spanning-tree and learning to transform a network to a tree. In traffic engineering, IP routing protocols are extended with Constrained SPF MPLS is the primary example