Presentation is loading. Please wait.

Presentation is loading. Please wait.

Page 1 COMP210 Network layer. Page 2 The Network Layer  The network layer is responsible for establishing, maintaining and terminating connections 

Similar presentations


Presentation on theme: "Page 1 COMP210 Network layer. Page 2 The Network Layer  The network layer is responsible for establishing, maintaining and terminating connections "— Presentation transcript:

1 Page 1 COMP210 Network layer

2 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

3 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

4 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

5 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

6 Page 6 Implementation of Connection-Oriented Service Routing within a virtual- circuit subnet.

7 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

8 Page 8 Implementation of Connectionless Service Routing within a diagram subnet.

9 Page 9 Comparison of Virtual- Circuit and Datagram 5-4

10 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

11 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

12 Page 12 Shortest Path Routing

13 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

14 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

15 Page 15 Distance Vector Routing

16 Page 16 Distance Vector Routing (2) The count-to-infinity problem.

17 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.

18 Page 18 Learning about the Neighbors

19 Page 19 Measuring Line Cost

20 Page 20 Building Link State Packets (a) A subnet. (b) The link state packets for this subnet.

21 Page 21 Distributing the Link State Packets The packet buffer for router B in the previous slide (Fig. 5-13).

22 Page 22 Hierarchical Routing Hierarchical routing.

23 Page 23 Routing for Mobile Hosts A WAN to which LANs, MANs, and wireless cells are attached.

24 Page 24 Q of S Requirements How stringent the quality-of- service requirements are. 5-30

25 Page 25 How Networks Differ Some of the many ways networks can differ. 5-43

26 Page 26 Routers •Use Network and Physical (NIC card) addressing •Maintain routing tables to direct packets to correct network •Function at the network layer

27 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

28 Page 28 Gateways •Protocol translator •Connecting two dissimilar networks •functions at the network layer and above

29 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)

30 Page 30 IP addressing-History (cont)  1984 National Science Foundation (NSF) decided to build "network of networks" (Internet) based on TCP/IP  1997 5 Million + internet users  Made up of non proprietary protocols  changed by RFC (request for comment)

31 Page 31 OSI Model versus TCP/IP

32 Page 32 Protocol layers

33 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

34 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

35 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

36 Page 36 Collection of Subnetworks

37 Page 37 OSPF – The Interior Gateway Routing Protocol (a) Autonomous system. (b) Graph representation of (a)

38 Page 38 The relation between ASes, backbones, and areas in OSPF.

39 Page 39 The five types of OSPF messages. 5-66

40 Page 40 BGP – The Exterior Gateway Routing Protocol (a) A set of BGP routers. (b) Information sent to F.

41 Page 41 The IP Protocol The IPv4 (Internet Protocol) header.

42 Page 42 The IP Protocol Some of the IP options. 5-54

43 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

44 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:142.110.3.4  10001110 01101110 00000011 00000100

45 Page 45 Classes of IP Addresses IP address formats.

46 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

47 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

48 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 192-223

49 Page 49 Classes of IP addresses •Class D –used for special multicast addresses –first four bits 1110

50 Page 50 Classes of IP addresses •Class E –used for experimental purposes –first four bits 1111

51 Page 51 Special IP addresses.

52 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

53 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

54 Page 54 Subnets A class B network subnetted into 64 subnets.

55 Page 55 Subnet Mask for Class B address

56 Page 56 Subnet Example #1  IP Address  130.97.16.132  Subnet Mask  255.255.255.192  11111111 11111111 11111111 11000000  10000010 01100001 00010000 10000100  Network  10000010 01100001 00010000 10000000  130.97.16.128  Host  00000000 00000000 00000000 00000100  4

57 Page 57 Subnet Example #2  IP Address  130.97.17.132  Subnet Mask  255.255.254.0  11111111 11111111 11111110 00000000  10000010 01100001 00010001 10000100  Network  10000010 01100001 00010000 00000000  130.97.16.  Host  00000000 00000000 00000001 10000100  1.132

58 Page 58 ROUTING EXAMPLE Script started on Mon Mar 11 15:46:32 2002 [root@clash ijirasek]# netstat -i eth0 1500 0 1282464 0 0 0 309442 0 0 0 BRU eth1 1500 0 11233 0 0 0 13268 0 0 0 BRU lo 16436 0 16545 0 0 0 16545 0 0 0 LRU [root@clash ijirasek]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:10:5A:98:02:F5 inet addr:136.159.6.32 Bcast:136.159.6.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1282496 errors:0 dropped:0 overruns:0 frame:0 TX packets:309466 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 Interrupt:10 Base address:0x6800

59 Page 59 ROUTING EXAMPLE - CONT netstat -r Kernel IP routing table sentinel * 255.255.255.255 UH 40 0 0 eth1 136.159.6.0 * 255.255.255.0 U 40 0 0 eth0 192.168.66.0 * 255.255.255.0 U 40 0 0 eth1 127.0.0.0 * 255.0.0.0 U 40 0 0 lo default 136.159.6.1 0.0.0.0 UG 40 0 0 eth0 netstat -rn 192.168.66.1 0.0.0.0 255.255.255.255 UH 40 0 0 eth1 136.159.6.0 0.0.0.0 255.255.255.0 U 40 0 0 eth0 192.168.66.0 0.0.0.0 255.255.255.0 U 40 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo 0.0.0.0 136.159.6.1 0.0.0.0 UG 40 0 0 eth0 Script done on Mon Mar 11 15:47:48 2002

60 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:194.24.16.011000010 00011000 00010000 00000000 CIDR mask: /20 11111111 11111111 11110000 00000000 Netmask:255.255.255.192 11111111 11111111 11111111 11000000 The highest IP 194.24.31.25511000010 00011000 00011111 11111111 # of subnets: 2**6 -2 # of hosts: 2**6 - 2

61 Page 61 CIDR examples 5-59

62 Page 62 Network Address Translation (NAT) Method to connect multiple computers to Internet via one IP address Private network ---------- 0 NAT router ----- 0 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:10.0.0.0 - 10.255.255.255/8 172.16.0.0 – 172.31.255.255/12 192.168.0.0 – 192.168.255.255/16

63 Page 63 NAT example

64 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

65 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

66 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.

67 Page 67 BOOTP, DHCP functionality - cont Work station (client) creates a following UDP message: Source IP address: 0.0.0.0 Destination IP address: 255.255.255.255 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: 255.255.255.255 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

68 Page 68 Dynamic Host Configuration Protocol (DHCP) Operation of DHCP.

69 Page 69 The Main IPv6 Header

70 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

71 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

72 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

73 Page 73 Routing for Mobile Hosts A WAN to which LANs, MANs, and wireless cells are attached.

74 Page 74 Routing for Mobile Hosts

75 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

76 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.

77 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


Download ppt "Page 1 COMP210 Network layer. Page 2 The Network Layer  The network layer is responsible for establishing, maintaining and terminating connections "

Similar presentations


Ads by Google