1 / 72

COMPUTER NETWORKS Chapter 05 The Network Layer Part 1

Explore the design issues of the network layer and learn about different routing algorithms for efficient data transmission.

pday
Download Presentation

COMPUTER NETWORKS Chapter 05 The Network Layer Part 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMPUTER NETWORKSChapter 05The Network Layer Part 1 Shoubao Yang Tel: 3601540 syang@ustc.edu.cn http://202.38.64.11/~syang September 2006 Computer Networks - 05 -1

  2. Chapter 5THE NETWORK LAYER Provide facilities for getting data from a source to a destination May require making many hops at intermediate routers along the way Computer Networks - 05 -1

  3. 5.1 Network Layer Design Issues • 5.1.1 Store-and-Forward Packet Switching • A host with a packet to send transmits it to the nearest router, either on its own LAN or over a point-to-point link to the carrier. The packet is stored there until it has fully arrived so the checksum can be verified. Then it is forwarded to the next router along the path until it reaches the destination host, where it is delivered. The environment of the network layer protocols Computer Networks - 05 -1

  4. 5.1.2 Services provided to the Transport Layer • Service goals: • Services should be independent of technology • Transport layer is shielded from number, type, and topology of the subnet • Uniform numbering plan across LANs and WANs • Issues about connection-oriented and connectionless services, the bottom line is about where to put the complexity. • In connection-oriented service, it is in the network layer (subnet) • In connectionless service, it is in the transport layer(hosts). Computer Networks - 05 -1

  5. The subnet is inherently unreliable • The Internet community argues that the routers’ job is moving packets around and nothing else. The subnet is inherently unreliable, no matter how it is designed. Therefore, the hosts should accept the fact that the network is unreliable and do error control, i.e., error detection and correction and flow control themselves. • Network service should be connectionless, with primitives SEND PACKET and RECEIVE PACKET and little else. No packet ordering and flow control should be done, the hosts are going to do that anyway; each packet must carry the full destination address, for it is carried independently of its predecessors. Computer Networks - 05 -1

  6. Subnet should provide a reliable, connection-oriented service? • The telephone companies argue that the subnet should provide a reliable, connection-oriented service. In this view, quality of service is the dominant factor, and without connections in the subnet, quality of service is very difficult to achieve, especially for real-time traffic such as voice and video. • These two camps are best exemplified by the Internet and ATM. Computer Networks - 05 -1

  7. Internal organization of the network layer • Virtual circuit • A route from source to destination is determined during connection setup, which is used for all traffic flowing over the connection. When the connection is released, the virtual circuit is terminated. Example: Setup procedure of virtual circuit • Datagrams • No routes are worked out in advance, even if the service is connection-oriented; each packet sent is routed independently of its predecessors; successive packets may follow different routes; more robust and more easily adapt to failures and congestion. Computer Networks - 05 -1

  8. 5.1.3 Implementation of Connectionless Service Routing within a datagram subnet. Computer Networks - 05 -1

  9. 5.1.4 Implementation of Connection-oriented Service Routing within a virtual-circuit subnet. Computer Networks - 05 -1

  10. 5.1.5 Comparison of virtual circuit and datagram Computer Networks - 05 -1

  11. Note: The services are independent of their implementation: Computer Networks - 05 -1

  12. 5.2 Routing Algorithms • Main issue: Routers that constitute the network layer of a network, should cooperate to find the best routes between all pairs of stations. • Properties of Routing Algorithm • Correctness • Simplicity • Robustness • Stability • Fairness • Optimality Computer Networks - 05 -1

  13. Routing Algorithms • The Optimality Principle • 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 Computer Networks - 05 -1

  14. Two major classes of routing algorithms • Conflict between fairness and optimality • Two major classes of routing algorithms • Non-adaptive algorithms(static routing): route is computed in advanced, off-line, and downloaded to routers, not depends on current traffic or topology. • Adaptive algorithms(dynamic routing): route is computed dynamically, on-line, according to current traffic and network topology Computer Networks - 05 -1

  15. 5.2.1 The optimality principle • One can make a general statement about optimal routes without regard to network topology or traffic: 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 on the same route. • Sink tree The set of optimal routes from all source station to a given destination forms a tree: sink tree This means: Routers have to collaborate to build the sink tree (or something that comes near to that) for each source station. Computer Networks - 05 -1

  16. Sink tree • 5.2.2 Shortest path routing Basic idea: During each step, select a newly reachable node at the lowest cost, and add the edge to that node, to the tree built so far. Computer Networks - 05 -1

  17. Shortest path routing Compute the shortest path from A to B using Dijkstra's Computer Networks - 05 -1

  18. Dijkstra's algorithm to compute the shortest path through a graph(1) Computer Networks - 05 -1

  19. Dijkstra's algorithm to compute the shortest path through a graph(2) Computer Networks - 05 -1

  20. 5.2.3 Flooding • Basic idea: Forward an incoming packet across every outgoing line, except the one it came through. • Basic problem: how to avoid “drowning by packets”? • Use a hop counter: after a packet has been forwarded across N routers, it is discarded. Got to find the right hop count, though. • Be sure to forward a packet only once (i.e. avoid directed cycles). Requires sequence numbers per source router. Each router keeps track of the last sequence number per source router. • Flood selectively: only in the direction that makes sense. • In general: flooding makes only sense when robustness is needed. Computer Networks - 05 -1

  21. 5.2.4 Distance Vector Routing • Basic idea: Take a look at the costs that your direct neighbors are advertising to get a packet to the destination. Select the neighbor whose advertised cost, added with the cost to get to that neighbor, is the lowest. Advertise that new cost to the other neighbors. • Ex: • Question: What will be the effect of this routing data? Computer Networks - 05 -1

  22. Distance Vector Routing Example Computer Networks - 05 -1

  23. Distance Vector Routing Problem The count-to-infinity problem. Computer Networks - 05 -1

  24. 5.2.5 Link State Routing • Better idea: One way or the other, broadcast info on the entire network topology to all routers, and let each of them calculate a sink tree to the other routers. • What a router needs to do (next to just routing): • Find out who its neighbors are and get their network addresses. • Calculate the cost for getting a packet to a neighbor. • Construct a link state packet telling all it has just learned. • Send that packet to all other routers. • Do a Dijkstra, compute the shortest path to every other router. Computer Networks - 05 -1

  25. Learning about the Neighbors Send a HELLO packet to each point-to-point line (a) Nine routers and a LAN. (b) A graph model of (a). Computer Networks - 05 -1

  26. Measuring Line Cost (1) • Simple: Just send an ECHO packet through each interface, and measure the round-trip delay. That’ll give you a reasonable estimate of the actual delay. For even better results, the test can be conducted several times, and the average used. • Problem: do we take the local load into account, or not? To factor the load in, the round-trip timer must be started when the ECHO packet is queued. To ignore the load, the timer should be started when the ECHO packet reaches the front of the queue. • YES: Including traffic-induced delays means that when a router has a choice between two lines with the same bandwidth, one of which is heavily loaded all the time and one of which is not, the router will regard the route over the unloaded line as a shorter path, resulting in better performance. Computer Networks - 05 -1

  27. Measuring Line Cost (2) • No: Consider the subnet divided into two parts, East and West, connected by CF and EI. Suppose most of the traffic is using CF, this line is heavily loaded with long delays. Including queuing delay in the shortest path calculation will make EI more attractive. After the new routing tables have been installed, most of the traffic will now go over EI, overloading this line. Therefore CF will appear to be the shortest path in the next update. As a result, the routing tables may oscillate wildly, leading to erratic routing and many potential problems. Computer Networks - 05 -1

  28. Building Link State Packets • Again simple: just put in a sequence number and aging information. The hard part is when to build them. Practice shows that once an hour is often enough. Computer Networks - 05 -1

  29. Distributing the Link State Packets • Basic idea: use a flooding algorithm, and dam the flood through sequence numbers: all routers maintain a list of (source,seq.number)-pairs. To safeguard against old data, down links, etc., an age is added to an LSP. The age is decremented once a second, and every time it is forwarded by a router. When the age hits zero, the LSP is discarded. Computer Networks - 05 -1

  30. Computing the New Routes • Use Dijkstra’s algorithm to construct the shortest path to all possible destinations. Computer Networks - 05 -1

  31. 5.2.6 Hierarchical Routing • Problem: No routing algorithm discussed so far can scale: all of them require each router to know about all others, that is, too demanding with respect to memory capacity and processing power. • Solution: Go for sub-optimal routes by introducing regions, and separate algorithms for intra-region and inter-region routing. Two or three levels will generally do. Computer Networks - 05 -1

  32. Computer Networks - 05 -1

  33. 5.2.7 Broadcast Routing • Problem: We want to send a message to (almost) every host on the network. In practice, this means we’re talking about (interconnected) LANs, or (relatively small) WANs. • Just send the message to each host individually. Not really good. • Use flooding. Acceptable provided that we can dam the flood. • Use multidestination routing, by means of a bitmap or list that is sent along with the packet. A router checks the destinations, and splits the list when forwarding it across different output lines. • Build a sink tree at the source and use that as your multicast route. The sink tree has to be a spanning tree (as in Dijkstra). The routers need to know the trees. Computer Networks - 05 -1

  34. Broadcasting: Reverse Path Forwarding • Problem: Suppose we don’t know every spanning tree. How can we construct one at low cost? • Solution: Make the assumption that when a router R forwards a packet for node N, it chooses an outgoing link that lies on a minimal spanning tree rooted at N. • Question: When is this a realistic assumption? Computer Networks - 05 -1

  35. 5.2.8 Multicast Routing (1) • Problem: But suppose that we want to send a message to only a subset of all the nodes in a network. In that case, we need to know when a host enters or leaves the multicast group. • Solution: Construct a spanning tree (at each router) for the entire network. Use the group-id to prune paths to nodes that do not contain members for that group. • Multicasting requires group management. Some way is needed to create and destroy groups, and to allow processes to join and leave groups. When a process joins a group, it informs its host. Routers know which of their hosts belong to which groups. Either hosts must inform their routers about changes in group membership, or routers must query their hosts periodically. Routers learn about which of their hosts are in which group and tell their neighbors, so the information propagates through the subnet. Computer Networks - 05 -1

  36. Multicast Routing (2) • Pruning strategy • Each router computes a spanning tree covering all other routers. Some routers are attached to hosts that belong to one or more groups. • When a process sends a multicast packet to a group, the first router examines its panning tree and prunes it, removing all lines that do not lead to hosts that are member of the group. Multicast packets are forwarded only along the appropriate spanning tree. • Link state routing is used and each router is aware of the complete topology, including which hosts belong to which groups, then the spanning tree can be pruned, starting at the end of each path, working toward the root, and removing all routers that do not belong to the group. • With distance vector routing, the basic algorithm is reverse path forwarding. Computer Networks - 05 -1

  37. Computer Networks - 05 -1

  38. 5.2.9 Routing for Mobile Hosts • This is fun: How can we forward messages to things that are constantly on the move, preferably in a wide-area context? • Note: The problem is not moving hosts from LAN to LAN, but finding the mobile computers. It becomes a bit easier when we assume that there is always a home location. Computer Networks - 05 -1

  39. Routing for Mobile Hosts (2) • Migratory hosts: basically stationary hosts, move from one fixed site to another but use the network only when they are physically connected to it. • Roaming hosts: actually compute on the run and want to maintain their connections as they move around. • Registration procedure at foreign agent site • Foreign agent broadcasts a packet announcing its existence and address. Mobile host may wait for one of these massages or broadcast a packet saying: are there any foreign agent around? • Mobile host registers with the foreign agent, giving its home address and MAC address, and security info. • The foreign agent contacts mobile host’s home agent and says: one of your hosts is over here with foreign agent’s address and some security info to convince the home agent the mobile host is really there. • Home agent checks the security info and tells it to proceed. • Foreign agent makes en entry in its tables and info the mobile that it is now registered. Computer Networks - 05 -1

  40. Tunneling: sending an IP packet in an IP packet. That’s the way to keep the routers ignorant of the fact that they’re routing something else. Adapt routers: when you send the new address back to the source, intermediate routers can adapt their tables. Computer Networks - 05 -1

  41. 5.2.10 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. • Ad Hoc network or MANET (Mobile Ad Hoc Networks) • Routers can come and go or appear in new places at the drop of a bit, the topology may be changing all the time, make routing quite different from a fixed network. Computer Networks - 05 -1

  42. Ad Hoc Networks Route Discovery (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. Computer Networks - 05 -1

  43. Ad Hoc Networks Route Discovery (2) Format of a ROUTE REQUEST packet. Format of a ROUTE REPLY packet. Computer Networks - 05 -1

  44. Ad Hoc Networks Route Maintenance (a) D's routing table before G goes down. (b) The graph after G has gone down. Computer Networks - 05 -1

  45. 5.2.11 Node Lookup in Peer-to-Peer Networks (a) A set of 32 node identifiers arranged in a circle. The shaded ones correspond to actual machines. The arcs show the fingers from nodes 1, 4, and 12. The labels on the arcs are the table indices. (b) Examples of the finger tables. Computer Networks - 05 -1

  46. 5.3 Congestion Control Algorithm • Problem: when too many packets have to be transmitted through the network, we can get into a serious performance problem: Computer Networks - 05 -1

  47. 5.3.1 General Principles of Congestion Control • Monitor the system to detect when and where congestion occurs • Percentage of all packets discarded for lack of buffer space • The average queue lengths • The number of packets that time out and are retransmitted • The average packet delay • Pass information to places where action can be taken • Transfer the information about the congestion from the point where it is detected to the point where something can be done • Adjust system operation to correct the problem • Increase the resources or decrease the load Computer Networks - 05 -1

  48. 5.3.2 Congestion Prevention Policies Policies that affect congestion. Computer Networks - 05 -1

  49. Congestion Control • Congestion can be caused by lack of bandwidth, but also by ill-configured or slow routers. • Make a distinction between open loop and closed loop solutions: is feedback provided (closed) or not (open)? • Avoid congestion by avoiding bursts: trafficshaping, regulate the average rate (and burstiness) of data transmission, and let the network provider do the traffic policing (monitor the flow). Computer Networks - 05 -1

  50. 5.3.3 Congestion Control in Virtual Circuits • Principle: when you set up a circuit, be sure that congestion can be avoided. 1.Admission control: if it’s too busy, just refuse to set up a virtual circuit. This is the same as refusing new users at an FTP site. 2.Select alternative routes when a part in the network is getting overloaded (i.e., temporarily rebuild your view of the network) 3. Negotiate the quality of the circuit in advance, so that the network provider can reserve buffers and the like. Resources are guaranteed to be there. Computer Networks - 05 -1

More Related