10/28/2003-10/30/2003 Network Layer, Routing, IP October 28-30, 2003.

Slides:



Advertisements
Similar presentations
CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
Advertisements

4: Network Layer4a-1 IP Addressing: introduction r IP address: 32-bit identifier for host, router interface r interface: connection between host, router.
Announcement r Recitation tomorrow on Project 2 r Midterm Survey at the end of this class.
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Network Layer introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol  datagram format  IPv4.
Data Communication and Networks Lecture 11 Internet Routing Algorithms and Protocols December 5, 2002 Joseph Conron Computer Science Department New York.
Routing - I Important concepts: link state based routing, distance vector based routing.
Network Layer-11 CSE401N: Computer Networks Lecture-9 Network Layer & Routing.
Network Layer4-1 Computer Networking (Datakom) Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing.
Announcement r Project 2 due Fri. midnight r Homework 3 out m Due 2/29 Sun. r Advertisement for my CS395/495 course next quarter: Computer Network Security:
Chapter 5 The Network Layer.
1 Announcement r CTEC code for TA CS 340 Lin Code: 322.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
Network Layer4-1 IP: Internet Protocol r Datagram format r IPv4 addressing r DHCP: Dynamic Host Configuration Protocol r NAT: Network Address Translation.
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing with.
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
4: Network Layer4a-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing.
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar1 ECSE-4730: Computer Communication Networks (CCN) Network Layer (Routing) Shivkumar.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
Announcement r Project 2 Extension ? m Previous grade allocation: Projects 40% –Web client/server7% –TCP stack21% –IP routing12% Midterm 20% Final 20%
Announcement r Project 2 due next week! r Homework 3 available soon, will put it online r Recitation tomorrow on Minet and project 2.
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
Computer Networking Intra-Domain Routing, Part I RIP (Routing Information Protocol)
Network Layer4-1 NAT: Network Address Translation local network (e.g., home network) /24 rest of.
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
Network Layer Lecture # 2 MAHS. 4: Network Layer 4b-2 Hierarchical Routing scale: with 200 million destinations: r can’t store all dest’s in routing tables!
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
12 – IP, NAT, ICMP, IPv6 Network Layer.
Chapter 4 Network Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 16.
Network Layer4-1 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network.
4: Network Layer4a-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing.
IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface UGH00emd UH10lo0.
Transport Layer 3-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012  CPSC.
CIS 3360: Internet: Network Layer Introduction Cliff Zou Spring 2012.
1 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing.
Network Layer4-1 Chapter 4 Network Layer All material copyright J.F Kurose and K.W. Ross, All Rights Reserved.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
The Network Layer & Routing
1 Week 5 Lecture 2 IP Layer. 2 Network layer functions transport packet from sending to receiving hosts transport packet from sending to receiving hosts.
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
Network Layer4-1 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol.
Overview of Internet Routing (I) Fall 2004 CS644 Advanced Topics in Networking Sue B. Moon Division of Computer Science Dept. of EECS KAIST.
Network Layer4-1 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol.
Sharif University of Technology, Kish Island Campus Internet Protocol (IP) by Behzad Akbari.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
The Internet Network layer
4: Network Layer4a-1 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous:
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
Network Layer4-1 Chapter 4 Network Layer All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down.
Network Layer4-1 NAT: Network Address Translation local network (e.g., home network) /24 rest of.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
CSE 421 Computer Networks. Network Layer 4-2 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
Chapter 4: Network Layer
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CPSC 335 Data Communication.
Chapter 4: Network Layer
Network layer functions
Chapter 4 – The Network Layer & Routing
Road Map I. Introduction II. IP Protocols III. Transport Layer
ECE453 – Introduction to Computer Networks
Overview The Internet (IP) Protocol Datagram format IP fragmentation
Chapter 4: Network Layer
ECSE-4730: Computer Communication Networks (CCN)
Chapter 4: Network Layer
Chapter 4: Network Layer
Presentation transcript:

10/28/ /30/2003 Network Layer, Routing, IP October 28-30, 2003

10/28/ /30/2003 Assignments Homework 4 Project 2 Read Chapter 4 sections for this week

