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

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

CSC 401 Data and Computer Communications Networks

CSC 4900 Computer Networks: Routing Algorithms

Chapter 4 Network Layer

Chapter 4 Network Layer. Network Layer 4-1

Chapter 5 Network Layer: The Control Plane

DATA COMMUNICATOIN NETWORKING

CSCE 463/612 Networks and Distributed Processing Spring 2017

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

Chapter 4: Network Layer, partb

Chapter 4 Network Layer

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

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

Network Layer. CMPS 4750/6750: Computer Networks

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

Module 3 Network Layer CS755! 3-1!

Chapter IV: Network Layer

Chapter 4: Network Layer

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

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

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

Interplay between routing, forwarding

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

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

Routing Algorithms : Fundamentals of Computer Networks Bill Nace

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

Department of Computer Science Southern Illinois University Carbondale

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

CSC 401 Data and Computer Communications Networks

Lecture 4. The Network Layer (cont d)

Chapter 4: network layer

Network layer: Overview. Network layer functions Routing IP Forwarding

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

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

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

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

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

Master Course Computer Networks IN2097

CSC 8560 Computer Networks: Control Plane

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

CSC 4900 Computer Networks: Network Layer

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

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

internet technologies and standards

CMPE 80N: Introduction to Networking and the Internet

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

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

Chapter 4: Network Layer

Network Layer: Internet Protocol

Network layer: Overview. Network Layer Functions

COMP211 Chapter 4 Network Layer: The Data Plane

The Internet network layer

CSCE 463/612 Networks and Distributed Processing Spring 2018

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

Chapter 4 Network Layer

UNIT III THE NETWORK LAYER

Chapter 4: Network Layer

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

COMP 3331/9331: Computer Networks and Applications

Network Layer: Routing

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

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

Chapter 4 Network Layer

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

Dynamic Routing. The Protocols

Routing Algorithm Classification. A Link-State Routing Algorithm

CS 3516: Advanced Computer Networks

Chapter 4: network layer

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

Chapter 4 Network Layer

Chapter 4 Network Layer

Chapter 4: Network Layer. Chapter 4: Network Layer

CS 43: Computer Networks. 21: The Network Layer & IP November 7, 2018

Chapter 4 Network Layer: The Data Plane

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

Chapter 4 Network Layer

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

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

CSCI Computer Networks Fall 2016

Network layer: Overview. Network layer functions Routing IP Forwarding

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

Chapter 4 Network Layer

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

Chapter 4 Network Layer

Chapter 4 Network Layer

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

COMPUTER NETWORKS CHAP 4 : NETWORK LAYER

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

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

CS/ECE 438: Communication Networks Fall Network Layer

Router Architecture Overview

CS 3516: Advanced Computer Networks

Chapter 5 Network Layer: The Control Plane

Chapter 5 Network Layer: The Control Plane

Computer Networking Introduction

Chapter 4 Network Layer

Chapter 4 Network Layer

Transcription:

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 application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical Network Layer 4-

Two Key Network-Layer Functions forwarding: move packets from router s input to appropriate router output routing: determine route taken by packets from source to destination Analogy (driving): routing: process of planning trip from source to destimation forwarding: process of getting through single interchange routing algorithms Network Layer 4-

Datagram Forwarding table routing algorithm local forwarding table dest address output link address-range address-range address-range 3 address-range 4 3 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 Network Layer 4-3

Datagram Forwarding table Destination Address Range 00000 0000 0000000 00000000 through 00000 0000 0000 00000 0000 000000 00000000 through 00000 0000 000000 00000 0000 00000 00000000 through 00000 0000 000 otherwise Link Interface 0 3 Network Layer 4-4

IPv4 datagram format IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to ver head. len 6-bit identifier time to live type of service upper layer 3 bits flgs length data (variable length, typically a TCP or UDP segment) fragment offset header checksum 3 bit source IP address 3 bit destination IP address Options (if any) total datagram length (bytes) for fragmentation/ reassembly Network Layer 4-5

IP Addressing: introduction IP address: 3-bit identifier for host, router interface interface: connection between host/router and physical link router s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 3... 3... 3... 3...4 3...9 3...3 3..3. 3..3.7 3... 3..3. 3... = 0 0000000 0000000 0000000 3 Network Layer 4-6

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 3... 3... 3... 3...4 3...9 3...3 3..3.7 3... subnet 3..3. 3..3. network consisting of 3 subnets Network Layer 4-7

Subnets 3...0/4 3...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. 3..3.0/4 Subnet mask: /4 Network Layer 4-8

IP addressing: CIDR CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part 00000 0000 0000000 00000000 00.3.6.0/3 host part Network Layer 4-9

