1 Week 6 Routing Concepts. 2 Network Layer Functions transport packet from sending to receiving hosts network layer protocols in every host, router path.

Slides:



Advertisements
Similar presentations
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 22 Omar Meqdadi Department of Computer Science and Software Engineering University.
Advertisements

What is “Routing”? Routing algorithm that part of the network layer responsible for deciding on which output line to transmit an incoming packet Adaptive.
13 –Routing Protocols Network Layer4-1. Network Layer4-2 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd.
Data Communication and Networks Lecture 11 Internet Routing Algorithms and Protocols December 5, 2002 Joseph Conron Computer Science Department New York.
Lecture 8 Overview. Graph abstraction u y x wv z Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v),
Routing - I Important concepts: link state based routing, distance vector based routing.
Network Layer-11 CSE401N: Computer Networks Lecture-9 Network Layer & Routing.
Introduction to Networking Bin Lin TA March 3 rd, 2005 Recital 6.
Routing & IP Routing Protocols
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing with.
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Data Communication and Networks Lecture 7 Networks: Part 2 Routing Algorithms October 27, 2005.
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.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar1 ECSE-4730: Computer Communication Networks (CCN) Network Layer (Routing) Shivkumar.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
Announcement r Project 2 Extension ? m Previous grade allocation: Projects 40% –Web client/server7% –TCP stack21% –IP routing12% Midterm 20% Final 20%
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.5 Routing algorithms m Link state m Distance.
Announcement r Project 2 due next week! r Homework 3 available soon, will put it online r Recitation tomorrow on Minet and project 2.
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Chapter 4 Network Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 18.
4: Network Layer 4a-1 14: Intro to Routing Algorithms Last Modified: 8/8/ :41:16 PM.
Computer Networking Intra-Domain Routing, Part I RIP (Routing Information Protocol)
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
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.
4: Network Layer4a-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing.
IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface UGH00emd UH10lo0.
Network Layer4-1 Chapter 4 Network Layer Part 3: Routing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March.
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
1 Week 5 Lecture 2 IP Layer. 2 Network layer functions transport packet from sending to receiving hosts transport packet from sending to receiving hosts.
Overview of Internet Routing (I) Fall 2004 CS644 Advanced Topics in Networking Sue B. Moon Division of Computer Science Dept. of EECS KAIST.
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
Introduction 1 Lecture 19 Network Layer (Routing Algorithms) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 20 Omar Meqdadi Department of Computer Science and Software Engineering University.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Transport Layer 3-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_3.
CS 4284 Systems Capstone Godmar Back Networking. CS 4284 Spring 2013 Summary Basics of Network Layer –Routing (path selection) vs Forwarding (switching)
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,
Network Layer4-1 Routing Algorithm Classification Global or decentralized information? Global: r all routers have complete topology, link cost info r “link.
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.
Internet and Intranet Protocols and Applications Lecture 9 Internet Routing Algorithms and Protocols March 27, 2002 Joseph Conron Computer Science Department.
4: Network Layer4a-1 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous:
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
Application Layer 2-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
Network Layer4-1 Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol.
CS 5565 Network Architecture and Protocols
Network Layer Introduction Datagram networks IP: Internet Protocol
Routing: Distance Vector Algorithm
Distance Vector Routing: overview
Network layer functions
Chapter 4 – The Network Layer & Routing
Road Map I. Introduction II. IP Protocols III. Transport Layer
ECE453 – Introduction to Computer Networks
Chapter 4: Network Layer
ECSE-4730: Computer Communication Networks (CCN)
Network Layer (contd.) Routing
Chapter 4: Network Layer
Chapter 4: Network Layer
Chapter 4: Network Layer
Chapter 4: Network Layer
EE 122: Intra-domain routing: Link State
Chapter 4 Network Layer A note on the use of these ppt slides:
Presentation transcript:

1 Week 6 Routing Concepts

2 Network Layer Functions transport packet from sending to receiving hosts network layer protocols in every host, router path determination: route taken by packets from source to dest. Routing algorithms switching: move packets from router’s input to appropriate router output call setup: some network architectures require router call setup along path before data flows network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical

value in arriving packet’s header routing algorithm local forwarding table header value output link Interplay between routing and forwarding

4 u y x wv z Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Graph abstraction Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections

5 Graph abstraction: costs u y x wv z c(x,x’) = cost of link (x,x’) - e.g., c(w,z) = 5 cost could always be 1, or inversely related to bandwidth, or inversely related to congestion Cost of path (x 1, x 2, x 3,…, x p ) = c(x 1,x 2 ) + c(x 2,x 3 ) + … + c(x p-1,x p ) Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path

