Chapter 4 Network Layer. Network Layer 4-1

Similar documents
CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 13

Network layer. Network Layer 4-1. application transport network data link physical. network data link physical. network data link physical

CSC 401 Data and Computer Communications Networks

Chapter 4: Network Layer

Chapter 4 Network Layer

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

CSC 4900 Computer Networks: Routing Algorithms

CSCE 463/612 Networks and Distributed Processing Spring 2017

Chapter IV: Network Layer

DATA COMMUNICATOIN NETWORKING

Chapter 4: Network Layer, partb

Interplay between routing, forwarding

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 14

Chapter 4 Network Layer

Network layer: Overview. Network layer functions Routing IP Forwarding

Chapter 5 Network Layer: The Control Plane

Network Layer: Routing

CMPE 80N: Introduction to Networking and the Internet. Katia Obraczka Computer Engineering UCSC Baskin Engineering Lecture 20

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

Internet rou)ng. V. Arun CS491G: Computer Networking Lab University of MassachuseFs Amherst

5.1 introduction 5.5 The SDN control 5.2 routing protocols plane. Control Message 5.3 intra-as routing in Protocol the Internet

Subnets. IP datagram format. The Internet Network layer. IP Fragmentation and Reassembly. IP Fragmentation & Reassembly. IP Addressing: introduction

Last time. Transitioning to IPv6. Routing. Tunneling. Gateways. Graph abstraction. Link-state routing. Distance-vector routing. Dijkstra's Algorithm

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Computer Networking Introduction

Course on Computer Communication and Networks. Lecture 7 Network Layer, Chapter 4 (6/e) - Part B (7/e Ch5)

EC441 Fall 2018 Introduction to Computer Networking Chapter 5: Network Layer Control Plane

CSC 8560 Computer Networks: Control Plane

CSCE 463/612 Networks and Distributed Processing Spring 2018

Routing Algorithm Classification. A Link-State Routing Algorithm

Δίκτυα Υπολογιστών ΙΙ. Κώστας Μαγκούτης Επίκουρος Καθηγητής Τμήμα Μηχανικών Η/Υ και Πληροφορικής Πανεπιστήμιο Ιωαννίνων

Network layer functions. Chapter 4 Network Layer. Network layer functions. Network layer functions

internet technologies and standards

Module 3 Network Layer CS755! 3-1!

Computer Networks. Instructor: Niklas Carlsson

Chapter 4: Network Layer. Chapter 4 Network Layer. Chapter 4: Network Layer. Network layer. Chapter goals:

Lecture 4 The Network Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Lecture 5 The Network Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2017

CS 457 Networking and the Internet. Shortest-Path Problem. Dijkstra s Shortest-Path Algorithm 9/29/16. Fall 2016

Last time. Network layer. Introduction. Virtual circuit vs. datagram details. IP: the Internet Protocol. forwarding vs. routing

Computer Networking. Rou1ng Algorithms. Rou1ng Algorithms. Interplay between rou1ng, forwarding. routing algorithm

Internet Protocol: Routing Algorithms. Srinidhi Varadarajan

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

COSC4377. TCP vs UDP Example Statistics

Lecture 9. Network Layer (cont d) Network Layer 1-1

Chapter 4: Network Layer

Network Layer. CMPS 4750/6750: Computer Networks

CSC 4900 Computer Networks: Routing Protocols

Lecture 4 - Network Layer. Transport Layer. Outline. Introduction. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

Chapter 4: Network Layer

Network Layer: Control Plane 5-2

Lecture 4. The Network Layer (cont d)

COMP 3331/9331: Computer Networks and Applications

Agenda. distance-vector (what you invented last Friday) hierarchical routing routing in the Internet. v DNS assignment Q&A v Routing Algorithms

Router Architecture Overview

CS 3516: Advanced Computer Networks

Announcements. CS 5565 Network Architecture and Protocols. Project 2B. Project 2B. Project 2B: Under the hood. Routing Algorithms

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Chapter 4: Network Layer

Network layer: Overview. Network layer functions Routing IP Forwarding

Chapter 4: Network Layer

Department of Computer Science Southern Illinois University Carbondale

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

Summary Chapter 4. Smith College, CSC 249 March 2, q IP Addressing. q DHCP dynamic addressing

EE 122: Intra-domain routing

Network layer: Overview. Network Layer Functions

Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation:

Network Technology 1 5th - Network Layer. Mario Lombardo -

CS 3516: Advanced Computer Networks

Network Routing. Packet Routing, Routing Algorithms, Routers, Router Architecture

