Protocoles et Interconnexions

Similar documents
Chapter 4: Network Layer

Interplay between routing, forwarding

Network Layer: Routing

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

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

Chapter IV: Network Layer

Computer Networks. Instructor: Niklas Carlsson

Protocoles et Interconnexions

CS 3516: Advanced Computer Networks

Network Layer: Control Plane 5-2

CS 3516: Advanced Computer Networks

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

Routing Algorithm Classification. A Link-State Routing Algorithm

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

Chapter 4: Network Layer: Part II

Chapter III: Transport Layer

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

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

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

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

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

COSC4377. Useful Linux Tool: screen

Chapter 4 Network Layer

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Computer Networks & Security 2016/2017

Graph abstraction: costs. Graph abstraction 10/26/2018. Interplay between routing and forwarding

Lecture 5. Transport Layer. Transport Layer 1-1

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

Chapter 4 Network Layer. Network Layer 4-1

Chapter 3 Transport Layer

CSE 4213: Computer Networks II

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

CC451 Computer Networks

Distributed Systems. 5. Transport Protocols. Werner Nutt

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

CS 3516: Computer Networks

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

Transport layer. Our goals: Understand principles behind transport layer services: Learn about transport layer protocols in the Internet:

Distributed Systems. 5. Transport Protocols

Last time. Mobility in Cellular networks. Transport Layer. HLR, VLR, MSC Handoff. Introduction Multiplexing / demultiplexing UDP 14-1

Chapter 3 Transport Layer

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

CSCD 330 Network Programming

CSC 401 Data and Computer Communications Networks

Chapter 3 Transport Layer

Chapter 5: Network Layer Control Plane. understand principles behind network control plane : traditional routing algorithms

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

TDTS06: Computer Networks

Transport layer: Outline

Chapter 4: Network Layer, partb

Chapter 6 Transport Layer

CNT 6885 Network Review on Transport Layer

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

Interplay tra routing e forwarding

CSC 401 Data and Computer Communications Networks

Chapter 3 Transport Layer

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Application. Transport. Network. Link. Physical

Lecture 9: Transpor Layer Overview and UDP

Transport Layer: outline

CS 3516: Advanced Computer Networks

CSE 3214: Computer Network Protocols and Applications Transport Layer (Part 2) Chapter 3 outline. UDP checksum. Port numbers

RSC Part III: Transport Layer 3. TCP

Chapter 3 outline. TDTS06 Computer networks. Principles of Reliable data transfer. Reliable data transfer: getting started

Chapter 5 Network Layer: The Control Plane

CSC 4900 Computer Networks: Routing Algorithms

10 minutes survey (anonymous)

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 4 Network Layer

Chapter 3 Transport Layer

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Chapter 3 Transport Layer

DATA COMMUNICATOIN NETWORKING

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 3: Transport Layer

Chapter 4 Network Layer

Chapter 2: outline. 2.1 principles of network applications app architectures app requirements

The Transport Layer Multiplexing, Error Detection, & UDP

Chapter 3 Transport Layer

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

CC451 Computer Networks

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

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

Transport Layer: Outline

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

CMSC 332 Computer Networks Reliable Data Transfer

Data Communications & Networks. Session 6 Main Theme Reliable Data Transfer. Dr. Jean-Claude Franchitti

TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581

Chapter 3 Transport Layer

CSC 4900 Computer Networks: Reliable Data Transport

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

Different Layers Lecture 20

Computer Networking Introduction

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

Chapter III: Transport Layer

Course on Computer Communication and Networks. Lecture 4 Chapter 3; Transport Layer, Part A

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

Transcription:

Protocoles et Interconneions Course Overview and Introduction Dario Vieira Department of Computer Science EFREI

Routing Protocol BGP TCP

