Chapter 5 The Network Layer FATİH ŞAHİN 2007513806 Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation of Connectionless Service Implementation of Connection-Oriented Service Comparison of Virtual-Circuit and Datagram Subnets Store-and-Forward Packet Switching Implementation of Connectionless Service fig 5-1 The environment of the network layer protocols. Routing within a diagram subnet. Implementation of Connection-Oriented Service Routing within a virtual-circuit subnet. 1
Comparison of Virtual-Circuit and Datagram Subnets 5-4 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 The Optimality Principle (a) A subnet. (b) A sink tree for router B. Shortest Path Routing Flooding 5-8 top The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node. Dijkstra's algorithm to compute the shortest path through a graph. 2
Flooding (2) 5-8 bottom Link State Routing Each router must do the following: 1. Discover its neighbors, learn their network address. 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. Dijkstra's algorithm to compute the shortest path through a graph. Learning about the Neighbors Broadcast Routing (a) Nine routers and a LAN. (b) A graph model of (a). Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding. Multicast Routing Routing for Mobile Hosts (a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for group 1. (d) A multicast tree for group 2. A WAN to which LANs, MANs, and wireless cells are attached. 3
Routing in Ad Hoc Networks Route Discovery Possibilities when the routers are mobile: 1. Military vehicles on battlefield. No infrastructure. 2. A fleet of ships at sea. All moving all the time 3. Emergency works at earthquake. The infrastructure destroyed. 4. A gathering of people with notebook computers. In an area lacking 802.11. a) (a) Range of A's broadcast. b) (b) After B and D have received A's broadcast. c) (c) After C, F, and G have received A's broadcast. d) (d) After E, H, and I have received A's broadcast. Shaded nodes are new recipients. Arrows show possible reverse routes. Route Discovery (2) Route Discovery (3) Format of a ROUTE REQUEST packet. Format of a ROUTE REPLY packet. Route Maintenance Congestion Control Algorithms General Principles of Congestion Control Congestion Prevention Policies Congestion Control in Virtual-Circuit Subnets C ti C t li D t S b t Congestion Control in Datagram Subnets Jitter Control (a) D's routing table before G goes down. (b) The graph after G has gone down. 4
Congestion General Principles of Congestion Control 1. Monitor the system. detect when and where congestion occurs. 2. Pass information to where action can be taken. 3. Adjust system operation to correct the problem. When too much traffic is offered, congestion sets in and performance degrades sharply. Congestion Control in Virtual-Circuit Subnets Hop-by-Hop Choke Packets (a) A choke packet that affects only the source. (a) A congested subnet. (b) A redrawn subnet, eliminates congestion and a virtual circuit from A to B. (b) A choke packet that affects each hop it passes through. Jitter Control Quality of Service Requirements Techniques for Achieving Good Quality of Service Integrated Services Differentiated Services Differentiated Services Label Switching and MPLS (a) High jitter. (b) Low jitter. 5
Requirements The Leaky Bucket Algorithm 5-30 How stringent the quality-of-service requirements are. (a) A leaky bucket with water. (b) a leaky bucket with packets. The Token Bucket Algorithm 5-34 Internetworking How Networks Differ How Networks Can Be Connected Concatenated Virtual Circuits Connectionless Internetworking Tunneling Internetwork Routing Fragmentation (a) Before. (b) After. Connecting Networks How Networks Differ System Network Arch. Asynchron. Transfer Mode 5-43 Fiber Distributed Data Interface A collection of interconnected networks. Some of the many ways networks can differ. 6
How Networks Can Be Connected Concatenated Virtual Circuits SNA : Systems Network Architecture OSI : Open System Interconnected ATM : Asynchronous transfer Mode (a) Two Ethernets connected by a switch. (b) Two Ethernets connected by routers. Internetworking using concatenated virtual circuits. Connectionless Internetworking Tunneling TCP:Transmission Control Protocol UDP:User Datagram Model TCP:Transmission Control Protocol A connectionless internet. Tunneling a packet from Paris to London. Tunneling (2) Fragmentation Tunneling a car from France to England. (a) Transparent fragmentation. (b) Nontransparent fragmentation. 7
Fragmentation (2) The Network Layer in the Internet Fragmentation when the elementary data size is 1 byte. (a) Original packet, containing 10 data bytes. (b) Fragments after passing through a network with maximum packet size of 8 payload bytes plus header. (c) Fragments after passing through a size 5 gateway. The IP Protocol IP Addresses Internet Control Protocols OSPF The Interior Gateway Routing Protocol BGP The Exterior Gateway Routing Protocol Internet Multicasting Mobile IP IPv6 The IP Protocol IP Addresses The IPv4 (Internet Protocol) header. IP address formats. Subnets NAT Network Address Translation A campus network consisting of LANs for various departments. Placement and operation of a NAT box. 8
The basic idea behind NAT is to assign each company a single IP address (or at most, a small number of them) for Internet traffic. Within the company, every computer gets a unique IP address, which is used for routing intramural traffic. However, when a packet exits the company and goes to the ISP, an address translation takes place. To make this scheme possible, three ranges of IP addresses have been declared as private. Companies may use them internally as they wish. The only rule is that no packets containing these addresses may appear on the Internet itself. The three reserved ranges are: 10.0.0.0 10.255.255.255/8 (16,777,216 hosts) 172.16.0.0 172.31.255.255/12 (1,048,576 hosts) 192.168.0.0 192.168.255.255/16 (65,536 hosts) The first range provides for 16,777,216 addresses (except for 0 and -1, as usual) and is the usual choice of most companies, even if they do not need so many addresses. The operation of NAT is shown in Fig. 5-60. Within the company premises, every machine has a unique address of the form 10.x.y.z. However, when a packet leaves the company premises, it passes through a NAT box that converts the internal IP source address, 10.0.0.1 in the figure, to the company's true IP address, 198.60.42.12 in this example. The NAT box is often combined in a single device with a firewall, which provides security by carefully controlling 339 what goes into the company and what comes out. We will study firewalls in Chap. 8. It is also possible to integrate the NAT box into the company's router. Bibliography a) Computer Networks 4. Edition, Andrew S. Tanenbaum b) http://en.wikipedia.org/wiki/computer_network c) http://ecourses.vtu.ac.in/nptel/courses/webcourse-contents/iit- MADRAS/ComputerNetworks/pdf/Lecture28_NetworkLayer.pdf d) http://www.scribd.com/ghatlı/d/68929040/31-ağ-katmanı- com/ghatlı/d/68929040/31 Network-Layer 9