710 likes | 741 Views
Understand the purpose, characteristics, and protocols of the transport layer in data communication. Learn about TCP and UDP, session establishment, reliability, and application suitability.
E N D
CIS 81 Fundamentals of NetworkingChapter 7: Transport LayerPart 1 of 2 CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College graziani@cabrillo.edu Fall 2013
Chapter 7: Objectives Part 1 • Describe the purpose of the transport layer in managing the transportation of data in end-to-end communication. • Describe characteristics of the TCP and UDP protocols, including port numbers and their uses. Part 2 • Explain how TCP session establishment and termination processes facilitate reliable communication. • Explain how TCP protocol data units are transmitted and acknowledged to guarantee delivery. • Explain the UDP client processes to establish communication with a server. • Determine whether high-reliability TCP transmissions, or non-guaranteed UDP transmissions, are best suited for common applications.
Encapsulation SEGMENT PACKET FRAME
Reminder of encapsulation/decapsulation Data Link Trailer Data Link Header IP Header TCP Header HTTP Header Data Data Link Trailer Data Link Trailer Data Link Header Data Link Header IP Packet IP Packet Data Link Trailer Data Link Trailer Data Link Header Data Link Header IP Packet IP Packet Data Link Trailer Data Link Trailer Data Link Header Data Link Header IP Packet IP Packet Data Link Trailer Data Link Header IP Header TCP Header HTTP Header Data
Focus on Transport Layer TCP TCP
Role of the Transport Layer TCP UDP • The Transport Layer is responsible for establishing a temporary communication session between two applications and delivering data between them. • It regulates the flow of information from source to destination, reliably and accurately.
Transport Layer Responsibility www.cisco.com TCP Segment TCP Segment TCP Segment • Tracking the individual communication between applications on the source and destination hosts • Segmenting data for manageability and reassembling segmented data into streams of application data at the destination • Identifying the proper application for each communication stream TCP Segment
What two protocols are at the Transport Layer? • TCP • UDP • IP is a best-effort delivery service. What does that mean? • No guarantees • Best-effort service • “Unreliable service” • TCP/UDP is responsible for extending IP’s delivery service between two end systems.
Tracking Individual Conversations • Any host on a network can have multiple applications that are communicating simultaneously. • It is the responsibility of the Transport layer to maintain the multiple communication streams between these applications.
HTTP HTTP SMTP FTP Cabrillo Web Server TCP TCP TCP ISP’s Email and FTP Server TCP TCP • A single client may have multiple transport connections with multiple servers. • Notice that TCP is a connection-oriented service (two-way arrow) between the hosts, whereas UDP is a connectionless service (one-way arrow) . (later) TCP TCP TCP
UDP Header TCP Header • The transport layer assigns each application an identifier called a port number. • The transport layer uses ports to identify the application or service. HTTP is Port 80
segment segment • To pass data streams to the proper applications, the Transport layer must identify the target application. • Accomplished by referencing the port number in the header. • Each software process that needs to access the network is assigned a port number unique in that host. • This port number is used in the transport layer header to indicate to which application that piece of data is associated. • More later!
Segmenting and Reassembling Segments • Some transport layer protocols can also reassemble the data pieces into streams to be passed to the application layer.
Acronym Alert Transport Layer Protocols • TCP/IP uses two transport layer protocols: • Transmission Control Protocol (TCP) • User Datagram Protocol (UDP)
TCP versus UDP UDP TCP • Two protocols for different types of traffic.
TCP Header UDP Header • TCP is a more complex protocol.
Jon Postel made many significant contributions to the development of the Internet, particularly in the area of standards. He is principally known for being the editor of the Request for Comment (RFC) document series, and for serving as the Internet Assigned Numbers Authority (IANA) until his death. TCP (1943 – 1998) • TCP is considered a reliable transport protocol. • Introduced in RFC 793. • It includes processes to ensure reliable delivery between. • Analogous to sending packages using FedEx. • With TCP, the three basic operations of reliability are: • Tracking transmitted data segments • Acknowledging received data • Retransmitting any unacknowledged data
TCP • The user uses FTP to upload a file to an FTP server.
UDP • Providing the reliability functions of TCP also adds additional overhead. • UDP provides just the basic functions for delivering data segments between the appropriate applications, with very little overhead and data checking. • It is known as a best-effort delivery protocol. • Analogous to sending a regular, non-registered, letter in the mail.
UDP • The user uses TFTP to upload a file to a TFTP server.
TCP Services • TCP provides reliable delivery on top of unreliable IP • In addition to supporting the basic functions of data segmentation and reassembly, TCP also provides: • Reliable delivery • Error checking • Flow control • Congestion control • Ordered delivery • Connection establishment
Transmission Control Protocol (TCP) HTTP FTP SMTP • Connection-oriented protocol, described in RFC 793. • TCP incurs additional overhead to gain functions. • Each TCP segment adds a 20 byte header to the Application layer data. • Applications that use TCP include: • Web Browsers • E-mail • File Transfers • The TCP PDU is called a segment.
Segmenting Data Application Data (100,000 bytes) 1-1000 1001-2000 2001-3000 3001-4000 4001-5000 … TCP 1-1000 TCP Segment • TCP encapsulates data into multiple segments. • Segments are required to make network communication efficient. • The segments header contain: • Source port number to help keep track of individual conversations. • Destination port number to enable a receiving host to forward the data to the appropriate application. • Sequence numbers help segmenting and reassembling segments. • Window size to help with flow control. • Error checking mechanisms.
Reassembling Segments • At the receiving host, each segment is examined and reconstructed into a complete data stream using the sequence numbers. • Missing segments can be requested from the source. • It is then directed to the appropriate application identified in the segment header.
Same Order Delivery Having taken different routes to the destination, the segments arrive out of order. • Segments can arrive out-of-order but are reorganized using sequence numbers. • NOTE: • Establishing a Session, Reliable Delivery, and Flow Control will be discussed later.
Source Port (16 bits) • Number of the calling port. • Dynamically assigned to the sending host. • Number ranges from 1024 to 65,535. • The source port makes it possible to have multiple sessions of FTP running simultaneously.
Destination Port (16 bits) • Number of the called port. • Sending host usually selects a number between 1 and 1023. • End systems use the same port numbers to select the proper application. • E.g., when telnetting, Telnet on the source (port 23) is talking to Telnet on the destination (port 23).
Sequence Number (32 bits) • Used to establish reliability. • Number ensures correct sequencing of arriving data. • Identifies the position in the sender’s byte stream of data.
Acknowledgement Number (32 bits) • Used to establish reliability. • Next expected TCP octet.
Header Length (4 bits) • Known as ʺdata offsetʺ. • Indicates the length of the TCP segment header.
Control Bits (Flags) (6 bits) • Includes bit codes, or flags, that indicate the purpose and function of the TCP segment.
Window (16 bits) • Number of octets that the receiver is willing to accept. • This number can be adjusted while data is being transmitted.
Checksum (16 bits) • Calculated checksum of the header and data fields.
UDP Header TCP Header • Both TCP and UDP use ports (or sockets) numbers to pass information to the upper layers. HTTP is Port 80
The application this TCP segment came from. The application this TCP segment is going to. The application this TCP segment came from. The application this TCP segment is going to.
Application Header + data Port numbers are used to by the sender to tell the receiver which network application it should use for the “Data”. Port Number Application Header + data Port numbers are used by the receiver so it knows which application it should send the “Data” to. Port Number
http://www.iana.org/assignments/port-numbers • TBA • The Internet Assigned Numbers Authority (IANA) assigns port numbers.
Well Known Ports (Numbers 0 to 1023) • Reserved for common services and applications • Client: TCP destination port • Server: TCP source port Well Known or Registered Port Number Well Known or Registered Port Number
Well Known or Registered Port Number • Registered Ports (Numbers 1024 to 49151) • Assigned to user processes or applications. • Non-common applications. • Client: TCP destination port • Server: TCP source port • May also be used as dynamic or private port (next). Well Known or Registered Port Number
Private/Dynamic Port Number Well Known or Registered Port Number Well Known or Registered Port Number Private/Dynamic Port Number • Dynamic or Private Ports (Numbers 49152 to 65535) • Also known as Ephemeral Ports • Usually assigned dynamically to client applications when initiating a connection. • Client: TCP source port • Server: TCP destination port • May also include the range of Registered Ports (Numbers 1024 to 49151)
Client Server Telnet
Client TCP Header 1028 23 Data for Telnet Client Server • Client sends TCP segment with: • Destination Port: 23 (Well known port number) • Source Port: 1028 (Dynamic Port assigned by client)
Server TCP Header 23 1028 Data for Telnet Client Server • Server responds with TCP segment with: • Destination Port: 1028 (Dynamic Port assigned by client) • Source Port: 23 (Well known port number)