Computer Networking Preliminaries Transport Laer Network Laer Introduction Terminolog UDP TCP Internet protocol Routing Link Laer Phsical Laer Ethernet Transmission media Other Topics Aplication Laer, advanced topics (e.g., wirelless, P2P, Multimedia, securit, and management

Chapter 3 Transport Laer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesle, April 2009. Transport Laer 3-4

Chapter 3: Transport Laer Our Goals Learn about transport laer protocols in the Internet UDP: connectionless transport TCP: connection-oriented transport Application Transport Network Link Phsical Transport Laer 3-5

Transport services and protocols Transport protocols run in end sstems send side: breaks app messages into segments, passes to network laer application transport network data link phsical rcv side: reassembles segments into messages, passes to app laer More than one transport protocol available to apps Internet: TCP and UDP application transport network data link phsical Transport Laer 3-6

Transport vs. Network laer Network laer Logical communication between hosts application transport network data link phsical Transport laer Logical communication between processes Relies on, enhances, network laer services application transport network data link phsical Transport Laer 3-7

Internet Transport-laer Protocols Reliable, in-order deliver (TCP) congestion control flow control connection setup application transport network data link phsical network data link phsical network data link phsical Unreliable, unordered deliver (UDP) no-frills etension of best-effort IP Services not available dela guarantees bandwidth guarantees network data link phsical network data link phsical network data link phsical network data link phsical application transport network data link phsical Transport Laer 3-8

Chapter 3 outline 3.1 Transport-laer services 3.2 Connectionless Transport: UDP 3.3 Principles of reliable data transfer 3.4 Connection-oriented transport: TCP 3.5 Principles of congestion control 3.6 TCP congestion control Transport Laer 3-9

UDP: User Datagram Protocol [RFC 768] No frills, bare bones Internet transport protocol Best effort service, UDP segments ma be: lost delivered out of order to app Connectionless No handshaking between UDP sender, receiver Each UDP segment handled independentl of others Wh is there a UDP? No connection establishment (which can add dela) Simple: no connection state at sender, receiver Small segment header No congestion control: UDP can blast awa as fast as desired Transport Laer 3-10

UDP: more Often used for streaming multimedia apps loss tolerant rate sensitive Other UDP uses DNS SNMP Reliable transfer over UDP: add reliabilit at application laer application-specific error recover! Length, in btes of UDP segment, including header 32 bits source port # dest port # length Application data (message) checksum UDP segment format Transport Laer 3-11

Chapter 3 outline 3.1 Transport-laer services 3.2 Connectionless Transport: UDP 3.3 Principles of reliable data transfer 3.4 Connection-oriented transport: TCP 3.5 Principles of congestion control 3.6 TCP congestion control Transport Laer 3-12

Principles of Reliable Data Transfer Important in app., transport, link laers top-10 list of important networking topics! Transport Laer 3-13

Principles of Reliable Data Transfer Important in app., transport, link laers top-10 list of important networking topics! Characteristics of unreliable channel will determine compleit of reliable data transfer protocol Transport Laer 3-14

Principles of Reliable Data Transfer Important in app., transport, link laers top-10 list of important networking topics! Characteristics of unreliable channel will determine compleit of reliable data transfer protocol (rdt) Transport Laer 3-15

Reliable Data Transfer: Getting Started rdt_send(): called above, (e.g., b app.). Passed data to deliver to receiver upper laer deliver_data(): called b rdt to deliver data to upper send side receive side udt_send(): called b rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel Transport Laer 3-16

Reliable Data Transfer: Getting Started Incrementall develop sender, receiver sides of Reliable Data Transfer protocol (rdt) Consider onl unidirectional data transfer but control info will flow on both directions! Use Finite State Machines (FSM) to specif sender, receiver state: when in this state net state uniquel determined b net event State 1 event causing state transition actions taken on state transition event actions State 2 Transport Laer 3-17

Rdt1.0: Reliable Transfer over a Reliable Channel Underling channel perfectl reliable no bit errors no loss of packets Separate FSMs for sender, receiver sender sends data into underling channel receiver read data underling channel Wait for call above rdt_send(data) packet =make_pkt(data) udt_send(packet) Wait for call below rdt_rcv(packet) Etract (packet,data) deliver_data(data) sender receiver Transport Laer 3-18

Rdt2.0: channel with bit errors Underling channel ma flip bits in packet checksum to detect bit errors The question: how to recover errors? acknowledgements (ACKs): receiver eplicitl tells sender that pkt received OK How do humans recover errors during conversation? negative acknowledgements (NAKs): receiver eplicitl tells sender that pkt had errors sender retransmits pkt on receipt of NAK new mechanisms in rdt2.0 (beond rdt1.0): error detection receiver feedback: control msgs (ACK,NAK) rcvr->sender Transport Laer 3-19

Rdt2.0: channel with bit errors Underling channel ma flip bits in packet checksum to detect bit errors The question: how to recover errors? acknowledgements (ACKs): receiver eplicitl tells sender that pkt received OK negative acknowledgements (NAKs): receiver eplicitl tells sender that pkt had errors sender retransmits pkt on receipt of NAK New mechanisms in rdt2.0 (beond rdt1.0): error detection receiver feedback: control msgs (ACK,NAK) rcvr->sender Transport Laer 3-20

rdt2.0: FSM specification Receiver sndpkt = make_pkt(data, checksum) udt_send(sndpkt) Wait for call above rdt_send(data) rdt_rcv(rcvpkt) && isack(rcvpkt) L Wait for ACK or NAK Sender rdt_rcv(rcvpkt) && isnak(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(nak) Wait for call below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) etract(rcvpkt,data) deliver_data(data) udt_send(ack) Transport Laer 3-21

TCP: Overview Point-to-point: one sender, one receiver Reliable, in-order bte steam: no message boundaries Pipelined: TCP congestion and flow control set window sie Send & receive buffers Full duple data: bi-directional data flow in same connection MSS: maimum segment sie Connection-oriented: handshaking (echange of control msgs) inits sender, receiver state before data echange Flow controlled: sender will not overwhelm receiver socket door application writes data TCP send buffer application reads data TCP receive buffer socket door 3-22 segment

TCP segment structure URG: urgent data (generall not used) ACK: ACK # valid PSH: push data now (generall not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) 32 bits source port # dest port # head len sequence number acknowledgement number not used checksum U A P R S F application data (variable length) Receive window Urg data pnter Options (variable length) counting b btes of data (not segments!) # btes rcvr willing to accept Transport Laer 3-23

TCP seq. # s and ACKs Seq. # s: ACKs: bte stream number of first bte in segment s data seq # of net bte epected other side cumulative ACK User tpes C Host A Host B host ACKs receipt of C, echoes back C Q: how receiver handles out-oforder segments A: TCP spec doesn t sa, - up to implementor host ACKs receipt of echoed C time simple telnet scenario Transport Laer 3-24

Seq=92 timeout timeout Seq=92 timeout TCP: Retransmission Scenarios Host A Host B Host A Host B X loss SendBase = 100 SendBase = 120 SendBase = 100 time lost ACK scenario SendBase = 120 premature timeout time Transport Laer 3-25

timeout TCP Retransmission Scenarios (more) Host A Host B X loss SendBase = 120 time Cumulative ACK scenario Transport Laer 3-26

TCP Congestion Control (a) A fast network feeding a low capacit receiver. (b) A slow network feeding a high-capacit receiver.

TCP Connection Management Recall: TCP sender, receiver establish connection before echanging data segments initialie TCP variables: Initial seq. #s Buffers, flow control info (e.g. RcvWindow) client: connection initiator Socket clientsocket = new Socket("hostname","port number"); server: contacted b client Socket connectionsocket = welcomesocket.accept(); Three wa handshake: Step 1: client host sends TCP SYN segment to server specifies initial seq # no data Step 2: server host receives SYN, replies with SYNACK segment server allocates buffers specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which ma contain data Transport Laer 3-28

timed wait TCP Connection Management (cont.) Closing a connection: client closes socket: clientsocket.close(); close client server Step 1: client end sstem sends TCP FIN control segment to server close Step 2: server receives FIN, replies with ACK. closed Transport Laer 3-29

timed wait TCP Connection Management (cont.) Step 3: client receives FIN, replies with ACK. Enters timed wait - will respond with ACK to received FINs closing client server closing Step 4: server, receives ACK. Connection closed. Step 5: after timeout, client s connection closed closed closed Transport Laer 3-30

TCP Connection Management (cont) TCP client lifeccle TCP server lifeccle 3-31

TCP Finite State Machine Step 2 of the 3-wa handshake Step 1 of the 3-wa handshake TCP connection management Finite State Machine: 3-Wa Handshake The heav solid line is the normal path for a client. The heav dashed line is the normal path for a server. Step 3 of the 3-wa handshake

Chapter 4 Network Laer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesle, April 2009. Network Laer 4-33

Network Laer Goals Understand principles behind network laer services Network laer service models Forwarding versus routing How a router works Routing (path selection) Broadcast, multicast Instantiation, implementation in the Internet Network Laer 4-34

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-35

Network laer Transport segment sending to receiving host On sending side encapsulates segments into datagrams On rcving side, delivers segments to transport laer Network laer protocols in ever host, router Router eamines header fields in all IP datagrams passing through it application transport network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical network data link phsical application transport network data link phsical Network Laer 4-36

Two Ke Network-Laer Functions Forwarding move packets router s input to appropriate router output Routing determine route taken b packets source to dest. routing algorithms Analog: Routing process of planning trip source to destination Forwarding process of getting through single interchange Network Laer 4-37

Routing vs. Forwarding Default to upstream router A D R R1 R4 R R2 B R5 E R3 R Net Forwarding: determine net hop A B C D E default C Routing: establish end-to-end paths Nt Hop Net R1 Direct R3 R1 R3 R1 A B C D E default Nt Hop R4 R3 R3 R4 Direct R4 Forwarding alwas works Routing can be badl broken Net A B C D E default Nt Hop R2 R2 Direct R5 R5 R2 38 Thanks to T. Griffin

How Are Forwarding Tables Populated to I Implement Routing? Staticall Administrator manuall configures forwarding table entries + More control + Not restricted to destination-based forwarding - Doesn t scale - Slow to adapt to network failures Dnamicall Routers echange network reachabilit information using ROUTING PROTOCOLS. Routers use this to compute best routes + Can rapidl adapt to changes in network topolog + Can be made to scale well - Comple distributed algorithms - Consume CPU, Bandwidth, Memor - Debugging can be difficult - Current protocols are destination-based In practice : a mi of these. Static routing mostl at the edge Thanks to T. Griffin 39

Network reachabilit Routing info Routing info 4-40

Interpla 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 Network Laer 4-41

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-42

Datagram Networks No call setup at network laer 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 ma take different paths application transport network data link phsical 1. Send data 2. Receive data application transport network data link phsical Network Laer 4-43

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 Network Laer 4-44

Longest prefi matching Longest prefi matching when looking for forwarding table entr for given destination address, use longest address prefi that matches destination address. Destination Address Range 11001000 00010111 00010*** ********* 11001000 00010111 00011000 ********* 11001000 00010111 00011*** ********* otherwise Link interface 0 1 2 3 Eamples: DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 10101010 Which interface? Network Laer 4-45

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-46

Router Architecture Overview Two ke router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams incoming to outgoing link switching fabric router input ports routing processor router output ports Network Laer 4-47

The Internet Network Laer Host, router network laer functions: Transport laer: TCP, UDP Network laer 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 laer phsical laer Network Laer 4-48

Chapter 4: Network Laer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Laer 4-49

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-52

Graph abstraction 5 Graph: G = (N,E) u 1 2 v 2 3 1 3 w 1 5 2 N = set of routers = { u, v, w,,, } E = set of links ={ (u,v), (u,), (v,), (v,w), (,w), (,), (w,), (w,), (,) } Remark: Graph abstraction is useful in other network contets Eample: P2P, where N is set of peers and E is set of TCP connections Network Laer 4-53

Graph Abstraction: Costs c(, ) = cost of link (, ) 5 - e.g., c(w,) = 5 u 1 2 v 2 3 1 3 w 1 5 2 Cost could alwas be 1, or inversel related to bandwidth, or inversel related to congestion Cost of path ( 1, 2, 3,, p ) = c( 1, 2 ) + c( 2, 3 ) + + c( p-1, p ) Question: What s the least-cost path between u and? Routing algorithm: algorithm that finds least-cost path Network Laer 4-54

Routing Algorithm Classification Global or decentralied information? Global: All routers have complete topolog, link cost info Link state algorithms Decentralied: Router knows phsicallconnected neighbors, link costs to neighbors Iterative process of computation, echange of info with neighbors Static or dnamic? Static: routes change slowl over time Dnamic: routes change more quickl periodic update in response to link cost changes Distance vector algorithms Network Laer 4-55

Routing Algorithm Classification Link State Topolog information is flooded within the routing domain Best end-to-end paths are computed locall at each router Best end-to-end paths determine net-hops Based on minimiing some notion of distance Works onl if polic is shared and uniform Eamples: OSPF, IS-IS Vectoring Each router knows little about network topolog Onl best net-hops are chosen b each router for each destination network Best end-to-end paths result composition of all net-hop choices Does not require an notion of distance Does not require uniform policies at all routers Eamples: RIP, BGP

The Gang of Four IGP Link State OSPF IS-IS Vectoring RIP EGP BGP ICNP 2002

Routers Talking to Routers Routing info Routing info Routing computation is distributed among routers within a routing domain Computation of best net hop based on routing information is the most CPU/memor intensive task on a router 4-58

Architecture of Dnamic Routing AS 1 OSPF BGP IGP = Interior Gatewa Protocol Metric based: OSPF, IS-IS, RIP, EIGRP (cisco) EGP = Eterior Gatewa Protocol Polic based: BGP AS 2 EIGRP 4-59

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-60

A Link-State Routing Algorithm Dijkstra s Algorithm Net topolog, link costs known to all nodes accomplished via link state broadcast all nodes have same info Computes least cost paths 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(,): link cost node to = if not direct neighbors D(v): current value of cost of path source to dest. v p(v): predecessor node along path source to v N': set of nodes whose least cost path definitivel known Network Laer 4-61

Dijkstra s Algorithm: Eample 5 u 1 2 v 2 3 1 3 w 1 5 2 v, w and are u s neighbors Step 0 N' u D(v),p(v) 2,u D(w),p(w) 5,u D(),p() 1,u D(),p() D(),p() Step 0: Add D(v) for all v on the graph Network Laer 4-62

Dijkstra s Algorithm: Eample 5 u 1 2 v 2 3 1 3 w 1 5 2 Step 0 1 N' u u D(v),p(v) 2,u 2,u D(w),p(w) 5,u 4, D(),p() 1,u D(),p() 2, D(),p() Step 1: a. Find node not in N such that D() is a minimum b. Add in set N c. Update D(v) for all v adjacent to and not in N using D(v) = min(d(v), D() + c(,v)) //update costs to reach s neighbors Network Laer 4-63

Dijkstra s Algorithm: Eample 5 u 1 2 v 2 3 1 3 w 1 5 2 Step 0 1 2 N' u u u D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4, 3, D(),p() 1,u D(),p() 2, D(),p() 4, Step 2: Find node not in N such that D() is a minimum; add in N Update costs to reach s neighbors v that are not in N using D(v) = min(d(v), D() + c(,v) ) Network Laer 4-64

Dijkstra s algorithm: Eample (2) Resulting shortest-path tree u: u v w Resulting forwarding table in u: destination link v w (u,v) (u,) (u,) (u,) (u,) Network Laer 4-66

Dijsktra s Algorithm 1 Initialiation: 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 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 v is either old v or known 14 shortest path w plus cost w to v */ 15 until all nodes in N' Network Laer 4-67

Dijkstra s algorithm: eample D(v) D(w) D() D() D() Step N' p(v) p(w) p() p() p() 0 u 7,u 3,u 5,u 1 uw 6,w 5,u 11,w 2 uw 6,w 11,w 14, 3 uwv 10,v 14, 4 5 uwv uwv 12, 9 Notes: Construct shortest path tree b tracing predecessor nodes Ties can eist (can be broken arbitraril) u 5 3 w 4 8 7 3 7 4 2 v Network Laer 4-68

Dijkstra s Algorithm: Discussion Algorithm compleit: n nodes Each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n 2 ) More efficient implementations possible: O(nlogn) Oscillations possible: e.g., link cost = amount of carried traffic 1 1 A 1+e D 0 0 B 0 e C 1 e initiall A 2+e 0 D B 0 1+e 1 0 C recompute routing A 0 2+e D 0 0 B 1 C 1+e recompute A 2+e 0 D B 0 1+e 1 e C recompute D A, B A, C A Network Laer 4-69

