Foundations of Telematics

Similar documents
Chapter 4: Network Layer

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

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

CSCI Computer Networks Fall 2016

Internet Protocol: Routing Algorithms. Srinidhi Varadarajan

Introduction to Internet Routing

Telematics I. Chapter 7 Network Layer

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

EE 122: Intra-domain routing

CSCE 463/612 Networks and Distributed Processing Spring 2018

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

Shortest Paths Algorithms and the Internet: The Distributed Bellman Ford Lecturer: Prof. Chiara Petrioli

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

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

Chapter 4: Network Layer, partb

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

Network Layer PREPARED BY AHMED ABDEL-RAOUF

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

Master Course Computer Networks IN2097

Network Layer: Control/data plane, addressing, routers

Chapter 4 Network Layer: The Data Plane

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

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

Network layer functions

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

CS 3516: Advanced Computer Networks

Chapter 4: Network Layer

internet technologies and standards

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

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

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

UNIT III THE NETWORK LAYER

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

DATA COMMUNICATOIN NETWORKING

Quiz. Segment structure and fields Flow control (rwnd) Timeout interval. Phases transition ssthresh setting Cwnd setting

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

Chapter 4: network layer

Chapter 4 Network Layer. Network Layer 4-1

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

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

Computer Networking. Intra-Domain Routing. RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)

Network layer: Overview. Network layer functions Routing IP Forwarding

Network layer: Overview. Network Layer Functions

CSCE 463/612 Networks and Distributed Processing Spring 2018

Network Layer: Internet Protocol

COMP211 Chapter 4 Network Layer: The Data Plane

Chapter 5 Network Layer: The Control Plane

Chapter 4: Network Layer

EEC-484/584 Computer Networks

Network layer: Overview. Network layer functions Routing IP Forwarding

CSCD 330 Network Programming Spring 2018

COMP/ELEC 429/556 Introduction to Computer Networks

CSCD 330 Network Programming Spring 2017

CSC 4900 Computer Networks: Routing Algorithms

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

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

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

Chapter 4 Network Layer

1-1. Switching Networks (Fall 2010) EE 586 Communication and. October 25, Lecture 24

EEC-684/584 Computer Networks

Router Architecture Overview

Chapter 4 Network Layer

CEN445 Network Protocols and Algorithms. Chapter 2. Routing Algorithms. Dr. Ridha Ouni

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

Chapter 4: Network Layer

CS 3516: Computer Networks

Lecture 16: Network Layer Overview, Internet Protocol

Chapter 4 Network Layer: The Data Plane

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

CSC 401 Data and Computer Communications Networks

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview

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

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

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

Topics for This Week

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

Chapter 4: Network Layer. TDTS06 Computer networks. Subnets. Subnets. Subnets. IP Addressing: introduction

Chapter 4 Network Layer: The Data Plane. Part A. Computer Networking: A Top Down Approach

COMP211 Chapter 5 Network Layer: The Control Plane

Internetworking Part 2

Module 3 Network Layer CS755! 3-1!

Algorithmic Aspects of Communication Networks

CSC 401 Data and Computer Communications Networks

internet technologies and standards

Network Layer: outline

II. Principles of Computer Communications Network and Transport Layer

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

Lecture 19: Network Layer Routing in the Internet

TDTS06: computer Networks

What s a protocol? CE80N Introduction to Networks & The Internet. Communication Protocol. Protocol Layers. Dr. Chane L. Fullmer UCSC Winter 2002

HW3 and Quiz. P14, P24, P26, P27, P28, P31, P37, P43, P46, P55, due at 3:00pm with both soft and hard copies, 11/11/2013 (Monday) TCP), 20 mins

Network Layer: Routing

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

Chapter IV: Network Layer

Chapter 4 Network Layer

Network Layer. CMPS 4750/6750: Computer Networks

Chapter 4: outline. Network Layer 4-1

IPv4 addressing, NAT. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.

COMP 3331/9331: Computer Networks and Applications

Transcription:

