Network Layer (part 1) CPSC 363 Computer Networks Ellen Walker Hiram College (Includes figures from Computer Networking by Kurose & Ross, © Addison Wesley.

Slides:



Advertisements
Similar presentations
1 Routing Protocols I. 2 Routing Recall: There are two parts to routing IP packets: 1. How to pass a packet from an input interface to the output interface.
Advertisements

Lecture 9 Overview. Hierarchical Routing scale – with 200 million destinations – can’t store all dests in routing tables! – routing table exchange would.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 22 Omar Meqdadi Department of Computer Science and Software Engineering University.
What is “Routing”? Routing algorithm that part of the network layer responsible for deciding on which output line to transmit an incoming packet Adaptive.
Lecture 8 Overview. Graph abstraction u y x wv z Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v),
Routing - I Important concepts: link state based routing, distance vector based routing.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing with.
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side, delivers.
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,
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
Spring Routing & Switching Umar Kalim Dept. of Communication Systems Engineering 06/04/2007.
Lecture 7 Overview. Two Key Network-Layer Functions forwarding: move packets from router’s input to appropriate router output routing: determine route.
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%
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.5 Routing algorithms m Link state m Distance.
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)
1 Announcement #1 r Did you all receive homework #1 and #2? r Homework #3 will be available online during the day r Midterm.
Computer Networking Intra-Domain Routing, Part I RIP (Routing Information Protocol)
Delivery, Forwarding and
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.
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing.
Packet-Switching Networks Routing in Packet Networks.
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface UGH00emd UH10lo0.
Network Layer4-1 Chapter 4 Network Layer Part 3: Routing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March.
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.
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 5 Network Layer.
Network Layer4-1 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)
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.
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
Introduction 1 Lecture 19 Network Layer (Routing Algorithms) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 20 Omar Meqdadi Department of Computer Science and Software Engineering University.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Transport Layer 3-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_3.
CS 4284 Systems Capstone Godmar Back Networking. CS 4284 Spring 2013 Summary Basics of Network Layer –Routing (path selection) vs Forwarding (switching)
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,
Network Layer4-1 Routing Algorithm Classification Global or decentralized information? Global: r all routers have complete topology, link cost info r “link.
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.
4: Network Layer4a-1 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous:
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.
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
Distance Vector Routing
4. Interconnecting Networks: Routers. © Tallal Elshabrawy 2 Bridges Vs Routers BRIDGES DO WELL IN SMALL (FEW HUNDRED HOSTS) WHILE ROUTERS USED IN LARGE.
Application Layer 2-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
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.
Network Layer4-1 Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol.
CS 5565 Network Architecture and Protocols
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CPSC 335 Data Communication.
Intra-Domain Routing Jacob Strauss September 14, 2006.
Routing: Distance Vector Algorithm
Network layer functions
Road Map I. Introduction II. IP Protocols III. Transport Layer
Lecture 10 Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from.
ECE453 – Introduction to Computer Networks
EEC-484/584 Computer Networks
Chapter 4: Network Layer
Network Layer (contd.) Routing
EE 122: Intra-domain routing: Distance Vector
EE 122: Intra-domain routing: Link State
Chapter 4 Network Layer A note on the use of these ppt slides:
Presentation transcript:

Network Layer (part 1) CPSC 363 Computer Networks Ellen Walker Hiram College (Includes figures from Computer Networking by Kurose & Ross, © Addison Wesley 2002)

Network Layer Implements host-to-host communication Distributed throughout hosts and routers –No central routing mechanism! Network layer functions –Path determination (routing) –Forwarding (to appropriate output link) –Call setup (ATM, not IP)

Routing vs. Forwarding Routing is a network-wide process that determines end-to-end paths –Even though it is not done in a centralized way! Forwarding is a router-only algorithm that sends each packet out the “right” interface –Uses tables determined by routing algorithm –Reads addresses in datagram headers

Virtual Circuit Setup: Build routing information tables (including unique VC numbers) in each router Data transfer: look at each packet, determine output interface and VC number based on input interface and VC number Teardown: inform both ends and all internal routers that the VC is no longer needed; routers remove information from their tables Setup & teardown done by “signaling messages” that cause VC tables to be modified Used by ATM networks (basis in telephony) -- guaranteed bandwidth (constant or min) and ordering

Datagram Every packet contains entire address (sufficient information to be routed to destination) No signaling messages needed Each router maintains a forwarding table to indicate the “direction” to each destination –Forwarding tables can change at any time –Therefore no guarantee all packets in message take the same route! Today’s Internet provides (only) Datagram service - also called “best effort”

Advantages of Internet Model We can build more reliable transfer models (e.g. TCP) on top of it Easy to interconnect networks with different link-layer technologies (satellite vs. copper vs. radio, etc.) Network doesn’t need to understand application packets to route them; new applications can always be added on hosts

Routing Each host attached directly to a “first-hop” router (e.g. in the network card) Goal is to find the “least cost” path from source (router) to destination (router) –Assume every link has a numerical cost –Add up all link costs to get a path cost

Find Least Cost Path from A to F

Routing Algorithms Dynamic –Results change as network connectivity changes Global –Works with complete information about all nodes and link costs –Also called link state algorithms Decentralized –Each router makes its decisions based on partial information about nodes and link costs –More complete routing information evolves by information exchange between neighbors –Example: distance vector algorithm

