Successfully reported this slideshow.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

CN Unit 3

  1. 1. Unit- 3 Internetworking.
  2. 2. 20.2 INTERNETWORKING In this section, we discuss internetworking, connecting networks together to make an internetwork or an internet. Network Layer Design Issues Need for Network Layer Internet as a Datagram Network Internet as a Connectionless Network Topics discussed in this section:
  3. 3. Network Layer Design Issues • Store-and-forward packet switching • Services provided to transport layer • Implementation of connectionless service • Implementation of connection-oriented service • Comparison of virtual-circuit and datagram.
  4. 4. ISP’s equipment Store-and-Forward Packet Switching The environment of the network layer protocols.
  5. 5. Services Provided to the Transport Layer 1.Services independent of router technology. 2. Transport layer shielded from number, type, topology of routers. 3. Network addresses available to transport layer use uniform numbering plan – even across LANs and WANs
  6. 6. ISP’s equipment Implementation of Connectionless Service A’s table (initially) A’s table (later) C’s Table E’s Table Routing within a datagram network v
  7. 7. A’s table C’s Table E’s Table Routing within a virtual-circuit network ISP’s equipment Implementation of Connection-Oriented Service v v v
  8. 8. Comparison of Virtual-Circuit and Datagram Networks v v v
  9. 9. Network layer
  10. 10. The network layer is responsible for the delivery of individual packets from the source host to the destination host. Note
  11. 11. Source to Destination deliverySource-to-destination delivery
  12. 12. 20.12 Links between two hosts Need of Network layer R1 R2 R3
  13. 13. 20.13 Network Layer in an internetwork Network la
  14. 14. 20.14 Network Layer at the Source, router and destination.
  15. 15. 20.15 Network layer at the source, router, and destination (continued)
  16. 16. 20.16 Switching at the network layer in the Internet uses the datagram approach to packet switching. Note
  17. 17. 20.17 Communication at the network layer in the Internet is connectionless. Note
  18. 18. IP (IPv4) •The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP protocols. •Unreliable, Connectionless datagram protocol. •No error control and Flow control. •Packets in IP layer is called datagram's. •Provides 232 addresses. •Address is written by dotted-decimal notation i.e.
  19. 19. 20.19 Position of IPv4 in TCP/IP protocol suite
  20. 20. 20.20 IPv4 datagram format
  21. 21. 20.21 Figure. Service type or differentiated services
  22. 22. 20.22 The precedence subfield was part of version 4, but never used. Note
  23. 23. 20.23 Table. Types of service
  24. 24. 20.24 Table. Default types of service
  25. 25. 20.25 Figure. Protocol field and encapsulated data
  26. 26. 20.26 Table. Protocol values
  27. 27. 20.27 Example of checksum calculation in IPv4
  28. 28. 20.28 Fragmentation: Maximum transfer unit (MTU)
  29. 29. 20.29 MTUs for some networks
  30. 30. 20.30 Fields Related to Fragmentation: 2. Flags used in fragmentation 1. Identification. 3. Fragmentation Offset.
  31. 31. 20.31 Fragmentation Offset
  32. 32. 20.32 Detailed fragmentation example
  33. 33. 19.33 IPv4 ADDRESSES An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet. Address Space Notations Classful Addressing Network Address Translation (NAT) Topics discussed in this section:
  34. 34. 19.34 An IPv4 address is 32 bits long. Note The IPv4 addresses are unique and universal. 1. Address Space The address space of IPv4 is 232 or 4,294,967,296.
  35. 35. 19.35 2. Notations Dotted-decimal notation and binary notation for an IPv4 address.
  36. 36. 19.36 In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Note 3. Classful addressing.
  37. 37. 19.37 Finding the classes in binary and dotted-decimal notation
  38. 38. 19.38 Number of blocks and block size in classful IPv4 addressing
  39. 39. 19.39 In classful addressing, a large part of the available addresses were wasted. Note
  40. 40. 19.40 • Default mask.
  41. 41. •Subnetting in IP. One network is divided into many smaller network. * Benefits of subnetting: •Reduced network traffic •Network Performance •Simplified Management •Divide large geographical distances •Supernetting.
  42. 42. Finding the Subnet Address Given an IP address, we can find the subnet address by applying the mask to the address.
  43. 43. we use binary notation for both the address and the mask and then apply the AND operation to find the subnet address.
  44. 44. Example 1 What is the subnetwork address if the destination address is and the subnet mask is
  45. 45. Solution 11001000 00101101 00100010 00111000 11111111 11111111 11110000 00000000 11001000 00101101 00100000 00000000 The subnetwork address is
  46. 46. A supernetwork
  47. 47. Classless addressing: To overcome address depletion and give more organizations access to the Internet, classless addressing was designed and implemented. In this scheme, there are no classes, but the addresses are still granted in blocks. Rules: ** The number of blocks must be a power of 2 (1, 2, 4, 8, 16, . . .). ** The blocks must be contiguous in the address space (no gaps between the blocks). ** The third byte of the first address in the superblock must be evenly divisible by the number of blocks. In other words, if the number of blocks is N, the third byte must be divisible by N.
  48. 48. Example 5 A company needs 600 addresses. Which of the following set of class C blocks can be used to form a supernet for this company?
  49. 49. Solution 1: No, there are only three blocks. 2: No, the blocks are not contiguous. 3: No, 31 in the first block is not divisible by 4. 4: Yes, all three requirements are fulfilled.
  50. 50. 19.50 Classful addressing, which is almost obsolete, is replaced with classless addressing. Note
  51. 51. 19.51 Figure shows a block of addresses, in both binary and dotted-decimal notation, granted to a small business that needs 16 addresses. We can see that the restrictions are applied to this block. The addresses are contiguous. The number of addresses is a power of 2 (16 = 24), and the first address is divisible by 16. The first address, when converted to a decimal number, is 3,440,387,360, which when divided by 16 results in 215,024,210. Example -1
  52. 52. 19.52 In IPv4 addressing, a block of addresses can be defined as x.y.z.t /n in which x.y.z.t defines one of the addresses and the /n defines the mask. Note
  53. 53. 19.53 The first address in the block can be found by setting the rightmost 32 − n bits to 0s. Note
  54. 54. 19.54 A block of addresses is granted to a small organization. We know that one of the addresses is What is the first address in the block? Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32−28 rightmost bits to 0, we get 11001101 00010000 00100101 0010000 or This is actually the block shown in last Figure Example -2
  55. 55. 19.55 The last address in the block can be found by setting the rightmost 32 − n bits to 1s. Note
  56. 56. 19.56 Find the last address for the block in Example-2 Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 − 28 rightmost bits to 1, we get 11001101 00010000 00100101 00101111 or This is actually the block shown in last Figure Example-3
  57. 57. 19.57 The number of addresses in the block can be found by using the formula 232−n. Note
  58. 58. 19.58 Find the number of addresses in Example -2. Example -4 Solution The value of n is 28, which means that number of addresses is 2 32−28 or 16.
  59. 59. 19.59 Another way to find the first address, the last address, and the number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly useful when we are writing a program to find these pieces of information. In Example-2 the /28 can be represented as 11111111 11111111 11111111 11110000 (twenty-eight 1s and four 0s). Find a. The first address b. The last address c. The number of addresses. Example -5
  60. 60. 19.60 Solution a. The first address can be found by ANDing the given addresses with the mask. ANDing here is done bit by bit. The result of ANDing 2 bits is 1 if both bits are 1s; the result is 0 otherwise. Example -5 (continued)
  61. 61. 19.61 b. The last address can be found by ORing the given addresses with the complement of the mask. ORing here is done bit by bit. The result of ORing 2 bits is 0 if both bits are 0s; the result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and each 0 to 1. Example -5 (continued)
  62. 62. 19.62 c. The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it. Example -5 (continued)
  63. 63. 19.63 The first address in a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. Note
  64. 64. •Limitations of IPv4: •Limited IP address field i.e. 232 •No encryption and Authentication is provided. •Minimum delay and resource reservation is not provided for real time audio and video transmission.
  65. 65. 20.65 IPv6 The network layer protocol in the TCP/IP protocol suite is currently IPv4. IPv4 has some deficiencies that make it unsuitable for the fast-growing Internet. Advantages of IPv6: •Larger Address Space: 128 bit address space. •Better Header Format: Options are separated and inserted when needed. It simplifies and speed up routing process. •New options: To allow for additional functionalities. • Allowance for extension: It allow the extension of the protocol if required by new technologies or applications. •Support for resource allocation: Is used to support traffic such as real time audio and video. •Support for more security: Encryption and authentication options in IPv6 provides confidentiality and integrity of the packet.
  66. 66. 20.66 IPv6 datagram header and payload An IPv6 address is 128 bits long. (16 bytes) Note
  67. 67. 20.67 Format of an IPv6 datagram
  68. 68. Version: Specifies the protocol version number. Here 6. Priority(Traffic class)(4 bits): Defines priority of the packet with respect to traffic congestion. Flow label(3 bytes): Designed to provide special handling for a particular flow of data. Used by host to label those packets for which it is requesting special handling by routers within a network. Payload Length (16 bits): Gives total length of IP datagram excluding base header. Next Header (8 bits): Gives type of next header. Hop Limit (8 bits): Same as TTL. Source Address (16 bytes): Gives original address of datagram source. Destination Address (16 bytes) : Identifies destination address of datagram source.
  69. 69. 20.69 Table Priorities for congestion-controlled traffic
  70. 70. 20.70 Table -Priorities for noncongestion-controlled traffic
  71. 71. 20.71 Next header codes for IPv6
  72. 72. 19.72 IPv6 address in binary and hexadecimal colon notation
  73. 73. 19.73 Abbreviated IPv6 addresses
  74. 74. 20.74 Comparison between IPv4 and IPv6 packet headers
  75. 75. 40 bytes 20 bytes IPv4 IPv6 0 15 16 31 vers hlen TOS total length identification flags flag-offset TTL protocol header checksum source address destination address options and padding vers priority flow-label payload length next header hop limit source address destination address Removed (6)  ID, flags, flag offset  TOS, hlen  header checksum Changed (3) Added (2) Expanded  total length => payload  protocol => next header  TTL => hop limit  priority  flow label  address 32 to 128 bits Header comparison
  76. 76. Major Improvements of IPv6 Header •No option field: Replaced by extension header. •Result in a fixed length, 40-byte IP header. •No header checksum: Result in fast processing. •No fragmentation at intermediate nodes: Result in fast IP forwarding.
  77. 77. 19.77 Reserved addresses for private networks NAT (Network Address Translation) NAT enables a user to have a large set of addresses internally (private addresses) and one address or a small set of address (global / public address) externally.
  78. 78. 19.78 A NAT implementation
  79. 79. 19.79 Addresses in a NAT Translation Table: How does the NAT router know the destination address for a packet coming from the Internet? This problem is solved by using Translation Table. 1.Using One IP Address. 2.Using a Pool of IP Addresses. 3.Using both IP addresses and Port Numbers.
  80. 80. 19.80 1. Using One IP address NAT address translation:
  81. 81. 19.81 3. Using Both IP and Port numbers: Combination of Source address and Destination Port number defines private n/w host. Five-column translation table
  82. 82. 20.82 TRANSITION FROM IPv4 TO IPv6 Because of the huge number of systems on the Internet, the transition from IPv4 to IPv6 cannot happen suddenly. It takes a considerable amount of time before every system in the Internet can move from IPv4 to IPv6. The transition must be smooth to prevent any problems between IPv4 and IPv6 systems. Dual Stack Tunneling Header Translation Topics discussed in this section:
  83. 83. 20.83 Three transition strategies
  84. 84. 20.84 1. Dual stack
  85. 85. 20.85 2. Tunneling strategy
  86. 86. Tunnel addressing view
  87. 87. 20.87 3. Header translation strategy
  88. 88. 20.88 Header translation
  89. 89. ADDRESS MAPPING The delivery of a packet to a host or a router requires two levels of addressing: logical and physical. We need to be able to map a logical address to its corresponding physical address and vice versa. This can be done by using either static or dynamic mapping. Mapping Logical to Physical Mapping Physical to Logical Address
  90. 90. 20.90 Network Layer & Physical/Data link layer in an internetwork Network
  91. 91. Logical Address: IP is logical address, use at network level . Physical Address (48 bits): At physical level, the host and routers are recognized by their physical addresses. It is local address which is unique locally but it is not necessarily unique universally. It is usually (but not always) implemented in hardware (NIC). Address mapping can be done using either Static or Dynamic mapping. Static Mapping: It involves in creation of a table that associates a logical address with Physical address. This table is stored on each machine on the n/w. Dynamic Mapping: Each time a machine knows one of the two addresses (logical or physical). It can use a protocol to find the other one.
  92. 92. ARP (Address Resolution Protocol) operation
  93. 93. ARP packet
  94. 94. Hardware Type(16 bit): Gives type of network on which ARP is running. Eg. Ethernet = 1. Protocol Type(16 bit): Gives protocol type. Eg. Ipv4 = 0800 Hardware Length(8 bit): Gives length of physical address in bytes. Eg. Ethernet = 6 (6 bytes = 48 bits) Protocol Length(8 bit): Gives length of logical address in bytes. Eg. Ipv4 = 4 (IP 32 bits = 4 bytes) Operation(16 bit) : Gives type of packet. 2 types of packet: 1) ARP request (1) 2) ARP reply (2) Sender Hardware Address(variable lenght): Gives physical address of sender. Sender Protocol Address(variable lenght): Gives logical address of the sender. Eg. IPv4 protocol = 4 bytes. Target Hardware address(variable lenght): Gives physical address of target. Eg. Ethernet = 6 bytes Target Protocol Address(variable lenght): Gives logical address of the target. Eg. IPv4 protocol = 4 bytes.
  95. 95. Encapsulation of ARP packet
  96. 96. Four cases using ARP
  97. 97. An ARP request is broadcast; an ARP reply is unicast. Note
  98. 98. Example 1 A host with IP address and physical address B2:34:55:10:22:10 has a packet to send to another host with IP address and physical address A4:6E:F4:59:83:AB (which is unknown to the first host). The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames.
  99. 99. Proxy ARP
  100. 100. RARP RARP finds the logical address for a machine that only knows its physical address. Note: The RARP request packets are broadcast; the RARP reply packets are unicast.
  101. 101. RARP operation
  102. 102. Encapsulation of RARP packet
  103. 103. BOOTP (Bootstrap Protocol) It is a client-server protocol. It is designed to provide physical address to logical address mapping. It is an application layer protocol. DHCP (Dynamic Host Configuration Protocol) It provides static and dynamic address allocation that can be manual or automatic.
  104. 104. ICMP (Internet Control Message Protocol) The IP protocol has no error-reporting or error- correcting mechanism. The IP protocol also lacks a mechanism for host and management queries. The Internet Control Message Protocol (ICMP) has been designed to compensate for the above two deficiencies. It is a companion to the IP protocol. Types of Messages Message Format Error Reporting and Query Debugging Tools Topics discussed in this section:
  105. 105. ICMP allows router to send error or control messages to the host. It is a communication between the IP software of two machines. ICMP is a error reporting mechanism not to correct them. ICMP messages are encapsulated in to IP packet. ICMP send msg to source only not to intermediate routers.
  106. 106. ICMP encapsulation
  107. 107. Types Of Messages ICMP messages are divided into two broad categories: error-reporting messages and query messages. The error-reporting messages report problems that a router or a host (destination) may encounter when it processes an IP packet. The query messages, which occur in pairs, help a host or a network manager get specific information from a router or another host.
  108. 108. Message Format General format of ICMP messages
  109. 109. Type (8 bits): Used to identify type of ICMP message i.e. Whether the msg is error reporting or query msg. Code (8 bits): Provides information or parameters of msg type. Checksum (16 bits): Gives checksum of the ICMP msg. Data section (64 bits): IP header and original datagram. Rest of the Header: Unused
  110. 110. Types of Messages
  111. 111. ICMP always reports error messages to the original source. Note
  112. 112. The following are important points about ICMP error messege 1) No ICMP error messege will be generated in response to a datagram carrying an ICMP error message. 2) No ICMP error messege will be generated for a fragmented datagram that is not the first fragment. 3) No ICMP error messege will be generated for a datagram having a multicast address. 4) No ICMP error messege will be generated for a datagram having a special address such as 127.0.01 or
  113. 113. 1. Destination-unreachable •Packet is not forwarded to destination due to some problems. Destination-unreachable messages with codes 2 or 3 can be created only by the destination host. •Other destination-unreachable messages can be created only by routers. •The router or the host sends a destination- unreachable message back to the source host.
  114. 114. When a router cannot forward or deliver an IP datagram, it sends a destination unreachable message back to the original source. The CODE field specifies details 0: network unreachable 1: host unreachable 2: protocol unreachable 3: port unreachable 4: fragmentation needed and DF (don’t fragment) set 5: source route failed Etc.
  115. 115. A source-quench message informs the source that a datagram has been discarded due to congestion in a router or the destination host. The source must slow down the sending of datagrams until the congestion is relieved. 2. Source-quench One source-quench message is sent for each datagram that is discarded due to congestion.
  116. 116. Whenever a router decrements a datagram with a time-to-live value to zero, it discards the datagram and sends a time-exceeded message to the original source. 3. Time-exceeded When the final destination does not receive all of the fragments in a set time, it discards the received fragments and sends a time- exceeded message to the original source.
  117. 117. In a time-exceeded message, code 0 is used only by routers to show that the value of the time-to-live field is zero. Code 1 is used only by the destination host to show that not all of the fragments have arrived within a set time.
  118. 118. When there is a problem in the header part of the datagram then a parameter-problem message can be created by a router or the destination host. 4. Parameter-problem
  119. 119. 5. Redirection concept A host usually starts with a small routing table that is gradually updated. One of the tools to accomplish this is the redirection message. A redirection message is sent from a router to a host on the same local network.
  120. 120. Query messages Encapsulation of ICMP query messages:
  121. 121. Echo-request and echo-reply messages can test the reachability of a host. An echo-request message can be sent by a host or router. An echo-reply message is sent by the host or router that receives an echo-request message. This is usually done by invoking the ping command. 1. Echo-request and reply message
  122. 122. 2. Timestamp-request and timestamp-reply message Timestamp-request and timestamp-reply messages can be used to calculate the round-trip time between a source and a destination machine even if their clocks are not synchronized.
  123. 123. 3. Address mask request and reply When source knows his IP address but dont know its Subnet mask that time source send Address mask request to router. Router receive request and send subnet mask address to source. At the time of request Address mask field is zeros and the time of reply its contain Address mask.
  124. 124. 4. Router Solitation and Advertisement A host want to send data to another network host for that he also know the Address of the routers connected to its network. For that the host broadcast a router solicitation message. The router receiving this message send the routing information using router Advertisement message. A router can also periodically sends router advertisement messages even if no host has solicited.
  125. 125. Debugging Tools  Ping  Traceroute
  126. 126. We use the ping program to test the server The result is shown below: Example 9.2
  127. 127. The traceroute program operation
  128. 128. We use the traceroute program to find the route from the computer to the server The following shows the result. Example 9.4
  129. 129. In this example, we trace a longer route, the route to The following is a partial listing. Example 9.5
  130. 130. An interesting point is that a host can send a traceroute packet to itself. This can be done by specifying the host as the destination. The packet goes to the loopback address as we expect. Example 9.6
  131. 131. Finally, we use the traceroute program to find the route between and (McGraw-Hill server). We notice that we cannot find the whole route. When traceroute does not receive a response within 5 seconds, it prints an asterisk to signify a problem (not the case in this example), and then tries the next hop. Example 9.7