Chapter 4: Network Laer 4. 1 Introduction 4.2 What s inside a router 4.4 IP: Internet Protocol 4.5 Routing algorithms Link state Distance Vector 4.6 Routing in the Internet RIP OSPF BGP Network Laer 4-70

Distance Vector Algorithm Bellman-Ford Equation (dnamic programming) Define d () := cost of least-cost path to Then d () = min {c(,v) + d v () } v where min is taken over all neighbors v of Network Laer 4-71

Bellman-Ford eample 5 Clearl, d v () = 5, d () = 3, d w () = 3 u 1 2 v 2 3 1 3 w 1 5 2 B-F equation sas: d u () = min { c(u,v) + d v (), c(u,) + d (), c(u,w) + d w () } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieves minimum is net hop in shortest path forwarding table Network Laer 4-72

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

Distance vector algorithm (4) Basic idea From time-to-time, each node sends its own Distance Vector (DV) estimate to neighbors When receives new DV estimate neighbor, it updates its own DV using B-F equation: D () min v {c(,v) + D v ()} for each node N Under minor, natural conditions, the estimate D () converge to the actual least cost d () Network Laer 4-74

Distance Vector Algorithm (5) Iterative, asnchronous each local iteration caused b local link cost change DV update message neighbor Each node wait for (change in local link cost or msg neighbor) Distributed: each node notifies neighbors onl when its DV changes neighbors then notif their neighbors if necessar recompute estimates if DV to an dest has changed, notif neighbors Network Laer 4-75

