Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you see the animations; and can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:  If you use these slides (e.g., in a class) that you mention their source (after all, we’d like people to use our book!)  If you post any slides on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved Network Layer 4-1

2 Network Layer 4-2 Chapter 4: network layer chapter goals:  understand principles behind network layer services:  forwarding versus routing  how a router works  routing (path selection)  instantiation, implementation in the Internet

3 Network Layer 4-3 4.1 introduction 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 routing algorithms  link state  distance vector  hierarchical routing 4.6 routing in the Internet  RIP  OSPF  BGP 4.7 broadcast and multicast routing Chapter 4: outline

4 Network Layer 4-4 Two key network-layer functions  forwarding: The process of moving packets from input to output based on: 1.The forwarding table 2.Information in the packet  routing: Process by which the forwarding table is built and maintained. 1.One or more routing protocols 2.Algorithms to convert routing info to forwarding tables

5 Network Layer 4-5 Example Routing Table Image coutesy of http://www.hill2dot0.com/wiki/index.php?title=Routing_table

6 Network Layer 4-6 4.1 introduction 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 routing algorithms  link state  distance vector  hierarchical routing 4.6 routing in the Internet  RIP  OSPF  BGP 4.7 broadcast and multicast routing Chapter 4: outline

7 Network Layer 4-7 Router architecture overview two key router functions:  run routing algorithms/protocol (RIP, OSPF, BGP)  forwarding datagrams from incoming to outgoing link high-seed switching fabric routing processor router input ports router output ports forwarding data plane (hardware) routing, management control plane (software) forwarding tables computed, pushed to input ports

8 Network Layer 4-8 4.1 introduction 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 routing algorithms  link state  distance vector  hierarchical routing 4.6 routing in the Internet  RIP  OSPF  BGP 4.7 broadcast and multicast routing Chapter 4: outline

9 Network Layer 4-9 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 forwarding table for that node  iterative: after k iterations, know least cost path to k dest.’s 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

10 Network Layer 4-10 Dijkstra’s algorithm: building a forwarding table (1) Step 0 1 2 3 4 5 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 2 2 1 3 1 1 2 5 3 5

11 Network Layer 4-11 Dijkstra’s algorithm: building a forwarding table (2) 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:

12 Link-State Walkthrough (1) 1. Each router sends a “Router Discovery (ICMP)” message to 224.0.0.2. (“All Routers” multicast address) 2. Each router makes a list of its adjacent neighbors. 3. Each router sends its list of adjacent neighbors to ALL other routers in the AS, using 224.0.0.9 (RIP address) 4. Each router builds a complete map of the network. 5. Each router uses Dykstra’s to build forwarding table. 6. Repeat every 30 seconds. Network Layer 4-12

13 Link-State Walkthrough (2) (Step 1) From: 10.10.1.1 To: 224.0.0.2 Data: What routers can hear this request? (Do not forward.) (Step 2) From: 10.10.1.3 To: 10.10.1.1 Data: I am a router From: 10.10.1.5 To: 10.10.1.1 Data: I am a router Network Layer 4-13

14 Link-State Walkthrough (3) (Step 3) From: 10.10.1.1 To: 224.0.0.9 Data: These routers are adjacent to me. (Please forward.) Origin: 10.10.1.1Neighbors (10.10.1.3, 10.10.1.5) Each router receives the complete collection of messages sent by all routers: Origin: 10.10.1.1Neighbors (10.10.1.3, 10.10.1.5) Origin: 10.10.1.3Neighbors (10.10.1.1, 10.10.1.5, 10.10.1.7) Origin: 10.10.1.5Neighbors (10.10.1.1, 10.10.1.3, 10.10.1.9) Origin: 10.10.1.7Neighbors (10.10.1.3, 10.10.1.9) Origin: 10.10.1.9Neighbors (10.10.1.5, 10.10.1.7) (Step 4) Exercise – Draw the network map yourself Network Layer 4-14

15 Link-State Walkthrough (4) (Step 4) Solution: (Step 5) Each router has the complete network map, can construct complementary forwarding tables. Network Layer 4-15 10.10.1.1 10.10.1.3 10.10.1.5 10.10.1.7 10.10.1.9

16 Link-State Walkthrough (4) (Step 6) If a network link goes down, each router will know after 30 seconds when the next update gets sent. Network Layer 4-16 10.10.1.1 10.10.1.3 10.10.1.5 10.10.1.7 10.10.1.9

17 Link-State Questions  Is this practical on the Internet backbone?  Q1: Is it scalable to large numbers of routers?  Q2: Is cost always a function of hop-count or time?  Q2: Do all router owners have the same incentives? Network Layer 4-17

18 Network Layer 4-18 4.1 introduction 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 routing algorithms  link state  distance vector  hierarchical routing 4.6 routing in the Internet  RIP  OSPF  BGP 4.7 broadcast and multicast routing Chapter 4: outline

