Chapter 5 Network Layer.

Slides:



Advertisements
Similar presentations
Network Layer – Routing 2 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Advertisements

COS 461 Fall 1997 Routing COS 461 Fall 1997 Typical Structure.
1 The Network Layer Chapter 5. 2 Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation.
UNIT-IV Computer Network Network Layer. Network Layer Prepared by - ROHIT KOSHTA In the seven-layer OSI model of computer networking, the network layer.
1 LINK STATE PROTOCOLS (contents) Disadvantages of the distance vector protocols Link state protocols Why is a link state protocol better?
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #4 Mobile Ad-Hoc Networks AODV Routing.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 23 Introduction to Computer Networks.
Network Layer Introduction:
Summary The Problem The Dijkstra’s Shortest Path Algorithm
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Chapter 10 Introduction to Wide Area Networks Data Communications and Computer Networks: A Business User’s Approach.
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 21 Introduction to Computer Networks.
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EECC694 - Shaaban #1 lec #7 Spring The OSI Reference Model Network Layer.
Networks: Routing1 Network Layer Routing. Networks: Routing2 Network Layer Concerned with getting packets from source to destination. The network layer.
Ad Hoc Wireless Routing COS 461: Computer Networks
1 Internet Protocol: Forwarding IP Datagrams Chapter 7.
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
Routing Algorithms (Ch5 of Computer Network by A. Tanenbaum)
SAvPS – úvod Genči 2009 (bsaed on Tanenbaum’s slides.
Packet-Switching Networks Routing in Packet Networks.
The Network Layer Week 5. Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation of Connectionless.
1 Spring Semester 2009, Dept. of Computer Science, Technion Internet Networking recitation #3 Mobile Ad-Hoc Networks AODV Routing.
Ad-hoc On-Demand Distance Vector Routing (AODV) and simulation in network simulator.
Network and Communications Ju Wang Chapter 5 Routing Algorithm Adopted from Choi’s notes Virginia Commonwealth University.
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.
10/19/20151 The Network Layer. 10/19/20152 Introduction Route packets through subnet So, it must know the topology of the subnet It should also be able.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 5 Network Layer.
The Network Layer Introduction  functionality and service models Theory  link state and distance vector algorithms  broadcast algorithms  hierarchical.
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.
The Network Layer.
Data Communications and Networking Chapter 11 Routing in Switched Networks References: Book Chapters 12.1, 12.3 Data and Computer Communications, 8th edition.
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
TELE202 Lecture 6 Routing in WAN 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Packet switching in Wide Area Networks »Source: chapter 10 ¥This Lecture.
THE NETWORK LAYER.
Teknik Routing Pertemuan 10 Matakuliah: H0524/Jaringan Komputer Tahun: 2009.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
Ad Hoc On-Demand Distance Vector Routing (AODV) ietf
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
Network Layer Chapter 5 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Design Issues Routing Algorithms Congestion.
Fundamentals of Computer Networks ECE 478/578
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.
The Network Layer Design Issues & Routing Algorithms Chapter 5.
Assignment 1  Chapter 1:  Question 11  Question 13  Question 14  Question 33  Question 34  Chapter 2:  Question 6  Question 39  Chapter 3: 
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The Network Layer Chapter
The Network Layer UNIT-4 snistforum.com. Network Layer Design Issues Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation.
The Network Layer Chapter 5 Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education- Prentice Hall, 2011.
Network Layer Routing Networks: Routing.
Network Layer COMPUTER NETWORKS Networking Standards (Network LAYER)
Network Layer.
Network Layer.
EEC-484/584 Computer Networks
Internet Networking recitation #4
THE NETWORK LAYER.
Chapter 5 The Network Layer.
Kuliah 5 ROUTING.
EEC-484/584 Computer Networks
ECE453 – Introduction to Computer Networks
The Network Layer Network Layer Design Issues:
PRESENTATION COMPUTER NETWORKS
EEC-484/584 Computer Networks
Network Layer Routing Networks: Routing.
Delivery, Forwarding, and Routing
Other Routing Protocols
Network Layer.
Presentation transcript:

Chapter 5 Network Layer

Network Layer Functions: connecting different application transport network data link physical Functions: Routing issues determine “good” path (sequence of routers) thru network from source to dest. Congestion (Not Contention!) More packets enter an area than can be processed Internetworking connecting different network technologies together Network layer protocols in every host, router 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 Design Issues Store-and-forward packet switching Services provided to transport layer Implementation of connectionless service Implementation of connection-oriented service Comparison of virtual-circuit and datagram networks

Network layer design issues Store-and-Forward packet switching After each reception checksum is done in router and a new packet is transmitted to the next router. 1

Network layer design issues Services provided to transport layer Independent of subnet technology Transport layer shielded from number, type, and topology of subnets Uniform network address numbering Even across LANs and WANs

Network layer design issues Two basic kind of services Connectionless (routers only send and receive packets) Packets also called datagram This kind of network is also called datagram subnet Connection oriented (error control and flow control is done end to end) Virtual circuit should set up before sending packets This kind of network is also called virtual circuit subnet

Connectionless: Datagram No call setup at network layer Packets forwarded using destination host address packets between same source-dest. pair may take different paths Use in Internet application transport network data link physical 2. Receive Data application transport network data link physical 1. Send Data

Connectionless: Datagram Routing within a diagram subnet: Store-and-Forward packet Subnet The table of router A is changed because of some reasons! Management and update this tables for routing = Routing algorithm Routing tables

Connection Oriented-Virtual Circuits Call setup, do for each call before data can flow Each packet carries VC identifier Used in ATM, frame-relay, X.25 application transport network data link physical 6. Receive data 3. Accept call 2. Incoming call application transport network data link physical 5. Data flow begins 4. Call connected 1. Initiate call

Virtual Circuits Routing within a virtual-circuit subnet:

Comparison of Virtual-Circuit and Datagram Subnets

Routing Algorithms The network layer is responsible for routing packets from the source to destination. The routing algorithm is the piece of software that decides where a packet goes next (e.g., which output line, or which node on a broadcast channel). For connectionless networks, the routing decision is made for each datagram. For connection-oriented networks, the decision is made once, at circuit setup time. The routing algorithm must deal with the following issues: Correctness, simplicity, stability, fairness and optimality Minimizing mean packet delay or maximizing total network throughput Routing is different from Forwarding!: Forwarding: Select the output path using routing table Routing: Management and updating the routing tables

Desirable properties of the routing algorithms: Correctness: Simplicity: for efficiency Robustness: must be able to sustain the changes in the networks (cannot just rely on reboot) Stability: should converge to equilibrium Fairness: every one gets to send Optimality: (Selection of Best Route)as efficient as possible

Conflict between fairness and optimality. Routing Algorithms Conflict between fairness and optimality. If traffic flows between A and A’, B and B’, and C and C’, the utilization of the network will be good, but flow between X and X’ will be severely restricted. Fairness must often be imposed at the expense of overall utilization.

Optimality Principle Optimality principle: This means: If router J is on the optimal path from router I to router K, then the optimal path from J to K also falls along the same route. This means: Given the final destination, routers only need to know the optimal route to the next router. Construct a sink tree with the destination to be root. The goal of all routing algorithms is to discover and use the sink tree for all routers. Since it is a tree, there is no loops. There would be different sink trees for each final destination.

The Optimality Principle (a) A subnet. (b) A sink tree for router B.

Routing There are two types: Static (Non-Adaptive) routes never update or update slowly over time Examples: Dijkstra, Flooding algorithm Dynamic (Adaptive) routes update more quickly use dynamic information of current topology such as load, delay, … Examples: Distance Vector, Link State Routing From another view: Global: all routers have complete topology, link cost info Decentralized: router knows physically-connected neighbors

Routing Algorithms Shortest Path Routing (Dijkstra’s) Flooding Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

Dijkstra Algorithm Net topology, link costs known to all nodes Non-Adaptive Algorithm Net topology, link costs known to all nodes Global algorithm Cost of a link is a function of : Number of Hops, Distance, Average traffic, Delay, … Computes least cost paths (Minimum path) from one node (‘source”) to all other nodes gives routing table for that node Iterative: after k iterations, know least cost path to k dest.’s

The shortest path from A to D is: ABEFHD Next steps? Figure. The first five steps used in computing the shortest path from A to D. The arrows indicate the working node. The shortest path from A to D is: ABEFHD

Example Find the Shortest path from s to y using dijsktra algorithm for the following graph. Solution

Dijkstra Animation http://optlab-server.sce.carleton.ca/POAnimations2007/DijkstrasAlgo.html

Flooding Algorithm P flooding P P P Transmit a copy of each packet it receives on every one of its transmission links flooding P P P How to reduce looping even further: 1. hop count 2. time stamp Using Hop Counter: Hop count is number of nodes that a packet may have to pass through on the way to its destination. Each router decrements a hop count contained in the packet header. Whenever the hop count decrements to zero, the router discards the packet

Flooding How to Keep track of which packet have been flood Add a sequence number to each packet's header. Each router maintains a private sequence number. When it sends a new packet, it copies the sequence number into the packet, and increments its private sequence number. Keeps track of the highest sequence number seen from S. Whenever it receives a packet from S containing a sequence number lower than the one stored in its table, it discards the packet. Otherwise, it updates the entry for S and forwards the packet on

Selective Flooding Another variation of flooding is Selective Flooding: Don’t send incoming packets to ALL output lines Just forward on that lines which are going approximately in right direction Flooding is not practical in most applications, but it does have some uses Uses: In military applications, the network must remain robust in the face of (extreme) hostility Sending routing updates, because updates can't rely on the correctness of a router's routing table. Theoretical-chooses all possible paths, so it chooses the shortest one

Distance Vector Routing Adaptive Algorithm Distance Vector Routing Each router maintains a table (vector) giving the best known distance to a destination and the line to use for sending there. Tables are updated by exchanging information with neighbors. Each router knows the distance (cost) of reaching its neighbors (e.g. send echo requests). Routers periodically exchange routing tables with each of their neighbors. The distance vector routing algorithm is sometimes called by other names, most commonly Bellman-Ford routing algorithm and the Ford-Fulkerson algorithm. This algorithm was used in the original ARPANET

Distance Vector Routing Distance table for J DJ (G,?)= c(J,H)+minw{DH(G,w)}= 6+12=18 A subnet. Input from A, I, H, K, and the new routing table for J. Suppose that J has measured its delay to its neighbors, A, I, H, and K as 8, 10,12,6 msec respectively.

Count –to-infinity Problem Convergence is slow! Good news travels quickly, bad news travels slowly (count-to-infinity) problem Example: Propagation of good news Initially A is down and all other routers know this When A comes up, the other routers learn about it via the vector exchanges There is no path to A Table for dest.=A In a subnet with longest subnet path=N, after N exchanges everyone will know

Count-to-Infinity Problem Example: Propagation of bad news The count-to-infinity problem A goes down after initially After this A goes down B thinks that there is a path to A thru C but C itself go to A via B! Counting will continuous to infinity

Link State Routing Each router must do the following:  Discover its neighbors, learn their network address. Sends ‘hello' message on booting.  Measure the delay or cost to each of its neighbors. Delay= (Send ‘Echo’ message + Receive its reply)/2  Construct a packet telling all it has just learned. Construct Link State (LS) packet, it contains: Source Add., Seq. No., Age No., List of neighbors + their delay  Send this packet to all other routers. Forwards link state packets to all other routers using Flooding algorithm.  Compute the shortest path to every other router. Each router uses an Dijkstra algorithm to calculate shortest paths based on the current values in its database. Adaptive Algorithm

Link State Routing Link state routing is based on the assumption that, although the global knowledge about the topology is not clear, each node has partial knowledge: it knows the state (type, condition, and cost) of its links In other words, the whole topology can be compiled from the partial knowledge of each node

Creation of Link State Packet (LSP) A link state packet (LSP) can carry a large amount of information such as the node identity, the list of links, a sequence number, and age Node identity and the list of links are needed to make the topology Sequence number facilitates flooding and distinguishes new LSPs from old ones Age prevents old LSPs from remaining in the domain for a long time

Link State Routing The link state packets for this subnet.

Hierarchical Routing As a network becomes larger, the amount of information that must be propagated increases, and the routing calculation becomes increasingly expensive. (Increase the memory amount and calculation) Hierarchical routing: Divide the network into regions, with a router only knowing the details of how to route to other routers in its region. Hides information from far-away nodes, reducing the amount of information a given router needs to perform routing Router don’t know about the internal topology of other regions. Gateway is a router that knows about other regions

Hierarchical Routing Advantage: Disadvantage: Scaling. Each router needs less information In Ex. Distance table reduce from 17 entries to 7 Disadvantage: Sub optimal routes. The average path length increases Optimal path for 1A to 5C is thru region 2 while in hierarchical is thru region 3

Broadcast routing Send message to all other hosts: Poor methods: Update distributed database Distribute weather reports Distribute live radio/TV programs Poor methods: Send a distinct packet to each destination List of addresses needed High usage of bandwidth Flooding Too many packets Multi-destination routing Each packet contains a list of destination On each line a single packet

Broadcast routing Best method: use sink tree Broadcast source = root of sink tree Forwarding on sink tree lines Excellent use of bandwidth Source tree must be known at each intermediate node Best method: use sink tree Which sink tree? How many sink trees?

Broadcast routing Sink tree approximation: reverse path forwarding if a packet arrives on line used for traffic to source of broadcast then forward packet on all lines, except the one it arrived on else discard packet

Routing Algorithms Properties Shortest Path Routing Flooding Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

Multicast routing Send a message to a well-defined group Large in size Small compared to network as a whole Group management Create and destroy groups Process can leave and join a group algorithm How will routers know about groups?

Multicast routing Algorithm Pruning: Source computes spanning tree Remove lines that do not lead to hosts of group ( = pruning) Pruning: Link state routing Each router knows full topology Distance vector routing Reverse path forwarding + PRUNE messages to remove arcs

Multicast routing Pruning: source Link state routing Each router knows full topology Distance vector routing Reverse path forwarding + PRUNE messages to remove arcs

Routing Algorithms Shortest Path Routing Flooding Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

Routing for Mobile Hosts 4. Network Layer - routing February 2006 Routing for Mobile Hosts Model of world: WAN + LANs, wireless cells Migratory users Roaming users Move from time to time Use network when connected Compute on the run Maintain connections as they move around Computer Networks

Routing for Mobile Hosts Foreign agent: keeps track of users: who are currently visiting the area Home agent: keeps track of users whose home is in the area who are currently visiting another area Permanent home location Permanent home address

Routing for Mobile Hosts How does it work? Registration procedure with foreign agents Sending packets Leaving an area Registration procedure with foreign agent Announcing existence of foreign agent Broadcast by foreign agent Broadcast query by arriving mobile user Mobile user gives to foreign agent Home address Current data link address Security information Foreign agent contacts home agent of user

Routing for Mobile Hosts Registration procedure with foreign agent (cont.) Announcing existence of foreign agent Mobile user gives to foreign agent Foreign agent contacts home agent of user Identity of user Security info Network address of foreign agent Home agent Checks security info Sends ack to foreign agent Foreign agent Stores state Informs mobile user

Routing for Mobile Hosts Sending a packet to a mobile user Home address is used  packet routed to home LAN Packet intercepted by home agent Packet forwarded to the foreign agent Encapsulation – tunneling Foreign agent forwards packet to mobile user Sender is given address of foreign agent Encapsulation – tunneling used

Routing for Mobile Hosts 4. Network Layer - routing February 2006 Routing for Mobile Hosts Home agent Foreign agent Computer Networks

Routing for Mobile Hosts Leaving an area Announced by user  deregistration Automatic detection by foreign agent Various different schemes: Protocol carried out by routers or hosts Routers along the way intercept and redirect traffic Modify original packet instead of encapsulation

Routing Algorithms Properties Shortest Path Routing Flooding Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

Routing in Ad Hoc Networks Networks of nodes that just happen to be near each other are called ad hoc networks or MANETs (Mobile Ad hoc NETworks). Ad Hoc Network = routers are mobile No fixed topologies No fixed or known neighbors Valid paths can disappear at any time Node = router + host Routing quite different from routing in wired networks Examples Military vehicles on a battlefield Fleet of ships at see People with notebooks (lacking 802.11) AODV = Ad hoc On-demand distance vector routing On-demand: route computed when needed Distance vector for mobile world Taking into account limited bandwidth + low battery life

Routing in Ad Hoc Networks Graph presentation Node Arc = nodes connected can communicate directly by radio Routing table: Line for known routes Can be valid or invalid A wants to send a packet To H: forward to D To I: start route discovery broadcasting a route request packet

Routing in Ad Hoc Networks (a) Range of A's broadcast. (b) After B and D have received A's broadcast. (c) After C, F, and G have received A's broadcast. (d) After E, H, and I have received A's broadcast. Shaded nodes are new recipients. Arrows show possible reverse routes.

Routing in Ad Hoc Networks Route request packet: Source & destination address: e.g. IP address Request ID: local counter incremented for each new route request packet broadcasted allows to discard duplicate requests at other nodes Source sequence # counter to distinguish old routes to destination from new ones Destination sequence # most recent sequence counter of destination seen by source

Routing in Ad Hoc Networks Processing a route request packet duplicate request? Yes: discard Fresh route to destination known? Fresh = local destination sequence # >= destination sequence # in request Yes: send route reply packet No fresh route to destination is known! Store info from route request in reverse route table; to enable the forwarding of route reply packets Increment hop count Rebroadcast route request

Routing in Ad Hoc Networks Route reply packet Returned by Intermediate node knowing a fresh route Destination node Destination sequence# Number known by sender of reply packet Hop count Set to length of path known by sender of reply packet For destination = 0

Routing in Ad Hoc Networks Route maintenance Detect that neighbors are not reachable anymore Broadcast Hello packet periodically Failure to send packet Cleanup routing table Additional field in routing table: active neighbor Nodes that have offered path to destination in recent past

Routing in Ad Hoc Networks Route maintenance Routing table of D G Node G goes down!

Routing in Ad Hoc Networks Route maintenance New routing table of D: Delete routes with G as next hop Delete G as active neigbor