Lecture 8. Network Layer (cont d) Network Layer 1-1

CSC 4900 Computer Networks: Network Layer

UNIT III THE NETWORK LAYER

11/13/2017 Network Layer (SSL) Network-layer functions. Recall the two network-layer functions:

Chapter 4: Network Layer: Part II

Lecture 19: Network Layer Routing in the Internet

Announcements. CS 5565 Network Architecture and Protocols. Count-To-Infinity. Poisoned Reverse. Distance Vector: Link Cost Changes.

internet technologies and standards

Chapter 4: network layer

CMPE 80N: Introduction to Networking and the Internet

Chapter 4 Network Layer

Announcement. Project 2 extended to 2/20 midnight Project 3 available this weekend Homework 3 available today, will put it online

Master Course Computer Networks IN2097

HY 335 Φροντιστήριο 8 ο

TDTS06: computer Networks

CS118 Discussion 1A, Week 7. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

Network Layer: Routing. Routing. Routing protocol. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links

Chapter 5 Network Layer: The Control Plane

Chapter 4 Network Layer

Routing Algorithms : Fundamentals of Computer Networks Bill Nace

The Internet network layer

Chapter 4 Network Layer

Announcements. CS 5565 Network Architecture and Protocols. Project 2B. Project 2B. Project 2B: Under the hood. Routing Algorithms

EECS 3214: Computer Networks Protocols and Applications

Chapter 5 Network Layer: The Control Plane

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

Chapter 4 Network Layer

Network layer. Key Network-Layer Functions. Network service model. Interplay between routing and forwarding. CSE 4213: Computer Networks II

Transcription:

Chapter 4 Network Layer Network Layer 4-

Chapter 4: Network Layer 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 Layer 4-

NAT: Network Address Translation rest of Internet 8.76.9.7 0.0.0.4 local network (e.g., home network) 0.0.0/4 0.0.0. 0.0.0. 0.0.0. All datagrams leaving local network have same single source NAT IP address: 8.76.9.7, different source port numbers Datagrams with source or destination in this network have 0.0.0/4 address for source, destination (as usual) Network Layer 4-

NAT: Network Address Translation Motivation: local network uses just one IP address as far as outside world is concerned: range of addresses not needed from ISP: just one IP address for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not eplicitly addressable, visible by outside world (a security plus). Network Layer 4-4

NAT: Network Address Translation Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer 4-5

NAT: Network Address Translation : host 0.0.0. sends datagram to 8.9.40.86, 80 0.0.0.4 S: 0.0.0., 45 D: 8.9.40.86, 80 0.0.0. 0.0.0. 8.76.9.7 0.0.0. Network Layer 4-6

NAT: Network Address Translation : NAT router changes datagram source addr from 0.0.0., 45 to 8.76.9.7, 500, updates table NAT translation table WAN side addr LAN side addr 8.76.9.7, 500 0.0.0., 45 S: 8.76.9.7, 500 D: 8.9.40.86, 80 0.0.0.4 S: 0.0.0., 45 D: 8.9.40.86, 80 : host 0.0.0. sends datagram to 8.9.40.86, 80 0.0.0. 0.0.0. 8.76.9.7 0.0.0. Network Layer 4-7

NAT: Network Address Translation : NAT router changes datagram source addr from 0.0.0., 45 to 8.76.9.7, 500, updates table NAT translation table WAN side addr LAN side addr 8.76.9.7, 500 0.0.0., 45 S: 8.76.9.7, 500 D: 8.9.40.86, 80 0.0.0.4 S: 0.0.0., 45 D: 8.9.40.86, 80 : host 0.0.0. sends datagram to 8.9.40.86, 80 0.0.0. 0.0.0. 8.76.9.7 S: 8.9.40.86, 80 D: 8.76.9.7, 500 : Reply arrives dest. address: 8.76.9.7, 500 0.0.0. Network Layer 4-8

NAT: Network Address Translation : NAT router changes datagram source addr from 0.0.0., 45 to 8.76.9.7, 500, updates table NAT translation table WAN side addr LAN side addr 8.76.9.7, 500 0.0.0., 45 S: 8.76.9.7, 500 D: 8.9.40.86, 80 0.0.0.4 S: 0.0.0., 45 D: 8.9.40.86, 80 : host 0.0.0. sends datagram to 8.9.40.86, 80 0.0.0. 0.0.0. 8.76.9.7 S: 8.9.40.86, 80 D: 8.76.9.7, 500 : Reply arrives dest. address: 8.76.9.7, 500 S: 8.9.40.86, 80 D: 0.0.0., 45 4 4: NAT router changes datagram dest addr from 8.76.9.7, 500 to 0.0.0., 45 0.0.0. Network Layer 4-9

