LECTURE 5
OSI Transport Layer objectives 1. Roles of the Transport Layer 1. segmentation of data 2. error detection 3. Multiplexing of upper layer application using port numbers 2. The TCP protocol Communicating with reliability (TCP Header) 3. TCP Connection Establishment (TCP Three-Way Handshake) 4. Managing TCP Sessions 1. reliability (sequencing and acknowledgements) 2. In order TCP Segment Reassembly 3. error correction -(TCP Retransmission) 4. flow control ( window size) 5. TCP Session Termination ( 4 Way handshake) 6. The UDP protocol Communicating with Low overhead (UDP Header) 7. TCP VS. UDP
Transport Layer TCP UDP
Main Purpose of the Transport Layer Multiplexing of applications.
What is the protocol which implement transport layer? TCP Header UDP Header or Application Header + data TCP Header=20 bytes UDP Header=8 bytes UDP is lower overhead
Applications Requirements Vary Because different applications have different requirements, there are multiple Transport layer protocols.
TCP and UDP UDP is a simple, connectionless protocol Applications that use UDP include: Domain Name System (DNS) Video Streaming Voice over IP (VoIP) TCP is a connection-oriented protocol Applications that use TCP are: Web Browsers E-mail File Transfers
Transport Layer Functions TCP/UDP FUNCTIONS. 1. Multiplexing of upper layer application using port numbers 2. segmentation of data 3. error detection TCP Additional functions 1. Establishment of connection (3-way handshake) 2. Management of connection reliability (sequencing and acknowledgements) error correction flow control (Buffering, congestion avoidance, windowing) 3. Termination of connection (4-way handshake)
TCP and UDP Identify the basic characteristics of the UDP and TCP protocols
Multiplexing of upper layer application using port numbers Identifying the Applications In order to pass data streams to the proper applications, the Transport layer must identify the target application. To accomplish this, the Transport layer assigns an application an identifier. The TCP/IP protocols call this identifier a port number. Why source port number & destination port number? The source port number is the number for this communication associated with the originating application on the local host. The destination port number is the number for this communication associated with the destination application on the remote host. A socket pair, consisting of the source and destination IP addresses and port numbers, is also unique and identifies the conversation between the two hosts.
Layer 4 Addressing Port Numbers : Port numbers are classified to Well Known port (0-1023) it identifies different applications, ex:ftp(20,21), Telnet(23), SMTP(25), DNS(53), HTTP(80) User defined port (1024-65535), it is given randomly by the operating system for each session initiated by the host
Port Numbers
192.168.1.101 Source Port 49888 49890 Destination Port 80 198.133.219.25 80 172.16.5.5 Source Port 49888 www.cisco.com 66.13.29.25 80 www.yahoo.com
TCP or UDP Source IP Destination IP Source Port Destination Port Connection State www.google.com www.cisco.com netstat n Note: When downloading a web document and its objects it is common that there will be several TCP sessions created.
TCP Connection Establishment When two hosts communicate using TCP, a connection is established before data can be exchanged. After the communication is completed, the sessions are closed and the connection is terminated. To establish the connection, the hosts perform a threeway handshake. Control bits in the TCP header indicate the progress and status of the connection.
TCP Connection Establishment and Termination Within the TCP segment header, there are six 1-bit fields that contain control information used to manage the TCP processes. Those fields are: 1. URG - Urgent pointer field significant 2. ACK - Acknowledgement field significant 3. PSH - Push function 4. RST - Reset the connection 5. SYN - Synchronize sequence numbers 6. FIN - No more data from sender
TCP Three-Way Handshake
TCP Three-Way Handshake Step 1: A TCP client begins the three-way handshake by sending a segment with the SYN (control flag set, indicating an initial value in the sequence number field in the header. The sequence number is the Initial Sequence Number (ISN), is randomly chosen and is used to begin tracking the flow of data from the client to the server for this session. Step 2: Server sends a segment back to the client with: ACK flag set indicating that the Acknowledgment number is significant. The value of the acknowledgment number field is equal to the client initial sequence number plus 1. SYN flag is set with its own random ISN for the Sequence number Step 3: TCP client responds with a segment containing an ACK that is the response to the TCP SYN sent by the server. The value in the acknowledgment number field contains one more than the initial sequence number received from the server.
Segmentation and reassembly. Describe the role of segments in the transport layer and the two principle ways segments can be marked for reassembly.
TCP In order Reassembly Describe how TCP sequence numbers are used to reconstruct the data stream with segments placed in the correct order
UDP out of order Datagram Reassembly Describe in detail the process specified by the UDP protocol to reassemble PDUs at the destination device
Error Detection TCP/UDP Checksum
TCP Supporting Reliable Communication A Transport layer protocol can implement a method to ensure reliable delivery of the data. At the Transport layer the three basic operations of reliability are: Tracking transmitted data Acknowledging received data Retransmitting any unacknowledged data
TCP TCP Additional functions Establishment of connection (3-way handshake) Management of connection flow control (window size) acknowledging of delivered segments Retransmission of undelivered segments Termination of connection (4-way handshake)
TCP Session Termination Session termination
What s meant by window size Flow Control and Reliability To govern the flow of data between devices, TCP uses a peer-to-peer flow control mechanism. The receiving host's TCP layer reports a window size to the sending host's TCP layer. This window size specifies the number of bytes, starting with the acknowledgment number, that the receiving host's TCP layer is currently prepared to receive. Window size is included in every TCP segment sent from client or server starting with three-way handshake. TCP is a full duplex service, client and server specify their own window sizes.
TCP Congestion Control- Minimizing Segment Loss Describe the mechanisms in TCP that manage the interrelationship between window size, data loss and congestion during a session
TCP Retransmission Describe the retransmission. remedy for lost data employed by TCP
UDP- Low Overhead vs. Reliability UDP is a simple protocol that provides the basic Transport layer functions. It much lower overhead than TCP, since it is not connectionoriented and does not provide the sophisticated retransmission, sequencing, and flow control mechanisms. This does not mean that applications that use UDP are always unreliable. Although the total amount of UDP traffic found on a typical network is often relatively low, key Application layer protocols that use UDP include: (DNS) (SNMP) (DHCP) (RIP) (TFTP) Online games Some applications, such as online games or VoIP, can tolerate some loss of some data. Some applications, such as DNS, will simply retry the request if they do not receive a response, and therefore they do not need TCP to guarantee the message delivery. The low overhead of UDP makes it very desirable for such applications.
Summary TCP vs. UDP TCP provides: Reliable delivery Error checking Flow control Congestion control Ordered delivery (Connection establishment) Applications: HTTP FTP Telnet MSN messenger UDP provides: Unreliable delivery No error checking No flow control No congestion control No ordered delivery (No connection establishment) Applications DNS (usually) RTP (Real-Time Protocol) VoIP
Summary Transport Layer Functions TCP/UDP FUNCTIONS. 1. Multiplexing of upper layer application using port numbers 2. segmentation of data 3. error detection TCP Additional functions 1. Establishment of connection (3-way handshake) 2. Management of connection reliability (sequencing and acknowledgements) error correction flow control (Buffering, congestion avoidance, windowing) 3. Termination of connection (4-way handshake)