Module 3 Network Layer CS755! 3-1!

Similar documents
Chapter 4: Network Layer, partb

Chapter 4 Network Layer

Chapter 4: Network Layer

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

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

Chapter 5 Network Layer: The Control Plane

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

internet technologies and standards

Chapter 4 Network Layer

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

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

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

Chapter 4: network layer

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

Chapter 4. Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, sl April 2009.

Chapter 4 Network Layer. Network Layer 4-1

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

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Chapter IV: Network Layer

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

Department of Computer Science Southern Illinois University Carbondale

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

UNIT III THE NETWORK LAYER

CSC 4900 Computer Networks: Routing Algorithms

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

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

Chapter 4: outline. Network Layer 4-1

Chapter 4: Network Layer. Lecture 12 Internet Routing Protocols. Chapter goals: understand principles behind network layer services:

TDTS06: computer Networks

CSCE 463/612 Networks and Distributed Processing Spring 2017

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

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

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

CSC 4900 Computer Networks: Routing Protocols

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

Lecture 4. The Network Layer (cont d)

internet technologies and standards

DATA COMMUNICATOIN NETWORKING

CSC 8560 Computer Networks: Control Plane

Data Communication & Networks G Session 7 - Main Theme Networks: Part I Circuit Switching, Packet Switching, The Network Layer

Hierarchical Routing. Our routing study thus far - idealization all routers identical network flat not true in practice

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

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

Chapter 4: Network Layer

Network Layer. CMPS 4750/6750: Computer Networks

Network layer: Overview. Network layer functions Routing IP Forwarding

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

DATA COMMUNICATOIN NETWORKING

Master Course Computer Networks IN2097

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

EECS 3214: Computer Networks Protocols and Applications

CSCE 463/612 Networks and Distributed Processing Spring 2018

Network layer: Overview. Network layer functions Routing IP Forwarding

Lecture 19: Network Layer Routing in the Internet

Router Architecture Overview

CSCD 330 Network Programming Spring 2018

Chapter 4 Network Layer

CSCD 330 Network Programming Spring 2017

Chapter 4 Network Layer

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

Chapter 4 Network Layer

Chapter 4 Network Layer

CS555, Spring /5/2005. April 12, 2005 No classes attend Senior Design Projects conference. Chapter 4 roadmap. Internet AS Hierarchy

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

CSC 401 Data and Computer Communications Networks

Chapter 4 Network Layer

Last time. Wireless link-layer. Introduction. Characteristics of wireless links wireless LANs networking. Cellular Internet access

CSCI Topics: Internet Programming Fall 2008

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

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

Chapter 4: network layer

Chapter 4 Network Layer

Chapter 4 Network Layer

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

Chapter 4: Network Layer

CS 43: Computer Networks Internet Routing. Kevin Webb Swarthmore College November 14, 2013

Chapter 4 Network Layer. Chapter 4: Network Layer. Chapter 4: Network Layer. Chapter goals: understand principles behind network layer services:

COMPUTER NETWORKS CHAP 4 : NETWORK LAYER

CS 43: Computer Networks Internet Routing. Kevin Webb Swarthmore College November 16, 2017

Topics for This Week

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

Chapter 4 Network Layer

Chapter 4: Network Layer. Chapter 4: Network Layer

Chapter 4 Network Layer

Chapter 4 Network Layer

CS 43: Computer Networks. 24: Internet Routing November 19, 2018

COMP211 Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer

Inter-AS routing. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley

Chapter 4 Network Layer

CMPT 371: Data Communications and Networking. Chapter 4: Network Layer

All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Computer Networking Introduction

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer

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

Chapter 4 Network Layer

Chapter 4 Network Layer

Chapter 4 Network Layer

Chapter 4 Network Layer

Transcription:

Module 3 Network Layer CS755 3-1

Please note: Most of these slides come from this book. Note their copyright notice below 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 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: v If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we d like people to use our book) v If you post any slides in substantially unaltered form 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-2010 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach " 5 th edition. " Jim Kurose, Keith Ross" Addison-Wesley, April 2009. " CS755 3-2

Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on receiving side, delivers segments to transport layer network layer protocols in every host, router router examines header fields in all IP datagrams passing through it application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical CS755 3-3

Network Layer is Host-to-Host client server application application transport transport network network network network link link link link physical physical physical physical router router CS755 3-4

Internet Protocols Application FTP Telnet NFS SMTP HTTP Transport TCP UDP Segment Network IP Datagram Data Link Physical X.25 Ethernet Packet Radio ATM FDDI Frame CS755 3-5

Two Key Network-Layer Functions Forwarding: move packets from router s input to appropriate router output Routing: determine route taken by packets from source to destination. routing algorithms Connection service: before datagrams flow, two end hosts and intervening routers establish virtual connection (VC) Needed in some network architectures: ATM, frame relay, X.25 Network vs transport layer connection service: network: between two hosts (may also involve intervening routers in case of VCs) transport: between two processes CS755 3-6

