Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer Chapter 5 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Design Issues Routing Algorithms Congestion.

Similar presentations


Presentation on theme: "Network Layer Chapter 5 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Design Issues Routing Algorithms Congestion."— Presentation transcript:

1 Network Layer Chapter 5 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Design Issues Routing Algorithms Congestion Control Quality of Service Internetworking Network Layer of the Internet Revised: August 2011

2 The Network Layer CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Responsible for delivering packets between endpoints over multiple links Physical Link Network Transport Application

3 TUNALI Computer Networks 1 3 Network Layer Functionality Getting packets from the source all the way to the destination Lowest layer that deals with end-to-end transmission Must know the topology of the physical network

4 Design Issues Store-and-forward packet switching » Services Provided to the Transport Layer Connectionless service – datagrams » Connection-oriented service – virtual circuits » Comparison of virtual-circuits and datagrams » CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

5 Store-and-Forward Packet Switching CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Hosts send packets into the network; packets are forwarded by routers ISP’s equipment

6 TUNALI Computer Networks 1 6 Services Provided to the Transport Layer Frequently, network layer is the interface between the carrier and the customer Services should be independent of the router technology Transport layer should be shielded from the topology of the routers present Network Layer addressing should be uniform

7 TUNALI Computer Networks 1 7 Unreliable and connectionless Just two primitives SEND PACKET RECEIVE PACKET The complexity is in the transport layer (hosts)

8 Connectionless Service – Datagrams Packet is forwarded using destination address inside it Different packets may take different paths CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 ISP’s equipment A’s table (initially) A’s table (later) C’s Table E’s Table Dest. Line

9 TUNALI Computer Networks 1 9 Connection-Oriented Service Properties Set up a connection to receiver Negotiate parameters Packets are guaranteed to be delivered in sequence Flow control provided Complexity is in the network layer

10 Connection-Oriented – Virtual Circuits Packet is forwarded along a virtual circuit using tag inside it Virtual circuit (VC) is set up ahead of time CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 ISP’s equipment A’s table C’s Table E’s Table In: Line Tag Line Tag: Out

11 TUNALI Computer Networks 1 11 Internal Organization of Network Layer Virtual circuits No need to choose a route for each packet Datagram No routes are worked out in advance Note that the type of services provided to transport layer and internal organization of the network are different concepts E.g. Network Layer may provide a connection- oriented service to transport layer even when it internally uses datagrams to move the packets around

12 TUNALI Computer Networks 1 12 Virtual Circuits Between the source and destination a path is established All the packets from the source to destination follow the same path Each router must remember where to forward packets for each of the currently open virtual circuits passing through it Each packet must contain a virtual circuit number field in the header for identification purposes Routers assign this number locally and maintain tables to determine which incoming packet with a particular number will be forwarded to which outgoing line

13 TUNALI Computer Networks 1 13 Datagrams Each packet must contain full destination address

14 TUNALI Computer Networks 1 14 Comparison of VC and Datagrams Router memory space for vc tables vs wasted bandwidth for extra long address in each packet header Set up time versus address parsing time Easier to control congestion with vc Datagram may be more suitable for transaction processing systems VC is vulnerable to crash of the router

15 Comparison of Virtual-Circuits & Datagrams CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

