CSC 401 Data and Computer Communications Networks

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

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

CSC 4900 Computer Networks: Routing Algorithms

Chapter 5 Network Layer: The Control Plane

Chapter 4 Network Layer. Network Layer 4-1

DATA COMMUNICATOIN NETWORKING

Chapter 4 Network Layer

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

CSCE 463/612 Networks and Distributed Processing Spring 2017

Chapter 4: Network Layer, partb

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

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2017

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

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

Chapter 4 Network Layer

Interplay between routing, forwarding

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

Chapter 4: Network Layer

Lecture 9. Network Layer (cont d) Network Layer 1-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

CSC 8560 Computer Networks: Control Plane

Routing Algorithms : Fundamentals of Computer Networks Bill Nace

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

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

Lecture 4. The Network Layer (cont d)

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

Network layer: Overview. Network layer functions Routing IP Forwarding

Network Layer. CMPS 4750/6750: Computer Networks

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

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

Chapter 5 Network Layer: The Control Plane

Chapter IV: Network Layer

Chapter 5 Network Layer: The Control Plane

Chapter 5 Network Layer: The Control Plane

Chapter 5 Network Layer: The Control Plane

CS 3516: Advanced Computer Networks

Department of Computer Science Southern Illinois University Carbondale

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

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

Lecture 17: Network Layer Addressing, Control Plane, and Routing

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

COMP 3331/9331: Computer Networks and Applications

Module 3 Network Layer CS755! 3-1!

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

Network Layer: Routing

Chapter 4: network layer

Dynamic Routing. The Protocols

Chapter 4: Network Layer

CS 457 Networking and the Internet. What is Routing. Forwarding versus Routing 9/27/16. Fall 2016 Indrajit Ray. A famous quotation from RFC 791

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

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

CS 3516: Advanced Computer Networks

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

EE 122: Intra-domain routing

CS 43: Computer Networks. 23: Routing Algorithms November 14, 2018

Data Communications & Networks. Session 7 Main Theme Networks: Part II Circuit Switching, Packet Switching, The Network Layer

Network Layer: Control Plane 5-2

Routing Algorithm Classification. A Link-State Routing Algorithm

Routing Algorithms. Daniel Zappala. CS 460 Computer Networking Brigham Young University

Network layer: Overview. Network layer functions Routing IP Forwarding

The Internet network layer

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

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

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

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

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

Chapter 4 Network Layer

Computer Networks. Instructor: Niklas Carlsson

Computer Networking Introduction

Internet Protocol: Routing Algorithms. Srinidhi Varadarajan

Telecomunicazioni. Docente: Andrea Baiocchi. DIET - Stanza 107, 1 piano palazzina P. Piga Via Eudossiana 18

Chapter 4: network layer

Chapter 4 Network Layer

Chapter 4 Network Layer

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

RSC Part II: Network Layer 3. IP addressing (2nd part)

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

Redes de Computadores. Shortest Paths in Networks

Chapter 4: Network Layer

Chapter 4 Network Layer

CS/ECE 438: Communication Networks Fall Network Layer

Telecomunicazioni. Docente: Andrea Baiocchi DIET - Stanza 107, 1 piano palazzina P. Piga Via Eudossiana 18

Chapter 4 Network Layer

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

CSC 4900 Computer Networks: Network Layer

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

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

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

Chapter 4 Network Layer

Chapter 4 Network Layer. Network Layer 4-1

Chapter 4 Network Layer

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

Chapter 4 Network Layer

Initialization: Loop until all nodes in N

Chapter 4 Network Layer

Router Architecture Overview

Master Course Computer Networks IN2097

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

Transcription:

CSC 40 Data and Computer Communications Networks Network Layer NAT, Routing, Link State, Distance Vector Prof. Lina Battestilli Fall 07

Chapter 4 Outline Network Layer: Data Plane 4. Overview of Network layer data plane control plane 4. What s inside a router 4.3 Internet Protocol (IP) datagram format, IPv4 addressing, DHCP, IPv6, NAT 4.4 Generalized Forward and SDN

