Lecture 7 Overview. Two Key Network-Layer Functions forwarding: move packets from router’s input to appropriate router output routing: determine route.

Slides:



Advertisements
Similar presentations
What is “Routing”? Routing algorithm that part of the network layer responsible for deciding on which output line to transmit an incoming packet Adaptive.
Advertisements

13 –Routing Protocols Network Layer4-1. Network Layer4-2 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd.
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.
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.
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.
Chapter 4 Network Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 14.
10 - Network Layer. Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving.
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.
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
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.
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
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)
1 Announcement #1 r Did you all receive homework #1 and #2? r Homework #3 will be available online during the day r Midterm.
Chapter 4 Network Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 18.
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.
Introduction 1 Lecture 21 Network Layer (Routing Activity) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science &
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 18 Omar Meqdadi Department of Computer Science and Software Engineering University.
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding.
Lecture 6 Overview. TCP: Transmission Control Protocol TCP is an alternative transport layer protocol supported by TCP/IP. TCP provides: – Connection-oriented.
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.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Network Layer introduction.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
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.
4: Network Layer4-1 Schedule Today: r Finish Ch3 r Collect 1 st Project r See projects run r Start Ch4 Soon: r HW5 due Monday r Last chance for Qs r First.
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.
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.
Computer Networks CSE 434 Fall 2009 Sandeep K. S. Gupta Arizona State University Research Experience.
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 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.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Project 2 r DUE Wed: 02/24 Network Layer4-1. Project 2 r DUE Wed: 02/24 r DUE Mon: 02/29 Network Layer4-2.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
CSE 421 Computer Networks. Chapter 4 Network Layer Thanks to you All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer.
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.
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.
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
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CPSC 335 Data Communication.
Chapter 7 Dynamic Routing
Network Layer Goals: Overview:
CS4470 Computer Networking Protocols
Network Layer Introduction Datagram networks IP: Internet Protocol
Distance Vector Routing: overview
Network layer functions
Chapter 4 – The Network Layer & 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.
Chapter 4-4 routing and IP routing
Network Layer I have learned from life no matter how far you go
CS4470 Computer Networking Protocols
Network Layer (contd.) Routing
Chapter 4: Network Layer
Network Layer: Link-state and Distance-Vector Routing Protocols
Chapter 4: Network Layer
Presentation transcript:

Lecture 7 Overview

Two Key Network-Layer Functions forwarding: move packets from router’s input to appropriate router output routing: determine route taken by packets from source to dest. – routing algorithms Analogy – routing: process of planning trip from source to destination – forwarding: process of getting through single interchange CPE 401/601 Lecture 7 : Routing 2

1 2 3 local forwarding table header value output link routing and forwarding 0111 value in arriving packet’s header routing algorithm CPE 401/601 Lecture 7 : Routing 3

Connection setup 3 rd important function in some architectures – ATM, frame relay, X.25 before datagrams flow, two end hosts and intervening routers establish virtual connection – routers get involved network vs transport layer connection service: – network: between two hosts may also involve intervening routers in case of VCs – transport: between two processes CPE 401/601 Lecture 7 : Routing 4

Network layer service models Network Architecture Internet ATM Service Model best effort BR VBR ABR UBR Bandwidth none constant rate guaranteed rate guaranteed minimum none Loss no yes no Order no yes Timing no yes no Congestion feedback no (inferred via loss) no congestion no congestion yes no Guarantees ? CPE 401/601 Lecture 7 : Routing 5

Virtual Circuit Implementation A Virtual Circuit consists of – path from source to destination – VC numbers one number for each link along path – entries in forwarding tables in routers along path Each packet carries VC identifier – VC number can be changed on each link Every router on source-dest path maintains “state” for each passing connection CPE 401/601 Lecture 7 : Routing 6

Forwarding table VC number interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # … … Forwarding table in northwest router: Routers maintain connection state information! CPE 401/601 Lecture 7 : Routing 7

Virtual circuits: signaling protocols used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet application transport network data link physical application transport network data link physical 1. Initiate call 2. incoming call 3. Accept call 4. Call connected 5. Data flow begins 6. Receive data CPE 401/601 Lecture 7 : Routing 8

Datagram networks no call setup at network layer routers: no state about end-to-end connections – no network-level concept of “connection” packets forwarded using destination host address – packets between same src-dst pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data CPE 401/601 Lecture 7 : Routing 9

Forwarding table Destination Address Range Link Interface through through through otherwise 3 4 billion possible entries CPE 401/601 Lecture 7 : Routing 10

Longest prefix matching Network Layer 4-11 Prefix Match Link Interface otherwise 3 DA: Examples DA: Interface 0 Interface 1

Datagram or VC network: why? Internet (datagram) – data exchange among computers “elastic” service, no strict timing requirement – “smart” end systems (computers) can adapt, perform control, error recovery simple inside network, complexity at “edge” – many link types different characteristics uniform service difficult CPE 401/601 Lecture 7 : Routing 12

Datagram or VC network: why? ATM (VC) – evolved from telephony – human conversation: strict timing, reliability requirements need for guaranteed service – “dumb” end systems telephones complexity inside network CPE 401/601 Lecture 7 : Routing 13

Lecture 8 Routing Algorithms CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger slides are modified from J. Kurose & K. Ross

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), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections CPE 401/601 Lecture 8 : Routing Algorithms 15

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 CPE 401/601 Lecture 8 : Routing Algorithms 16

