Chap4.5 Network Layer

Chap4.5 Network Layer - Distance Vector Algorithm ...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3/16/10 Distance Vector Algorithm Bellman ­Ford EquaFon (dynamic programming) Define dx(y) := cost of least ­cost path from x to y Then Many slides in this document adapted from materials for Kurose and Ross, Computer Networking, 5th edition. copyright 1996-2009 J.F Kurose and K.W. Ross, All Rights Reserved Network Layer Part 3 dx(y) = min {c(x,v) + dv(y) } v where min is taken over all neighbors v of x Network Layer 4 ­2 Bellman ­Ford example 5 2 Distance Vector Algorithm •  Dx(y) = esFmate of least cost from x to y •  Node x knows cost to each neighbor v: c(x,v) •  Node x maintains distance vector Dx = [Dx(y): y є N ] •  Node x also maintains its neighbors’ distance vectors –  For each neighbor v, x maintains Dv = [Dv(y): y є N ] v 2 3 3 1 w 1 Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 5 u 1 z 2 B ­F equaFon says: du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 x y Node that achieves minimum is next hop in shortest path ➜ forwarding table Network Layer 4 ­3 Network Layer 4 ­4 Distance vector algorithm (4) Basic idea: •  From Fme ­to ­Fme, each node sends its own distance vector esFmate to neighbors •  Asynchronous •  When a node x receives new DV esFmate from neighbor, it updates its own DV using B ­F equaFon: Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N ❒  Under minor, natural condiFons, the esFmate Dx(y) Distance Vector Algorithm (5) IteraFve, asynchronous: each local iteraFon caused by: •  local link cost change •  DV update message from neighbor Each node: wait for (change in local link cost or msg from neighbor) Distributed: •  each node noFfies neighbors only when its DV changes –  neighbors then noFfy their neighbors if necessary recompute estimates if DV to any dest has changed, notify neighbors converge to the actual least cost dx(y) Network Layer 4 ­5 Network Layer 4 ­6 3/16/10 node x table cost to x y z from Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 cost to x y z x 0 2 3 y 2 0 1 z 7 1 0 from Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3 node x table cost to x y z from Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 cost to x y z x 0 2 3 y 2 0 1 z 7 1 0 cost to x y z x 0 2 7 y 2 0 1 z 7 1 0 cost to x y z x 0 2 7 y 2 0 1 z 3 1 0 from from from from from from cost to x y z x 0 2 3 y 2 0 1 z 3 1 0 cost to x y z x 0 2 3 y 2 0 1 z 3 1 0 cost to x y z x 0 2 3 y 2 0 1 z 3 1 0 Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3 x 0 2 7 y ∞ ∞ ∞ z ∞ ∞ ∞ node y table cost to x y z x ∞ ∞ ∞ y 2 0 1 z ∞ ∞ ∞ node z table cost to x y z from x ∞ ∞ ∞ y ∞ ∞ ∞ z 7 1 0 from 2 y 7 1 x 0 2 7 y ∞ ∞ ∞ z ∞ ∞ ∞ node y table cost to x y z from x z x ∞ ∞ ∞ y 2 0 1 z ∞ ∞ ∞ node z table cost to x y z x ∞ ∞ ∞ y ∞ ∞ ∞ z 7 1 0 from 2 y 7 1 x z Network Layer Fme 4 ­7 Network Layer Fme 4 ­8 Distance Vector: link cost changes Link cost changes: ❒  node detects local link cost change ❒  updates rouFng info, recalculates Distance Vector: link cost changes Link cost changes: ❒  good news travels fast 1 4 y 50 60 4 1 y 50 distance vector ❒  if DV changes, noFfy neighbors x z ❒  bad news travels slow  ­ “count 1 to infinity” problem! ❒  44 iteraFons before algorithm stabilizes: see text x z “good news travels fast” At Fme t0, y detects the link ­cost change, updates its DV, and informs its neighbors. At Fme t1, 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 Fme t2, 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. 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? Network Layer 4 ­9 Network Layer 4 ­10 Comparison of LS and DV algorithms Message complexity •  LS: with n nodes, E links, O(nE) msgs sent •  DV: exchange between neighbors only –  convergence Fme varies Chapter 4: Network Layer •  4. 1 IntroducFon •  4.2 Virtual circuit and datagram networks •  4.3 What’s inside a router •  4.4 IP: Internet Protocol –  –  –  –  Datagram format IPv4 addressing ICMP IPv6 Robustness: what happens if router malfuncFons? LS: –  node can adverFse incorrect link cost –  each node computes only its own table •  4.5 RouFng algorithms –  Link state –  Distance Vector –  Hierarchical rouFng Speed of Convergence •  msgs –  may have oscillaFons •  DV: convergence Fme varies –  may be rouFng loops –  count ­to ­infinity problem LS: O(n2) algorithm requires O(nE) •  4.6 RouFng in the Internet –  RIP –  OSPF –  BGP DV: –  DV node can adverFse incorrect path cost –  each node’s table used by others •  error propagate thru network •  4.7 Broadcast and mulFcast rouFng Network Layer 4 ­11 Network Layer 4 ­12 3/16/10 Hierarchical RouFng Our rouFng study thus far  ­ idealizaFon ❒  all routers idenFcal ❒  network “flat” … not true in pracFce scale: with 200 million desFnaFons: •  can’t store all dest’s in rouFng tables! •  rouFng table exchange would swamp links! Hierarchical RouFng •  aggregate routers into regions, “autonomous systems” (AS) •  routers in same AS run same rouFng protocol –  “intra ­AS” rouFng protocol –  routers in different AS can run different intra ­AS rouFng protocol Gateway router •  Direct link to router in another AS administraFve autonomy •  internet = network of networks •  each network admin may want to control rouFng in its own network Network Layer 4 ­13 Network Layer 4 ­14 Interconnected ASes 3c 3b 3a AS3 1a 1c 1d 1b AS1 2a 2c AS2 Inter ­AS tasks •  suppose router in AS1 receives datagram desFned outside of AS1: –  router should forward packet to gateway router, but which one? 2b Intra-AS Routing algorithm Inter-AS Routing algorithm •  forwarding table configured by both intra ­ and inter ­AS rouFng algorithm –  intra ­AS sets entries for internal dests –  inter ­AS & intra ­As sets entries for external dests 4 ­15 AS1 must: 1.  learn which dests are reachable through AS2, which through AS3 2.  propagate this reachability info to all routers in AS1 Job of inter ­AS rouFng! 3c 3b Forwarding table 3a AS3 1a 1c 1d 1b AS1 2a 2c AS2 2b Network Layer Network Layer 4 ­16 Example: Sevng forwarding table in router 1d •  suppose AS1 learns (via inter ­AS protocol) that subnet x reachable via AS3 (gateway 1c) but not via AS2. •  inter ­AS protocol propagates reachability info to all internal routers. •  router 1d determines from intra ­AS rouFng info that its interface I is on the least cost path to 1c. Example: Choosing among mulFple ASes •  now suppose AS1 learns from 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 job of inter ­AS rouFng protocol! –  installs forwarding table entry (x,I) 3c 3b … x 2a 1b AS1 Network Layer 3a 1c 1a 1d AS3 2c AS2 2b 3a 3b AS3 3c … 1c 1a 1d x … 2a 1b AS1 2c AS2 2b 4 ­17 Network Layer 4 ­18 3/16/10 Example: Choosing among mulFple ASes •  now suppose AS1 learns from 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. •  hot potato rouFng: send packet towards closest of two routers. Chapter 4: Network Layer •  4. 1 IntroducFon •  4.2 Virtual circuit and datagram networks •  4.3 What’s inside a router •  4.4 IP: Internet Protocol –  –  –  –  Datagram format IPv4 addressing ICMP IPv6 •  4.5 RouFng algorithms –  Link state –  Distance Vector –  Hierarchical rouFng –  this is also job of inter ­AS rouFng protocol! •  4.6 RouFng in the Internet –  RIP –  OSPF –  BGP 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 •  4.7 Broadcast and mulFcast rouFng Network Layer 4 ­19 Network Layer 4 ­20 Intra ­AS RouFng •  also known as Interior Gateway Protocols (IGP) •  most common Intra ­AS rouFng protocols: RIP ( RouFng InformaFon Protocol) •  distance vector algorithm •  included in BSD ­UNIX DistribuFon in 1982 •  distance metric: # of hops (max = 15 hops) From router A to subnets: u v desFnaFon hops u 1 v 2 w 2 x 3 y 3 z 2 –  RIP: RouFng InformaFon Protocol –  OSPF: Open Shortest Path First –  IGRP: Interior Gateway RouFng Protocol (Cisco proprietary) A B w z C D x y Network Layer Network Layer 4 ­21 4 ­22 RIP adverFsements •  distance vectors: exchanged among neighbors every 30 sec via Response Message (also called adverFsement) •  each adverFsement: list of up to 25 desFnaFon subnets within AS w x RIP: Example z A D C Des0na0on Network w y B y z x …. Next Router Num. of hops to dest. A B B  ­ ­ …. 2 2 7 1 .... RouFng/Forwarding table in D Network Layer 4 ­23 Network Layer 4 ­24 3/16/10 RIP: Example Dest Next hops w  ­ 1 x  ­ 1 z C 4 …. … ... RIP: Link Failure and Recovery If no adverFsement heard azer 180 sec  ­ ­> neighbor/link declared dead Adver0sement from A to D z x D C y B w A Des0na0on Network w y z x …. Next Router Num. of hops to dest. A B B A  ­ ­ …. 2 2 7 5 1 .... –  routes via neighbor invalidated –  new adverFsements sent to neighbors –  neighbors in turn send out new adverFsements (if tables changed) –  link failure info quickly (?) propagates to enFre net –  poison reverse used to prevent ping ­pong loops (infinite distance = 16 hops) Network Layer 4 ­26 Network Layer RouFng/Forwarding table in D 4 ­25 RIP Table processing •  RIP rouFng tables managed by applica0on ­level process called route ­d (daemon) •  adverFsements sent in UDP packets, periodically repeated OSPF (Open Shortest Path First) •  “open”: publicly available •  uses Link State algorithm –  LS packet disseminaFon –  topology map at each node –  route computaFon using Dijkstra’s algorithm routed Transprt (UDP) network forwarding (IP) table link physical Network Layer routed Transprt (UDP) forwarding table network (IP) link physical 4 ­27 Network Layer 4 ­28 •  OSPF adverFsement carries one entry per neighbor router •  adverFsements disseminated to enFre AS (via flooding) –  carried in OSPF messages directly over IP (rather than TCP or UDP OSPF “advanced” features (not in RIP) •  security: all OSPF messages authenFcated (to prevent malicious intrusion) •  mulFple same ­cost paths allowed (only one path in RIP) •  For each link, mulFple cost metrics for different TOS (e.g., satellite link cost set “low” for best effort; high for real Fme) •  integrated uni ­ and mulFcast support: Hierarchical OSPF –  MulFcast OSPF (MOSPF) uses same topology data base as OSPF •  hierarchical OSPF in large domains. Network Layer 4 ­29 Network Layer 4 ­30 3/16/10 Hierarchical OSPF •  two ­level hierarchy: local area, backbone. Internet inter ­AS rouFng: BGP •  BGP (Border Gateway Protocol): the de facto standard •  BGP provides each AS a means to: 1.  Obtain subnet reachability informaFon from neighboring ASs. 2.  Propagate reachability informaFon to all AS ­ internal routers. 3.  Determine “good” routes to subnets based on reachability informaFon and policy. –  Link ­state adverFsements only in area –  each nodes has detailed area topology; only know direcFon (shortest path) to nets in other areas. •  area border routers: “summarize” distances to nets in own area, adverFse to other Area Border routers. •  backbone routers: run OSPF rouFng limited to backbone. •  boundary routers: connect to other AS’s. •  allows subnet to adverFse its existence to rest of Internet: “I am here” 4 ­31 Network Layer 4 ­32 Network Layer BGP basics •  pairs of routers (BGP peers) exchange rouFng info over semi ­ permanent TCP connecFons: BGP sessions •  when AS2 adverFses a prefix to AS1: DistribuFng reachability info •  using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. –  BGP sessions need not correspond to physical links. –  AS2 promises it will forward datagrams towards that prefix. –  AS2 can aggregate prefixes in its adverFsement •  when router learns of new prefix, it creates entry for prefix in its forwarding table. –  1c can then use iBGP do distribute new prefix info to all routers in AS1 –  1b can then re ­adverFse new reachability info to AS2 over 1b ­to ­2a eBGP session 3c 3b 3a AS3 1a AS1 1c 1d eBGP session iBGP session 2a 1b Network Layer 2c AS2 3c 2b 3b 3a AS3 1a AS1 1c 1d eBGP session iBGP session 2a 1b Network Layer 2c AS2 2b 4 ­33 4 ­34 Path a}ributes & BGP routes •  adverFsed prefix includes BGP a}ributes. •  two important a}ributes: –  prefix + a}ributes = “route” –  AS ­PATH: contains ASs through which prefix adverFsement has passed: e.g, AS 67, AS 17 –  NEXT ­HOP: indicates specific internal ­AS router to next ­hop AS. (may be mulFple links from current AS to next ­hop ­AS) BGP route selecFon •  router may learn about more than 1 route to some prefix. Router must select route. •  eliminaFon rules: 1.  2.  3.  4.  local preference value a}ribute: policy decision shortest AS ­PATH closest NEXT ­HOP router: hot potato rouFng addiFonal criteria •  when gateway router receives route adverFsement, uses import policy to accept/ decline. Network Layer 4 ­35 Network Layer 4 ­36 3/16/10 BGP messages •  BGP messages exchanged using TCP. •  BGP messages: BGP rouFng policy B W legend: X provider network customer network: –  OPEN: opens TCP connecFon to peer and authenFcates sender –  UPDATE: adverFses new path (or withdraws old) –  KEEPALIVE keeps connecFon alive in absence of UPDATES; also ACKs OPEN request –  NOTIFICATION: reports errors in previous msg; also used to close connecFon Network Layer 4 ­37 A C Y ❒  A,B,C are provider networks ❒  X,W,Y are customer (of provider networks) ❒  X is dual ­homed: a}ached to two networks ❍  X does not want to route from B via X to C ❍  .. so X will not adverFse to B a route to C Network Layer 4 ­38 BGP rouFng policy (2) B W Why different Intra ­ and Inter ­AS rouFng ? provider network customer network: legend: X Policy: •  Inter ­AS: admin wants control over how its traffic routed, who routes through its net. •  Intra ­AS: single admin, so no policy decisions needed A C Y ❒  A adverFses path AW to B ❒  B adverFses path BAW to X ❒  Should B adverFse path BAW to C? ❍  No way! B gets no “revenue” for rouFng CBAW since Scale: •  hierarchical rouFng saves table size, reduced update traffic Performance: •  Intra ­AS: can focus on performance •  Inter ­AS: policy may dominate over performance neither W nor C are B’s customers ❍  B wants to force C to route to w via A ❍  B wants to route only to/from its customers! Network Layer 4 ­39 Network Layer 4 ­40 ...
View Full Document

This note was uploaded on 03/21/2010 for the course CS 4457 taught by Professor Cetti during the Spring '10 term at UVA.

Ask a homework question - tutors are online