Private IPv4 address spaces A private network is a network that uses private IP address space, following RFC 98 Used for home, office, and enterprise local area networks (LANs) If you have a local IP address then you need a NAT http://en.wikipedia.org/wiki/private_network

NAT: network address translation rest of Internet 38.76.9.7 0.0.0.4 local network (e.g., home network) 0.0.0/4 0.0.0. 0.0.0. 0.0.0.3 all datagrams leaving local network have same single source NAT IP address: 38.76.9.7,different source port numbers datagrams with source or destination in this network have 0.0.0/4 address for source, destination (as usual)

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)

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

NAT: network address translation : NAT router changes datagram source addr from 0.0.0., 3345 to 38.76.9.7, 500, updates table NAT translation table WAN side addr LAN side addr 38.76.9.7, 500 0.0.0., 3345 S: 38.76.9.7, 500 D: 8.9.40.86, 80 0.0.0.4 S: 0.0.0., 3345 D: 8.9.40.86, 80 : host 0.0.0. sends datagram to 8.9.40.86, 80 0.0.0. 0.0.0. 38.76.9.7 S: 8.9.40.86, 80 D: 38.76.9.7, 500 3 3: reply arrives dest. address: 38.76.9.7, 500 S: 8.9.40.86, 80 D: 0.0.0., 3345 4 4: NAT router changes datagram dest addr from 38.76.9.7, 500 to 0.0.0., 3345 0.0.0.3

NAT Example 7

NAT :RFC 3489, 538, 4687 NAT 0.39.64.96 (5.7.4.6) 64.33.77.00 64.33.77.00 0.39.64.96 5.7.4.6 64.33.77.00 0.39.64.96 43 554 5.7.4.6 80 43 80 554 Q: What packets does a NAT allow to traverse this mapping? Q: How are the Mapping Assigned? Q: When are mappings deleted? 8

9 NAT Static Configuration client wants to connect to server with address 0.0.0. server address 0.0.0. local to LAN (client can t use it as destination addr) visible NATed address: 38.76.9.7 client 0.0.0. Port 5000 38.76.9.7 NAT router 0.0.0.4 server Statically configure NAT to forward incoming connection requests at given port to server e.g., (3.76.9.7, port 500) always forwarded to 0.0.0. port 5000

NAT Automate Configuration Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to: learn public IP address (38.76.9.7) add/remove port mappings (with lease times) IGD 0.0.0. NAT router automated static NAT port map configuration 0

NAT Implications 6-bit port-number field: ~65K simultaneous connections with a single WAN-side address! NAT is controversial: routers should only process up to layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, e.g., PP applications address shortage should instead be solved by IPv6 Developing Apps is hard Proliferation of middleboxes: NAT, load balancers, firewalls, Intrusion Detection/Prevention Systems, etc.

The New Hourglass http smtp ssh ftp TCP IP UDP Network Layer And Transport Layers Ethernet WiFi DSL 3G

Chapter 5 Outline Network Layer: Control Plane 5. Introduction 5. Routing protocols: Link State, Distance Vector 5.3 intra-as routing in the Internet: OSPF 5.4 routing among the ISPs: BGP 5.5 The SDN control plane 5.6 ICMP: The Internet Control Message Protocol 5.7 Network management and SNMP

Network-layer functions Data Plane Control Plane forwarding: move packets from router s input to appropriate router output routing: determine route taken by packets from source to destination Two approaches to structuring network control plane: per-router control (traditional) logically centralized control (Software Defined Networking)

Routing protocols Routing protocol goal: determine good paths (equivalently, routes), from sending hosts to receiving host, through network of routers path: sequence of routers packets will traverse in going from given initial source host to given final destination host good : least cost, fastest, least congested top-0 list of important networking topics!

Graph Abstraction 5 u v x 3 3 w y 5 z graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } aside: graph abstraction is useful in other network contexts, e.g., PP, where N is set of peers and E is set of TCP connections