Foundations of Telematics Chapter 4 Network Layer cknowledgement: These slides have been prepared by J.F. Kurose and K.W. Ross with a couple of additions from various sources (see references) Foundations of Telematics (MW SS 00): 04 Network Layer Chapter Goals Understand principles behind network layer services: How a router works Routing (path selection) Dealing with scale Instantiation and implementation in the Internet Foundations of Telematics (MW SS 00): 04 Network Layer

Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 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 application transport network data link physical Foundations of Telematics (MW SS 00): 04 Network Layer 4

Key Network-Layer Functions Forwarding: move packets from router s input to appropriate router output Routing: determine route taken by packets from source to dest. Routing algorithms nalogy: Routing: process of planning trip from source to dest Forwarding: process of getting through single interchange Foundations of Telematics (MW SS 00): 04 Network Layer Interplay Between Routing and Forwarding routing algorithm local forwarding table header value output link 000 00 0 00 value in arriving packet s header 0 Foundations of Telematics (MW SS 00): 04 Network Layer 6

Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 7 Network Layer Connection and Connectionless Service Datagram network provides network-layer connectionless service VC network provides network-layer connection service nalogous to the transport-layer services, but: Service: host-to-host No choice: network provides one or the other Implementation: in the core Foundations of Telematics (MW SS 00): 04 Network Layer 8

Virtual Channel (VC) Implementation VC consists of: Path from source to destination VC numbers, one number for each link along path Entries in forwarding tables in routers along path Packet belonging to VC carries a VC number. VC number must be changed on each link. New VC number comes from forwarding table Foundations of Telematics (MW SS 00): 04 Network Layer 9 Forwarding Table VC Number Forwarding table in northwest router: Interface Number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 6 8 7 7 97 87 Routers maintain connection state information! Foundations of Telematics (MW SS 00): 04 Network Layer 0

Virtual Circuits: Signaling Protocols Used to setup, maintain teardown VC Used in TM, frame-relay, X. Not used in today s Internet application transport network data link physical. Data flow begins 6. Receive data 4. Call connected. ccept call. Initiate call. incoming call application transport network data link physical Foundations of Telematics (MW SS 00): 04 Network Layer 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-dest pair may take different paths application transport network data link physical. Send data. Receive data application transport network data link physical Foundations of Telematics (MW SS 00): 04 Network Layer

Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 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 ddressing conventions Datagram format Packet handling conventions ICMP protocol Error reporting Router signaling Link layer physical layer Foundations of Telematics (MW SS 00): 04 Network Layer 4

IP Packet 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 How much overhead with TCP? 0 bytes of TCP 0 bytes of IP = 40 bytes + appl. layer overhead bits ver head. type of len service length fragment 6-bit identifier flgs offset time to protocol Internet live checksum bit source IP address bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) total datagram length (bytes) for fragmentation/ reassembly E.g. timestamp, record route taken, specify list of routers to visit. Foundations of Telematics (MW SS 00): 04 Network Layer IP Packet Format () Version: the IP version number (currently still 4 even though 6 exists) IHL: IP Header Length in -bit words Type of Service: contains priority information, rarely used Total Length: the total length of the datagram in bytes (incl. header) Identification: when an IP packet is segmented into multiple fragments, each fragment is given the same identification; this field is used to reassemble fragments Flags: DF: Don t Fragment MF: More Fragments; when a packet is fragmented, all fragments except the last one have this bit set Fragment Offset: the fragment s position within the original packet (specified in units of 8 octets) Time to Live: hop count, decremented each time the packet reaches a new router; when hop count = 0, packet is discarded Foundations of Telematics (MW SS 00): 04 Network Layer 6