Link State Algorithm Initialization: All nodes broadcast the identities and costs of their neighboring links until every node has an identical table, then every node can run its own copy of the algorithm Dijkstra’s Algorithm (all shortest paths) –Builds a list of shortest (known) distance to every (other) node –When complete, all links have been considered

Dijkstra’s Algorithm Initialization N = {A} // the only node we know is the source For every node v –If v is adjacent to A, then – D(v) = link cost from A to v – Prev(v) = A –Else D(v) = infinity

Dijkstra’s Algorithm Loop Find a node w (not in N) such that D(w) is a minimum Add w to N For each v adjacent to w and not in N –//update distance to be distance through w if it’s less –D(v) = min(D(v), D(w)+ link cost from w to v –If D(w)+link cost is shorter, set Prev(v)=w (This loop is repeated until all nodes are in N)

Dijkstra’s Algorithm Example Source node is A – A:0 B:3 C:x D:2 E:4 F:x Choose node D –A:0 B:3 C:x D:2 E:3 F:x Choose node B –A:0 B:3 C:4 D:2 E:3 F:7 Choose node E –A:0 B:3 C:4 D:2 E:3 F:4 Choose node C –A:0 B:3 C:4 D:2 E:3 F:4 Choose node F –A:0 B:3 C:4 D:2 E:3 F:4 A D E B C F Final “Previous” table A:A B:A C:B D:A E:D F:E (Node chosen when v got its final value to the left)

Result of Dijkstra’s Algorithm Each node knows its previous node along the least cost path from A Example –Previous table is [ A:A B:A C:B D:A E:D F:E ] –Path from A to F A … E F(prev of F is E) A… D E F(prev of E is D) A D E F(prev of D is A) Use this information to make a “next hop” table

Result of Dijkstra’s Algorithm Example Example –Previous table is [ A:A B:A C:B D:A E:D F:E ] –Path from A to F A … E F(prev of F is E) A… D E F(prev of E is D) A D E F(prev of D is A) In node A, next-hop(F) is D In node D, next-hop(F) is E In node E, next-hop(F) is F

Comments on Dijkstra’s Algorithm Time cost is O(N 2 ) –Roughly N searches through N possible next nodes each time –Note that the number of links is also O(N 2 ) for most networks! Traffic considerations can cause oscillation –Make costs not depend on traffic (not practical) –Avoid running algorithm simultaneously in all nodes (add random delay)

Distance Vector Algorithm Each node… –Receives information from its neighbors –Calculates –Distributes new information to its neighbors … until no new information is received This algorithm is.. –Asynchronous –Distributed –Iterative

Distance Table Each row represents a destination Each column represents a “next hop” Thus a cell indicates the current best estimate cost from “me” to “row” via “column” Example (in node A): –Row B, col C = c(A,C)+ C’s estimate of (C,B)

Example Distance Table In A: B D E B C D E F Red (minimum) indicates which next-hop to take A D E B C F

Distance Algorithm Initialize all values where row=col to direct distance to that col. (e.g. B,B=3 and D,D=2) Initialize all other values to infinity Send min distance for each destination to all neighbors Wait for a change (either message or link cost) –If cost to neighbor v changes by d, add d to each value in column v –If update from v (cost from v to Y has changed), recalculate distance to y (link to v + cost from v to Y) –If change caused a new min, send new D value for that min to all neighbors

Example: Assuming no initial knowledge, generate distance table (and next hop) Set AD to 5 and let network re-adjust Set AB to 100 and try again A D E B C F

Comments on Distance Vector Algorithm With no changes, settles fairly quickly –As soon as information propagates from one edge of the network to the other (network diameter) “Good news” spreads quickly –Reduction in link distance “Bad news” takes longer (“count to infinity”) –When a link is broken –Because the higher entry in the table might reflect old info “Poisoned reverse” –If Z goes through Y to get to X, then Z tells Y that Z’s distance to X is infinite –This prevents routes with short (but not long) loops

Link State vs. Distance Vector Routing Algorithms LS requires enough messages that every node knows the cost of every link, before the algorithm starts. DV sends messages as needed. When a link cost changes, LS informs every node, DV only sends messages where it matters (new least cost paths) LS is guaranteed to converge in O(N 2 ) DV can be faster, but can also “count to infinity” Bad cost table in LS hurts only the node; bad cost table in DV can hurt the whole network (broadcasting incorrect information)

Networks Are Hierarchical Total number of nodes is too big to keep track of all of them Organizations like to keep track of their own networks, presenting only one gateway to the “outside world” Result: –Networks divided into Autonomous Systems (AS) –Gateway router responsible for routing all packets to/from outside world –Most routing is Gateway to Gateway (think local roads & interstates)

Inter and Intra-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

Necessary Routing Information Non-gateway router (intra-AS only) –Holds complete routing information within AS –Sends all extra-AS packets to gateway router (as if that were their address) –“Hot potato” routing – get packet to “closest” gateway Gateway router (inter-AS and intra-AS) –Holds complete routing information within AS –Also hold routing information to other gateways –Routing protocols include BGP (later)

Summary so far (Sec. 4.5) Every router has a “next hop” table to route packets to the right interface (output) Routing algorithms determine these tables –Global –Distributed In the Internet, hosts are arranged hierarchically, and inter-gateway routing is separated from intra-gateway routing Next look at network-layer transmission units (datagrams) and their headers, then return to routing