Graph abstraction: costs of links 5 c(x,x ) = cost of link (x,x ) u v x 3 3 w y 5 z e.g., c(w,z) = 5 cost could always be, or inversely related to bandwidth, or inversely related to congestion cost of path (x, x, x 3,, x p ) = c(x,x ) + c(x,x 3 ) + + c(x p-,x p ) key question: what is the least-cost path between u and z? routing algorithm: algorithm that finds that least cost path What If all the edges have the same cost?

Routing algorithm classification Q: global or decentralized information? global: all routers have complete topology, link cost info link state algorithms decentralized: router knows physically-connected neighbors, link costs to neighbors exchange info with neighbors distance vector algorithms Q: static or dynamic? static: routes change slowly over time dynamic: routes change more quickly periodic update in response to link cost changes Q: Load sensitive?

Chapter 5 Outline Network Layer: Control Plane 5. Introduction 5. Routing protocols: Link State Distance Vector 5.3 Intra-AS routing in the Internet: OSPF 5.4 Routing among the ISPs: BGP 5.5 The SDN control plane 5.6 ICMP: The Internet Control Message Protocol 5.7 Network management and SNMP

A Link-State Routing Algorithm Dijkstra s algorithm net topology, link costs known to ALL nodes accomplished via link state broadcast all nodes have same info computes least cost paths from one node ( source ) to all other nodes results in a forwarding table for that node iterative: after k iterations, know least cost path to k destinations Example: Internet s OSPF protocol

A Link-State Routing Algorithm x 9 5 4 7 8 u source 3 w 3 7 4 y z v

Dijkstra s algorithm: example Step 0 3 4 5 N' D(v) p(v) D(w) p(w) D(x) p(x) D(y) p(y) D(z) p(z) u 7,u 3,u 5,u uw 6,w 5,u,w uwx 6,w,w 4,x uwxv 0,v 4,x uwxvy,y uwxvyz x notation: c(x,y): link cost from node x to y; if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known 9 Computed at node u construct shortest path tree by tracing predecessor nodes ties can exist (can be broken arbitrarily) u 5 3 w 4 8 7 3 7 4 y z v

source: node u Initialization: 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 Dijsktra s Algorithm notation: c(x,y): link cost from node x to y; = if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known 9 find w not in N' such that D(w) is a minimum 0 add w to N' update D(v) for all v adjacent to w and not in N' : D(v) = min( D(v), D(w) + c(w,v) ) 3 /* new cost to v is either old cost to v or known 4 shortest path cost to w plus cost from w to v */ 5 until all nodes in N'

Dijkstra s algorithm: Example SOLUTION Step 0 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v),u,u,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x),u D(y),p(y),x D(z),p(z) 4,y 4,y 4,y u 5 v x 3 3 w y 5 z figure out path from u to z u x y z 37

Dijkstra s algorithm: Example resulting shortest-path tree from u: v w u x y z path from u to z u x y z resulting forwarding table in u: destination v x y w z link (u,v) (u,x) (u,x) (u,x) (u,x)

Dijkstra s algorithm Complexity algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N Iteration Comparisons n (n-) 3 (n-) n n(n+)/ comparisons: O(n ) more efficient implementations possible using a heap: O(nlogn) What happens when link cost changes or routers/link fail? 39

Dijkstra s algorithm Oscillations oscillations possible: link cost equals amount of carried traffic: Arpanet did this in the 80 s D A +e 0 0 0 e C initially e B D A +e 0 0 +e C B given these costs, find new routing. resulting in new costs 0 D A 0 +e 0 0 C +e B given these costs, find new routing. resulting in new costs D A +e 0 0 +e C B given these costs, find new routing. resulting in new costs 0 What can be done to prevent such oscillations? 40

Chapter 5 Outline Network Layer: Control Plane 5. Introduction 5. Routing protocols: Link State Distance Vector 5.3 Intra-AS routing in the Internet: OSPF 5.4 Routing among the ISPs: BGP 5.5 The SDN control plane 5.6 ICMP: The Internet Control Message Protocol 5.7 Network management and SNMP

