Lecture 4 The Network Layer (cont d)
Agenda Routing Tables Unicast and Multicast Routing Protocols Routing Algorithms Link State and Distance Vector Routing Information and Open Shortest Path First Protocols Network Layer 4-2
Traffic at Current Internet Network Layer 4-3
Routing Tables A host or a router has a routing table with an entry for each destination, or a combination of destinations Routing tables: static (updated manually) or dynamic (updated automatically periodically) Routing methods Next-Hop Method vs. Route Method Network Layer 4-4
Routing Tables Routing methods Network-Specific Method vs. Host-Specific Method Network Layer 4-5
Interplay between Routing Algorithms and Forwarding Tables routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 the job of routing algorithm is to determine good paths from senders to receivers, through a network of routers Typically, a good path is one that has the least cost value in arriving packet s header 0111 3 2 1 Network Layer 4-6
Routing Protocols Routing protocols have been created in response to the demand for dynamic routing tables A routing protocol is a combination of rules and procedures that lets routers in the Internet inform each other of routing changes share whatever they know about the Internet or their neighborhood Unicast Routing Protocols Forwarding data packets from a source to a destination on a network Multicast Routing Protocols Forwarding data packets from a source to multiple destinations Network Layer 4-7
Intradomain and Interdomain Routing An autonomous system (AS) is a group of networks and routers under the authority of a single administration Routing inside an autonomous system is referred to as intradomain routing Routing between autonomous systems is referred to as interdomain routing Network Layer 4-8
Routing Protocols Network Layer 4-9
Routing Problem Formulation (Graph abstraction) Link cost Graph: G = (N,E) u 1 2 5 v 2 x 3 1 3 w y 1 5 2 z Link s cost may reflect: - Link s physical length - The link speed - The monetary cost associated with a link 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) } Network Layer 4-10
Graph abstraction: costs 5 u 1 2 v x 2 3 1 3 w y 1 5 2 z c(u,z) = cost of link (u,z) = cost of link (z,u) e.g., c(w,z) = c(z,w) = 5 Cost of path (u, v, x,, z) = c(u,v) + c(v,x) + + c(y,z) Routing algorithm: an algorithm that finds least-cost path Question: What s the least-cost (or shortest) path between u and z? Note: a shortest routing path is a source-destination path with the smallest number of links or hops Network Layer 4-11
Routing Algorithm Classification Global or Decentralized Information Global: all routers have complete topology, link cost info e.g. link state algorithms Decentralized: router knows physicallyconnected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors e.g. distance vector algorithms Static or Dynamic Static: routes change slowly over time Dynamic: Suitable for proactive routing protocols. (What about ad hoc networks with routing type?) Updates might not be required routes change more quickly periodic update in response to link cost changes suitable for reactive routing 4-12
A Link-State Routing Algorithm net topology and link costs known to all nodes (global info.) accomplished via link state broadcast all nodes have same info Example: Open short path first (OSPF) routing protocol uses link-state routing algorithm such as Dijkstra s algorithm Dijkstra s algorithm computes least cost paths from one node ( source ) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k destinations Algorithm complexity: n nodes n(n-1)/2 comparisons: O(n 2 ) polynomial complexity more efficient implementations possible: O(nlog(n)) Network Layer 4-13
Network Layer 4-14 Dijkstra s algorithm: example Step 0 1 2 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) 2,x D(z),p(z) 4,y 4,y 4,y u y x w v z 2 2 1 3 1 1 2 5 3 5
Distance Vector Algorithm Iterative, asynchronous, and distributed algorithm Distributed: node receives some information from one or more of its directly attached neighbors (decentralized information) Iterative: route discovery process continues on until no more information is exchanged between neighbors Asynchronous: does not require all of the nodes to operate in lockstep with each other From time-to-time, each node sends its own distance vector estimate to neighbors (e.g., may be at having link cost updates) Bellman-Ford algorithm in Routing Information protocol (RIP) Define d x (y) := cost of least-cost path from x to y Then: d x (y) = min {c(x,v) + d v (y) } v where min is taken over all neighbors v of x
Comparison of Link State (LS) and Distance Vector (DV) Algorithms Message complexity LS: with n nodes, E links, O(nE) messages sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n 2 ) algorithm requires O(nE) messages may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem (e.g., Bellman Ford algorithm does not prevent routing loops) Robustness: what happens if router malfunctions? LS: DV: node can advertise incorrect link cost each node computes only its own table DV node can advertise incorrect path cost each node s table used by others error propagate through network Network Layer 4-16
RIP ( Routing Information Protocol) Distance vector algorithm included in Berkeley Software Distribution (BSD)- UNIX Distribution in 1982 distance metric: # of hops (max = 15 hops) From router A to subnets: z u A C B D v y w x destination hops u 1 v 2 w 2 x 3 y 3 z 2 Network Layer 4-17
RIP advertisements distance vectors: exchanged among neighbors every 30 sec via RIP Response Message (also called advertisement) each advertisement: contains a list of up to 25 destination subnets within AS as well as the sender s distance to each of those subnets If no advertisement heard after 180 sec --> neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) Network Layer 4-18
RIP: Example z w x y A D B C Routing/Forwarding Table in Router D Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x -- 1..... Network Layer 4-19
RIP: Example Dest Next hops w - 1 x - 1 z C 4.... Advertisement from A to D w x y A D B z C Routing/Forwarding table in router D Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1..... Network Layer 4-20
OSPF (Open Shortest Path First) Link State algorithm LS packet dissemination (router floods routing information to all routers) topology map at each node route computation using Dijkstra s algorithm router broadcasts link state information whenever there is a change in a link s state (also broadcasts a link s state periodically) typically deployed in upper-tier ISPs while RIP deployed in lower-tier ISPs and enterprise networks OSPF advertisement carries one entry per neighbor router advertisements disseminated to entire AS (via flooding) carried in OSPF messages directly over IP Network Layer 4-21
OSPF advanced features (not in RIP) Security all OSPF messages authenticated (to prevent malicious intrusion) Using authentication algorithms Multiple same-cost paths multiple same-cost paths allowed (only one path in RIP) Integrated support for unicast and multicast routing Multicast OSPF (MOSPF) uses the existing OSPF link database and adds a new type of link-state advertisement to the existing OSPF link-state broadcast mechanism Support for hierarchy within a single routing domain An OSPF autonomous system can be configured hierarchically into areas Network Layer 4-22
Internet Inter-AS routing: BGP BGP (Border Gateway Protocol) BGP provides each AS means to: 1. Obtain subnet reachability information from neighboring ASs. 2. Propagate reachability information to all ASinternal routers. 3. Determine good routes to subnets based on reachability information and policy. BGP allows subnet to advertise its existence to rest of Internet: I am here Network Layer 4-23
BGP basics pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions exterior BGP session interior BGP session 3c 3a 3b AS3 1a AS1 1c 1d 1b 2a 2c AS2 2b Network Layer 4-24
Broadcast Routing deliver packets from source to all other nodes source duplication is inefficient duplicate R1 duplicate creation/transmission R1 R2 R2 duplicate R3 R4 R3 R4 source duplication in-network duplication Network Layer 4-25
In-network duplication flooding: when node receives broadcast packet, sends copy to all neighbors (redundant packets and heavy traffic) Solutions controlled flooding: node only broadcasts packet if it hasn t sent same packet before spanning tree no redundant packets received by any node each node sends unicast join message to center node Network Layer 4-26
Multicast Routing Goal: find a tree (or trees) connecting routers having local multicast group members tree: not all paths between routers used source-based: different tree from each sender to receivers shared-tree: same tree used by all group members Shared tree Source-based trees
Lecture Summary Covered material The Network Layer (cont d) Routing Tables Unicast and Multicast Routing Protocols Routing Algorithms Link State and Distance Vector Routing Information and Open Shortest Path First Protocols Material to be covered next lecture Introduction to the Transport Layer Network Layer 4-28