Interplay Between Routing and Forwarding routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet s header 0111 3 2 1 CS755 3-7

Network service model Q: What service model for channel transporting datagrams from sender to receiver? example services for individual datagrams: guaranteed delivery guaranteed delivery with less than 40 msec delay example services for a flow of datagrams: in-order datagram delivery guaranteed minimum bandwidth to flow restrictions on changes in inter-packet spacing CS755 3-8

Network layer service models: Network Architecture Service Model Bandwidth Guarantees? Loss Order Timing Congestion feedback Internet ATM ATM ATM best effort CBR VBR ABR none constant rate guaranteed rate guaranteed Minimum no yes yes No no yes yes Yes no yes yes No no (inferred via loss) no congestion no congestion Yes CS755 3-9

Network layer connection and connection-less service Datagram network provides network-layer connectionless service Virtual Circuit (VC) network provides network-layer connection service Analogous to the transport-layer services, but: service: host-to-host no choice: network provides one or the other implementation: in network core CS755 3-10

Virtual Circuits source-to-destination path behaves much like telephone circuit performance-wise network actions along source-to-destination path call setup, teardown for each call before data can flow each packet carries VC identifier (not destination host address) every router on source-destination path maintains state for each passing connection link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service) CS755 3-11

Datagram networks no call setup at network layer routers: no state about end-to-end connections no network-level concept of connection packets forwarded using destination host address packets between same source-destination pair may take different paths application transport network data link physical 1. Send data 2. Receive data application transport network data link physical CS755 3-12

Datagram Forwarding table routing algorithm local forwarding table dest address output link address-range 1 address-range 2 address-range 3 address-range 4 3 2 2 1 4 billion IP addresses, so rather than list individual destination address list range of addresses (aggregate table entries) IP destination address in arriving packet s header 3 2 1 CS755 3-13

Datagram Forwarding table Destination Address Range 11001000 00010111 00010000 00000000 through 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 11001000 00010111 00011111 11111111 otherwise Link Interface 0 1 2 3 Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** ********* otherwise Link interface 0 1 2 CS755 3-14 3

Longest prefix matching Longest prefix matching when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address. Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** ********* otherwise Link interface 0 1 2 3 Examples: DA: 11001000 00010111 00010110 10100001 DA: 11001000 00010111 00011000 10101010 Which interface? Which interface? CS755 3-15

Datagram or VC network: why? Internet (datagram) data exchange among computers elastic service, no strict timing req. smart end systems (computers) can adapt, perform control, error recovery simple inside network, complexity at edge many link types different characteristics uniform service difficult ATM (VC) evolved from telephony human conversation: strict timing, reliability requirements need for guaranteed service dumb end systems telephones complexity inside network CS755 3-16

Router Architecture Overview two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link switching fabric router input ports routing processor router output ports CS755 3-17

Input Port Functions line termination link layer protocol (receive) lookup, forwarding queueing switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet Decentralized switching: given datagram destination, lookup output port using forwarding table in input port memory goal: complete input port processing at line speed queuing: if datagrams arrive faster than forwarding rate into switch fabric CS755 3-18

Switching fabrics transfer packet from input buffer to appropriate output buffer switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate N inputs: switching rate N times line rate desirable three types of switching fabrics memory memory bus crossbar CS755 3-19

The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Network layer Routing protocols path selection RIP, OSPF, BGP forwarding table IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router signaling Link layer Physical layer CS755 3-20

IP datagram format IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to ver head. len 16-bit identifier time to live type of service upper layer 32 bits flgs data (variable length, typically a TCP or UDP segment) length 32 bit source IP address fragment offset header checksum 32 bit destination IP address Options (if any) total datagram length (bytes) for fragmentation/ reassembly E.g. timestamp, record route taken, specify list of routers to visit. CS755 3-21

IP Fragmentation & Reassembly network links have MTU (maximum transmission unit): largest possible link-level frame. different link types, different MTUs large IP datagram divided ( fragmented ) within net one datagram becomes several datagrams reassembled only at final destination IP header bits used to identify, order related fragments reassembly fragmentation: in: one large datagram out: 3 smaller datagrams CS755 3-22

IP Fragmentation and Reassembly Example 4000 byte datagram MTU = 1500 bytes length =4000 ID =x fragflag =0 One large datagram becomes several smaller datagrams offset =0 1480 bytes in " data field offset = 1480/8 length =1500 length =1500 length =1040 ID =x ID =x ID =x fragflag =1 fragflag =1 fragflag =0 offset =0 offset =185 offset =370 CS755 3-23

IP Addressing: introduction IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.2 223.1.1.3 223.1.3.27 router s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.3.1 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 CS755 3-24