6 Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay, $ cost, or congestion level Goal: determine “good” path (sequence of routers) thru network from source to dest. Routing protocol A E D CB F “good” path: typically means minimum cost path other definitions possible

7 Routing Algorithm Classification Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically- connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes

8 Distance Vector Routing Algorithm (Old Arpanet Routing or Bellman-Ford) iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node communicates only with directly- attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly-attached neighbor to node example: in node X, for dest. Y via neighbor Z: D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =

9 Distance Table: Example A E D CB D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14 loop!

10 Distance table gives routing table D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination ABCD ABCD A,1 D,5 D,4 Outgoing link to use, cost destination Distance table Routing table

11 Distance Vector Routing: Overview Iterative, asynchronous: each local iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: each node notifies neighbors only when its least cost path to any destination changes neighbors then notify their neighbors if necessary wait for (change in local link cost or message from neighbor) Recompute distance table if least cost path to any dest has changed, notify neighbors Each node:

12 Distance Vector Algorithm 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infty /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w At all nodes, X:

13 Distance Vector Algorithm (cont.): 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval if we have a new min w D X (Y,w) for any destination Y 24 send new value of min w D X (Y,w) to all neighbors forever w X X X

14 Distance Vector Algorithm: example X Z Y

15 Distance Vector Algorithm: example X Z Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y

16 Distance Vector: link cost changes Link cost changes: node detects local link cost change updates distance table (line 15) if cost change in least cost path, notify neighbors (lines 23,24) X Z Y 1 algorithm terminates “good news travels fast”

17 Distance Vector: link cost changes Link cost changes: good news travels fast bad news travels slow - “count to infinity” problem! X Z Y 60 algorithm continues on!

18 What to do -- Split Horizon If router R forwards traffic for destination D thru neighbor N, then R reports to N that R’s distance to D is infinity. Because R is routing traffic for D thru N, R’s real distance to N cannot simply matter to N. Works in the previous case but does not work in some cases Example R2 R1 R3 D The count-to-infinity problem still exists

19 Distance Vector: Poison Reverse If Z routes through Y to get to X : Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) will this completely solve count to infinity problem? X Z Y 60 algorithm terminates

20 Link State Routing Each router is responsible for meeting its neighbours and learning their names Each router constructs a packet known as link state packet, or LSP, which contains a list of names of and cost to each of its neighbours A router generates an LSP periodically as well as when R discovers that it has a new neighbour the cost of a link to a neighbour has changed a link to a neighbour has gone down The LSP is somehow transmitted (this is the most complex and critical piece) to all other routers and each router stores the most recently generated LSP from each other router Each router armed now with a complete map of the topology, computes routes to each destination.

21 Disseminating the LSP to all Routers A simple scheme for routing that does not depend having any routing info is flooding, in which each packet received is transmitted to each neighbour except the one from which the packet is received. Also let the packet have a hop count. A better and simple LSP distribution scheme is as follows: If an LSP is received from neighbour N with source S and if the LSP is identical to the one from S that is stored, then ignore the received LSP (it is a duplicate) If the received LSP is not identical to the one from S currently stored or no LSP from S is stored, store the received LSP and transmit it to all neighbours The problem is that router cannot assume that the LSP most recently received from S is the one most recently generated. Use sequence number/age schemes

22 Sequence number/age Schemes A sequence number is a counter Each router S keeps track of the sequence number it used the last time it generated an LSP; when S needs to generate a new LSP, it uses the next sequence number When router R receives an LSP from from S, router R compares sequence number of the received LSP with the one from S stored in memory and assumes that the the one with the higher sequence number is the more recently generated. Problem 1. Sequence number field is of finite size Wrap around, count as 0,1,…,n-1,n,0,1,… How would you compare two sequence numbers a and b in this framework?

23 Sequence number/age schemes a n-1 n 0 1 < a > a

24 Sequence number/age schemes What happens if router S goes down and forgets the sequence number it was using? If it starts at 0 again, will its LSPs be believed by the network, or will they look older than the LSPs that S had issued before? To solve this problem, a second field, known as the age of the LSP is added to each LSP packet. It starts at some value and is decremented by routers as it is held in memory. When an LSP’s age reaches 0, the LSP can be considered too old, and an LSP with a nonzero age is accepted as newer regardless of its sequence number. LSP distribution scheme intelligently uses age and sequence number for dissemination of LSPs; used in IS-IS, OSPF, and PNNI.