node table node table node table 0 2 7 2 0 1 7 1 0 time 2 7 1 4-76

node table node table node table 0 2 7 2 0 1 7 1 0 Each node sends its own DV to its neighbors 0 2 3 2 0 1 7 1 0 time 2 7 1

node table node table node table 0 2 7 2 0 1 7 1 0 D () = min{c(,) + D (), c(,) + D ()} = min{2+0, 7+1} = 2 0 2 3 2 0 1 7 1 0 the net-hop router to reach is time 2 7 1

node table node table node table 0 2 7 2 0 1 7 1 0 D () = min{c(,) + D (), c(,) + D ()} = min{2+1, 7+0} = 3 0 3 2 0 1 7 1 0 2 the net-hop router to reach is time 2 7 1

D () = min{c(,) + D (), c(,) + D ()} = min{2+0, 7+1} = 2 node table node table node table 0 2 7 2 0 1 7 1 0 0 2 3 2 0 1 7 1 0 2 time D () = min{c(,) + Network Laer 4-80 7 D (), c(,) + D ()} = min{2+1, 7+0} = 3 1

node table 0 2 7 node table 2 0 1 node table 0 2 3 2 0 1 7 1 0 0 2 7 2 0 1 7 1 0 2 7 1 7 1 0 time 4-81

