Routing Protocols and the IP Layer CS244A Review Session 2/01/08 Ben Nham Derived from slides by: Paul Tarjan Martin Casado Ari Greenberg.

Slides:



Advertisements
Similar presentations
Bellman-Ford algorithm
Advertisements

CSCI-1680 Network Layer: Intra-domain Routing Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
4/12/2015© 2009 Raymond P. Jefferis IIILect Internet Protocol - Continued.
Outline  Recap Network components & basic mechanisms Routing Flow control  Continue Basic queueing analysis Construct routing table.
Chapter 4 Distributed Bellman-Ford Routing
Courtesy: Nick McKeown, Stanford
Graph II MST, Shortest Path. Graph Terminology Node (vertex) Edge (arc) Directed graph, undirected graph Degree, in-degree, out-degree Subgraph Simple.
1 LINK STATE PROTOCOLS (contents) Disadvantages of the distance vector protocols Link state protocols Why is a link state protocol better?
Routing - I Important concepts: link state based routing, distance vector based routing.
1 Comnet 2010 Communication Networks Recitation 6 Routing.
Routing So how does the network layer do its business?
Chapter 4 Distance Vector Problems, and Link-State Routing Professor Rick Han University of Colorado at Boulder
Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side, delivers.
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
CSE 461: Distance Vector Routing. Next Topic  Focus  How do we calculate routes for packets?  Routing is a network layer function  Routing Algorithms.
1 Computer Networks Routing Algorithms. 2 IP Packet Delivery Two Processes are required to accomplish IP packet delivery: –Routing discovering and selecting.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
CSE123A discussion session 2007/03/08 Ryo Sugihara.
CS 4700 / CS 5700 Network Fundamentals Lecture 9: Intra Domain Routing Revised 7/30/13.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Review: routing algorithms. –Choose the appropriate paths. –Routing algorithms Flooding Shortest path routing (example). –Dijkstra algorithm. –Bellman-Ford.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 14 Routing Protocols RIP, OSPF, BGP.
CS551: Unicast Routing Christos Papadopoulos (
Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing.
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
13 – Routing Algorithms Network Layer.
Network Layer4-1 Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y)
The Network Layer & Routing
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
4: Network Layer4a-1 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous:
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
CS 6401 Intra-domain Routing Outline Introduction to Routing Distance Vector Algorithm.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
1 Relates to Lab 4. This module covers link state routing and the Open Shortest Path First (OSPF) routing protocol. Dynamic Routing Protocols II OSPF.
Routing algorithms. D(v): the cost from the source node to destination that has currently the least cost. p(v): previous node along current least.
Network Layer.
The network layer: routing
CS 5565 Network Architecture and Protocols
CSE390 – Advanced Computer Networks
Network Layer Introduction Datagram networks IP: Internet Protocol
Intra-Domain Routing Jacob Strauss September 14, 2006.
Routing: Distance Vector Algorithm
Distance Vector Routing: overview
Routing in Packet Networks Shortest Path Routing
Road Map I. Introduction II. IP Protocols III. Transport Layer
Lecture 10 Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from.
CS 4700 / CS 5700 Network Fundamentals
CS 3700 Networks and Distributed Systems
Intradomain Routing Outline Introduction to Routing
CS 640: Introduction to Computer Networks
Lecture 11 Topics Application of BFS Shortest Path
CS 3700 Networks and Distributed Systems
Computer Networking Lecture 10: Intra-Domain Routing
Communication Networks
Advanced Computer Networks
Network Layer (contd.) Routing
Brad Karp UCL Computer Science
EE 122: Intra-domain routing: Distance Vector
Communication Networks
Network Layer.
Topological Sorting Minimum Spanning Trees Shortest Path
EE 122: Intra-domain routing: Link State
Presentation transcript:

Routing Protocols and the IP Layer CS244A Review Session 2/01/08 Ben Nham Derived from slides by: Paul Tarjan Martin Casado Ari Greenberg

Functions of a router Forwarding – Determine the correct egress port for an incoming packet based on a forwarding table Routing – Choosing the best path to take from source to destination – Routing algorithms build up forwarding tables in each router – Two main algorithms: Bellman-Ford and Dijkstra’s Algorithm