NAT: Network Address Translation 6-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to layer violates end-to-end argument NAT possibility must be taken into account by app designers, e.g., PP applications address shortage should instead be solved by IPv6 Network Layer 4-0

NAT traversal problem client wants to connect to server with address 0.0.0. server address 0.0.0. local to LAN (client can t use it as destination addr) only one eternally visible NATed address: 8.76.9.7 Client? 0.0.0.4 0.0.0. solution : statically configure NAT to forward incoming connection requests at given port to server e.g., (.76.9.7, port 500) always forwarded to 0.0.0. port 5000 8.76.9.7 NAT router Network Layer 4-

NAT traversal problem solution : Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to: 0.0.0. learn public IP address (8.76.9.7) add/remove port mappings (with lease times) 8.76.9.7 NAT router IGD 0.0.0.4 Network Layer 4-

Chapter 4: Network Layer 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 Layer 4-

ICMP: Internet Control Message Protocol used by hosts & routers to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 0 dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable 6 dest network unknown 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 0 0 router discovery 0 TTL epired 0 bad IP header Network Layer 4-4

Traceroute and ICMP Source sends series of UDP segments to dest first has TTL = second has TTL=, etc. unlikely port number When nth datagram arrives to nth router: router discards datagram and sends to source an ICMP message (type, code 0) ICMP message includes name of router & IP address when ICMP message arrives, source calculates RTT traceroute does this times Stopping criterion UDP segment eventually arrives at destination host destination returns ICMP port unreachable packet (type, code ) when source gets this ICMP, stops. Network Layer 4-5

Chapter 4: Network Layer 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 Layer 4-6

IPv6 Initial motivation: -bit address space soon to be completely allocated. Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS IPv6 datagram format: fied-length 40 byte header no fragmentation allowed Network Layer 4-7

IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same flow. (concept of flow not well defined). Net header: identify upper layer protocol for data ver pri flow label payload len net hdr hop limit source address (8 bits) destination address (8 bits) data bits Network Layer 4-8

Other Changes from IPv4 Checksum: removed entirely to reduce processing time at each hop Options: allowed, but outside of header, indicated by Net Header field ICMPv6: new version of ICMP additional message types, e.g. Packet Too Big multicast group management functions Network Layer 4-9

Transition From IPv4 To IPv6 Not all routers can be upgraded simultaneous no flag days How will the network operate with mied IPv4 and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Network Layer 4-0

Tunneling Logical view: A B E F tunnel IPv6 IPv6 IPv6 IPv6 Physical view: A B E F IPv6 IPv6 IPv6 IPv6 IPv4 IPv4 Network Layer 4-

Tunneling Logical view: A B E F tunnel IPv6 IPv6 IPv6 IPv6 Physical view: A B C D E F IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F Src:B Dest: E Flow: X Src: A Dest: F Flow: X Src: A Dest: F data data data A-to-B: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 E-to-F: IPv6 Network Layer 4-

Chapter 4: Network Layer 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 Layer 4-

Interplay between routing, forwarding routing algorithm local forwarding table header value output link 000 00 0 00 value in arriving packet s header 0 Network Layer 4-4

Graph abstraction 5 Graph: G = (N,E) u v w y 5 z N = set of routers = { u, v, w,, y, z } E = set of links ={ (u,v), (u,), (v,), (v,w), (,w), (,y), (w,y), (w,z), (y,z) } Remark: Graph abstraction is useful in other network contets Eample: PP, where N is set of peers and E is set of TCP connections Network Layer 4-5

Graph abstraction: costs 5 c(, ) = cost of link (, ) u v w y 5 z - e.g., c(w,z) = 5 cost could always be, or inversely related to bandwidth, or inversely related to congestion Cost of path (,,,, p ) = c(, ) + c(, ) + + c( p-, p ) Question: What s the least-cost path between u and z? Routing algorithm: algorithm that finds least-cost path Network Layer 4-6

Routing Algorithm classification Global or decentralized information? Global: all routers have complete topology, link cost info link state algorithms Decentralized: router knows physicallyconnected neighbors, link costs to neighbors iterative process of computation, echange of info with neighbors distance vector algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes Network Layer 4-7

Chapter 4: Network Layer 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 Layer 4-8

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(,y): link cost from node 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 Network Layer 4-9

Dijsktra s Algorithm Initialization: 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 Layer 4-0