16 Routing Algorithms (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Optimality principle » Shortest path algorithm » Flooding » Distance vector routing » Link state routing » Hierarchical routing » Broadcast routing » Multicast routing » Anycast routing » Routing for mobile hosts » Routing in ad hoc networks »

17 Routing Algorithms (2) Routing is the process of discovering network paths Model the network as a graph of nodes and links Decide what to optimize (e.g., fairness vs efficiency) Update routes for changes in topology (e.g., failures) Forwarding is the sending of packets along a path CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

18 TUNALI Computer Networks 1 18 Routing Algorithm Properties Correctness Simplicity Robustness What happens if the topology changes? Stability Must converge to an equilibrium Fairness Optimality Minimize mean packet delay Maximize total network throughput

19 TUNALI Computer Networks 1 19 Classes of Routing Algorithms Nonadaptive algorithms Route is computed in advance and stored in the router This is called static routing Adaptive algorithms Base their decision on current measurement of traffic and topology

20 The Optimality Principle CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Each portion of a best path is also a best path; the union of them to a router is a tree called the sink tree Best means fewest hops in the example Network Sink tree of best paths to router B B

21 Shortest Path Algorithm (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Dijkstra’s algorithm computes a sink tree on the graph: Each link is assigned a non-negative weight/distance Shortest path is the one with lowest total weight Using weights of 1 gives paths with fewest hops Algorithm: Start with sink, set distance at other nodes to infinity Relax distance to other nodes Pick the lowest distance node, add it to sink tree Repeat until all nodes are in the sink tree

22 Shortest Path Algorithm (2) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 A network and first five steps in computing the shortest paths from A to D. Pink arrows show the sink tree so far.

23 TUNALI Computer Networks 1 23 Shortest Path Algorithm (3) Initialize T = {s} set of nodes incorporated (s source) L(n)=w(i,j) for n  s initial path costs to neighbors Get next node Add the neighbor x not in T that has least cost L(x) to s. Add the edge from this neighbor to old T that contributes to the path Update least cost paths For all n  T, update costs by L(n)=min[L(n),L(x)+w(x,n)]

24 Shortest Path Algorithm (4) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011... Start with the sink, all other nodes are unreachable Relaxation step. Lower distance to nodes linked to newest member of the sink tree

25 Shortest Path Algorithm (5) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011... Find the lowest distance, add it to the sink tree, and repeat until done

26 Flooding CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 A simple method to send a packet to all network nodes Each node floods a new packet received on an incoming link by sending it out all of the other links Nodes need to keep track of flooded packets to stop the flood; even using a hop limit can blow up exponentially

27 TUNALI Computer Networks 1 27 Flooding (2) Every incoming packet is sent out on every outgoing line except the one it arrived on Generates vast number of duplicate packets Solutions Put a hop counter to every packet Avoid flooding the same packet second time −Needs packet sequence numbers Use selective flooding −Do not put the packet to every outgoing line, instead put the packet to certain outgoing lines Used in military applications and measurements

28 Distance Vector Routing (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Distance vector is a distributed routing algorithm Shortest path computation is split across nodes Algorithm: Each node knows distance of links to its neighbors Each node advertises vector of lowest known distances to all neighbors Each node uses received vectors to update its own Repeat periodically

29 TUNALI Computer Networks 1 29 Distance Vector Routing 2 Each router maintains a table that contains the following for each destination Best known distance to the destination −Number of hops or −Time delay in milliseconds or −Total number of packets queued along the path Which line to use to get there Each router is assumed to know the distance to each of its neighbors

30 TUNALI Computer Networks 1 30 Distance Vector Routing 3 Once every T msec, each router sends to each neighbor a list of its estimated delays to each destination A router, knowing the distance to its neighbor, can calculate distances to all destinations via its respective neighbor Then, it can choose the minimum distance and forward packets via that neighbor

31 Distance Vector Routing (4) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Network Vectors received at J from Neighbors A, I, H and K New vector for J

32 The Count-to-Infinity Problem 1 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Failures can cause DV to “count to infinity” while seeking a path to an unreachable node Good news of a path to A spreads quickly X Bad news of no path to A is learned slowly

33 TUNALI Computer Networks 1 33 The Count-to-Infinity Problem 2 In distance vector routing Good news travel fast −One hop per exchange −Within N (number of nodes) exchanges, everyone will know about new changes Bad news travel slow −Count-to-Infinity problem »Routers increase their costs by a value of one to reach infinity

34 Link State Routing (1) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Link state is an alternative to distance vector More computation but simpler dynamics Widely used in the Internet (OSPF, ISIS) Algorithm: Each node floods information about its neighbors in LSPs (Link State Packets); all nodes learn the full network graph Each node runs Dijkstra’s algorithm to compute the path to take for each destination

35 TUNALI Computer Networks 1 35 Link State Routing 2 Distance vector routing Did not take line bandwidth into account Took too long to converge Link state routing: Each router Discover its neighbors, learn their network address. Measure the delay or cost to each of its neighbors. Construct a packet telling all it has just learned. Send this packet to all other routers. Compute the shortest path to every other router.

36 TUNALI Computer Networks 1 36 Learning about the Neighbors When a rooter is booted, it sends HELLO packet to all of its neighbors Neighbors reply by sending their globally unique names Modeling LANs need extra mechanisms In the next slide an artificial node N is added to represent the LAN −From A to C, the path is represented as ANC

37 TUNALI Computer Networks 1 37 Learning about the Neighbors 2 (a) Nine routers and a LAN. (b) A graph model of (a).

38 TUNALI Computer Networks 1 38 Measuring Line Cost Each router should know an estimate of delay to each of its neighbors To estimate the delay, a router can send an echo packet to its neighbor and measure the time when it receives it back While measuring time, it is possible to include or exclude the time the echo packet spends on the queues which corresponds to consider load on the line Including load may cause oscillations in the algorithm

39 TUNALI Computer Networks 1 39 Building Link State Packets Packets contain Identity of the sender Sequence number Age List of neighbors and delays Packets canbe issued Periodically or When a significant event occurs

40 Link State Routing (3) – LSPs CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 LSP (Link State Packet) for a node lists neighbors and weights of links to reach them Network LSP for each node

41 TUNALI Computer Networks 1 41 Distributing the Link State Packets Flooding is used Packet sequence numbers are used to discard duplicates or old packets by holding packets for a short while before flooding them 32-bit sequence numbers are used to prevent wrap-arounds For each packet, in addition to sequence number, age is used and decremented every second to solve Router crash problem Corrupted sequence number problem

42 Link State Routing (4) – Reliable Flooding CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Seq. number and age are used for reliable flooding New LSPs are acknowledged on the lines they are received and sent on all other lines Example shows the LSP database at router B

43 TUNALI Computer Networks 1 43 Computing the New Routes When a router accumulates a full set of link state packets, it can construct the entire network graph It then runs Dijkstra’s algorithm to construct shortest paths to all possible destinations Even for a large subnet, the memory requirements are reasonable Malfunctioning routers may cause problems Protocols using link state routing OSPF and IS-IS

44 TUNALI Computer Networks 1 44 Hierarchical Routing As networks grow Routing table memory requirements increase CPU time to execute routing algorithm increases Solution: Use hierarchical routing Routers are divided into regions A router knows every detail about its region but knows nothing about other regions Each region is represented by a “monitor” router Monitor routers form a higher level in hierarchy

45 Hierarchical Routing 2 Hierarchical routing reduces the work of route computation but may result in slightly longer paths than flat routing CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Best choice to reach nodes in 5 except for 5C

46 TUNALI Computer Networks 1 46 Hierarchical routing (3) Path length increases How many levels should the hierarchy have? If there are N nodes, the optimal number of levels is ln N

47 TUNALI Computer Networks 1 47 Broadcast Routing Broadcast Sending a packet to all destinations simultaneously Broadcast method 1: Send a distinct packet to each destination Needs addresses of destinations and wastes bandwidth Broadcast method 2: Flooding

48 TUNALI Computer Networks 1 48 Broadcast Routing 2 Broadcast method 3: Multidestination routing −Each packet contains a list of destinations −A router receiving a packet checks the destinations and determines the output lines needed − The router generates a new packet for each output line and modifies the destination list by including only those destinations that are on that particular line

49 TUNALI Computer Networks 1 49 Broadcast Routing (3) Broadcast method 4: Spanning tree −A subset of network that includes all routers but contains no loops −Each router knows which of its lines belong to the spanning tree (this is an important restriction) −Any incoming packet on a spanning tree line is forwarded to all other spanning tree lines

50 TUNALI Computer Networks 1 50 Broadcast Routing (4) Broadcast method 5: Reverse Path Forwarding −No need to know the spanning tree −When a broadcast packet arrives, the router checks to see if it arrived on the line that it uses forwarding packets to the source node of the broadcast −If yes, it forwards the packets to all other lines except the one it arrived on. −If no, it discards the packet, considering that the packet did not arrive through optimal route. −Simple and efficient

51 Broadcast Routing 5 Broadcast sends a packet to all nodes RPF (Reverse Path Forwarding): send broadcast received on the link to the source out all remaining links Alternatively, can build and use sink trees at all nodes CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Network Sink tree for I is efficient broadcast RPF from I is larger than sink tree

52 TUNALI Computer Networks 1 52 Multicast Routing Process Groups A set of processes that work in an interactive manner Multicasting Sending message to a group Multicast Routing Routing of multicast messages Group Management Creating and destroying groups Processes join and leave groups

53 TUNALI Computer Networks 1 53 Multicast Routing (2) Routers need to know which host belongs to which group Each router needs to compute a spanning tree covering all other routers in the group subnet Multicast messages are forwarded only along the appropriate spanning tree Link state or distance vector approaches are used to disseminate topology information Pruning Forming the spanning tree for a group Pruning by link state routing Each router knows the complete topology

54 Multicast Routing (3) – Dense Case Multicast sends to a subset of the nodes called a group Uses a different tree for each group and source CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Network with groups 1 & 2 Spanning tree from source S S S S Multicast tree from S to group 1 Multicast tree from S to group 2

55 Multicast Routing (4) – Sparse Case CBT (Core-Based Tree) uses a single tree to multicast Tree is the sink tree from core node to group members Multicast heads to the core until it reaches the CBT p 1. CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Sink tree from core to group 1 Multicast is send to the core then down when it reaches the sink tree

56 TUNALI Computer Networks 1 56 Multicast Routing (5) Pruning by distance vector routing Use reverse path forwarding to eliminate routers that reject that particular group communication Scales poorly

57 Anycast Routing CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Anycast sends a packet to one (nearest) group member Falls out of regular routing with a node in many places Anycast routes to group 1 Apparent topology of sink tree to “node” 1

58 TUNALI Computer Networks 1 58 Routing for Mobile Hosts To route a packet to a mobile host, the network first has to find it Classification of users Stationary: Never move Mobile: They move −Migratory: They move but physically connect to network somewhere −Roaming: They maintain connection as they move around Locations Home Foreign

59 TUNALI Computer Networks 1 59 Routing for Mobile Hosts (2) Each area has Home agent −Keeps track of users whose home is in the area Foreign agent −Keeps track of all mobile users who are visiting the area

60 TUNALI Computer Networks 1 60 Routing for Mobile Hosts (3) Each mobile host entering a foreign area must register with the foreign agent of that area as follows Mobile host provides foreign agent −Its home address −Current data link address −Security information Foreign agent contacts mobile host’s home agent and report the presence of the mobile host in its region The home agent confirms security information and permits proceed Foreign agent registers the mobile host

61 TUNALI Computer Networks 1 61 Encapsulation and Tunneling After registration, Any packet sent to the mobile host is intercepted by the home agent The packet is encapsulated by the home agent and sent to the foreign agent The home agent also informs the sender of the packet about the new address of the mobile host Subsequent packets are directly sent to the mobile host (tunneling)

62 Routing for Mobile Hosts 4 Mobile hosts can be reached via a home agent Fixed home agent tunnels packets to reach the mobile host; reply can optimize path for subsequent packets No changes to routers or fixed hosts CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

63 TUNALI Computer Networks 1 63 Routing in Ad Hoc Networks Possibilities when the routers are mobile: Military vehicles on battlefield. No infrastructure. A fleet of ships at sea. All moving all the time Emergency works at earthquake. The infrastructure destroyed. A gathering of people with notebook computers. In an area lacking 802.11.

64 Routing in Ad Hoc Networks 2 The network topology changes as wireless nodes move Routes are often made on demand, e.g., AODV (below) CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 A’s broadcast reaches B & D B’s and D’s broadcast reach C, F & G C’s, F’s and G’s broadcast reach H & I A’s starts to find route to I

65 TUNALI Computer Networks 1 65 Route Discovery Request ID Incremented each time a ROUTE REQUEST is broadcast Other nodes check source address and request id and discard duplicates Source sequence # Each node maintains a second counter that is increased whenever a Route Request is sent or someone else’s Route Request is replied Dest. Sequence # Most recent value of I’s sequence number that A has seen

66 TUNALI Computer Networks 1 66 AODV Algorithm A node receiving ROUTE REQUEST examines source address and request ID and discards it if it is a duplicate Looks up for destination in its route table. If fresh route is known, a ROUTE REPLY packet is sent back to source Else, increases hop count and broadcasts the packet It also stores the data in its reverse route table

67 Reading 5-1 5-2 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011

68 Homework 5959 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011


Download ppt "Network Layer Chapter 5 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Design Issues Routing Algorithms Congestion."

Similar presentations


Ads by Google