IP Packet Format () Protocol: identifies which transport layer protocol is being used for this packet (most of the time: either TCP or UDP) Header Checksum: allows to verify the contents of the IP header (not polynomial-based) Source and Destination ddresses: uniquely identify sender and receiver of the packet Options: up to 40 bytes in length; used to extend functionality of IP (examples: source routing, record route) IP addresses: bits long (4 bytes) Each byte is written in decimal in MSB order, separated by decimals (example: 8.9..80) 0.0.0.0 (lowest) to... (highest) ddress Classes: Class, B, C, D, E, Loopback, Broadcast Foundations of Telematics (MW SS 00): 04 Network Layer 7 IP Fragmentation & Reassembly Network links have MTU (max.transfer size) - 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: smaller datagrams Foundations of Telematics (MW SS 00): 04 Network Layer 8

Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 9 Internet Names and ddresses Example Organization MC address 8:0:0:7:9:8 flat, permanent IP address... topological (mostly) Host name www.ietf.org hierarchical Host Name DNS many-to-many IP IP ddress RP -to- MC ddress Foundations of Telematics (MW SS 00): 04 Network Layer 0

IP ddress Classes () Class bits 0 Net Type of Serv. Host B 0 Net Host C 0 Net Host D 0 Multicast address E 0 Reserved Foundations of Telematics (MW SS 00): 04 Network Layer IP ddress Classes () Class : for very large organizations; 6 million hosts allowed Class B: for large organizations; 6 thousand hosts allowed Class C: for small organizations; hosts allowed Class D: multicast addresses; no network/host hierarchy Class E: reserved Loopback: 7.xx.yy.zz (7.anything) is reserved for loopback testing; packets sent to this address are not put out onto the wire; they are processed locally and treated as incoming packets. Broadcast: all s ddress Hierarchy: Each address contains a network and a host portion, meaning two levels of hierarchy Note that Class, Class B, and Class C addresses only support two levels of hierarchy However, the host portion can be further split into subnets by the address class owner Foundations of Telematics (MW SS 00): 04 Network Layer

IP ddressing: Introduction IP address: -bit identifier for host, router interface Interface: connection between host/router and physical link Router s typically have multiple interfaces Host may have multiple interfaces IP addresses associated with each interface............4...9......7............ = 0 0000000 0000000 0000000 Foundations of Telematics (MW SS 00): 04 Network Layer 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............4...9.........7 LN...... network consisting of subnets Foundations of Telematics (MW SS 00): 04 Network Layer 4

Subnets...0/4...0/4 Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet....0/4 Subnet mask: /4 Foundations of Telematics (MW SS 00): 04 Network Layer Subnets... How many?......4.....9...7.0..9...8...8.0..7....6...7............ Foundations of Telematics (MW SS 00): 04 Network Layer 6

IP ddresses () Given the notion of network, let s re-examine IP addresses: Class-full addressing: class 0 network host B 0 network host C 0 network host.0.0.0 to 7... 8.0.0.0 to 9... 9.0.0.0 to... D 0 multicast address bits 4.0.0.0 to 9... Foundations of Telematics (MW SS 00): 04 Network Layer 7 IP ddresses () Classful addressing: Inefficient use of address space, address space exhaustion E.g., class B net allocated enough addresses for 6K hosts, even if only K hosts in that network CIDR: Classless InterDomain Routing Network portion of address of arbitrary length ddress format: a.b.c.d/x, where x is # bits in network portion of address network part 00000 0000 0000000 00000000 00..6.0/ host part Foundations of Telematics (MW SS 00): 04 Network Layer 8

CIDR: Classless Interdomain Routing Discard class boundaries supernetting ISP assigns a contiguous group of class C blocks Longest match routing on masked address; e.g. 9.7..0/ ddress/mask Next hop 9.7..0/ 9.7..0/ 9.7.8.0/7 Example: ll sites in Europe common prefix Only single entry in most U.S. routers Details: RFC 9: Supernet address extensions and CIDR Foundations of Telematics (MW SS 00): 04 Network Layer 9 Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 0