10/28/ /30/2003 Network Layer Move packet from sender to receiver Network layer protocols in every host, router Three Functions: –path determination: route taken by packets from source to dest. Routing algorithms –forwarding: move packets from router’s input to appropriate router output –call setup: some network architectures require router call setup along path before data flows 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 application transport network data link physical

10/28/ /30/2003 Service Model End-to-end transport of data between sending and receiving systems –How is this different than the transport layer services? Datagram versus Virtual Circuit

10/28/ /30/2003 Virtual Circuit Call setup, teardown for each call Each packet carries VC identifier (not destination host ID) Every router on source-dest path maintains “state” for each passing connection –transport-layer connection only involved two end systems Link, router resources (bandwidth, buffers) may be allocated to VC –to get circuit-like performance

10/28/ /30/2003 Datagram Networks Routers: no state about end-to-end connections Packets forwarded using destination host address Best-effort service –No guarantees with respect to delay, in-order delivery application transport network data link physical application transport network data link physical 1. Send data 2. Receive data

10/28/ /30/2003 Datagram and the Internet Why is datagram service okay for the Internet?

10/28/ /30/2003 Routing Routing Protocol –Find route from default/first hop/source router to destination router Job of the algorithm – find a “good path” –Use graph abstraction to represent the network –Where do the numbers come from? A E D CB F

10/28/ /30/2003 Routing Algorithm Classification 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 –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 Load sensitive/insensitive

10/28/ /30/2003 A Link-State Routing Algorithm Global – every router knows about all others How does a node find out about all other nodes? Once a node has the complete topology, it runs Dijkstra’s algorithm to generate the routing table

10/28/ /30/2003 Notation c(i,j): link cost from node i to j. cost infinite 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, that is next v N: set of nodes whose least cost path definitively known

10/28/ /30/2003 Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infinity 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 cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

10/28/ /30/2003 Dijkstra’s algorithm: example Step start N A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) infinity 2,D D(F),p(F) infinity 4,E A E D CB F

10/28/ /30/2003 Discussion Algorithm complexity –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 –Solution? A D C B 1 1+e e 0 e A D C B 2+e e 1 A D C B 0 2+e 1+e A D C B 2+e 0 e 0 1+e 1 initially … recompute routing … recompute

10/28/ /30/2003 Distance Vector Routing Algorithm Iterative, asynchronous, and distributed Distance table –all nodes have one –row for all destinations and a column for neighbors D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w = =

10/28/ /30/2003 Distance Table: Example A E D CB D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14 loop!

10/28/ /30/2003 Routing Table D () A B C D A1764A1764 B D5542D5542 E cost to destination via destination ABCD ABCD A,1 D,5 D,4 Outgoing link to use, cost destination Distance table Routing table

