370 likes | 509 Views
CCNA – Network Fundamentals Jane Connors, Instructor. Chapter 4 – OSI Transport Layer. Objectives. Explain the need for Transport layer Identify role of Transport layer as it provides the end-to-end transfer of data between applications
E N D
CCNA – Network FundamentalsJane Connors, Instructor Chapter 4 – OSI Transport Layer
Objectives • Explain the need for Transport layer • Identify role of Transport layer as it provides the end-to-end transfer of data between applications • Describe role of two TCP/IP Transport layer protocols: TCP and UDP • Explain key functions of Transport layer, including reliability, port addressing, and segmentation • Explain how TCP and UDP each handle key functions • Identify when appropriate to use TCP or UDP and provide examples of applications that use each one
Transport Layer • Transport layer accepts data from Application layer and prepares it for addressing at Network layer, see Figure 4-1, p.100 • Transport layer is responsible for overall end-to-end transfer of application data • Transport layer encapsulates Application data for use by Network layer
Transport Layer • Enables multiple applications to communicate over network at same time on a single device • See Figure 4-2, p.101 • Ensures that, if required, all data is received reliably and in order by correct application • Employs error handling mechanisms
Purpose of the Transport Layer • Tracking individual communication between applications on source and destination hosts • Segmenting data and managing each piece • Reassembling segments into streams of application data • Identifying different applications • Performing flow control between end users • Enabling error recovery • Initiating a session
Tracking Individual Conversations • Different applications – ex. Fig.4-3, p.102 • Segmentation of the data, in accordance with Transport layer protocols, provides the means to both send and receive data when running multiple applications concurrently on a computer • Without segmentation, only one application, the streaming video for example, would be able to receive data
Basic Functions of the Transport Layer • Segmentation and Reassembly • sequence #’s added to each header • Conversation Multiplexing • identify applications with port #’s added to each header • Plus : • Connection-oriented conversations • Reliable delivery • Ordered data reconstruction • Flow control
Controlling the Conversations • Establishing a Session - Transport layer can provide this connection orientation by creating a session between the applications • connections prepare the applications to communicate with each other before any data is transmitted • Reliable Delivery - Transport layer can ensure that all pieces reach their destination by having the source device retransmit any data that is lost • Same Order Delivery - Transport layer can ensure that these segments are reassembled into the proper order • by numbering and sequencing the segments • Flow Control – to prevent the loss of segments on the network and avoid the need for retransmission
Implementing Reliability • At the Transport layer the three basic operations of reliability are: • tracking transmitted data • acknowledging received data • retransmitting any unacknowledged data NOTE: reliability processes place additional overhead on network resources
What is Reliability? • Protocols specify methods for either reliable, guaranteed delivery OR best-effort delivery • Best-effort delivery is referred to as unreliable, because there is no ACK (acknowledgement) that the data is received at the destination (UDP, DNS, DHCP) • Value of reliability or burden of reliability? • Figure 4-5, p.106
TCP and UDP - Transport Layer Protocols • two most common Transport layer protocols of TCP/IP protocol suite are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) • both protocols manage the communication of multiple applications • differences between them are the specific functions that each protocol implements
User Datagram Protocol • UDP is a simple, connectionless protocol, described in RFC 768 • has advantage of providing low overhead data delivery • pieces of communication in UDP are called datagrams • These datagrams are sent as "best effort" by the UDP Transport layer protocol • only 8 bytes overhead
User Datagram Protocol • Applications that use UDP include: • Domain Name System (DNS) • Video Streaming • Voice over IP (VoIP) • Online Games
Transmission Control Protocol • TCP is a connection-oriented protocol, described in RFC 793 (google “rfc 793”—what year published?) • Each TCP segment has 20 bytes of overhead in the header encapsulating the Application layer data • Same order delivery • Reliable delivery • Flow control
Transmission Control Protocol • Applications that use TCP are: • Web Browsers • E-mail • File Transfers
Port Addressing • Port numbers are unique application identifiers • Port numbers are assigned in various ways, depending on whether the message is a request or a response • While server processes have static port numbers assigned to them, clients dynamically choose a port number for each conversation • When a client application sends a request to a server application, the destination port contained in the header is the port number that is assigned to the service daemon running on the remote host • Example – web page access, pg. 109
Knowing the Ports • client software must know what port number is associated with the server process on the remote host • source port in a segment or datagram header of a client request is randomly generated from port numbers greater than 1023 • this port number acts like a return address for the requesting application • Transport layer keeps track of this port and the application that initiated the request so when response is returned, it can be forwarded to correct application • Socket = IP address : Port number, see p.109
Port Addressing – see pages 110 and 111 • Well known ports (Numbers 0 to 1023) • Reserved—services and applications • Registered Ports (Numbers 1024 to 49151) • Assigned to user processes or applications • Dynamic or Private Ports (Numbers 49152 to 65535) • Short-lived port; temp/valid while connected • Internet Assigned Numbers Authority (IANA) assigns port numbers http://www.iana.org/about/ • netstat shows active (open)TCP and UDP connections
Segmentation and Reassembly • Dividing application data into pieces ensures • data is transmitted within the limits of the media • data from different applications can be multiplexed on to the media • TCP and UDP Segmentation Different • sequence numbers for order (tcp only) • application must tolerate data not in order (udp) • key distinction between TCP and UDP is reliability • TCP is __??__ and UDP is __??__
TCP Server Processes • Each application process running on server is configured to use a port number, either by default or manually by a system administrator • An individual server cannot have two services assigned to the same port number within the same Transport layer services • Many simultaneous ports open on server • Security measure – block ports on server
Connection Establishment and Termination • When two hosts communicate using TCP, a connection is established before data can be exchanged • To establish the connection, the hosts perform a three-way handshake. Control bits in the TCP header use a 1-bit field to indicate the progress and status of the connection (fields=flags) • URG - Urgent pointer field significant • ACK - Acknowledgement field significant • PSH - Push function • RST - Reset the connection • SYN - Synchronize sequence numbers • FIN - No more data from sender (termination)
TCP Three-Way Handshake • Establishes destination device is present on the network • Verifies destination device has an active service and is accepting requests on the destination port number • Informs destination device that source client intends to establish a communication session on that port number
TCP Three-Way Handshake • Client sends segment (SYN) to Server • Server sends SYN.ACK to client’s SYN • Client sends ACK for the server’s SYN.ACK SYN = synchronize sequence number ACK = acknowledgment
TCP Connection Establishment: SYN ACK(Initiate a Session) p.117 – Fig. 4-11
TCP Session Termination= 4 exchanges / two-way handshake • Client sends segment to Server with FIN flag set • Server sends ACK for client’s FIN • Server sends FIN to client to terminate session • Client sends ACK for the server’s FIN
TCP Connection Termination: FIN ACK (Ending a Session) p.119, Fig.4-12
TCP Acknowledgement with Windowing • expectationalacknowledgment is the next byte that receiver expects to receive • amount of data that a source can transmit before an acknowledgement must be received is called the window size • window size is a field in the TCP header that enables the management of lost data and flow control • See Figure 4-14 window size and ACKs, p.123
ACK of TCP Segments, p.121, Fig.4-13 • sending host is expected to send a segment that uses a sequence number that is equal to the ACK number
TCP Retransmission • when TCP at source host has not received an ACK after a predetermined amount of time, it will go back to last ACK number that it received and retransmit data from that point forward • selectiveacknowledgment is an optional feature if both hosts support it; destination host will ACK noncontiguous segments and source host only retransmits the missing data
Flow Control • initial window size is determined during session startup via three-way handshake • TCP feedback mechanism adjusts the effective rate of data transmission to the maximum flow that the network and destination device can support without loss • slowdown in data rate helps reduce the resource contention • another way to control the data flow is to use dynamic window sizes (sliding or scaling)
TCP Congestion and Flow Control, p.124(Dynamic Window Sizing) Receiver changes window size in TCP header of the returning segment Dynamic increasing/decreasing window size is a continuous process in TCP
UDP – Communicating with low overhead • It is a simple protocol that provides basic Transport layer functions • It is not connection oriented • It does not have retransmission, sequencing, or flow control • Applications that use it are not always unreliable, but they are responsible for the data • Reliability is not provided by UDP • But it is very __________ (and give me examples)
UDP Datagram Reassembly • It is connectionless so sessions are not established before communication takes place • It does not keep track of sequence numbers • It has no way to reorder the datagrams into their transmission order • The application decides the proper order • Figure 4-16, p.125 • Figure 4-17, p.126
The End • Don’t forget to write your Cisco online test for Chapter 4 – Transport Layer • Interesting link, RFC 1180: http://www.networksorcery.com/enp/rfc/rfc1180.txt TCP/IP Tutorial, January 1991