Recall: Interplay Between Routing and Forwarding routing algorithm local forwarding table header value output link 000 00 0 00 value in arriving packet s header 0 Foundations of Telematics (MW SS 00): 04 Network Layer Overview on Routing lgorithms () n router executes a routing algorithm to decide which output line an incoming packet should be transmitted on: In connection-oriented service, the routing algorithm is performed only during connection setup In connectionless service, the routing algorithm is either performed as each packet arrives, or performed periodically and the results of this execution updated in the forwarding table Often, routing algorithms take a so-called metric into account when making routing decisions: In this context, a metric assigns a cost to each network link This allows to compute a metric for each route in the network metric may take into account parameters like number of hops, cost of a link, delay, length of output queue, etc. The cheapest path according to some metric is often also referred to as the shortest path (even though it might actually contain more hops than an alternative path) Foundations of Telematics (MW SS 00): 04 Network Layer

Overview on Routing lgorithms () Two basic types of routing algorithms: Non-adaptive routing algorithms: do not base their routing decisions on the current state of the network (example: flooding) daptive routing algorithms: take into account the current network state when making routing decisions (examples: distance vector routing, link state routing) Remark: additionally, hierarchical routing can be used to make these algorithms scale to large networks Foundations of Telematics (MW SS 00): 04 Network Layer Flooding Basic strategy: Every incoming packet is sent out on every outgoing line except the one it arrived on Problem: vast number of duplicated packets Reducing the number of duplicated packets: Solution : Have a hop counter in the packet header; routers decrement each arriving packet s hop counter; routers discard a packet with hop count=0 Ideally, the hop counter should be initialized to the length of the path from the source to the destination Solution : Require the first router hop to put a sequence number in each packet it receives from its hosts Each router maintains a table listing the sequence numbers it has seen from each first-hop router; the router can then discard packets it has already seen Foundations of Telematics (MW SS 00): 04 Network Layer 4

Flooding: Possible pplications Military applications Large number of routers is desirable (all systems act as a router) If one router is taken out (e.g. by a bomb) flooding will still get packets to their destinations Distributed databases Simultaneous updates of multiple databases can be done with a single packet transmission Networks with frequent topology changes dhoc networks Foundations of Telematics (MW SS 00): 04 Network Layer daptive Routing lgorithms () Problems with non-adaptive algorithms: If traffic levels in different parts of the subnet change dramatically and often, non-adaptive routing algorithms are unable to cope with these changes Lots of computer traffic is bursty (~ very variable in intensity), but nonadaptive routing algorithms are usually based on average traffic conditions daptive routing algorithms can deal with these situations Three types: Centralized adaptive routing: One central routing controller Isolated adaptive routing: Based on local information Does not require exchange of information between routers Distributed adaptive routing: Routers periodically exchange information and compute updated routing information to be stored in their forwarding table Foundations of Telematics (MW SS 00): 04 Network Layer 6

Centralized daptive Routing Basic strategy: Routing table adapts to network traffic routing control center is somewhere in the network Periodically, each router forwards link status information to the control center The center can compute the best routes, e.g. with Dijkstra s shortest path algorithm (explained later) Best routes are dispatched to each router Problems: Vulnerability: if the control center goes down, routing becomes nonadaptive Scalability: the control center must handle a great deal of routing information, especially for larger networks Foundations of Telematics (MW SS 00): 04 Network Layer 7 Isolated daptive Routing lgorithms Basic idea: Routing decisions are made only on the basis of information available locally in each router Examples: Hot potato Backward learning Hot potato routing: When a packet arrives, the router tries to get rid of it as fast as it can by putting it on the output line that has the shortest queue Hot potato does not care where the output line leads Not very effective Foundations of Telematics (MW SS 00): 04 Network Layer 8

