1 / 58

Chapter 5

Chapter 5. The Network Layer. Network layer. Network layer gets pkts from source to dest. The packets may need to go through different routers to get to the destination.

shandi
Download Presentation

Chapter 5

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. Chapter 5 The Network Layer

  2. Network layer • Network layer gets pkts from source to dest. • The packets may need to go through different routers to get to the destination. • Network layer must therefore know the topology of the subnet (I.e., the set of all routers) to be able to choose “optimal” paths through it. • ASIDE: Subnets allow a network to be split into several parts for internal use but act like a single network to the outside world. More later.

  3. Network layer • It must do some form of load balancing, I.e., make sure that certain routers are not overloaded while others are not • Must also deal with problems that arise when source and destination networks are different • Design Issues: 1) Services provided to the transport layer 2) Internal organization of the network layer

  4. Services provided to transport layer • Network layer provides services to transport layer • Goals of network layer services: • Services should be independent of subnet technology • Transport layer should be shielded from the number, type, and topology of the subnets present. • The network addresses made available to the transport layer should have a uniform numbering plan, even across LAN’s and WAN’s

  5. Services provided to transport layer 2 warring factions Connectionless Connection Oriented • Reliable connection oriented service • Connection opened, given id, closed • after data is sent • On opening connection; negotiation • about cost, quality of service is begun • Full duplex with packets delivered in • sequence • Flow control for fast sender slow • receiver • Primitives - SEND PKT, RECV PKT • No packet ordering or flow control is done since hosts will do it • Each packet carries full destination address since each pkt sent is carried independently of its predecessors EXAMPLE: Internet EXAMPLE: ATM

  6. Email FTP ……. TCP IP ATM Data Link Physical Running TCP/IP over an ATM subnet Problem: ATM network layer guarantees that packets are delivered in order but TCP also contains this capability.

  7. Internal organization of Network layer • Connection is called a virtual circuit • Packets in a connectionless setup is called a datagram • VIRTUAL CIRCUIT: • Using a virtual circuit ensures that the route for each packet (in a message consisting of a large number of packets) is fixed. • When the connection is released, termination of the virtual circuit occurs. • Each router in a virtual circuit must remember which virtual ckts are open and where they come from and where they go to

  8. Internal organization of Network layer • VIRTUAL CIRCUIT (cont’d): • Therefore each router has a table containing entries for all virtual ckts contained within it. • Each packet going through the subnet must contain a virtual ckt # in its header • Each machine chooses a virtual circuit independently. Full duplex case below • Suppose two machines initiate a virtual ckt & these propagate to adjacent routers. If each router (by chance) chooses the same virtual ckt #, then two unrelated virtual ckts on the same physical line will have the same #. Data packet could get confused. Simplex solves the problem

  9. Internal organization of Network layer • VIRTUAL CIRCUIT (cont’d): • When processes are through with a virtual ckt, it must indicate this so that router tables can free used up space. • This is achieved by charging for connect time as well as data quantity sent • DATAGRAMS • No routes worked out in advance • Successive packets may follow different routes • Routers have tables indicating which outgoing line to use for each possible destination router • Datagram contains full destination address

  10. Internal organization of Network layer • DATAGRAMS • Addresses can be long for a large network • Establishment and release of network or transport layer connections don’t require any special work on the part of the routers

  11. Comparison of VC and datagram Issue Datagram subnet VC subnet Circuit setup Not needed Required Addressing Each packet contains Each packet contains full source and a short VC # dest. Address State information Subnet does not hold Each VC requires state information subnet table space Routing Each packet is Route chosen when routed independent. VC is setup; all packets follow this route Effect of router None, except for All VC’s that passed failures pkts lost during crash thru failed router are terminated Congestion control Difficult Easy, need enough

  12. ROUTING ALGORITHMS • Main function of network layer is routing packets from source to destination machine. • Routing algorithm is part of the network layer that takes incoming packets and finds the “optimal” output line to put it on. • If subnet uses datagrams internally, routing algo is invoked for each and every packet passing through • If subnet uses VC’s internally, routing algo is invoked only when a new virtual ckt is set up. This is called session routing.

  13. ROUTING ALGORITHMS • Properties of a good routing algorithm • correctness, simplicity, robustness, stability, fairness and optimality • Robustness is extremely important. If network has to be rebooted every time a router is taken off line, then it is not robust. • Stability is impt. Some routing algorithms never reach equilibrium no matter how long they are run. • Fairness and optimality are inherently in conflict, see slide on next page

  14. Conflict between fairness and optimality

  15. ROUTING ALGORITHMS • What do we seek to optimize? • 1)Mean packet delay • 2)Total network throughput • 1) and 2) are in conflict since using a queueing system at capacity implies a long queueing delay • COMPROMISE minimize the number of hops a packet must make. This reduces bandwidth used as well as improve (reduce) delay • Routing algos could be nonadaptive (staticrouting) or adaptive

  16. ROUTING ALGORITHMS • NON-ADAPTIVE: • Routing decisions are not based on current conditions (topology and traffic) • Choice of route from I to J (for all I, J) done in advance, off line prior to network booting • ADAPTIVE • Routing decision based on topology and traffic • Issues: where information is obtained (locally or from all routers); when they change the routes (fixed time, when load changes, when topology changes); optimization metric (distance, # of hops, estimated transit time)

  17. ROUTING ALGORITHMS • Optimality Principle: • If router J is on the optimal path from router I to router K, then the optimal path from J to K falls along the same route • How? Route from I->J is r1 and the rest is r2. If a route better than r2 existed from J to K, it could be concatenated with r1 to improve the route from I to K. This contradicts the statement that r1r2 is optimal • Corollary: The set of optimal routes from all sources to a given destination forma a tree rooted at the destination (figure on next slide)

  18. A subnet and a sink tree for router B

  19. STATIC ROUTING ALGORITHMS • Build a graph of the subnet, with each node of the graph representing a router and each arc of the graph representing a communication line (link) • Shortest path • Number of hops. In this case, regardless of geographic distance the hops A->B->C are the same as the hops A->B->E (see figure on next slide) • Geographic distance. A->B->C is much longer than A->B->E. • Shortest path=fastest path (recalculated hourly)

  20. STATIC ROUTING ALGORITHMS • Shortest path (cont’d) • Weighted calculations. Each arc in the subnet has a weighting function associated with it. The weights are a function of distance, bandwidth, average traffic, communication cost, mean queue length, measured delay + more • Change the weighting function and the shortest distance will change. • Djikstra’s algorithm - See figure on next slide

  21. STATIC ROUTING ALGORITHMS First five steps in choosing shortest path from A to D

  22. STATIC ROUTING ALGORITHMS • Djikstra’s algorithm • Find shortest path from A to D • Consider weighted undirected graph (previous) • Each node is labeled with its distance from the source node with the best known path. • Labels may change as algo. Proceeds. • Initially all labels are tentative (and infinity) • When shortest path from source node to current node is discovered, label is called permanent • Mark node A as permanent (filled in circle) • Examine all nodes connected to A (adjacent) relabeling them with distance to A

  23. STATIC ROUTING ALGORITHMS • Djikstra’s algorithm (continued) • Examine all nodes connected to A (adjacent) relabeling them with distance to A • Also label adjacent nodes to a with the tag A so that we can construct a final path later. (In this case B, G are labeled with distance and A) • Examine tentatively labeled nodes & make the one with the smallest label permanent (B, this becomes the new working node - arrowed in) • Start with B & its adjacent nodes. If sum of the label on B & the distance from B to the node being considered is less than the label on that node, we have a new node which is relabeled

  24. STATIC ROUTING ALGORITHMS • Djikstra’s algorithm (continued) • After all nodes adjacent to working node have been inspected and the tentative labels changed if possible, entire graph is searched for tentatively labeled nodes with smallest value. • This node is made permanent and is the working node for the next round. • Why the algorithm works. Read on your own (bottom half of p. 350 and top of 351)

  25. STATIC ROUTING ALGORITHMS • Flooding algorithm • Every incoming packet is sent out on every outgoing line except the one it arrived on • Infinite number of packets could be generated & we need to damp this process. • Have a hop counter contained in header of each packet. Counter is decreased with each hop and packet is discarded when hop reaches 0. • Ideally - hop counter and distance from source to destination should be identical. If distance is unknown, entire diameter of subnet could be used

  26. STATIC ROUTING ALGORITHMS • Flooding algorithm • Alternative - read paras 2, 3 in sec 5.2.3 on own • Selective flooding - routers don’t send each and every incoming packet out on every line, only on those lines that are going approximately in the right direction (I.e., why send something East when it should generally be going West). • Useful in military applications where routers may be destroyed in a war. • Flooding could be used as a metric against which other routing algorithms are compared since it always chooses the shortest path in parallel

  27. Incomplete Notes • Slides for p. 351-358 were done by hand and are not part of this set. Please read p. 351-358 from your text book.

  28. DYNAMIC ROUTING ALGORITHMS • Split horizon stack • (p 358-359) read on your own • Link state routing • Problems with distance vector routing • Doesn’t take BW into account • Algorithm takes very long to converge (count-to-infinity problem) • 5 parts to this algo (from a routers viewpoint) • 1) Discover neighbours and obtain their network addresses • 2) Measure delay or cost to each of the neighbours

  29. STATIC ROUTING ALGORITHMS • Link state routing (cont’d) • 3) Construct a packet with all it has just learned • 4) Send packet in 3) to every router • 5) Compute shortest path to every other router • Thus topology and delays are empirically obtained - and Djikstra’s algorithm can be used in this case • DETAILS OF LINK STATE ROUTING • Learning about the neighbours • Router comes up and sends HELLO packet on each point to point line

  30. DYNAMIC ROUTING ALGORITHMS • Learning about the neighbours • Router comes up and sends HELLO packet on each point to point line • Router at other end replies with globally unique name • What happens when two or more routers are connected by a LAN? (See next slide)

  31. Routers A, C, F are directly connected to LAN LAN has been made into a node N to which A, C, F are connected, I.e., we go to F from A via N.

  32. DYNAMIC ROUTING ALGORITHMS • Line cost • It is expected that any router will have a reasonable estimate of delay to each of its neighbours. • For example, an ECHO packet could be sent N times and the average delay computed (total time divided by 2N) • Take load into account? If “yes,” then we must start timer when packet is put on queue. If “no,” then start timer when packet is at head of queue. • Build packet (build link state packets) • Identity, sequence #, age and list of neighbours (with delay to that neighbour included). (next slide)

  33. Build link state packets To be discussed When to build packets? Periodically seems to be a decent solution, but some recommend when a line goes down or changes its properties etc. This raises the question of how the router knows when properties have changed.

  34. DYNAMIC ROUTING ALGORITHMS • Distribute link state packets • Reliability is an issue. • When link state packet (LSP) is sent out, routers that are first to get LSP’s will change their routes. • Ultimately inconsistency will arise since different routers will have different understanding of what the topology is. • Use flooding to distribute LSP’s. Every time a packet passes through a router and is sent to a new line its sequence number is incremented. • Routers keep a log of all pairs (router, seq #) that have passed through.

  35. DYNAMIC ROUTING ALGORITHMS • Distribute link state packets • When new LSP comes in, it is checked against the list of packets already seen. If new, it is “flooded.” If a repeat, it is not “flooded.” If sequence number is less than the highest seen, that LSP is considered obsolete and rejected. • Use a 32 bit number in order to prevent wraparound. • Crashing routers - lead to lost sequence numbers. What happens when router comes up? • What about corruption of sequence numbers, I.e., 4 becomes 5000 for example. All pkts from 5-5000 will be rejected (obsolete that is)

  36. DYNAMIC ROUTING ALGORITHMS • Distribute link state packets • When new LSP comes in, it is checked against the list of packets already seen. If new, it is “flooded.” If a repeat, it is not “flooded.” If sequence number is less than the highest seen, that LSP is considered obsolete and rejected. • Use a 32 bit number in order to prevent wraparound. • Crashing routers - lead to lost sequence numbers. What happens when router comes up? • What about corruption of sequence numbers, i.e., 4 becomes 5000 for example. All pkts from 5-5000 will be rejected (obsolete that is)

  37. DYNAMIC ROUTING ALGORITHMS • Distribute link state packets • All LSP’s carry a time to live (TTL) (or age). A node always decrements the TTL of a newly received LSP before flooding to its neighbours. It also ages the LSP while it is stored in the node. • When the TTL reaches 0, the node re-floods LSP with a TTL of 0 - this is a signal that all nodes in the network should delete the LSP. • Route Calculation • Once a node has a copy of the LSP from every other node, the topology of the network is computed and can used Djikstra’s algo for best route calculations.

  38. DYNAMIC ROUTING ALGORITHMS • Hierarchical Routing • As network size increases, routing tables grow and grow. More time is needed to process these tables. • When networks grow beyond a certain size, it becomes necessary to do routing hierarchically. • Routers are divided into regions. Each router knows how to route packets to destinations within its own region but knows nothing about topological structure of other regions. • Could have a multi-layer hierarchy when network grows huge. regions -> clusters -> zones -> groups • Next slide shows a 5 level hierarchy

  39. DYNAMIC ROUTING ALGORITHMS Traffic for region 2 goes 1B-2A. Traffic for regions 3, 4, 5 go through 1C-3B line. Hierarchical table is 7 entries as opposed to 17.

  40. DYNAMIC ROUTING ALGORITHMS • Hierarchical Routing • Saves table space but at the cost of longer routes (see 1A to 5C via region 2 or region 3) • How many levels should a hierarchy have? Some math wizards showed that ln N is optimal for an N router subnet. • Ignore 5.2.8, 5.2.9, 5.2.10, and all of section 5.3 • INTERNETWORKING. • What are the issues when two or more networks are combined together to form an internetwork. • Why different networks? • 1. Installed base is large and growing

  41. INTERNETWORKING • Why different networks (cont’d)? • Different parts of an organization have different latitude in buying hardware/software resulting in non-standardization • Different networks have different technology. This trend will continue. • Various scenarios are possible • LAN-LAN • LAN-WAN • WAN-WAN • LAN-WAN-LAN - see following slide.

  42. INTERNETWORKING Common names for devices connecting dis-similar networks (depending on the layer). Layer 1: Repeaters copy bits between cable segments Layer 2: Bridges store and forward data link frames between LAN’s Layer 3: Multi-protocol routers forward packets between diff networks Layer 4: Transport gateways connect byte streams in the transport layer. Above 4: Application gateways allow internetworking above layer 4

  43. INTERNETWORKING • What is the difference between REPEATERS, BRIDGES, MULTIPROTOCOL ROUTERS, TRANSPORT GATEWAYS, APPLICATION GATEWAYS? • Repeaters are low-level devices that amplify or regenerate weak signals. They just copy bits as they arrive. • Bridges - store-&-forward devices. Takes a frame & passes it to DLL (where checksum is verified) & then passes it to physical layer for forwarding to a different type of network. Do not examine network layer header or packets inside frames.

  44. INTERNETWORKING • Multi-protocol routers are in the network layer. Takes packets from one line and forwards to another.A router knows whether it is an IP router, IPX router and CLNP (connectionless packet protocol for OSI) - it examines headers and makes decisions based on addresses over there. • Many devices combine bridge and router capability.

  45. Concatenated Virtual Circuits A sequence of virtual circuits is built up from the source through one or more multi-protocol routers (“gateway”) to the destination.

  46. Connectionless internetworking No sequence of virtual circuits is necessary Each packet travels a different path (possibly) No guarantee packets arrive in order - if they arrive at all Each network has its own network layer protocol so translation from one to another is hard Addressing: Example, IP has 32 bit internet address OSI has decimal address. Problems. Can be used over subnets that don’t have virtual circuits inside them - e.g., mobile networks, some LANs etc.

  47. IP ADDRESSES • IP Addresses.

  48. IP ADDRESSES # of networks Format # of hosts A 16 million 126 B 16382 64K C 254 million 2 million • IP Addresses

  49. Subnets • Subnets • Start with an example. Company A has a class C network shown below (for completeness). 32 bits Host 110 Network 8 bits • A can have 254 different hosts but suppose they are maxed out. Could get second C class address or get a LAN of a different type. • Problems: • # of networks could grow & grow. Mgt. Of networks is hard (e.g., go to Network information Center (NIC) to get new address every time.

  50. Subnets • Problems: • Moving machine B from one LAN to another? B’s IP address will have to be changed. C may get B’s old IP add. & get mail intended for A. This continues till changes are propagated throughout the internet. • Solution: subnet. • Subnet • Network is split into different parts which is opaque to the rest of the world. • Example on next slide considers a class B address.

More Related