Dijkstra s algorithm: eample Step 0 N' u D(v) p(v) D(w) p(w) D() p() 7,u,u 5,u D(y) p(y) D(z) p(z) 5 9 5 4 7 Step0 u w 8 y z 7 4 7 v Network Layer 4-

Dijkstra s algorithm: eample Step 0 N' u uw D(v) p(v) D(w) p(w) D() p() 7,u,u 5,u 6,w 5,u D(y) p(y),w D(z) p(z) 5 7 9 u 5 Step w v 4 8 7 7 4 6 7 y z Network Layer 4-

Dijkstra s algorithm: eample Step 0 N' u uw uw D(v) p(v) D(w) p(w) D() p() 7,u,u 5,u 6,w 5,u 6,w D(y) p(y),w,w D(z) p(z) 4, Step 5 9 u 5 w v 4 8 7 7 4 6 y z Network Layer 4-4

Dijkstra s algorithm: eample Step 0 N' D(v) p(v) D(w) p(w) D() p() D(y) p(y) D(z) p(z) u 7,u,u 5,u uw 6,w 5,u,w uw uwv 6,w,w 4, 4, 0,v 5 9 u 5 w v 4 8 7 7 4 6 Step y 0 z Network Layer 4-4 4

Dijkstra s algorithm: eample Step 0 4 N' D(v) p(v) D(w) p(w) D() p() D(y) p(y) D(z) p(z) u 7,u,u 5,u uw 6,w 5,u,w uw 6,w,w 4, uwv 0,v 4, uwvy,y 5 9 u 5 w v 4 8 7 7 4 6 y 0 4 z Network Layer 4-5

Dijkstra s algorithm: eample Step 0 4 5 N' D(v) p(v) D(w) p(w) D() p() D(y) p(y) D(z) p(z) u 7,u,u 5,u uw 6,w 5,u,w uw 6,w,w 4, uwv 0,v 4, uwvy,y uwvyz 9 Notes: construct shortest path tree by tracing predecessor nodes ties can eist (can be broken arbitrarily) u 5 w v 4 8 7 7 4 y z Network Layer 4-6

Network Layer 4-7 Dijkstra s algorithm: another eample Step 0 4 5 N' u u uy uyv uyvw uyvwz D(v),p(v),u,u,u D(w),p(w) 5,u 4,,y,y D(),p(),u D(y),p(y), D(z),p(z) 4,y 4,y 4,y u y w v z 5 5

Dijkstra s algorithm: eample () Resulting shortest-path tree from u: v w u z y Resulting forwarding table in u: destination v y w z link (u,v) (u,) (u,) (u,) (u,) Network Layer 4-8

Dijkstra s algorithm, discussion Algorithm compleity: n nodes each iteration: need to check all nodes, w, not in N n(n+)/ comparisons: O(n ) more efficient implementations possible: O(nlogn) Oscillations possible: e.g., link cost = amount of carried traffic D A +e 0 0 0 e C initially B e D A +e 0 0 +e C 0 B recompute routing D A 0 +e 0 0 +e C B recompute D A +e 0 0 +e C e recompute B Network Layer 4-9

Chapter 4: Network Layer 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 Layer 4-40

Distance Vector Algorithm Based on Bellman-Ford equation Define d (y) := cost of least-cost path from to y c(,y) := cost of direct link from to y Then, d (y) = min {c(,v) + d v (y) } where min is taken over all neighbors v of Network Layer 4-4

Bellman-Ford eample 5 Consider a path from u to z Clearly, d v (z) = 5, d (z) =, d w (z) = u v w y 5 z B-F equation says: d u (z) = min { c(u,v) + d v (z), c(u,) + d (z), c(u,w) + d w (z) } = min { + 5, +, 5 + } = 4 Network Layer 4-4

Distance Vector Algorithm D (y) = estimate of least cost from to y maintains distance vector D = [D (y): y є N ] node : knows cost to each neighbor v: c(,v) maintains its neighbors distance vectors. For each neighbor v, maintains D v = [D v (y): y є N ] Network Layer 4-4

Distance vector algorithm (4) Basic idea: Every node v keeps vector (DV) of least costs to other nodes These are estimates, D(y) from time-to-time, each node sends its own distance vector estimate to neighbors when receives new DV estimate from neighbor, it updates its own DV using B-F equation: D (y) min v {c(,v) + D v (y)} for each node y N under minor, natural conditions, the estimate D (y) converge to the actual least cost d (y) Network Layer 4-44