Backward Learning Routing Basic idea: Packet headers include destination and source addresses; they also include a hop counter learn from this data as packets pass by Network nodes, initially ignorant of network topology, acquire knowledge of the network state as packets are handled lgorithm: Routing is originally random (or hot potato) packet with a hop count of one is from a directly connected node; thus, neighboring nodes are identified with their connecting links packet with a hop count of two is from a source two hops away, etc. s packets arrive, the IMP compares the hop count for a given source address with the minimum hop count already registered; if the new one is less, it is substituted for the previous one Remark: in order to be able to adapt to deterioration of routes (e.g. link failures) the acquired information has to be forgotten periodically Foundations of Telematics (MW SS 00): 04 Network Layer 9 Distributed daptive Routing Routing Protocol Goal: Determine good path (sequence of routers) through network from source to dest. Graph abstraction for routing algorithms: Graph nodes are routers Graph edges are physical links Link cost: delay, $ cost, or congestion level Path cost: sum of the link costs on the path B D Good path: Typically means minimum cost path Other definitions possible C E F Foundations of Telematics (MW SS 00): 04 Network Layer 40

Distributed daptive Routing lgorithm Classification Global or decentralized information? Decentralized: Router knows physically-connected neighbors, link costs to neighbors Iterative process of computation, exchange of info with neighbors Distance vector algorithms RIP protocol BGP protocol ( path vector ) Static or dynamic? Static: Routes change slowly over time Dynamic: Routes change more quickly Periodic update In response to link cost changes Global: ll routers have complete topology, link cost info Link state algorithms Dijkstra s algorithm OSPF protocol Foundations of Telematics (MW SS 00): 04 Network Layer 4 Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 4

Distance Vector Routing lgorithm Iterative: Continues until no nodes exchange info. Self-terminating: no signal to stop synchronous: Nodes need not exchange info/iterate in lock step! Distributed: Each node communicates only with directly-attached neighbors Distance Table data structure Each node has its own Row for each possible destination Column for each directlyattached neighbor to node Example: in node X, for dest. Y via neighbor Z: X D (Y,Z) = = distance from X to Y, via Z as next hop Z c(x,z) + min {D (Y,w)} w Foundations of Telematics (MW SS 00): 04 Network Layer 4 Example for Distance Table 7 E D (C,D) E D (,D) E D (,B) B E 8 C D D = c(e,d) + min {D (C,w)} w = + = 4 D = c(e,d) + min {D (,w)} w = + = loop! B c(e,b) + min {D (,w)} w = = 8+6 = 4 loop! destination E D () B C D cost to destination via 7 6 4 B 4 8 9 D 4 Foundations of Telematics (MW SS 00): 04 Network Layer 44

Constructing Routing Table from Distance Table E D () Cost to destination via B D Outgoing link to use, cost 4, Destination B C 7 6 8 9 4 Destination B C D, D,4 D 4 D D,4 Distance table Routing table Foundations of Telematics (MW SS 00): 04 Network Layer 4 Distance Vector Routing: Overview Iterative, asynchronous: Each local iteration caused by: Local link cost change Message from neighbor: its least cost path change from neighbor Distributed: Each node notifies neighbors only when its least cost path to any destination changes Neighbors then notify their neighbors if necessary Each node: wait for (change in local link cost or msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Foundations of Telematics (MW SS 00): 04 Network Layer 46

Distance Vector lgorithm: Initialization t all nodes, X: Initialization: for all adjacent nodes v: X D (*,v) = infinity /* the * operator means "for all rows" */ X 4 D (v,v) = c(x,v) for all destinations, y X 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ W Foundations of Telematics (MW SS 00): 04 Network Layer 47 Distance Vector lgorithm: Main Loop 8 loop 9 wait (until I see a link cost change to neighbor V 0 or until I receive update from neighbor V) if (c(x,v) changes by d) /* change cost to all dest's via neighbor v by d */ 4 /* note: d could be positive or negative */ for all destinations y: D X (y,v) = D X (y,v) + d 6 7 else if (update received from V w.r.t. destination Y) 8 /* shortest path from V to some Y has changed */ 9 /* V has sent a new value for its min D V W (Y,w) */ 0 /* call this received new value "newval" */ for the single destination y: D X (y,v) = c(x,v) + newval if we have a new min D X W (Y,w) for any destination Y 4 send new value of min D X W (Y,w) to all neighbors 6 forever Foundations of Telematics (MW SS 00): 04 Network Layer 48

Distance Vector lgorithm: Example () X Y 7 Z Foundations of Telematics (MW SS 00): 04 Network Layer 49 Distance Vector lgorithm: Example () X Y 7 Z X Z D (Y,Z) = c(x,z) + min {D (Y,w)} w = 7+ = 8 X Y D (Z,Y) = c(x,y) + min {D (Z,w)} w = + = Foundations of Telematics (MW SS 00): 04 Network Layer 0

Distance Vector: Reaction to Link Cost Changes () Link cost changes: Node detects local link cost change Updates distance table (line ) 4 Y If cost change in least cost path, notify neighbors (lines,4) X 0 Z Good news travels fast lgorithm terminates Foundations of Telematics (MW SS 00): 04 Network Layer Distance Vector: Reaction to Link Cost Changes () Link cost changes: Good news travels fast Bad news travels slow - count to infinity problem! 60 X 4 Y 0 Z Y Y Y algorithm continues on! Foundations of Telematics (MW SS 00): 04 Network Layer

Distance Vector: 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) 60 4 Y Will this completely solve count to infinity problem? X 0 Z Y Y Y Y algorithm terminates Foundations of Telematics (MW SS 00): 04 Network Layer Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 4