25 A Link-State Routing Algorithm Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (‘source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest.’s Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node along path from source to v, that is next v N: set of nodes whose least cost path definitively known

26 Dijsktra’s Algorithm -- Shortest Path 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

27 Dijkstra’s algorithm: example Step start N A AD ADE ADEB ADEBC ADEBCF 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 A E D CB F

28 Dijsktra’s Algorithm -- Widest Path 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = b(A,v) /* b(A,v) is the available bandwidth*/ 6 else D(v) = Loop 9 find w not in N such that D(w) is a maximum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = max[ D(v), min(D(w),b(w,v)) ] 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

29 Dijkstra’s algorithm -- Widest Path Step start N A AC ACF ACFB ACFBD ACFBDE D(B),p(B) 2,A 3,C D(C),p(C) 5,A D(D),p(D) 1,A 3,C D(E),p(E) 0 1,C 2,F D(F),p(F) 0 5,C A E D CB F

30 Dijkstra’s algorithm, Discussion Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n*(n+1)/2 comparisons: O(n^2) more efficient implementations possible: O(n logn) Oscillations possible: e.g., link cost = amount of carried traffic A D C B 1 1+e e 0 e A D C B 2+e e 1 A D C B 0 2+e 1+e A D C B 2+e 0 e 0 1+e 1 initially … recompute routing … recompute

31 Comparison of LS and DV algorithms Message complexity and memory LS: with n nodes, E links, O(nE) messages sent each, larger tables DV: exchange between neighbors only convergence time varies, smaller distance tables Speed of Convergence LS: O(n^2) algorithm requires O(nE) messages may have oscillations DV: convergence time varies may have routing loops count-to-infinity problem link state routing converges more quickly than distance vector a router cannot pass routing information on until it has computed its distance vector looping Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node’s table used by others error propagate thru network

32 Link Costs Whether link costs are fixed or they vary with the utilization of the link? Proponents of variable costs: traffic is routed more optimally having costs assigned by network management requires additional configuration Proponents of fixed link costs: routing info needs to be generated only if the link goes down or recovers if link costs change frequently, the network is often in an unconverged state, not making good routing decisions stability There are recent studies that find link costs in the networks so as to maximize the total traffic through the network (traffic matrix should be known)

33 Load Splitting If costs are equal then traffic can be split amongst equal-cost paths; splitting otherwise may lead to routing loops Applicable to both LS and DV However, this annoys the transport layer Out of order packets Transport layer requires a uniform service for RTT and MTU calculations Flow-level splitting Packets of the same flow would follow the same path The router, if it has two equal cost paths, can do a hash of (source IP, dest. IP, source port, dest. port) to select which path the packet should take

34 Hierarchical Routing scale: with 200 million destinations: can’t store all dest’s in routing tables! routing table exchange would swamp links! administrative autonomy internet = network of networks each network admin may want to control routing in its own network Our routing study thus far - idealization all routers identical network “flat” … not true in practice

35 Hierarchical Routing aggregate routers into regions, “autonomous systems” (AS) routers in same AS run same routing protocol “intra-AS” routing protocol routers in different AS can run different intra-AS routing protocol Gateway router Direct link to router in another AS

36 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b Intra-AS Routing algorithm Inter-AS Routing algorithm Forwarding table 3c Interconnected ASes Forwarding table is configured by both intra- and inter-AS routing algorithm Intra-AS sets entries for internal dests Inter-AS & Intra-As sets entries for external dests

37 3b 1d 3a 1c 2a AS3 AS1 AS2 1a 2c 2b 1b 3c Inter-AS tasks Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards on of the gateway routers, but which one? AS1 needs: 1. to learn which dests are reachable through AS2 and which through AS3 2. to propagate this reachability info to all routers in AS1 Job of inter-AS routing!

38 Example: Setting forwarding table in router 1d Suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 (gateway 1c) but not from AS2. Inter-AS protocol propagates reachability info to all internal routers. Router 1d determines from intra-AS routing info that its interface I is on the least cost path to 1c. Puts in forwarding table entry (x,I).

39 Learn from inter-AS protocol that subnet x is reachable via multiple gateways Use routing info from intra-AS protocol to determine costs of least-cost paths to each of the gateways Hot potato routing: Choose the gateway that has the smallest least cost Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x,I) in forwarding table Example: Choosing among multiple ASes Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. To configure forwarding table, router 1d must determine towards which gateway it should forward packets for dest x. This is also the job on inter-AS routing protocol! Hot potato routing: send packet towards closest of two routers.

40 Intra-AS Routing Also known as Interior Gateway Protocols (IGP) Most common Intra-AS routing protocols: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary)