Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TCP/IP Training Basic Concepts.

TCP/IP Training in IRAN

  • Be the first to comment

TCP/IP Training Basic Concepts.

  1. 1. TCP/IP Protocol Suite 1 TCP/IP Protocol Suite ‫پروتكلهاي‬ ‫معرفي‬ TCP/IP ‫دهنده‬ ‫ارائه‬ ‫پناهي‬ ‫اميرحسين‬ ‫خرداد‬1391 ‫خدا‬ ‫بنام‬
  2. 2. TCP/IP Protocol Suite 2 The OSI Model Established in 1947, the International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international standards. An ISO standard that covers all aspects of network communications is the Open Systems Interconnection (OSI) model. It was first introduced in the late 1970s. The topics discussed in this section include: Layered Architecture Peer-to-Peer Processes Encapsulation
  3. 3. TCP/IP Protocol Suite 3 ISO is the organization. OSI is the model Note:
  4. 4. TCP/IP Protocol Suite 4 The OSI model
  5. 5. TCP/IP Protocol Suite 5 OSI layers
  6. 6. TCP/IP Protocol Suite 6 An exchange using the OSI model
  7. 7. TCP/IP Protocol Suite 7 Layers in the OSI Model The functions of each layer in the OSI model is briefly described. The topics discussed in this section include: Physical Layer Data Link Layer Network Layer Transport Layer Session Layer Presentation Layer Application Layer Summary of Layers
  8. 8. TCP/IP Protocol Suite 8 The physical layer is responsible for Movement of individual bits from one hop (node) to the next. •Includes electrical and mechanical connection features •Determines bit rates •Should be synchronized in transmission clock •Transmission modes: Simplex, Half and Full duplex Note: Physical layer
  9. 9. TCP/IP Protocol Suite 9TCP/IP Protocol Suite 9 The data link layer is responsible for moving frames from one hop (node) to the next •Framing •Physical addressing •Flow control •Bit error control •Access control in shared link(CSMA/CD/CA) Note: Data link layer
  10. 10. TCP/IP Protocol Suite 10 CSMA/CA
  11. 11. TCP/IP Protocol Suite 11 Hop-to-hop delivery
  12. 12. TCP/IP Protocol Suite 12 The network layer is responsible for the delivery of individual packets from the source host to the destination host. •Physical addressing •Routing Network layer Note:
  13. 13. TCP/IP Protocol Suite 13 Source-to-destination delivery
  14. 14. TCP/IP Protocol Suite 14 The transport layer is responsible for the delivery of a message from one process to another. •Port addressing (Process Addressing) •Segmentation and Reassembly by sequencing •Connection control (connection-less/connection-oriented) • flow control (window size) •Error control (Acknowledgement) Note: Transport layer
  15. 15. TCP/IP Protocol Suite 15 The Session layer is responsible for synchronization of a message •Synchronization point insertion and deletion for integrity validation of message •Dialog control by changing mode of transmission (half/full duplex) Note: Session layer
  16. 16. TCP/IP Protocol Suite 16 The presentation layer is responsible for: •Translation (coding/decoding) •Encryption/Decryption •Compression/Decompression Note: Presentation layer
  17. 17. TCP/IP Protocol Suite 17 Application layer
  18. 18. TCP/IP Protocol Suite 18 Summary of layers
  19. 19. TCP/IP Protocol Suite 19 TCP/IP Protocol Suite The TCP/IP protocol suite is made of five layers: physical, data link, network, transport, and application. The first four layers provide physical standards, network interface, internetworking, and transport functions that correspond to the first four layers of the OSI model. The three topmost layers in the OSI model, however, are represented in TCP/IP by a single layer called the application layer. The topics discussed in this section include: Physical and Data Link Layers Network Layer Transport Layer Application Layer
  20. 20. TCP/IP Protocol Suite 20 TCP/IP and OSI model
  21. 21. TCP/IP Protocol Suite 21 Addressing Three different levels of addresses are used in an internet using the TCP/IP protocols: physical (link) address, logical (IP) address, and port address. The topics discussed in this section include: Physical Address Logical Address Port Address
  22. 22. TCP/IP Protocol Suite 22 Relationship of layers and addresses in TCP/IP
  23. 23. TCP/IP Protocol Suite 23 Physical addresses In Figure a node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link. At the data link level this frame contains physical (link) addresses in the header. These are the only addresses needed. The rest of the header contains other information needed at this level. The trailer usually contains extra bits needed for error detection. 07:01:02:01:2C:4B A 6-byte (12 hexadecimal digits) physical address.
  24. 24. TCP/IP Protocol Suite 24 IP addresses •In Figure we want to send data from a node with network address A and physical address 10, located on one LAN, to a node with a network address P and physical address 95, located on another LAN. Because the two devices are located on different networks, we cannot use link addresses only; the link addresses have only local jurisdiction. What we need here are universal addresses that can pass through the LAN boundaries. The network (logical) addresses have this characteristic. •The packet at the network layer contains the logical addresses, which remain the same from the original source to the final destination (A and P, respectively, in the figure). They will not change when we go from network to network. However, the physical addresses will change as the packet moves from one network to another. The boxes labeled routers are internetworking devices. 132.24.75.9 An internet address in IPv4 in decimal numbers
  25. 25. TCP/IP Protocol Suite 25 Figure 2.20 Port addresses 753 A 16-bit port address represented as one single number.
  26. 26. TCP/IP Protocol Suite 26 •Figure shows an example of transport layer communication. Data coming from the upper layers have port addresses j and k ( j is the address of the sending process, and k is the address of the receiving process). Since the data size is larger than the network layer can handle, the data are split into two packets, each packet retaining the service-point addresses ( j and k). Then in the network layer, network addresses (A and P) are added to each packet. •The packets can travel on different paths and arrive at the destination either in order or out of order. The two packets are delivered to the destination transport layer, which is responsible for removing the network layer headers and combining the two pieces of data for delivery to the upper layers Port addresses
  27. 27. TCP/IP Protocol Suite 27 IP Versions IP became the official protocol for the Internet in 1983. As the Internet has evolved, so has IP. There have been six versions since its inception. We look at the latter three versions here. The topics discussed in this section include: Version 4 Version 5 Version 6
  28. 28. TCP/IP Protocol Suite 28 Connecting Devices LANs or WANs do not normally operate in isolation. They are connected to one another or to the Internet. To connect LANs or WANs, we use connecting devices. Connecting devices can operate in different layers of the Internet model. We discuss three kinds of connecting devices: repeaters (or hubs), bridges (or two-layer switches), and routers (or three-layer switches). Repeaters and hubs operate in the first layer of the Internet model. Bridges and two-layer switches operate in the first two layers. Routers and three-layer switches operate in the first three layers The topics discussed in this section include: Repeaters Hubs Bridges Router
  29. 29. TCP/IP Protocol Suite 29 Figure 3.28 Connecting devices
  30. 30. TCP/IP Protocol Suite 30 Figure 3.29 Repeater
  31. 31. TCP/IP Protocol Suite 31 A repeater connects segments of a LAN. Notes: A repeater forwards every bit; it has no filtering capability. A repeater is a regenerator, not an amplifier.
  32. 32. TCP/IP Protocol Suite 32 Figure 3.30 Function of a repeater
  33. 33. TCP/IP Protocol Suite 33 A bridge has a table used in filtering decisions. Note:
  34. 34. TCP/IP Protocol Suite 34 Figure 3.31 Bridge
  35. 35. TCP/IP Protocol Suite 35 A bridge does not change the physical (MAC) addresses in a frame. Note:
  36. 36. TCP/IP Protocol Suite 36 Figure 3.32 Learning bridge
  37. 37. TCP/IP Protocol Suite 37 A router is a three-layer (physical, data link, and network) device. Note:
  38. 38. TCP/IP Protocol Suite 38 A repeater or a bridge connects segments of a LAN. A router connects independent LANs or WANs to create an internetwork (internet). Note:
  39. 39. TCP/IP Protocol Suite 39 Figure 3.33 Routing example
  40. 40. TCP/IP Protocol Suite 40 A router changes the physical addresses in a packet. Note:
  41. 41. TCP/IP Protocol Suite 41 CLASSFUL ADDRESSING IP addresses, when started a few decades ago, used the concept of classes. This architecture is called classful addressing. In the mid- 1990s, a new architecture, called classless addressing, was introduced and will eventually supersede the original architecture. However, part of the Internet is still using classful addressing, but the migration is very fast.
  42. 42. TCP/IP Protocol Suite 42 Finding the class in binary notation
  43. 43. TCP/IP Protocol Suite 43 Finding the class in decimal notation
  44. 44. TCP/IP Protocol Suite 44 Netid and hostid
  45. 45. TCP/IP Protocol Suite 45 Masking concept Default masks
  46. 46. TCP/IP Protocol Suite 46 The network address is the beginning address of each block. It can be found by applying the default mask to any of the addresses in the block (including itself). It retains the netid of the block and sets the hostid to zero. Note:
  47. 47. TCP/IP Protocol Suite 47 Upon completion you will be able to: ARP and RARP • Understand the need for ARP • Understand the cases in which ARP is used • Understand the components and interactions in an ARP package • Understand the need for RARP Objectives
  48. 48. TCP/IP Protocol Suite 48 ARP and RARP - Position in TCP/IP protocol suite
  49. 49. TCP/IP Protocol Suite 49 ARP ARP associates an IP address with its physical address. On a typical physical network, such as a LAN, each device on a link is identified by a physical or station address that is usually imprinted on the NIC.
  50. 50. TCP/IP Protocol Suite 50 ARP packet / Encapsulation of ARP
  51. 51. TCP/IP Protocol Suite 51 Four cases using ARP
  52. 52. TCP/IP Protocol Suite 52 An ARP request is broadcast; an ARP reply is unicast. Note:
  53. 53. TCP/IP Protocol Suite 53 ARP Request/Reply packet Example
  54. 54. TCP/IP Protocol Suite 54 Proxy ARP
  55. 55. TCP/IP Protocol Suite 55 RARP RARP finds the logical address for a machine that only knows its physical address.
  56. 56. TCP/IP Protocol Suite 56 The RARP request packets are broadcast; the RARP reply packets are unicast. Note:
  57. 57. TCP/IP Protocol Suite 57 RARP packet / Encapsulation of RARP packet
  58. 58. TCP/IP Protocol Suite 58 Upon completion you will be able to: Internet Protocol • Understand the format and fields of a datagram • Understand the need for fragmentation and the fields involved • Understand the options available in an IP datagram • Be able to perform a checksum calculation • Understand the components and interactions of an IP package Objectives
  59. 59. TCP/IP Protocol Suite 59 Position of IP in TCP/IP protocol suite
  60. 60. TCP/IP Protocol Suite 60 DATAGRAM A packet in the IP layer is called a datagram, a variable-length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery.
  61. 61. TCP/IP Protocol Suite 61 Service type or differentiated services The precedence subfield was designed, but never used in version 4. Types of service
  62. 62. TCP/IP Protocol Suite 62 Default types of service
  63. 63. TCP/IP Protocol Suite 63 The total length field defines the total length of the datagram including the header. Note:
  64. 64. TCP/IP Protocol Suite 64 Figure 8.4 Encapsulation of a small datagram in an Ethernet frame
  65. 65. TCP/IP Protocol Suite 65 Protocols field
  66. 66. TCP/IP Protocol Suite 66 TTL field •This filed is used to make limitation of movement of a packet in the internet •After any hop in a router this filed is decremented one. •If TTL equals zero, the packet will be discarded.
  67. 67. TCP/IP Protocol Suite 67 FRAGMENTATION The format and size of a frame depend on the protocol used by the physical network. A datagram may have to be fragmented to fit the protocol regulations.
  68. 68. TCP/IP Protocol Suite 68 Flags field
  69. 69. TCP/IP Protocol Suite 69 Detailed fragmentation example
  70. 70. TCP/IP Protocol Suite 70 CHECKSUM The error detection method used by most TCP/IP protocols is called the checksum. The checksum protects against the corruption that may occur during the transmission of a packet. It is redundant information added to the packet. The topics discussed in this section include: Checksum Calculation at the Sender Checksum Calculation at the Receiver Checksum in the IP Packet
  71. 71. TCP/IP Protocol Suite 71 To create the checksum the sender does the following: ❏ The packet is divided into k sections, each of n bits. ❏ All sections are added together using 1’s complement arithmetic. ❏ The final result is complemented to make the checksum. Note:
  72. 72. TCP/IP Protocol Suite 72 Figure 8.22 Checksum concept
  73. 73. TCP/IP Protocol Suite 73 Figure 8.23 Checksum in one’s complement arithmetic
  74. 74. TCP/IP Protocol Suite 74 Upon completion you will be able to: User Datagram Protocol • Be able to explain process-to-process communication • Know the format of a UDP user datagram • Be able to calculate a UDP checksum • Understand the operation of UDP • Know when it is appropriate to use UDP • Understand the modules in a UDP package Objectives
  75. 75. TCP/IP Protocol Suite 75 Figure 11.1 Position of UDP in the TCP/IP protocol suite
  76. 76. TCP/IP Protocol Suite 76 11.1 PROCESS-TO-PROCESS COMMUNICATION Before we examine UDP, we must first understand host-to-host communication and process-to-process communication and the difference between them. The topics discussed in this section include: Port Numbers Socket Addresses
  77. 77. TCP/IP Protocol Suite 77 Figure 11.2 UDP versus IP
  78. 78. TCP/IP Protocol Suite 78 Figure 11.3 Port numbers
  79. 79. TCP/IP Protocol Suite 79 Figure 11.4 IP addresses versus port numbers
  80. 80. TCP/IP Protocol Suite 80 Figure 11.5 ICANN ranges
  81. 81. TCP/IP Protocol Suite 81 The well-known port numbers are less than 1024. Note:
  82. 82. TCP/IP Protocol Suite 82 Table 11.1 Well-known ports used with UDP
  83. 83. TCP/IP Protocol Suite 83 Socket address
  84. 84. TCP/IP Protocol Suite 84 USER DATAGRAM UDP packets are called user datagrams and have a fixed-size header of 8 bytes.
  85. 85. TCP/IP Protocol Suite 85 UDP length = IP length − IP header’s length Note:
  86. 86. TCP/IP Protocol Suite 86 11.3 CHECKSUM UDP checksum calculation is different from the one for IP and ICMP. Here the checksum includes three sections: a pseudoheader, the UDP header, and the data coming from the application layer. The topics discussed in this section include: Checksum Calculation at Sender Checksum Calculation at Receiver Optional Use of the Checksum
  87. 87. TCP/IP Protocol Suite 87 Figure 11.8 Pseudoheader for checksum calculation
  88. 88. TCP/IP Protocol Suite 88 Figure 11.9 Checksum calculation of a simple UDP user datagram
  89. 89. TCP/IP Protocol Suite 89 UDP OPERATION UDP uses concepts common to the transport layer. These concepts will be discussed here briefly, and then expanded in the next chapter on the TCP protocol. The topics discussed in this section include: Connectionless Services Flow and Error Control Encapsulation and Decapsulation Queuing Multiplexing and Demultiplexing
  90. 90. TCP/IP Protocol Suite 90 Figure 11.10 Encapsulation and decapsulation
  91. 91. TCP/IP Protocol Suite 91 Figure 11.11 Queues in UDP
  92. 92. TCP/IP Protocol Suite 92 Figure 11.12 Multiplexing and demultiplexing
  93. 93. TCP/IP Protocol Suite 93 Upon completion you will be able to: Transmission Control Protocol • Be able to name and understand the services offered by TCP • Understand TCP’s flow and error control and congestion control • Be familiar with the fields in a TCP segment • Understand the phases in a connection-oriented connection • Understand the TCP transition state diagram • Be able to name and understand the timers used in TCP • Be familiar with the TCP options Objectives
  94. 94. TCP/IP Protocol Suite 94 TCP/IP protocol suite
  95. 95. TCP/IP Protocol Suite 95 12.1 TCP SERVICES We explain the services offered by TCP to the processes at the application layer. The topics discussed in this section include: Process-to-Process Communication Stream Delivery Service Full-Duplex Communication Connection-Oriented Service Reliable Service
  96. 96. TCP/IP Protocol Suite 96 well-known ports used by TCP
  97. 97. TCP/IP Protocol Suite 97 Stream delivery
  98. 98. TCP/IP Protocol Suite 98 Sending and receiving buffers
  99. 99. TCP/IP Protocol Suite 99 TCP segments
  100. 100. TCP/IP Protocol Suite 100 TCP FEATURES To provide the services mentioned in the previous section, TCP has several features that are briefly summarized in this section. The topics discussed in this section include: Numbering System Flow Control Error Control Congestion Control
  101. 101. TCP/IP Protocol Suite 101 The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. Note:
  102. 102. TCP/IP Protocol Suite 102 The value in the sequence number field of a segment defines the number of the first data byte contained in that segment. Note:
  103. 103. TCP/IP Protocol Suite 103 The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative. Note:
  104. 104. TCP/IP Protocol Suite 104 SEGMENT A packet in TCP is called a segment The topics discussed in this section include: Format Encapsulation
  105. 105. TCP/IP Protocol Suite 105 TCP segment format
  106. 106. TCP/IP Protocol Suite 106 Control field
  107. 107. TCP/IP Protocol Suite 107 Figure 12.7 Pseudoheader added to the TCP datagram
  108. 108. TCP/IP Protocol Suite 108 The inclusion of the checksum in TCP is mandatory. Note:
  109. 109. TCP/IP Protocol Suite 109 Encapsulation and decapsulation
  110. 110. TCP/IP Protocol Suite 110 A TCP CONNECTION TCP is connection-oriented. A connection-oriented transport protocol establishes a virtual path between the source and destination. All of the segments belonging to a message are then sent over this virtual path. A connection-oriented transmission requires three phases: connection establishment, data transfer, and connection termination. The topics discussed in this section include: Connection Establishment Data Transfer Connection Termination Connection Reset
  111. 111. TCP/IP Protocol Suite 111 Connection establishment using three-way handshaking
  112. 112. TCP/IP Protocol Suite 112 A SYN segment cannot carry data, but it consumes one sequence number. Note:
  113. 113. TCP/IP Protocol Suite 113 A SYN + ACK segment cannot carry data, but does consume one sequence number. Note:
  114. 114. TCP/IP Protocol Suite 114 An ACK segment, if carrying no data, consumes no sequence number. Note:
  115. 115. TCP/IP Protocol Suite 115 Data transfer
  116. 116. TCP/IP Protocol Suite 116 The FIN segment consumes one sequence number if it does not carry data. Note:
  117. 117. TCP/IP Protocol Suite 117 Connection termination using three-way handshaking
  118. 118. TCP/IP Protocol Suite 118 The FIN + ACK segment consumes one sequence number if it does not carry data. Note:
  119. 119. TCP/IP Protocol Suite 119 Half-close
  120. 120. TCP/IP Protocol Suite 120 STATE TRANSITION DIAGRAM To keep track of all the different events happening during connection establishment, connection termination, and data transfer, the TCP software is implemented as a finite state machine. . The topics discussed in this section include: Scenarios
  121. 121. TCP/IP Protocol Suite 121 Table 12.3 States for TCP
  122. 122. TCP/IP Protocol Suite 122 State transition diagram
  123. 123. TCP/IP Protocol Suite 123 Common scenario
  124. 124. TCP/IP Protocol Suite 124 Three-way handshake
  125. 125. TCP/IP Protocol Suite 125 Simultaneous open
  126. 126. TCP/IP Protocol Suite 126 Simultaneous close
  127. 127. TCP/IP Protocol Suite 127 Denying a connection
  128. 128. TCP/IP Protocol Suite 128 Aborting a connection
  129. 129. TCP/IP Protocol Suite 129 FLOW CONTROL Flow control regulates the amount of data a source can send before receiving an acknowledgment from the destination. TCP defines a window that is imposed on the buffer of data delivered from the application program. The topics discussed in this section include: Sliding Window Protocol Silly Window Syndrome
  130. 130. TCP/IP Protocol Suite 130 Sliding window
  131. 131. TCP/IP Protocol Suite 131 A sliding window is used to make transmission more efficient as well as to control the flow of data so that the destination does not become overwhelmed with data. TCP’s sliding windows are byte oriented. Note:
  132. 132. TCP/IP Protocol Suite 132 Example 5
  133. 133. TCP/IP Protocol Suite 134 Example 7
  134. 134. TCP/IP Protocol Suite 137 ERROR CONTROL TCP provides reliability using error control, which detects corrupted, lost, out-of-order, and duplicated segments. Error control in TCP is achieved through the use of the checksum, acknowledgment, and time- out. The topics discussed in this section include: Checksum Acknowledgment Acknowledgment Type Retransmission Out-of-Order Segments Some Scenarios
  135. 135. TCP/IP Protocol Suite 138 ACK segments do not consume sequence numbers and are not acknowledged. Note:
  136. 136. TCP/IP Protocol Suite 139 In modern implementations, a retransmission occurs if the retransmission timer expires or three duplicate ACK segments have arrived. Note:
  137. 137. TCP/IP Protocol Suite 140 No retransmission timer is set for an ACK segment. Note:
  138. 138. TCP/IP Protocol Suite 141 Data may arrive out of order and be temporarily stored by the receiving TCP, but TCP guarantees that no out-of-order segment is delivered to the process. Note:
  139. 139. TCP/IP Protocol Suite 142 Normal operation
  140. 140. TCP/IP Protocol Suite 143 Lost segment
  141. 141. TCP/IP Protocol Suite 144 The receiver TCP delivers only ordered data to the process. Note:
  142. 142. TCP/IP Protocol Suite 145 Fast retransmission
  143. 143. TCP/IP Protocol Suite 146 Lost acknowledgment
  144. 144. TCP/IP Protocol Suite 147 Lost acknowledgment corrected by resending a segment
  145. 145. TCP/IP Protocol Suite 148 Lost acknowledgments may create deadlock if they are not properly handled. Note:
  146. 146. TCP/IP Protocol Suite 149 ‫تشكر‬ ‫با‬ ‫؟‬

    Be the first to comment

    Login to see the comments

  • AmirPanahi1

    May. 26, 2016
  • AKSHAY33K

    May. 27, 2016
  • UmairAhmed32

    Oct. 14, 2017
  • jankikanabar1

    Nov. 9, 2017
  • MinKhantHtay

    Sep. 28, 2018
  • AyazKhan311

    Aug. 26, 2020

TCP/IP Training in IRAN

Views

Total views

1,338

On Slideshare

0

From embeds

0

Number of embeds

10

Actions

Downloads

149

Shares

0

Comments

0

Likes

6

×