1 / 127

The Network Layer

The Network Layer. Design Issues Routing Algorithms Congestion Control Internetworking Example Network Layer Protocols. Goals of the Network Layer. The network layer is concerned with getting packets from the source all the way to the destination the network layer must

ciara
Download Presentation

The Network Layer

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. The Network Layer • Design Issues • Routing Algorithms • Congestion Control • Internetworking • Example Network Layer Protocols Computer Networks - Network Layer

  2. Goals of the Network Layer • The network layer is concerned with getting packets from the source all the way to the destination • the network layer must • know the topology of the communication subnet • choose route to avoid overloading some of the communication lines and routers while leaving others idle • deal with problems when the source and destination are in different networks Computer Networks - Network Layer

  3. Services Provided to the Transport Layer • Connectionless (unreliable) services • each packet must carry the full destination address • no packet ordering and flow control should be done • Connection-oriented (reliable) services • a network layer process on the sending site must set up a connection to its peer on the receiving side • when a connection is set up, two processes can enter a negotiation about service parameters • packets are delivered in sequence • flow control is provided automatically Computer Networks - Network Layer

  4. International Organization of the Network Layer • virtual circuit • a route from the source to the destination is chosen as part of the connection setup • primarily for connection-oriented service • datagrams • each packet sent is routed independently of its predecessors • for connection-oriented and connectionless services Computer Networks - Network Layer

  5. Datagram Vs. Virtual Circuit Computer Networks - Network Layer

  6. Combinations of Services and Subnet Structures Services provided by Transport layer Connection-oriented Connectionless Services provided to Transport layer Connection-oriented Connectionless Subnet Structures Virtual Circuit Datagram ATM AAL1 over ATM UDP over ATM IP TCP over IP UDP over IP Computer Networks - Network Layer

  7. Routing • Packets are often routed from the source to the destination hop by hop. • Two networks are connected by at least a router. The network is defined from the point of view of the network layer. Computer Networks - Network Layer

  8. Types of Routing • Static Routing • Routes to destinations are predetermined and are not dependent on the current state (traffic, topology etc.) of the network. • Dynamic Routing (Adaptive Routing) • Routes being learned via exchange of routing information to reflect changes in the topology and traffic. • Default Routing: • Traffic to destinations that are unknown to the router is sent to a default “outlet”. Computer Networks - Network Layer

  9. The Optimality Principle • 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. • the set of optimal routes from all sources to a destination form a tree, called a sink tree, rooted at the destination. • The goal of all routing algorithms is to discover and use the sink trees for all routers. r2 J r1 I K Computer Networks - Network Layer

  10. Routing Algorithms • Static Routing Algorithms • Shortest Path Routing • Flooding • Flow-Based Routing • Dynamic Routing Algorithms • Distance Vector Routing • Link State Routing • Hierarchical Routing • Routing for Mobile Hosts • Broadcast Routing • Multicast Routing Computer Networks - Network Layer

  11. Shortest Path Routing • Find the shortest path between a given pair of routers. • Cost of a link may be a function of the distance, bandwidth, average traffic, communication cost, mean queue length, delay, etc. • The Dijkstra’s algorithm is used. Computer Networks - Network Layer

  12. Flooding • Every incoming packet is sent out on every outgoing line except the one it arrived on. • Vast numbers of duplicate packets are generated. • For robustness • Application: • Concurrent updates of databases • Always choose the shortest path M I J K L Computer Networks - Network Layer

  13. Flow-Based Routing • For a given line, if the capacity and average flow are known in advance, it is possible to compute the mean packet delay on that line from queueing theory. • The routing problem then reduces to finding a routing algorithm that produces the minimum average delay for the subnet. Computer Networks - Network Layer

  14. Distance Vector Routing • RIP, the distributed Bellman-Ford routing algorithm, the Ford-Fulkerson algorithm • Each router maintains a routing table giving the best known distance to each destination and which line to use to get there. • These tables are updated by exchanging information with the neighbors. Computer Networks - Network Layer

  15. Update Routing Table Computer Networks - Network Layer

  16. Distance Vector Routing • Metric used to measure the “distance” • number of hops • time delay • queue length • Drawback • it reacts rapidly to good news, but leisurely to bad news. Computer Networks - Network Layer

  17. A B C D E A B C D E Count-to-Infinity Problem Initially After 1 exchange After 2 exchanges After 3 exchanges After 4 exchanges After 5 exchanges After 6 exchanges down initially and come up later alive initially and down later Good News Bad News Computer Networks - Network Layer

  18. Link State Routing • IS-IS, CLNP, NLSP, OSPF • Each route must 1.Discover its neighbors and learn their network addresses. 2.Measure the delay or cost to each of its neighbors. 3.Construct a packet telling all it has just learned. 4.Send this packet to all other routers. 5.Compute the shortest path to every other router. Computer Networks - Network Layer

  19. Learning About the Neighbors • Send a special HELLO packet on each point-to-point line • the router on the other end is expected to send back a reply telling who it is HELLO I J L I am J K Computer Networks - Network Layer

  20. Measuring Line Cost • Send an ECHO packet over a line • the other side is required to send back ECHO immediately • the round-trip delay can be mesaured • if the load is taken into account • results in better performance • the routing table may be oscillate wildly Computer Networks - Network Layer

  21. Building Link State Packets Computer Networks - Network Layer

  22. Distributing Link State Packets • Use flooding • sequence number is used to determine among new, duplicate, or obsolete packets • three problems • sequence number may wrap around • a crash router will lose track of its sequence number when it restarts • a corrupted bit in sequence number may cause disaster Computer Networks - Network Layer

  23. The Use of ‘Age’ Field • Include in each packet • decremented once per second • when the age hits zero, the information from that router is discarded • also decremented by each router during the initial flooding process • no packet can get lost and live for an indefinite period of time Computer Networks - Network Layer

  24. Reducing Flooding Costs • When a link state packet comes in • it is put in a holding area to wait a short while • when another packet from the source comes in • duplicate: discarded • different: the older one is thrown out • all link state packets are acknowledged M I J K L Computer Networks - Network Layer

  25. Computing the New Route • Once a router has accumulated a full set of link state packets • it can construct the entire subnet graph by locally running Dijkstra’s algorithm • for a subnet with n routers, each of which has k neighbors, the memory required to store the input data is proportional to kn. Computer Networks - Network Layer

  26. Hierarchical Routing • When hierarchical routing is used, the routers are divided into regions • each router knows all the details about how to route packets to destinations within its own region • each router knows nothing about the internal structure of other regions. Computer Networks - Network Layer

  27. Hierarchical Routing Region 1 Region 2 Dest. Line Hops 1A ---- --- 1B 1B 1 1C 1C 1 2 1B 2 3 1C 2 4 1C 3 5 1C 4 Dest. Line Hops 1A ---- --- 1B 1B 1 1C 1C 1 2A 1B 2 2B 1B 3 2C 1B 3 2D 1B 4 3A 1C 3 3B 1C 2 4A 1C 3 4B 1C 4 4C 1C 4 5A 1C 4 5B 1C 5 5C 1B 5 5D 1C 5 A B B C C A D B C A A D B A Hierarchical table for 1A B Region 5 C Region 3 Region 4 Full table for 1A Computer Networks - Network Layer

  28. Routing for Mobile Hosts • Each mobile node is assumed to have a permanent home location that never changes. • Each area has one or more foreign agents, which keep track of all mobile nodes visiting the area. • In addition, each area has a home agent, which keep track of nodes whose home is in the area, but who are currently visiting another area. • When a new node enters an area, it must register itself with a foreign agent there. Then the mobile node will register either directly with its home agent, or through the foreign agent which forwards the registration to the home agent. Computer Networks - Network Layer

  29. Routing for Mobile Hosts Home Foreign WAN, MAN, or LAN moving Foreign moving Computer Networks - Network Layer

  30. Routing for Mobile Hosts • Datagrams sent to the mobile node are • intercepted by its home agent, then • tunneled by the home agent towards the mobile node, • received at the tunnel foreign agent, and • finally delivered to the mobile node. Computer Networks - Network Layer

  31. Routing for Mobile Hosts 1. Packet is sent to the mobile host’s home 3. Sender is given foreign agent’s address 2. Packet is tunneled to the foreign agent 4. Subsequent packets are tunneled to the foreign agent Computer Networks - Network Layer

  32. Broadcast Routing • To simply send a distinct packet to each destination • Flooding • Multidestination Routing • Spanning Tree Routing • Reverse Path Forwarding Computer Networks - Network Layer

  33. Multidestination Routing • Each packet contains a list of desired destinations. • When a packet arrives, the router checks all the destinations to determine the set of output lines for forwarding the packet. An output line is selected if it is the best route to at least one of the destinations. • The router generates a new copy of the packet for selected output line, with a set of destinations that are to use the line. Computer Networks - Network Layer

  34. Spanning Tree Routing • Assume each router has knowledge of a spanning tree (e.q. a sink tree) in the network. • Each router copies an incoming broadcast packet onto all the spanning tree lines except the one it arrives on. • Use minimum number of packets. Computer Networks - Network Layer

  35. Reverse Path Forwarding • Without knowing any spanning tree if a packet arrives at the line that is normally used for sending packets to the source of the broadcast the router forwards copies of it onto all lines except the one it arrived on. otherwise the packet is discarded Computer Networks - Network Layer

  36. Reverse Path Forwarding: An Example I B C D A F H J N F G I E A D E K G O M O H N J L K O E C G D N K M H B L Preferred link L B Computer Networks - Network Layer

  37. Multicasting • Send a message to all the other members of the group • group management • create and destroy groups • for processes to join and leave groups • routers knows which of their hosts belong to which group • routers tell their neighbors, so the information propagates through the subnet Computer Networks - Network Layer

  38. Multicast Routing • Each router computes a spanning tree covering all other routers in the subnet. • When a multicast packet for a group arrives, the first router examines its spanning tree and prunes it, removing all lines that do not lead to hosts in the group. • Multicast packets are forwarded only along the pruned tree. • mn trees is needed with n groups, each with an average of m members. Computer Networks - Network Layer

  39. Core-based Tree for Multicast Routing • A single spanning tree,called core-based tree, for a group is computed, with the root (core) near the middle of the group. • A host first sends a multicasting message to the core, which then does the multicasting along the spanning tree. • The tree is not optimal. However only n trees need to be stored. Computer Networks - Network Layer

  40. Maximun carrying capacity of subnet Perfect Desirable Congested Congestion • When too many packets are present in (a part of) a subnet, performance degrades. This situation is called congestion. Packet delivered Packet sent Computer Networks - Network Layer

  41. Congestion Control • goal • make sure the subnet is able to carry the offered traffic • Congestion causes • bursty data • insufficient memory • slow processor • low-bandwidth line Computer Networks - Network Layer

  42. Flow Control vs. Congestion Control 1000 Gbps Super Computer PC Flow Control 1 Gbps 1 Mbps 1000 Congestion Control 100 Kbps 1000 Computer Networks - Network Layer

  43. General Principles • Open Loop • make sure congestion does not occur in the first place • Closed Loop • monitor the system to detect congestion (where and when) • pass this information to places where action can be taken • adjust system operation to correct the problem Computer Networks - Network Layer

  44. Congestion Control Algorithm Taxonomy • explicit feedback • Packets are sent back from the point of congestion to warn the source. • implicit feedback • The source deduces the existence of congestion by making local observations, such as the acknowledgement time. Computer Networks - Network Layer

  45. Congestion Prevention Policies • Virtual circuit versus datagram • Most algorithms work only with virtual circuit. • Packet queueing and service policy • input queueing versus output queueing • round robin, priority-based, random, ... • Packet discarded policy • which packet is dropped when there is no space • Routing algorithm • Load sharing • Packet lifetime management Computer Networks - Network Layer

  46. Traffic Shaping/Policing • Congestion would be less common if traffic is less bursty • traffic shaping • force packets to be transmitted at a more predictable rate • traffic policing • monitor a traffic flow Computer Networks - Network Layer

  47. Leaky Bucket Algorithm packets unregulated flow interface implementing the leaky bucket algorithm The bucket holds packets. Water drips out of the hole at a constant rate. regulated flow Network Computer Networks - Network Layer

  48. After Network Network Token Bucket Algorithm Before tokens added periodically packets tokens The bucket holds packets. The bucket holds tokens. Computer Networks - Network Layer

  49. Properties of Token Bucket • allows saving up permission to send large bursts later • throws away token when the bucket fills up but never discards packets • C: token bucket capacity; :token arrival rate; S: burst length; M: maximal output rate C+ S=MS Computer Networks - Network Layer

  50. Flow Specification • An agreement on the traffic pattern • the source gives the flow specification to the subnet for approval Characteristics of the input Service Desired Loss sensitivity (bytes) Loss interval (sec) Burst loss sensitivity (packets) Min. delay noticed (sec) Max. delay variation (sec) Quality of guarantee Maximal packet size (bytes) Token bucket rate (bytes/sec) Token bucket size (bytes) Maximal transmission rate (bytes/sec) Computer Networks - Network Layer

More Related