Subnets IP address: subnet part (high order bits) host part (low order bits) What s a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.2 223.1.1.3 223.1.3.27 223.1.3.1 223.1.3.2 Subnet (223.1.3.0/24) CS755 3-25

Subnets How many? 223.1.1.2 223.1.1.1 223.1.1.4 223.1.1.3 223.1.9.2 223.1.7.0 223.1.9.1 223.1.8.1 223.1.8.0 223.1.7.1 223.1.2.6 223.1.3.27 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 CS755 3-26

IP addressing: CIDR CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part 11001000 00010111 00010000 00000000 200.23.16.0/23 host part CS755 3-27

IP addresses: how to get one? Q: How does a host get IP address? Static allocation: hard-coded by system admin in a file DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server plug-and-play CS755 3-28

DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected) Support for mobile users who want to join network DHCP overview: host broadcasts DHCP discover message [optional] DHCP server responds with DHCP offer message [optional] host requests IP address: DHCP request message DHCP server sends address: DHCP ack message CS755 3-29

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 explicitly addressable, visible by outside world (a security plus). rest of Internet local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) 10.0.0.3 CS755 3-30

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 messages 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) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header CS755 3-31

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

IPv6 Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed CS755 3-33

IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same flow. (concept of flow not well defined). Next header: identify upper layer protocol for data ver pri flow label payload len next hdr hop limit source address (128 bits) destination address (128 bits) data 32 bits CS755 3-34

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

Transition From IPv4 To IPv6 Not all routers can be upgraded simultaneous no flag days How will the network operate with mixed IPv4 and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Logical view: Physical view: A B E F tunnel IPv6 IPv6 IPv6 IPv6 A B E F IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 Flow: X Src: A Dest: F data Src:B Src:B Dest: E Flow: X Flow: X Src: A Dest: F data Dest: E Src: A Dest: F data Flow: X Src: A Dest: F data A-to-B: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 E-to-F: IPv6 CS755 3-36

Routing Algorithms Interplay between routing, forwarding routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet s header 0111 1 3 2 CS755 3-37

Graph abstraction Graph: G=(N,E) u x N: set of routers = {u, v, w, x, y, z} 1 2 5 v 2 E: set of links = {(u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)} c(x,y) = cost of link (x,y) e.g., c(w,z) = 5 3 cost could always be 1, or inversely related to bandwidth, or inversely related to congestion Cost of path (x 1, x 2, x 3,, x p ) = c(x 1,x 2 ) + c(x 2,x 3 ) + + c(x p-1,x p ) Routing algorithm: algorithm that finds least-cost path 1 CS755 3-38 3 w y 1 5 2 z

Routing Algorithm classification Global or decentralized information? Global: all routers have complete topology, link cost info link state (LS) algorithms Decentralized: router knows physicallyconnected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors distance vector (DV) algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes CS755 3-39

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 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 CS755 3-40

set of nodes whose least cost path definitively known Dijsktra s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = 7 8 Loop current value of cost of path from source to destination v 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N' link cost from node x to y; = if not direct neighbors CS755 3-41

CS755 3-42 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

Dijkstra s algorithm: example (2) Resulting shortest-path tree from u: v w u z x y Resulting forwarding table in u: destination link v x y w z (u,v) (u,x) (u,x) (u,x) (u,x) CS755 3-43

Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y 18 y Then d x (y) = min v {c(x,v) + d v (y)} x 6 v 1 2 3 v 2 25 20 v 3 where min is taken over all neighbors v of x CS755 3-44

Bellman-Ford example u 1 2 5 v 2 x 3 1 3 w y 1 5 2 z Clearly, d v (z) = 5, d x (z) = 3, d w (z) = 3 B-F equation says: d u (z) = min { c(u,v) + d v (z), c(u,x) + d x (z), c(u,w) + d w (z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is next hop in shortest path forwarding table CS755 3-45

Distance Vector Algorithm Each node x maintains the following Its own distance vector D x = [D x (y): y $ N ] (N is the set of nodes) D x (y) = estimate of least cost from x to y cost to each neighbor v: c(x,v) its neighbors distance vectors. For each neighbor v, x maintains " D v = [D v (y): y $ N ] from time-to-time, each node sends its own distance vector estimate to neighbors when x receives new DV estimate from neighbor, it updates its own DV using B-F equation: D x (y) min v {c(x,v) + D v (y)} for each node y N Under minor, natural conditions, the estimate D x (y) converge to the actual least cost d x (y) CS755 3-46

Distance Vector Algorithm 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 CS755 3-47

node x table from from from x y z cost to x y z 0 2 7 node y table x y z node z table x y z cost to x y z 2 0 1 cost to x y z 7 1 0 D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} " = min{2+0, 7+1} = 2 from x y z cost to x y z 0 2 3 2 0 1 7 1 0 time D x (z) = min{c(x,y) + " D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 2 y 1 x z 7 CS755 3-48

node x table from from from x y z cost to x y z 0 2 7 node y table x y z x y z cost to x y z node z table 2 0 1 cost to x y z 7 1 0 D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} " = min{2+0, 7+1} = 2 from from from x y z x y z x y z cost to x y z 0 2 3 2 0 1 7 1 0 cost to x y z 0 2 7 2 0 1 7 1 0 cost to x y z 0 2 7 2 0 1 3 1 0 from from from x y z x y z x y z cost to x y z 0 2 3 2 0 1 3 1 0 cost to x y z 0 2 3 2 0 1 3 1 0 cost to x y z 0 2 3 2 0 1 3 1 0 time D x (z) = min{c(x,y) + " D y (z), c(x,z) + D z (z)} = min{2+1, 7+0} = 3 2 y 1 x z 7 CS755 3-49