10/28/ /30/2003 DV Overview wait for (change in local link cost of msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each node:

10/28/ /30/2003 Distance Vector Algorithm 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infinity /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w At all nodes, X:

10/28/ /30/2003 Distance Vector Algorithm 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min DV(Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval if we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors forever w X X X X X w w

10/28/ /30/2003 Example X Z Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y

10/28/ /30/2003 Example X Z Y

10/28/ /30/2003 Link Cost Changes node detects local link cost change updates distance table (line 15) if cost change in least cost path, notify neighbors (lines 23,24) X Z Y 1 algorithm terminates “good news travels fast”

10/28/ /30/2003 Link Cost Changes good news travels fast bad news travels slow - “count to infinity” problem! X Z Y 60 algorithm continues on!

10/28/ /30/2003 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? X Z Y 60 algorithm terminates

10/28/ /30/2003 Comparison of LS and DV Message Complexity Speed of Convergence Robustness

10/28/ /30/2003 Hierarchical Routing So far – all routers are equal, network is flat –Why is this view a problem?

10/28/ /30/2003 Hierarchical Routing Aggregate routers into autonomous systems ASs Intra-AS routing Each AS has a gateway –responsible for inter-AS routing

10/28/ /30/2003 Intra-AS and Inter-AS routing Gateways: perform inter-AS routing amongst themselves perform intra-AS routers with other routers in their AS inter-AS, intra-AS routing in gateway A.c network layer link layer physical layer a b b a a C A B d A.a A.c C.b B.a c b c

10/28/ /30/2003 Intra-AS and Inter-AS routing Host h2 a b b a a C A B d c A.a A.c C.b B.a c b Host h1 Intra-AS routing within AS A Inter-AS routing between A and B Intra-AS routing within AS B We’ll examine specific inter-AS and intra- AS Internet routing protocols shortly

10/28/ /30/2003 Assignments Continue work on Project 2Project 2 Finish reading chapter 4 for next week – we will not talk about 4.6 in class

10/28/ /30/2003 Network Layer forwarding table Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer

10/28/ /30/2003 IP Addressing IP address –32-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 =

10/28/ /30/2003 IP Addressing IP address: –network part (high order bits) –host part (low order bits) What’s a network ? (from IP address perspective) –device interfaces with same network part of IP address –can physically reach each other without intervening router network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) LAN

10/28/ /30/2003 Classful Addressing 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to to to bits

10/28/ /30/2003 CIDR Classful addressing –inefficient use of address space, address space exhaustion –example? CIDR: Classless InterDomain Routing –network portion of address of arbitrary length –address format: a.b.c.d/x, where x is # bits in network portion of address network part host part /23

10/28/ /30/2003 How do I get an IP address? Two options – what are they? Which is used when and why?

10/28/ /30/2003 What about the network part? ISP's block /20 Organization /23 Organization /23 Organization /23... ….. …. …. Organization /23

10/28/ /30/2003 Route Aggregation “Send me anything with addresses beginning /20” / / /23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning /16” /23 Organization Hierarchical addressing allows efficient advertisement of routing information:

10/28/ /30/2003 Constructing a Packet misc fields source IP addr dest IP addr data

10/28/ /30/2003 Determining the Next Hop Dest. Net. next router Nhops misc fields data A B E

10/28/ /30/2003 Determining the Next Hop Dest. Net. next router Nhops misc fields data A B E

10/28/ /30/2003 Router Forwarding Table misc fields data Dest. Net router Nhops interface A B E

10/28/ /30/2003 Datagram Format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time to live 32 bit source IP address head. len type of service flgs fragment offset upper layer 32 bit destination IP address Options (if any)

10/28/ /30/2003 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 fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

10/28/ /30/2003 IP Fragmentation and Reassembly ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =1480 fragflag =1 length =1500 ID =x offset =2960 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Example 4000 byte datagram MTU = 1500 bytes

10/28/ /30/2003 ICMP: Internet Control Message Protocol used by hosts, routers, gateways to communication network-level information –error reporting: unreachable host, network, port, protocol –echo request/reply (used by ping) network-layer “above” IP: –ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

10/28/ /30/2003 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network –Can renew its lease on address in use –Allows reuse of addresses (only hold address while connected an “on” –Support for mobile users who want to join network (more shortly) DHCP overview: –host broadcasts “DHCP discover” msg –DHCP server responds with “DHCP offer” msg –host requests IP address: “DHCP request” msg –DHCP server sends address: “DHCP ack” msg

10/28/ /30/2003 DHCP client-server scenario A B E DHCP server arriving DHCP client needs address in this network

10/28/ /30/2003 DHCP client-server scenario DHCP server: arriving client time DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs

10/28/ /30/2003 NAT: Network Address Translation local network (e.g., home network) /24 rest of Internet Datagrams with source or destination in this network have /24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: , different source port numbers

10/28/ /30/2003 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

10/28/ /30/2003 NAT S: , 3345 D: , : host sends datagram to , 80 NAT translation table WAN side addr LAN side addr , , 3345 …… S: , 80 D: , S: , 5001 D: , : NAT router changes datagram source addr from , 3345 to , 5001, updates table S: , 80 D: , : Reply arrives dest. address: , : NAT router changes datagram dest addr from , 5001 to , 3345

10/28/ /30/2003 NAT 16-bit port-number field: –60,000 simultaneous connections with a single LAN-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., P2P applications –address shortage should instead be solved by IPv6