Link-State Routing Link state routing usually uses Dijkstra s algorithm: Network topology, link costs known to all nodes: ccomplished via link state broadcast ll nodes have same information Input: a graph (V, E) with V being the set of vertices (nodes) E being the set of edges (links) mapping c(v, w) representing the cost of edge (v, w) if (v, w) is in E (otherwise c(v, w) = infinity) Goal: compute the least cost paths from one node s ( source ) to all other nodes v: Can be used to obtain routing table for that node s Foundations of Telematics (MW SS 00): 04 Network Layer Dijkstra s lgorithm to Compute Shortest Paths () Basic algorithm idea: Start with a set N containing only the source node s and incrementally add one node at a time, to which the shortest path can be determined with the knowledge available at that point in time Initially, the shortest path to node v is estimated to be infinity for all vertices except the source vertex s In each step: Select the node v not yet in the set N that can be reached from s with the cheapest estimated cost using only nodes, that are already in N Include v in N Update the estimates for all direct neighbors w of v if a path over v would be cheaper than the current estimate When updating an estimate for node w, also memorize the predecessor node v leading to this estimate Foundations of Telematics (MW SS 00): 04 Network Layer 6

Dijkstra s lgorithm to Compute Shortest Paths () Thus, the algorithm maintains for every vertex v: shortest path estimate d(v) This estimate d(v) is what the algorithm currently assumes to be the shortest path from s to v The predecessor node p(v) on the currently assumed shortest path from s to v list of vertices N for whom the shortest path is definitely known Some remarks: It holds that whenever the estimate d(v) is finite for a vertex v, there exists a path from the source s to v with weight d(v) It turns out that the estimate is accurate for the vertex with the minimum value of this estimate Shortest path is known for this vertex v This vertex v is added to the set N of vertices for which shortest path is known Shortest path estimates are upgraded for every vertex which has an edge from v, and is not in N Foundations of Telematics (MW SS 00): 04 Network Layer 7 Dijkstra s lgorithm to Compute Shortest Paths () Estimate upgrade procedure: Suppose vertex v is added to the list newly, and we are upgrading the estimate for vertex w: d(v) is the shortest path estimate for v, d(w) is the estimate for w c(v, w) is the cost of the edge from v to w if ( d(v) + c(v, w) < d(w)) { d(w) = d(v) + c(v, w); p(w) = v; } Intuition behind this procedure: ssume that d(w) and d(v) are finite So, there exists a path (s, v, v,, v) from s to v of weight d(v) Hence, there exists a path (s, v, v,, v, w) from s to w of weight d(v) + c(v, w) lso, there exists a path to w of weight d(w) So the shortest path to w can not have weight more than either d(w) or d(v) + c(v, w) Foundations of Telematics (MW SS 00): 04 Network Layer 8