node table 0 2 7 node table 2 0 1 node table 7 1 0 0 2 3 2 0 1 7 1 0 0 2 7 2 0 1 7 1 0 0 2 7 2 0 1 3 1 0 2 7 1 4-82

node table 0 2 7 node table 2 0 1 node table 7 1 0 0 2 3 2 0 1 7 1 0 0 2 7 2 0 1 7 1 0 0 2 7 2 0 1 3 1 0 0 2 3 2 0 1 3 1 0 0 2 3 2 0 1 3 1 0 0 2 3 2 0 1 3 1 0 time 2 7 1 4-83

D () = min{c(,) + D (), c(,) + D ()} = min{2+0, 7+1} = 2 node table 0 2 7 node table 2 0 1 node table 7 1 0 0 2 3 2 0 1 7 1 0 0 2 7 2 0 1 7 1 0 0 2 7 2 0 1 3 1 0 D () = min{c(,) + D (), c(,) + D ()} = min{2+1, 7+0} = 3 0 2 3 2 0 1 3 1 0 0 2 3 2 0 1 3 1 0 0 2 3 2 0 1 3 1 0 time 2 7 1 4-84

Distance Vector: Link cost changes Link cost changes: node detects local link cost change updates routing info, recalculates distance vector if DV changes, notif neighbors 1 4 50 1 good news travels fast t 0 : detects link-cost change, updates its DV, informs its neighbors. t 1 : receives update, updates its table, computes new least, sends its neighbors its DV. t 2 : receives s update, updates its distance table. s least costs do not change, so does not send a message to. Network Laer 4-85