19 Network Layer 4-19 Distance vector algorithm Bellman-Ford equation (dynamic programming) let d x (y) := cost of least-cost path from x to y then d x (y) = min {c(x,v) + d v (y) } v cost to neighbor v min taken over all neighbors v of x cost from neighbor v to destination y

20 Network Layer 4-20 Distance vector: link cost changes link cost changes:  node detects local link cost change  updates routing info, recalculates distance vector  if DV changes, notify neighbors “good news travels fast” x z 1 4 50 y 1 t 0 : y detects link-cost change, updates its DV, informs its neighbors. t 1 : z receives update from y, updates its table, computes new least cost to x, sends its neighbors its DV. t 2 : y receives z’s update, updates its distance table. y’s least costs do not change, so y does not send a message to z.

21 Distance-Vector Walkthrough (1) 1. Each router sends an “Open Shortest Path First (OSPF)” Hello message to 224.0.0.5. (OSPF multicast address) 2. Each router finds direct cost to its adjacent neighbors 3. Each router updates its estimated cost to all known routers 4. Each router collates its complete list of forwarding costs to all known routers and then mails the list to its adjacent neighbors only (no forwarding). 5. Repeat every 30 seconds. Network Layer 4-21

22 Distance-Vector Walkthrough (2) *** Assume that 10.10.1.1 is entering an established network *** (Step 1) From: 10.10.1.1 To: 224.0.0.5 Data: What routers can hear this request? (Do not forward.) (Step 2) From: 10.10.1.3 To: 10.10.1.1 Data: I am a router, COST==5 From: 10.10.1.5 To: 10.10.1.1 Data: I am a router, COST==3 Network Layer 4-22

23 Distance-Vector Walkthrough(3) (Step 3) Build forwarding table: (Step 4) From: 10.10.1.1 To: 224.0.0.5 Data: These are all of my known routes. (Do not forward.) 10.10.1.1 -> 10.10.1.3 (cost 5) 10.10.1.1 -> 10.10.1.5 (cost 3) Network Layer 4-23 DestinationCostNIC 10.10.1.35A 10.10.1.53B

24 Distance-Vector Walkthrough(4) (Step 4 cont) Messages received from the group of routers: From 10.10.1.3Known routes: 10.10.1.3 -> 10.10.1.1 (cost 5) 10.10.1.3 -> 10.10.1.5 (cost 1) 10.10.1.3 -> 10.10.1.7 (cost 2) 10.10.1.3 -> 10.10.1.9 (cost 4) From 10.10.1.5Known routes: 10.10.1.5 -> 10.10.1.1 (cost 3) 10.10.1.5 -> 10.10.1.3 (cost 1) 10.10.1.5 -> 10.10.1.7 (cost 3) 10.10.1.5 -> 10.10.1.9 (cost 5) Network Layer 4-24

25 Distance-Vector Walkthrough(5) *** SECOND ROUND *** (Step 3) Build your new forwarding table yourself as an exercise: Network Layer 4-25 DestinationCostNIC 10.10.1.3 10.10.1.5 10.10.1.7 10.10.1.9 Neighbors: NIC A: 10.10.1.3 (cost 5) NIC B: 10.10.1.5 (cost 3) From 10.10.1.3Known routes: 10.10.1.3 -> 10.10.1.1 (cost 5) 10.10.1.3 -> 10.10.1.5 (cost 1) 10.10.1.3 -> 10.10.1.7 (cost 2) 10.10.1.3 -> 10.10.1.9 (cost 4) From 10.10.1.5Known routes: 10.10.1.5 -> 10.10.1.1 (cost 3) 10.10.1.5 -> 10.10.1.3 (cost 1) 10.10.1.5 -> 10.10.1.7 (cost 3) 10.10.1.5 -> 10.10.1.9 (cost 5 )

26 Distance-Vector Walkthrough(6) *** SECOND ROUND *** (Step 3) ANSWERS: Network Layer 4-26 DestinationCostNIC 10.10.1.34B 10.10.1.53B 10.10.1.76B 10.10.1.98B Neighbors: NIC A: 10.10.1.3 (cost 5) NIC B: 10.10.1.5 (cost 3) From 10.10.1.3Known routes: 10.10.1.3 -> 10.10.1.1 (cost 5) 10.10.1.3 -> 10.10.1.5 (cost 1) 10.10.1.3 -> 10.10.1.7 (cost 2) 10.10.1.3 -> 10.10.1.9 (cost 4) From 10.10.1.5Known routes: 10.10.1.5 -> 10.10.1.1 (cost 3) 10.10.1.5 -> 10.10.1.3 (cost 1) 10.10.1.5 -> 10.10.1.7 (cost 3) 10.10.1.5 -> 10.10.1.9 (cost 5 ) Q: Is it possible to draw the network topology from this information?