Dijkstra s lgorithm in Pseudocode Computes least-cost path path from from one one node to to other nodes in in the the net net Initialization (for (for Node s): s): N = {s} {s}/*/* Set Set of of Nodes with with known least-cost path path */ */ for for all all nodes v 4 if if v adjacent to to s then then {{ d(v) d(v) = c(s,v); p(v) p(v) = s; s; }} 6 else else d(v) d(v) = infinity; 7 8 Loop 9 find find v not not in in N such that that d(v) d(v) is is a minimum 0 0 add add v to to N for for all all w adjacent to to v and and not not in in N do do /* /* update d(w) d(w) */ */ {{ if if (d(v) (d(v) +c(v, w) w) < d(w)) {{ d(w) d(w) = d(v) d(v) + c(v, c(v, w); w); p(w) p(w) = v; v; }}}} /* /* new new cost cost to to w is is either old old cost cost to to w or or known 4 4 shortest path path cost cost to to v plus plus cost cost from from v to to w */ */ until all all nodes in in N Foundations of Telematics (MW SS 00): 04 Network Layer 9 Example Run of Dijkstra s lgorithm () Step 0 start N d(b),p(b), d(c),p(c), d(d),p(d), d(e),p(e) infinity d(f),p(f) infinity B D C E F Foundations of Telematics (MW SS 00): 04 Network Layer 60

Example Run of Dijkstra s lgorithm () Step 0 start N D d(b),p(b),, d(c),p(c), 4,D d(d),p(d), d(e),p(e) infinity,d d(f),p(f) infinity infinity B D C E F Foundations of Telematics (MW SS 00): 04 Network Layer 6 Example Run of Dijkstra s lgorithm () Step 0 4 start N D DE d(b),p(b),,, d(c),p(c), 4,D,E d(d),p(d), d(e),p(e) infinity,d d(f),p(f) infinity infinity 4,E B D C E F Foundations of Telematics (MW SS 00): 04 Network Layer 6

Example Run of Dijkstra s lgorithm (4) Step 0 start N D DE DEB d(b),p(b),,, d(c),p(c), 4,D,E,E d(d),p(d), d(e),p(e) infinity,d d(f),p(f) infinity infinity 4,E 4,E B D C E F Foundations of Telematics (MW SS 00): 04 Network Layer 6 Example Run of Dijkstra s lgorithm () Step 0 4 start N D DE DEB DEBC d(b),p(b),,, d(c),p(c), 4,D,E,E d(d),p(d), d(e),p(e) infinity,d d(f),p(f) infinity infinity 4,E 4,E 4,E B D C E F Foundations of Telematics (MW SS 00): 04 Network Layer 64

Example Run of Dijkstra s lgorithm (6) Step 0 4 start N D DE DEB DEBC DEBCF d(b),p(b),,, d(c),p(c), 4,D,E,E d(d),p(d), d(e),p(e) infinity,d d(f),p(f) infinity infinity 4,E 4,E 4,E B C D E F Foundations of Telematics (MW SS 00): 04 Network Layer 6 Link State Routing (with Dijkstra s lgorithm) Each router measures the cost (in delay, hop count, etc.) between itself and its adjacent routers The router builds a packet containing all these distances The packet also contains a sequence number and an age field Each router distributes these packets using flooding To control flooding, the sequence numbers are used by routers to discard flood packets they have already seen from a given router The age field in the packet is an expiration date that specifies how long the information in the packet is valid Once a router receives all the link state packets from the network, it can reconstruct the complete topology and compute a shortest path between itself and any other node using Dijsktra s algorithm Foundations of Telematics (MW SS 00): 04 Network Layer 66