Distance Vector Algorithm Input to : Node knows each neighbor v: c(,v) Decentralied algorithm since it onl needs local knowledge Distance vectors: Node maintains distance ( ) vector D = [D (): є N ] Node also maintains its neighbors distance vectors: D v = [D v (): є N ], for each neighbor v of Iterative, asnchronous: From time-to-time, each node sends its own DV estimate D to neighbors When a node receives new DV estimate neighbor, it updates its own DV using Bellman-Ford equation: D () min v {c(,v) + D v ()} where v are neighbors of, (for each node N) Output: least-cost paths to all other nodes Network Laer 4-86

Distance Vector: link cost changes Link cost changes: Good news travels fast Bad news travels slow - count to infinit problem! 44 iterations before algorithm stabilies Bef: D v () =4, D v () =1, D (v) =1, D () =4+1 =5 Aft: D v () = min{60, c(v,)+ D ()} = 6 Net: D () = = c(,v)+d v () =1+6=7 Then: D v () = c(v,)+d () = 1+7=8 Poisoned reverse: If routes through to get to : tells v: D () = (so v won t route to via ) D v () = 60 D () = 50 D v () =51 60 4 v 50 1 Will this completel solve count to infinit problem? 4-87

Comparison of LS and DV algorithms Message compleit LS: with n nodes, E links, O(nE) msgs sent DV: echange between neighbors onl convergence time varies Speed of Convergence LS: O(n 2 ) algorithm requires O(nE) msgs ma have oscillations DV: convergence time varies ma be routing loops count-to-infinit problem Robustness: what happens if router malfunctions? LS: DV: node can advertise incorrect link cost each node computes onl its own table DV node can advertise incorrect path cost each node s table used b others error propagate thru network 4-88

Routing Algorithm Classification Link State Topolog information is flooded within the routing domain Best end-to-end paths are computed locall at each router Best end-to-end paths determine net-hops Based on minimiing some notion of distance Works onl if polic is shared and uniform Eamples: OSPF, IS-IS Vectoring Each router knows little about network topolog Onl best net-hops are chosen b each router for each destination network Best end-to-end paths result composition of all net-hop choices Does not require an notion of distance Does not require uniform policies at all routers Eamples: RIP, BGP

The Gang of Four IGP Link State OSPF IS-IS Vectoring RIP EGP BGP ICNP 2002

Protocoles et Interconneions Course Overview and Introduction Dario Vieira Department of Computer Science EFREI