Transport Layer
Learning Outcomes Understanding of end-to-end delivery and port address Understanding of well-known port numbers Understanding of different service types in the transport layer List of two transport layer protocols List of applications of UDP and applications of TCP Understanding of TCP connection/termination procedure
Topics discussed in this section: 1. INTRODUCTION The transport layer is responsible for process-to-process delivery (or also called end-to-end delivery) – the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, as we will see later. Topics discussed in this section: Client/Server Paradigm Multiplexing and Demultiplexing Connectionless Versus Connection-Oriented Service Reliable Versus Unreliable Two Protocols
Note The transport layer is responsible for process-to-process (or also called end-to-end) delivery.
Types of data deliveries
Transport layer protocol + port number Port numbers OS assigns applications when socket() is invoked. bind() with applications. Transport layer protocol + port number
IP addresses versus port numbers
A bit different from different OSes. IANA ranges (client port numbers) A bit different from different OSes.
TCP UDP Services Connectionless Connection-oriented Block transfer Byte streaming Unreliable Reliable TCP UDP
Position of UDP, TCP, and SCTP in TCP/IP suite
Topics discussed in this section: 2. USER DATAGRAM PROTOCOL (UDP) The User Datagram Protocol (UDP) is called a connectionless, unreliable, block transfer protocol. It does not add anything to the services of IP except to provide process-to-process communication instead of host-to-host communication. Topics discussed in this section: Well-Known Ports for UDP User Datagram Checksum UDP Operation Use of UDP
Note: UDP is a connectionless, unreliable, block transfer protocol that has no flow and error control. It uses port numbers to multiplex data from the application layer.
Well-known ports used with UDP
User datagram format
Note: UDP is a convenient transport-layer protocol for applications that provide flow and error control. It is also used for short message transfer and by multimedia applications.
Topics discussed in this section: 3. TCP TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses flow and error control mechanisms at the transport level. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control
TCP service Connection-oriented Full-duplex Byte streaming Reliable
Well-known ports used by TCP
Any size Any size Any size Byte stream delivery No overwriting, not like UDP
The numbering starts with a randomly generated number. Note The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.
Numbering bytes Sequence number and acknowledge number Why do we need? Independent in each direction: full-duplex mode Not segment numbers, but byte numbers 0 ~ 232 - 1
TCP segment format
TCP segment format Source port address Destination port address Sequence number for the first byte of the payload Acknowledge number [Q] How to know whether ACK is valid? Header length: unit 4B Reserved Control field Window size With acknowledgement The size of the window, in bytes, of the opponent for flow control Maximum 65535 bytes The unit could be changed by using an option Checksum 16 bit checksum Urgent pointer Used when the urgent flag is set It points to the last byte of the urgent data Options
When the payload needs to be sent out of order, Control field When the payload needs to be sent out of order, e.g., it wants to abort the sending application, but it has already sent a huge amount of data. u.p. u.d. payload When the payload needs to be delivered without buffering that is used to increase the efficiency of TCP, called delayed transmission. E.g., SSH terminal session
Description of flags in the control field
Connection establishment using three-way handshaking 8001 Initial window size of the opponent included for flow control.
Data transfer
Connection termination using three-way handshaking X +1
Half-close x+1
to control the flow of data so that the destination does not become Note 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 sliding windows are byte-oriented. What kind ARQ algorithm for error control? Selective Repeat ARQ