Comparison of LS and 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 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 CS755 3-50

Hierarchical Routing So far we assumed All routers are identical Network is flat These are not true in practice scale: with 200 million destinations: can t store all destinations in routing tables routing table exchange would swamp links administrative autonomy internet = network of networks each network admin may want to control routing in its own network CS755 3-51

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 CS755 3-52

Interconnected ASes 3c 3a 3b AS3 1a 1c 1d 1b Intra-AS Routing algorithm AS1 Forwarding table Inter-AS Routing algorithm 2a 2c 2b AS2 forwarding table configured by both intraand inter-as routing algorithm intra-as sets entries for internal destinations inter-as & intra-as sets entries for external destinations CS755 3-53

Inter-AS tasks suppose router in AS1 receives datagram destined outside of AS1: router should forward packet to gateway router, but which one? AS1 must: 1. learn which destinations are reachable through AS2, which through AS3 2. propagate this reachability info to all routers in AS1 job of inter-as routing 3c other networks 3b 3a AS3 1a AS1 1c 1d 1b 2a 2c 2b AS2 other networks CS755 3-54

Intra-AS Routing also known as Interior Gateway Protocols (IGP) most common Intra-AS routing protocols: RIP: Routing Information Protocol (open - Internet) OSPF: Open Shortest Path First (open Internet) IGRP: Interior Gateway Routing Protocol (Cisco proprietary) CS755 3-55

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) u v A B z C D w y x from router A to destination subnets: subnet hops u 1 v 2 w 2 x 3 y 3 z 2 CS755 3-56

RIP: Example w x y A D B z C routing table in router D destination subnet next router # hops to dest w A 2 y B 2 z B 7 x -- 1..... CS755 3-57

RIP: Example A-to-D advertisement dest next hops w - 1 x - 1 z C 4.... w x y A D B z C routing table in router D destination subnet next router # hops to dest w A 2 y B 2 A z B 7 5 x -- 1..... CS755 3-58

OSPF (Open Shortest Path First) open : publicly available uses Link State algorithm LS packet dissemination topology map at each node route computation using Dijkstra s algorithm OSPF advertisement carries one entry per neighbor router advertisements disseminated to entire AS (via flooding) carried in OSPF messages directly over IP (rather than TCP or UDP) CS755 3-59

OSPF advanced features (not in RIP) security: all OSPF messages authenticated (to prevent malicious intrusion) multiple same-cost paths allowed (only one path in RIP) for each link, multiple cost metrics for different TOS (e.g., satellite link cost set low for best effort ToS; high for real time ToS) integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF hierarchical OSPF in large domains. CS755 3-60

Hierarchical OSPF boundary router backbone router area border routers backbone Area 3 Area 1 Area 2 internal routers CS755 3-61

Hierarchical OSPF two-level hierarchy: local area, backbone. link-state advertisements only in area each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. area border routers: summarize distances to nets in own area, advertise to other Area Border routers. backbone routers: run OSPF routing limited to backbone. boundary routers: connect to other AS s. CS755 3-62

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 CS755 3-63

BGP basics 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 when AS3 advertises a prefix to AS1: AS3 promises it will forward datagrams towards that prefix AS3 can aggregate prefixes in its advertisement other networks 3b 3c AS3 3a 1a AS1 BGP message 1c 1d 1b 2a 2c 2b AS2 other networks CS755 3-64

BGP basics: distributing path information 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. other networks 3b 3a AS3 1a AS1 1c 1d ebgp session ibgp session 1b 2a 2c 2b AS2 other networks CS755 3-65

BGP routing policy W A B C X legend: provider network customer network: Y 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 CS755 3-66

BGP routing policy (2) W A B C X legend: provider network customer network: Y A advertises path AW to B B advertises path BAW to X Should B advertise path BAW to C? No 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 CS755 3-67

Why different Intra- and 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 CS755 3-68