Chapter 4: outline 4. introduction 4. virtual circuit and datagram networks 4. what s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP Network Laer 4-
Interpla between routing, forwarding routing algorithm local forwarding table dest address output link address-range address-range address-range address-range 4 routing algorithm determines end-end-path through network forwarding table determines local forwarding at this router IP destination address in arriving packet s header Network Laer 4-
Graph abstraction 5 graph: G = (N,E) u v w 5 N = set of routers = { u, v, w,,, } E = set of links ={ (u,v), (u,), (v,), (v,w), (,w), (,), (w,), (w,), (,) } Network Laer 4-
Graph abstraction: costs u 5 v w 5 c(, ) = cost of link (, ) e.g., c(w,) = 5 cost could alwas be, or inversel related to bandwidth, or inversel related to congestion cost of path (,,,, p ) = c(, ) + c(, ) + + c( p-, p ) ke question: what is the least-cost path between u and? routing algorithm: algorithm that finds that least cost path Network Laer 4-4
Routing algorithm classification Q: global or decentralied information? global: v all routers have complete topolog, link cost info v link state algorithms decentralied: v router knows phsicallconnected neighbors, link costs to neighbors v iterative process of computation, echange of info with neighbors v distance vector algorithms Q: static or dnamic? static: v routes change slowl over time dnamic: v routes change more quickl periodic update in response to link cost changes Network Laer 4-5
Chapter 4: outline 4. introduction 4. virtual circuit and datagram networks 4. what s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Laer 4-6
A Link-State Routing Algorithm Dijkstra s algorithm v net topolog, link costs known to all nodes accomplished via link state broadcast all nodes have same info v computes least cost paths from one node ( source ) to all other nodes gives forwarding table for that node v iterative: after k iterations, know least cost path to k dest. s notation: v c(,): link cost from node to ; = if not direct neighbors v D(v): current value of cost of path from source to dest. v v p(v): predecessor node along path from source to v v N': set of nodes whose least cost path definitivel known Network Laer 4-7
Dijsktra s Algorithm Initialiation: N' = {u} 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 0 add w to N' update D(v) for all v adjacent to w and not in N' : D(v) = min( D(v), D(w) + c(w,v) ) /* new cost to v is either old cost to v or known 4 shortest path cost to w plus cost from w to v */ 5 until all nodes in N' Network Laer 4-8
Dijkstra s algorithm: eample D(v) p(v) D(w) p(w) D() p() D() p() D() p() Step N' 0 u 7,u,u 5,u uw 6,w 5,u,w uw 6,w,w 4, uwv 0,v 4, 4 uwv, 5 uwv notes: v v construct shortest path tree b tracing predecessor nodes ties can eist (can be broken arbitraril) u 5 w v 4 8 7 7 4 9 Network Laer 4-9
Dijkstra s algorithm: an eercise Initialiation: N' = {u} 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 0 add w to N' update D(v) for all v adjacent to w and not in N' : D(v) = min( D(v), D(w) + c(w,v) ) /* new cost to v is either old cost to v or known u 4 shortest path cost to w plus cost from w to v */ 5 until all nodes in N' 5 v w 5 Network Laer 4-0
Network Laer 4- Dijkstra s algorithm: eercise Step 0 4 5 N' u u u uv uvw uvw D(v),p(v),u,u,u D(w),p(w) 5,u 4,,, D(),p(),u D(),p(), D(),p() 4, 4, 4, u w v 5 5 u w v
Dijkstra s algorithm: eercise resulting shortest-path tree from u: v w u resulting forwarding table in u: destination v w link (u,v) (u,) (u,) (u,) (u,) Network Laer 4-
Dijkstra s algorithm, discussion algorithm compleit: n nodes v each iteration: need to check all nodes, w, not in N v n(n+)/ comparisons: O(n ) v more efficient implementations possible: O(nlogn) oscillations possible: v e.g., support link cost equals amount of carried traffic: the cost with more traffic is higher Network Laer 4-
OSPF (Open Shortest Path First) v open : publicl available v uses link state algorithm LS packet dissemination topolog map at each node route computation using Dijkstra s algorithm v advertisements flooded to entire AS carried in OSPF messages directl over IP (rather than TCP or UDP Network Laer 4-4
Hierarchical OSPF boundar router backbone router area border routers backbone area area area internal routers Network Laer 4-5
Hierarchical OSPF v two-level hierarch: local area, backbone. link-state advertisements onl in area each nodes has detailed area topolog; onl know direction (shortest path) to nets in other areas. v area border routers: summarie distances to nets in own area, advertise to other Area Border routers. v backbone routers: run OSPF routing limited to backbone. v boundar routers: connect to other AS s. Network Laer 4-6
Chapter 4: outline 4. introduction 4. virtual circuit and datagram networks 4. what s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Laer 4-7
Distance vector algorithm Bellman-Ford equation (dnamic programming) let d () := cost of least-cost path from to then d () = min {c(,v) + d v () } v cost from neighbor v to destination cost to neighbor v min taken over all neighbors v of Network Laer 4-8
Bellman-Ford eample u 5 v w 5 clearl, d v () = 5, d () =, d w () = B-F equation sas: d u () = min { c(u,v) + d v (), c(u,) + d (), c(u,w) + d w () } = min { + 5, +, 5 + } = 4 Network Laer 4-9
Distance vector algorithm ke idea: v from time-to-time, each node sends its own distance vector estimate to neighbors v when receives new DV estimate from neighbor, it updates its own DV using B-F equation: D () min v {c(,v) + D v ()} for each node N Network Laer 4-0
Distance vector algorithm each node: wait for (change in local link cost or msg from neighbor) recompute estimates if DV to an dest has changed, notif neighbors Network Laer 4-
node table from cost to 0 7 D () = min{c(,) + D (), c(,) + D ()} = min{+0, 7+} = from 0 cost to 0 7 0 D () = min{c(,) + D (), c(,) + D ()} = min{+, 7+0} = node table from cost to 0 7 node table from cost to 7 0 time Network Laer 4-
node table from node table from cost to 0 7 D () = min{c(,) + D (), c(,) + D ()} = min{+0, 7+} = cost to 0 from from 0 cost to cost to 0 7 0 0 7 0 7 0 from from cost to 0 0 0 cost to 0 0 0 D () = min{c(,) + D (), c(,) + D ()} = min{+, 7+0} = 7 node table from cost to 7 0 from cost to 0 7 0 0 from cost to 0 0 0 time Network Laer 4-
Distance vector: link cost changes link cost changes: v node detects local link cost change v updates routing info, recalculates distance vector v if DV changes, notif neighbors 4 50 good news travels fast t 0 : detects link-cost change, updates its DV, informs its neighbors. t : receives update from, updates its table, computes new least cost to, sends its neighbors its DV. t : receives s update, updates its distance table. s least costs do not change, so does not send a message to. Network Laer 4-4
Distance vector: link cost changes link cost changes: v node detects local link cost change v bad news travels slow - count to infinit problem! v 44 iterations before algorithm stabilies: see tet poisoned reverse: v 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) v will this completel solve count to infinit problem? 60 4 50 Network Laer 4-5
RIP ( Routing Information Protocol) v included in BSD-UNIX distribution in 98 v distance vector algorithm distance metric: # hops (ma = 5 hops), each link has cost DVs echanged with neighbors ever 0 sec in response message (aka advertisement) from router A to destination subnets: u A C B D v w subnet hops u v w Network Laer 4-6
RIP table processing v RIP routing tables managed b application-level process called route-d (daemon) v advertisements sent in UDP packets, periodicall repeated routed routed transport (UDP) transprt (UDP) network (IP) forwarding table forwarding table network (IP) link link phsical phsical Network Laer 4-7
Comparison of LS and DV algorithms message compleit v v LS: with n nodes, E links, O(nE) msgs sent DV: echange between neighbors onl convergence time varies speed of convergence v v LS: O(n ) algorithm requires O(nE) msgs ma have oscillations DV: convergence time varies ma be routing loops count-to-infinit problem Network Laer 4-8
Intra-AS Routing v also known as interior gatewa protocols (IGP) v most common intra-as routing protocols: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gatewa Routing Protocol (Cisco proprietar) Network Laer 4-9
Homework 4 + Qui v HW4 Chapter 4: R, R5, R0, P4, P0, P, P, P9, P, P6, P8, P7, due at :00pm, /5/0 (Monda) v Qui: 0 mins, network laer,/8/0 (Monda) Network Laer 4-0