Bellman Ford Equation Let G = (V, E) and Cost(e) = cost of edge e Suppose we want to find the lowest cost path to vertex t from all other vertices in V Let Shortest-Path(i, u) be the shortest path from u to t using at most i edges. Then: If there are no negative edge costs, then any shortest path has at most |V|-1 edges. Therefore, algorithm terminates after |V|-1 iterations.

Bellman Ford Algorithm function BellmanFord(list vertices, list edges, vertex dest) // Step 1: Initialize shortest paths of w/ at most 0 edges for each vertex v in vertices: v.next := null if v is dest: v.distance := 0 else: v.distance := infinity // Step 2: Calculate shortest paths with at most i edges from // shortest paths with at most i-1 edges for i from 1 to size(vertices) - 1: for each edge (u,v) in edges: if u.distance > Cost(u,v) + v.distance: u.distance = Cost(u,v) + v.distance u.next = v

An Example AB DE C F

Example AB DE C F A0, - B∞, - C D E F

AB DE C F A0, - B∞, -2, A C∞, - 3, B D∞, -9, A 8, E 7, E E∞, - 7, B 6, F F∞, - 4, C Solution

Bellman-Ford and Distance Vector We’ve just run a centralized version of Bellman-Ford Can be distributed as well, as described in lecture and text In distributed version: – Maintain a distance vector that maintains cost to all other nodes – Maintain cost to each directly attached neighbor – If we get a new distance vector or cost to a neighbor, re- calculate distance vector, and broadcast new distance vector to neighbors if it has changed For any given router, who does it have to talk to? What does runtime depend on?

Problems with Distance Vector Increase in link cost is propagated slowly Can “count to infinity” – What happens if we delete (B, C)? – B now tries to get to C through A, and increase its cost to C – A will see that B’s cost of getting to C increased, and will increase its cost – Shortest path to C from B and A will keep increasing to infinity Partial solutions – Set infinity – Split horizon – Split horizon with poison reverse ABC 21

Dijkstra’s Algorithm Given a graph G and a starting vertex s, find shortest path from s to any other vertex in G Use greedy algorithm: – Maintain a set S of nodes for which we know the shortest path – On each iteration, grow S by one vertex, choosing shortest path through S to any other node not in S – If the cost from S to any other node has decreased, update it

Dijkstra’s Algorithm function Dijkstra(G, w, s) Q = new Q // Initialize a priority queue Q for each vertex v in V[G] // Add every vertex to Q with inf. cost d[v] := infinity previous[v] := undefined Insert(Q, v, d[v]) d[s] := 0 // Distance from s to s ChangeKey(Q, s, d[s]) // Change value of s in priority queue S := empty set // Set of all visited vertices while Q is not an empty set // Remove min vertex from priority queue, mark as visited u := ExtractMin(Q) S := S union {u} // Relax (u,v) for each edge for each edge (u,v) outgoing from u if d[u] + w(u,v) < d[v] d[v] := d[u] + w(u,v) previous[v] := u ChangeKey(Q, v, d[v])

Example Explored Set SUnexplored Set Q = V - S A(0, -)B(0+2, A), C(∞, -), D(0+9, A), E(∞, -), F(∞, -) AB DE C F

Solution Explored Set SUnexplored Set Q = V - S A(0, -)B(0+2, A), C(∞, -), D(0+9, A), E(∞, -), F(∞, -) A(0, -), B(2,A)C(2+1, B), D(9, A), E(2+3, B), F(∞, -) A(0, -), B(2, A), C(3, B)D(9, A), E(5, B), F(3+1, B) A(0, -), B(2, A), C(3, B), F(4, B)D(9, A), E(5, B) A(0, -), B(2, A), C(3, B), F(4, B), E(5, B) D(5+1, B) A(0, -), B(2, A), C(3, B), F(4, B), E(5, B), D(6, B) AB DE C F

Link-State (Using Dijkstra’s) Algorithm must know the cost of every link in the network – Each node broadcasts LS packets to all other nodes – Contains source node id, costs to all neighbor nodes, TTL, sequence # – If a link cost changes, must rebroadcast Calculation for entire network is done locally

Comparison between LS and DV Messages – In link state: Each node broadcasts a link state advertisement to the whole network – In distance vector: Each node shares a distance vector (distance to every node in network) to its neighbor How long does it take to converge? – O((|E|+|V|) log |V|) = O(|E| log |V|) for Dijkstra’s – O(|E||V|) for centralized Bellman-Ford; for distributed, can vary Robustness – An incorrect distance vector can propagate through the whole network