Distance Vector Algorithm (5) 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 Each node: wait for (change in local link cost or msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Network Layer 4-45

node table cost to y z 0 7 y z node y table cost to y z from y 0 z node z table cost to y z from Step : Initialization Initialize costs of direct links Set to costs from neighbours y 7 z from y z 7 0 time Network Layer 4-46

D (y) = min{c(,y) + D y (y), c(,z) + D z (y)} = min{+0, 7+} = node table cost to cost to y z y z 0 7 y z node y table cost to y z from y 0 z node z table cost to y z from from y z 7 0 from y z 0 0 7 0 Step : Echange DV and iterate -In first iteration, node saves neighbours DVs -Then, it checks path costs to all nodes using received DVs -E.g. new cost D(z) is obtained by adding costs marked red time D (z) = min{c(,y) + D y (z), c(,z) + D z (z)} = min{+, 7+0} = y 7 z Network Layer 4-47

node table cost to y z 0 7 y z node y table cost to y z from y 0 z node z table cost to y z from from y z 7 0 from from from y z y z y z cost to y z 0 0 7 0 cost to y z 0 7 0 7 0 cost to y z 0 7 0 0 from from from y z y z y z cost to y z 0 0 0 cost to y z 0 0 0 cost to y z 0 0 0 time y 7 z Network Layer 4-48

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 4 y 50 z Network Layer 4-49

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 4 y 50 z t 0 : y detects link-cost change, updates its DV, informs its neighbors. Network Layer 4-50

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 4 y 50 z t 0 : y detects link-cost change, updates its DV, informs its neighbors. t : z receives update from y, updates its table, computes new least cost to, sends its neighbors its DV. Network Layer 4-5

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 4 y 50 z t 0 : y detects link-cost change, updates its DV, informs its neighbors. t : z receives update from y, updates its table, computes new least cost to, sends its neighbors its DV. t : 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. Network Layer 4-5

Distance Vector: link cost changes Link cost changes: good news travels fast bad news travels slow - count to infinity problem! 44 iterations before algorithm stabilizes: see tet 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? 60 4 y 50 t 0 : As a result of poisoned reverse y s table indicates D z () = and D y () = 60. t : after receiving updates at t z shifts its route to via the direct (z,) link at a cost of 50, D z () = 50. t : z informs y that D z () = 50, and y updates D y () = 5. t : y informs its neighbors, but no update. z Network Layer 4-5

Comparison of LS and DV algorithms Message compleity LS: with n nodes, E links, O(nE) msgs sent DV: echange between neighbors only convergence time varies Speed of Convergence LS: O(n ) 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: 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 thru network Network Layer 4-54

Chapter 4: Network Layer 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 Layer 4-55

Hierarchical Routing Our routing study thus far - idealization all routers identical network flat not true in practice scale: with 00 million destinations: can t store all dest s in routing tables! routing table echange would swamp links! administrative autonomy internet = network of networks each network admin may want to control routing in its own network Network Layer 4-56

Hierarchical Routing aggregate routers into regions, autonomous systems (AS) 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 Network Layer 4-57

Interconnected ASes c a b AS a c d b Intra-AS Routing algorithm AS Forwarding table Inter-AS Routing algorithm a c AS b forwarding table configured by both intra- and inter-as routing algorithm intra-as sets entries for internal dests inter-as & intra-as sets entries for eternal dests Network Layer 4-58

Inter-AS tasks suppose router in AS receives datagram destined outside of AS: router should forward packet to gateway router, but which one? AS must:. learn which dests are reachable through AS, which through AS. propagate this reachability info to all routers in AS job of inter-as routing! c other networks b a AS a AS c d b a c AS b other networks Network Layer 4-59

Eample: Setting forwarding table in router d suppose AS learns (via inter-as protocol) that subnet reachable via AS (gateway c) but not via AS. inter-as protocol propagates reachability info to all internal routers router d determines from intra-as routing info that its interface I is on the least cost path to c. installs forwarding table entry (,I) other networks c a b AS a AS c d b a c AS b other networks Network Layer 4-60

Eample: Choosing among multiple ASes now suppose AS learns from inter-as protocol that subnet is reachable from AS and from AS. to configure forwarding table, router d must determine which gateway it should forward packets towards for dest this is also job of inter-as routing protocol! other networks c a b AS a AS c d? b a c AS b other networks Network Layer 4-6

Eample: Choosing among multiple ASes now suppose AS learns from inter-as protocol that subnet is reachable from AS and from AS. to configure forwarding table, router d must determine towards which gateway it should forward packets for dest. this is also job of inter-as routing protocol! hot potato routing: send packet towards closest of two routers. Learn from inter-as protocol that subnet 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 (,I) in forwarding table Network Layer 4-6