Distance vector algorithm Bellman-Ford Equation (dynamic programming) Important relationship that exists among the costs of least-cost paths Let d x (y) := cost of least-cost path from x to y then d x (y) = min {c(x,v) + d v (y) } v cost from neighbor v to destination y cost to neighbor v min taken over all neighbors v of x 4

Bellman-Ford example source u v x neighbors: v, x, w 5 d v (z) = 5, d x (z) = 3, d w (z) = 3 3 3 w y 5 z path to z from u s neighbors 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 { + 5, + 3, 5 + 3} = 4 node achieving minimum is next hop in shortest path, used in forwarding table Gives us un idea of the neighbor-to-neighbor communication needed for DV 43

Distance Vector Algorithm D x (y) is the estimate of least cost from x to y x maintains its own Distance Vector D x = [D x (y): y є N ] Node x determines its Distance Vector by: Knowing the cost to each of its neighbors v: c(x,v) Also maintaining its neighbors Distance Vectors. for each neighbor v, x has D v = [D v (y): y є N ]

Distance Vector Algorithm Key Idea: 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 Bellman-Ford equation: D x (y) min v {c(x,v) + D v (y)} for each node y N The estimate D x (y) converges to the actual least cost dx(y)

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 Internet s RIP, BGP and original ARPAnet 4-46

from from from from from from D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{+0, 7+} = node x table x y z node y table x y z cost to x y z 0 7 cost to x y z 0 x y z x y z x y z 0 cost to 3 0 7 0 x y z 0 cost to 7 0 7 0 D x (z) = min{c(x,y) + D y (z),c(x,z) + D z (z)} = min{+, 7+0} = 3 x y 7 z node z table cost to x y z x y z 7 0 x y z x y z 0 cost to 7 0 3 0 Quiescent State until link cost changes time 47

Distance vector: link cost changes link cost changes: node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors x 4 y 50 z good news travels fast t 0 : y detects link-cost change, updates its DV, informs its neighbors. t : z receives update from y, updates its table, computes new least cost to x, sends its neighbors its DV. iterations needed to get to quiescent state t : y receives z s update, updates its distance table. y s least costs do NOT change, so y does not send a message to z. 4-48

Distance vector: link cost changes link cost changes: node detects local link cost change 44 iterations before algorithm stabilizes Why? 60 x 4 y 50 z bad news travels slow - count to infinity problem! Before link cost changes at node y c y, x = 4 and c y, z = D x x = 0 and D z x = 5 at node z c z, x = 50 and c z, y = D x x = 0 and D y x = 4 t 0 : y detects the link cost change D y x = min{c y, x + D x (x), c y, z + D z x } = min{ 60, 6} = 6 t : y informs z of it s new cost to x t : z computes its new cost to x via y to be D z x = 6+=7 t 3 : z informs y of it s new cost to x t 4 : y computes its new cost to x via z to be D y x =7+=8 wrong! Routing Loop

Distance vector: link cost changes link cost changes: node detects local link cost change 44 iterations before algorithm stabilizes at node y c y, x = 4 and c y, z = D x x = 0 and D z x = 5 60 x 4 y 50 at node z c z, x = 50 and c z, y = D x x = 0 and D y x = 4 z 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)

Comparison both used in Internet Number of messages Link State with n nodes, E links, O(nE) messages sent Distance Vector exchange messages between neighbors only speed of convergence O(n ) algorithm may have oscillations convergence time varies may be routing loops count-to-infinity problem robustness what happens if router malfunctions? node can advertise incorrect link cost each node computes only its own table DV node can advertise incorrect path cost each node s table used by others - > error propagates through the network e.g in 997 a router caused large portions of the internet to be disconnected for hours 5

References Some of the slides are identical or derived from. Slides for the 7 th edition of the book Kurose & Ross, Computer Networking: A Top-Down Approach,. Computer Networking, Nick McKeown and Philip Levis, 04 Stanford University