Routing Algorithm classification Global or decentralized information? Global: link state algorithms – all routers have complete topology, link cost info Decentralized: distance vector algorithms – router knows physically-connected neighbors link costs to neighbors – iterative process of computation, exchange of info with neighbors CPE 401/601 Lecture 8 : Routing Algorithms 17

Routing Algorithm classification Static or dynamic? Static: – routes change slowly over time Dynamic: – routes change more quickly periodic update in response to link cost changes CPE 401/601 Lecture 8 : Routing Algorithms 18

Dijkstra’s Algorithm

Dijkstra’s algorithm A Link-State Routing Algorithm – Topology, link costs known to all nodes – accomplished via “link state broadcast” – all nodes have same info Compute least cost paths from source node to all other nodes – produces forwarding table for that node Iterative: – after k iterations, know least cost path to k dests CPE 401/601 Lecture 8 : Routing Algorithms 20

Dijkstra’s Algorithm Notation: c(x,y): link cost from node x to y; – ∞ 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 N': set of nodes whose least cost path definitively known CPE 401/601 Lecture 8 : Routing Algorithms 21

Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 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‘ CPE 401/601 Lecture 8 : Routing Algorithms 22

Dijkstra’s algorithm: example Step N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u D(w),p(w) 5,u 4,x 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ 4,y u y x wv z CPE 401/601 Lecture 8 : Routing Algorithms 23

Dijkstra’s algorithm: example u y x wv z Resulting shortest-path tree from u: v x y w z (u,v) (u,x) destination link Resulting forwarding table in u: CPE 401/601 Lecture 8 : Routing Algorithms 24

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(nlogn) CPE 401/601 Lecture 8 : Routing Algorithms 25

Oscillations possible: – e.g., link cost = amount of carried traffic Dijkstra’s algorithm, discussion A D C B 1 1+e e 0 e initially A D C B 2+e e 1 … recompute routing A D C B 0 2+e 1+e … recompute A D C B 2+e 0 e 0 1+e 1 … recompute CPE 401/601 Lecture 8 : Routing Algorithms 26

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) = min v {c(x,v) + d v (y) } where min is taken over all neighbors v of x CPE 401/601 Lecture 8 : Routing Algorithms 28

Bellman-Ford example u y x wv z Clearly, d v (z) = 5, d x (z) = 3, d w (z) = 3 d u (z) = min { c(u,v) + d v (z), c(u,x) + d x (z), c(u,w) + d w (z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path ➜ forwarding table B-F equation says: CPE 401/601 Lecture 8 : Routing Algorithms 29

Distance Vector Algorithm D x (y) = estimate of least cost from x to y – Node x knows cost to each neighbor v: c(x,v) – Node x maintains distance vector D x = [D x (y): y є N ] Node x also maintains its neighbors’ distance vectors – For each neighbor v, x maintains D v = [D v (y): y є N ] CPE 401/601 Lecture 8 : Routing Algorithms 30

Distance vector algorithm Basic idea: – From time-to-time, each node sends its own distance vector estimate to neighbors – Asynchronous When a node x receives new DV estimate from neighbor, it updates its own DV using B-F Under minor, natural conditions, the estimate D x (y) converge to the actual least cost d x (y) D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N CPE 401/601 Lecture 8 : Routing Algorithms 31

Distance Vector Algorithm Iterative, asynchronous: – each local iteration caused by local link cost change DV update message from neighbor Distributed: – each node notifies neighbors only when its DV changes – neighbors then notify their neighbors if necessary wait for (change in local link cost or msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Each node: CPE 401/601 Lecture 8 : Routing Algorithms 32

x y z x y z ∞∞∞ ∞∞∞ from cost to from x y z x y z 0 from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z ∞∞∞ 710 cost to ∞ ∞ ∞ ∞ time x z y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 32 CPE 401/601 Lecture 8 : Routing Algorithms33

CPE 401/601 Lecture 8 : Routing Algorithms34 x y z x y z ∞∞∞ ∞∞∞ from cost to from x y z x y z from cost to x y z x y z from cost to x y z x y z ∞∞ ∞∞∞ cost to x y z x y z from cost to x y z x y z from cost to x y z x y z from cost to x y z x y z from cost to x y z x y z ∞∞∞ 710 cost to ∞ ∞ ∞ ∞ time x z y node x table node y table node z table D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{2+0, 7+1} = 2 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3

Link cost changes Link cost changes: – node detects local link cost change – updates routing info, recalculates distance vector – if DV changes, notify neighbors CPE 401/601 Lecture 8 : Routing Algorithms 35 “good news travels fast” x z y 1 At time t 0, y detects the link-cost change, updates its DV, and informs its neighbors. At time t 1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t 2, y receives z’s update and updates its distance table. y’s least costs do not change and hence y does not send any message to z.

Link cost changes Link cost changes: – good news travels fast – bad news travels slow “count to infinity” problem! – 44 iterations before algorithm stabilizes Poisoned 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? CPE 401/601 Lecture 8 : Routing Algorithms 36 x z y 60

LS vs DV Message complexity – LS: with n nodes, E links, O(nE) msgs sent – DV: exchange between neighbors only Speed of Convergence – LS: O(n 2 ) algorithm requires O(nE) msgs may have oscillations – DV: convergence time varies may be routing loops count-to-infinity problem CPE 401/601 Lecture 8 : Routing Algorithms 37

LS vs DV 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 CPE 401/601 Lecture 8 : Routing Algorithms 38