IP addresses: how to get one? Q: How does a host get an IP address? hard-coded by system admin in a file Windows: control-panel->network->configuration- >tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from a server plug-and-play Network Layer 4-0

IP addressing: the last word... Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes Network Layer 4-

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

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

IPv6 Addresses (IPv4 addresses, 3 bits long, written in decimal, separated by periods) IPv6 addresses, 8 bits long, written in hexadecimal, separated by colons. 3ffe:900:4545:3:00:f8ff:fe:67cf Leading zeros can be omitted in each field, :0003: is written :3:. A double colon (::) can be used once in an address to replace multiple fields of zeros. fe80:0000:0000:0000:000:f8ff:fe:67cf can be written fe80::00:f8ff:fe:67cf Network Layer 4-4

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

Transition From IPv4 To IPv6 Not all routers can be upgraded simultaneous How will the network operate with mixed IPv4 and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Dual stack: Both IPv4 and IPv6 protocol implemented in the routers Translation: When transiting, translate between protocols (information lost) Network Layer 4-5

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

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

Routingalgoritmer Hur skapas innehållet i routingtabellerna?? Network Layer 4-9

Graph abstraction 5 Graph: G = (N,E) u v x 3 3 w y 5 z 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) } Remark: Graph abstraction is useful in other network contexts Example: PP, where N is set of peers and E is set of TCP connections Network Layer 4-0

Graph abstraction: costs u 5 v x 3 3 w y 5 z c(x,x ) = cost of link (x,x ) - 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 ) Question: What s the least-cost path between u and z? Routing algorithm: algorithm that finds least-cost path Network Layer 4-

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

A Link-State Routing Algorithm Dijkstra s algorithm net topology, link costs known to all nodes accomplished via link state broadcast all nodes have same info computes least cost paths from one node ( source ) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k destinations 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 destination v p(v): predecessor node along path from source to v N': set of nodes whose least cost path definitively known Network Layer 4-3

Dijsktra s Algorithm 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 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' Network Layer 4-4

Dijkstra s algorithm: example D(v) p(v) D(w) p(w) D(x) p(x) D(y) p(y) D(z) p(z) Step N' 0 u 7,u 3,u 5,u uw 6,w 5,u,w uwx 6,w,w 4,x 3 uwxv 0,v 4,x 4 uwxvy,y 5 uwxvyz x 9 Notes: 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 Network Layer 4-5

Network Layer 4-6 Dijkstra s algorithm: another example 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 y x w v z 3 5 3 5

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

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

Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y) = min {c(x,v) + d v (y) } v where min is taken over all neighbors v of x Network Layer 4-9

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

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

Distance vector algorithm Basic 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 B-F equation: D x (y) min v {c(x,v) + D v (y)} for each node y N under minor, natural conditions, the estimate D x (y) converge to the actual least cost d x (y) Network Layer 4-3

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 Network Layer 4-33

D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{+0, 7+} = node x table cost to cost to x y z x y z x 0 7 y z node y table cost to x y z from from from x y z 0 node z table cost to x y z x y z 7 0 from x y z 0 3 0 7 0 D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{+, 7+0} = 3 y x 7 time z Network Layer 4-34

D x (y) = min{c(x,y) + D y (y), c(x,z) + D z (y)} = min{+0, 7+} = node x table cost to cost to cost to x y z x y z x y z x 0 7 x 0 3 x 0 3 y y 0 y 0 z z 7 0 z 3 0 node y table cost to cost to cost to x y z x y z x y z x x 0 7 x 0 3 y 0 y 0 y 0 z z 7 0 z 3 0 node z table cost to cost to cost to x y z x y z x y z from from from x y z 7 0 from from from x y z 0 7 0 3 0 from from from x y z 0 3 0 3 0 time D x (z) = min{c(x,y) + D y (z), c(x,z) + D z (z)} = min{+, 7+0} = 3 x y 7 z Network Layer 4-35

Distance Vector: link cost changes Link cost changes: node detects local link cost change updates routing info, recalculates distance vector x 4 y 50 z if DV changes, notify neighbors 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. t : y receives z s update, updates its distance table. y s least costs do not change, so y does not send a message to z. Network Layer 4-36

Distance Vector: link cost changes Link cost changes: good news travels fast bad news travels slow - count to infinity problem! 44 iterations before algorithm stabilizes: see text 60 x 4 y 50 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) will this completely solve count to infinity problem? Network Layer 4-37

Comparison of LS and DV algorithms Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n ) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: DV: node can advertise incorrect link cost each node computes only its own table DV node can advertise incorrect path cost each node s table used by others error propagate thru network Network Layer 4-38