Page 1 COMP210 Network layer
Page 2 The Network Layer The network layer is responsible for establishing, maintaining and terminating connections The network layer provides: Routing Flow and congestion control Internetworking
Page 3 Routing Packets originating from a source must be delivered to the destination by routing them through several intermediate nodes Routing involves the selection of the paths for the packets When a stream of packets need to be delivered, the network may handle them in two ways: Virtual circuit Datagram
Page 4 In this approach a preplanned route is established before any packets are sent Packets are still buffered at each node and queue up to use an outgoing link Virtual Circuit
Page 5 Since all packets follow the same route, sequencing of packets is maintained Virtual circuit is useful when two stations exchange data over an extended period of time Virtual Circuit
Page 6 Implementation of Connection-Oriented Service Routing within a virtual- circuit subnet.
Page 7 The call setup phase is avoided It is more flexible and can respond to congestion Packet sequencing may not be maintained Datagram is useful when only a few packets are exchanged Datagram Each packet is routed independently
Page 8 Implementation of Connectionless Service Routing within a diagram subnet.
Page 9 Comparison of Virtual- Circuit and Datagram 5-4
Page 10 Routing Strategies The decision time for a route may be made either at the packet level (datagram) or at the virtual circuit establishment time The routing decisions may be either centralized or distributed Routing decisions are usually based on topology, traffic load and cost
Page 11 Fixed Routing Each node needs to store only a single row of the routing directory to decide the next node to take for each destination This strategy is simple, and works well in a reliable network, but the method is not flexible and cannot adapt to network load
Page 12 Shortest Path Routing
Page 13 Adaptive Routing These are dynamic algorithms and react to changes in the network conditions The routing decisions are more complex and require more processing at the nodes The network status information needs to be exchanged among the nodes, imposing further traffic among the nodes
Page 14 Adaptive Routing Methods Distance Vector Routing each router exchanges routing tables with it ' s neighbours every x seconds creates heavy network traffic can be out of date Link State Routing each router broadcasts it ' s entire routing table at startup routers broadcast subsequent updates
Page 15 Distance Vector Routing
Page 16 Distance Vector Routing (2) The count-to-infinity problem.
Page 17 Link State Routing Each router must do the following: 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.
Page 18 Learning about the Neighbors
Page 19 Measuring Line Cost
Page 20 Building Link State Packets (a) A subnet. (b) The link state packets for this subnet.
Page 21 Distributing the Link State Packets The packet buffer for router B in the previous slide (Fig. 5-13).
Page 22 Hierarchical Routing Hierarchical routing.
Page 23 Routing for Mobile Hosts A WAN to which LANs, MANs, and wireless cells are attached.
Page 24 Q of S Requirements How stringent the quality-of- service requirements are. 5-30
Page 25 How Networks Differ Some of the many ways networks can differ. 5-43
Page 26 Routers Use Network and Physical (NIC card) addressing Maintain routing tables to direct packets to correct network Function at the network layer
Page 27 Routers Routing terms hop count number of routers a message passes to get to it's destination tick count time required to deliver a message. One tick is 1/8 sec TTL Time To Live how many routers will a message pass until it is undeliverable
Page 28 Gateways Protocol translator Connecting two dissimilar networks functions at the network layer and above
Page 29 IP addressing-History 1969 ARPANET used by U.S. Department of Defence 1970+TCP/IP developed and used as the common protocol Developed to link educational an governmental agencies (military)
Page 30 IP addressing-History (cont) 1984 National Science Foundation (NSF) decided to build "network of networks" (Internet) based on TCP/IP Million + internet users Made up of non proprietary protocols changed by RFC (request for comment)
Page 31 OSI Model versus TCP/IP
Page 32 Protocol layers
Page 33 Internet Protocol (IP) defining the datagram defining the internet addressing scheme moving data between the Network Access Layer and the Transport Layer routing datagrams to remote hosts
Page 34 IP (cont) performing fragmentation and re-assembly of datagrams connectionless protocol does not exchange control information (handshake) to establish end to end connection before transmitting data
Page 35 IP (cont) relies on other protocols to establish connection if required unreliable contains no error detection, does not check if message is delivered (Time To Live) relies on other protocols for this
Page 36 Collection of Subnetworks
Page 37 OSPF – The Interior Gateway Routing Protocol (a) Autonomous system. (b) Graph representation of (a)
Page 38 The relation between ASes, backbones, and areas in OSPF.
Page 39 The five types of OSPF messages. 5-66
Page 40 BGP – The Exterior Gateway Routing Protocol (a) A set of BGP routers. (b) Information sent to F.
Page 41 The IP Protocol The IPv4 (Internet Protocol) header.
Page 42 The IP Protocol Some of the IP options. 5-54
Page 43 IP address The IP address is a 32 bit address identifies the network and the host on a given network divided into two parts first part identifies the network, second part identifies the host on the network the format is not the same for each address
Page 44 IP Address the 32 bit number is represented in the following format xxx.xxx.xxx.xxx where xxx is the decimal representation of the binary bit string Example:
Page 45 Classes of IP Addresses IP address formats.
Page 46 Classes of IP addresses Class A used for small number of networks and large number of hosts first byte (8 bits) represent the network address last 3 bytes (24 bits) represent the host address class A address have a first bit of 0 class A network addresses range from 0 to 127
Page 47 Classes of IP addresses Class B Provide an equal number of networks and hosts first two bytes are network address and last two bytes are host addresses first two bits of a class B address are 10 network addresses range from 128 to 191
Page 48 Classes of IP addresses Class C greater number of network addresses fewer host addresses first three bits are 110 network addresses range form
Page 49 Classes of IP addresses Class D used for special multicast addresses first four bits 1110
Page 50 Classes of IP addresses Class E used for experimental purposes first four bits 1111
Page 51 Special IP addresses.
Page 52 Subnets subnets are used to divide a large network into smaller networks each address allows for one network address and many hosts (ie all hosts are on the same network) subnet masks are used to create many subnets within the same network address
Page 53 Subnet masks a bit string applied to an address if the bit is on the corresponding bit in the address is considered to be a network bit the network mask is known locally only
Page 54 Subnets A class B network subnetted into 64 subnets.
Page 55 Subnet Mask for Class B address
Page 56 Subnet Example #1 IP Address Subnet Mask Network Host 4
Page 57 Subnet Example #2 IP Address Subnet Mask Network Host 1.132
Page 58 ROUTING EXAMPLE Script started on Mon Mar 11 15:46: ijirasek]# netstat -i eth BRU eth BRU lo LRU ijirasek]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:10:5A:98:02:F5 inet addr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 Interrupt:10 Base address:0x6800
Page 59 ROUTING EXAMPLE - CONT netstat -r Kernel IP routing table sentinel * UH eth * U eth * U eth * U lo default UG eth0 netstat -rn UH eth U eth U eth U lo UG eth0 Script done on Mon Mar 11 15:47:
Page 60 Classless InterDomain Routing - CIDR CIDR Block Prefix # Equivalent Class C # of Host Addresses /27 1/8th of a Class C 32 hosts /26 1/4th of a Class C 64 hosts /25 1/2 of a Class C 128 hosts /24 1 Class C 256 hosts /23 2 Class C 512 hosts /22 4 Class C 1,024 hosts /21 8 Class C 2,048 hosts /20 16 Class C 4,096 hosts... /13 2,048 Class C 524,288 hosts Example: Consider the following: Sidte ID: CIDR mask: / Netmask: The highest IP # of subnets: 2**6 -2 # of hosts: 2**6 - 2
Page 61 CIDR examples 5-59
Page 62 Network Address Translation (NAT) Method to connect multiple computers to Internet via one IP address Private network NAT router Internet (client) (server) |Source Address| Source Port | Dest. Address | Dest. Port| - 0 When the packet arrives from the Private Network to NAT router NAT router will: 1. Insert |Source Address| Source Port| into a table 2. Change Source address to NAT router address 3. Change Source Port to the table offset 4. Send the modified packet to destination When the response comes back NAT router replaces the modified Source info with the original source info and sends it to the client. Outside node cannot initiate the communication Reserved addresses: / – / – /16
Page 63 NAT example
Page 64 PROBLEMS WITH NAT 1.If NAT box fails all the connections are lost 2.Violates the OSI layers independency 3.Some applications insert IP address as a part of the message. Those applications will fail 4. NAT changes the content of the IP datagram. This in incompatible with the secure data communication
Page 65 NIC card address IP Address translation 1. IP address -> NIC card address Address Resolution Protocol (ARP) Each node broadcasts its IP address and NIC card address in the boot time. Other nodes on the subnet store the info. Alternatively, a node can broadcast the question: “ What NIC card has IP address . 2. NIC card address -> IP address Reverse Address Resolution Protocol (RARP) Used for diskless workstation. Diskless workstation has to be booted from remote file server. After the boot the workstation will broadcast the message My NIC card address is Who knows my IP address? RARP server will know the answer 3. BOOTP: Similar to RARP. Uses UDP protocol 4. DHCP: Extension of BOOTP. Current technology
Page 66 BOOTP, DHCP functionality 1BOOTP server will provide the client with the following information: IP address and netmask IP address of default router IP address of DNS server The assignment between IP address and NIC card address is static (manual) 2. DHCP (Dynamic Host Configuration Protocol) Same functionality as BOOTP plus dynamic IP addresses assignment. DHCP server is given a block of IP addresses to choose from.
Page 67 BOOTP, DHCP functionality - cont Work station (client) creates a following UDP message: Source IP address: Destination IP address: Source Port #: 68 Destination Port #: 67 Message: Here is my NIC address. What is my IP address? Server answers with a following UDP message: Source IP address: Its own address Destination IP address: Source port #: 67 Destination port #: 68 Message: Machine with NIC card address .! Your IP is .. Routers know about it and make exception in limited broadcast forwarding
Page 68 Dynamic Host Configuration Protocol (DHCP) Operation of DHCP.
Page 69 The Main IPv6 Header
Page 70 Internet Control Message Protocol (ICMP) Used to: 1. Transmit error messages (type 3 message) 2. Pass router info (type 9, 10 message) ICMP is also used to facilitate mobile networking
Page 71 Mobile IP Design criteria: 1.Each mobile host must be able to use its home IP address anywhere 2. Software changes to fixed hosts not permitted 3. Changes to router software not permitted 4. Most packets for mobile hosts should not make detour. 5. No overheads when mobile host is at home
Page 72 Mobile IP Purpose: To provide routing for nodes which move between radio ranges of routers. Components of mobile network: Mobile node: Node on the move Home network: Network to which Mobile node belongs to Home agent: Router in Home Network which provides mobility management Foreign network: Network where Mobile node resides Foreign agent: Router in the Foreign network which provides mobility management
Page 73 Routing for Mobile Hosts A WAN to which LANs, MANs, and wireless cells are attached.
Page 74 Routing for Mobile Hosts
Page 75 Mobile IP - cont Permanent Address: IP address permanently assigned to the Mobile node Care-of address: Temporary IP address assigned to Mobile node by Foreign agent Correspondent: Node wishing to communicate with Mobile node
Page 76 Mobile IP - cont Functionality: Correspondent sends a message addressed to the Permanent address. This message will arrive to the Home agent. Home agent forwards the message to Foreign agent. Foreign agent forwards it to Mobile node. Mobile node replies directly to Correspondent.
Page 77 Mobile IP - cont Additional protocols required: Agent discovery: Mobile node finds the Foreign agent or Home agent Registration with Home agent: Foreign agent sends Home agent Care-of address Indirect routing of Correspondent’s datagrams: Rules about encapsulating datagrams forwarded to Mobile node by Home agent