Comparison of Link State and Distance Vector lgorithms Message complexity LS: with n nodes, E links, O(n E) msgs sent each DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n ) algorithm requires O(n E) 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 other routers: Errors propagate through network Foundations of Telematics (MW SS 00): 04 Network Layer 67 Chapter 4: Network Layer 4. Introduction 4. Virtual circuit and datagram networks 4. IP: Internet Protocol Datagram format IPv4 addressing 4.4 Routing algorithms Overview Distance Vector Link state Hierarchical routing Foundations of Telematics (MW SS 00): 04 Network Layer 68

Hierarchical Routing Our routing study so far is an idealization: ll routers are assumed to be identical Network is assumed to be flat Practice, however, looks different Scale (0 million destinations!): Can t store all destinations in routing tables Routing table exchange would overload links dministrative autonomy: Internet = network of networks Each network admin may want to control routing in its own network Foundations of Telematics (MW SS 00): 04 Network Layer 69 Hierarchical Routing: utonomous Systems ggregate routers into regions, autonomous systems (S) Routers in same S run same routing protocol Intra-S routing protocol Routers in different S can run different intra-s routing protocol Gateway Routers Special routers in S Run intra-s routing protocol with all other routers in S lso responsible for routing to destinations outside S Run inter-s routing protocol with other gateway routers Foundations of Telematics (MW SS 00): 04 Network Layer 70

Inter-S and Intra-S Routing a C C.b b d.a a b.c c B.a a B c b Gateways: Perform inter-s routing amongst themselves Perform intra-s routers with other routers in their S inter-s, intra-s routing in gateway.c network layer link layer physical layer Foundations of Telematics (MW SS 00): 04 Network Layer 7 Routing in the Internet The Global Internet consists of utonomous Systems (S) interconnected with each other: Stub S: small corporation (only one link to the Internet) Multihomed S: large corporation (multiple links, but no transit) Transit S: provider Two-level routing: Intra-S: administrator is responsible for choice Routing Information Protocol (RIP): Distance Vector Open Shortest Path First (OSPF): Link State Interior Gateway Routing Protocol (IGRP): Distance Vector (Cisco proprietary) Inter-S: unique standard Border Gateway Protocol (BGP): Path Vector (sort of distance vector, but with path information for loop avoidance) Foundations of Telematics (MW SS 00): 04 Network Layer 7

Why Having Different Inter- and Intra-Domain Routing? Policy: Inter-S: admin wants control over how its traffic routed, who routes through its net. Intra-S: single admin, so no policy decisions needed Scale: Hierarchical routing saves table size, reduced update traffic Performance: Intra-S: can focus on performance Inter-S: policy may dominate over performance Foundations of Telematics (MW SS 00): 04 Network Layer 7 Network Layer: Summary What we ve covered: Network layer services IPv4 Routing algorithms & hierarchical routing Some conclusions: Routing in large networks not only requires adequate routing algorithms for general graphs lso an appropriate, hierarchical network structure is required Network structure has to be reflected in the addressing structure Flat addresses would result in prohibitive overhead Different metrics and goals have to be fulfilled, in particular in inter-domain routing where optimality is only a single aspect Foundations of Telematics (MW SS 00): 04 Network Layer 74

dditional References [Car0] G. Carle. Internet-Protokolle und -Komponenten. Vorlesungsfolien, Universität Tübingen, 00. http://net.informatik.uni-tuebingen.de/teaching/ipuk/index.php [CLR90] T. Cormen, C. Leiserson, R. Rivest. Introduction to lgorithms. MIT Press, M, US, 990. [KR04] J. F. Kurose, K. W. Ross. Computer Networking: Top-Down pproach Featuring the Internet. rd edition, ddison Wesley, 004. [Sar04] S. Sarkar. lgorithms in Networking - Lecture. Course slides of course TCOM 799, School of Engineering & pplied Science, University of Pennsylvania, P, US, 004. [Ste9] M. Steenstrup. Routing in Communication Networks. Prentice Hall, 99. [Sud04] T. Suda. Computer Networks. Course slides, Department of Information and Computer Science, University of California, Irvine, US, 004. http://www.ics.uci.edu/~ics4a Foundations of Telematics (MW SS 00): 04 Network Layer 7