27 Distance-Vector Walkthrough(7) Network Layer 4-27 10.10.1.1 10.10.1.3 10.10.1.5 10.10.1.7 10.10.1.9 5 3 1 2 2 10 A: No. This is a drawing of the actual network with costs. You cannot reproduce this from what you know.

28 Distance-Vector Walkthrough(8) Network Layer 4-28 10.10.1.1 10.10.1.3 10.10.1.5 10.10.1.7 10.10.1.9 5 3 1 2 4 5 You can produce a map that looks like this It shows the cost to each node from your neighbors The map has a max of two edges from you to any other node 3

29 Network Layer 4-29 Comparison of LS and DV algorithms message complexity  LS: with n nodes, E links, O(nE) msgs sent  DV: exchange between neighbors only  convergence time varies 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 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

30 Network Layer 4-30 “autonomous systems” (AS)  aggregate routers into regions  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:  at “edge” of its own AS  has link to router in another AS Hierarchical routing

31 Network Layer 4-31 4.1 introduction 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 routing algorithms  link state  distance vector  hierarchical routing 4.6 routing in the Internet  RIP  OSPF  BGP 4.7 broadcast and multicast routing Chapter 4: outline

32 Network Layer 4-32 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

33 Network Layer 4-33 RIP (Routing Information Protocol)  included in BSD-UNIX distribution in 1982  distance vector algorithm  distance metric: # hops (max = 15 hops), each link has cost 1  DVs exchanged with neighbors every 30 sec in response message (aka advertisement)  each advertisement: list of up to 25 destination subnets (in IP addressing sense) D C BA u v w x y z subnet hops u 1 v 2 w 2 x 3 y 3 z 2 from router A to destination subnets:

34 Network Layer 4-34 RIP: link failure, recovery 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)  link failure info quickly (?) propagates to entire net  poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

35 Network Layer 4-35 OSPF (Open Shortest Path First)  “open”: publicly available  uses link state & distance vector algorithms  LS packet dissemination  topology map at each node  route computation using Dijkstra’s algorithm  OSPF advertisement carries one entry per neighbor  advertisements flooded to entire AS  carried in OSPF messages directly over IP (rather than TCP or UDP  IS-IS routing protocol: nearly identical to OSPF

36 Network Layer 4-36 Hierarchical OSPF boundary router backbone router area 1 area 2 area 3 backbone area border routers internal routers

37 Network Layer 4-37 Summary of Protocols ProtocolType of routing (LS/DV/Other) Common Usage RIPLSLower-tier ISPs and enterprise networks OSPFLS & DVUpper-tier ISPs Hierarchical LS for smaller ASs DV for collections of ASs BGPDV & Policy

38 Network Layer 4-38 Internet inter-AS routing: BGP  BGP (Border Gateway Protocol): the de facto inter-domain routing protocol  “glue that holds the Internet together”  BGP provides each AS a means to:  eBGP: obtain subnet reachability information from neighboring ASs.  iBGP: propagate reachability information to all AS- internal routers.  determine “good” routes to other networks based on reachability information and policy.  allows subnet to advertise its existence to rest of Internet: “I am here”

39 Network Layer 4-39 BGP basics  when AS3 advertises a prefix to AS1:  AS3 promises it will forward datagrams towards that prefix  AS3 can aggregate prefixes in its advertisement AS3 AS2 3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks  BGP session: two BGP routers (“peers”) exchange BGP messages:  advertising paths to different destination network prefixes (“path vector” protocol)  exchanged over semi-permanent TCP connections BGP message

40 Network Layer 4-40 BGP basics: distributing path information AS3 AS2 3b 3a AS1 1c 1a 1d 1b 2a 2c 2b other networks other networks  using eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1.  1c can then use iBGP do distribute new prefix info to all routers in AS1  1b can then re-advertise new reachability info to AS2 over 1b-to- 2a eBGP session  when router learns of new prefix, it creates entry for prefix in its forwarding table. eBGP session iBGP session 3c

41 Network Layer 4-41 BGP routing policy  A,B,C are provider networks  X,W,Y are customer (of provider networks)  X is dual-homed: attached to two networks  X does not want to route from B via X to C .. so X will not advertise to B a route to C A B C W X Y legend : customer network: provider network

42 Network Layer 4-42 BGP routing policy (2)  A advertises path AW to B  B advertises path BAW to X  Should B advertise path BAW to C?  No way! B gets no “revenue” for routing CBAW since 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! A B C W X Y legend : customer network: provider network

43 Network Layer 4-43 Why different Intra-, Inter-AS routing ? 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 scale:  hierarchical routing saves table size, reduced update traffic performance:  intra-AS: can focus on performance  inter-AS: policy may dominate over performance


Download ppt "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."

Similar presentations


Ads by Google