Transport Layer : Process-to-Process Delivery
The transport layer is responsible for processto-process deliverythe 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.
Computer Networks 2010
Dept. of Electronics Eng.
Process-to-Process Delivery
Client/Server Paradigm Multiplexing and Demultiplexing Connectionless Versus ConnectionOriented Service Reliable Versus Unreliable Protocols
UDP TCP
Computer Networks 2010 Dept. of Electronics Eng. 3
Types of data deliveries
Computer Networks 2010
Dept. of Electronics Eng.
Client/Server Paradigm
The most common process-to-process communication is through the client/server paradigm. A process on the local host, called a client, needs services from a process usually on the remote host, called a server. Operating systems today support multi-user multiprograming environment. Several programs running on both servers and clients at the same time! For communication, we need the following addresses:
local host local process remote host remote process
Port numbers
Computer Networks 2010
Dept. of Electronics Eng.
Computer Networks 2010
Dept. of Electronics Eng.
IP addresses versus port numbers
Socket address
Process-to-process delivery needs two identifiers Socket address = combination of IP address and port number
Computer Networks 2010
Dept. of Electronics Eng.
Computer Networks 2010
Dept. of Electronics Eng.
Multiplexing and Demultiplexing
Connectionless Versus ConnectionOriented Service
Connectionless service
No need for connection establishment or connection release UDP(User Datagram Protocol)
Connection-oriented service
A connection is first established between sender and receiver before data transfer. TCP(Transmission Control Protocol)
Computer Networks 2010 Dept. of Electronics Eng. 9 Computer Networks 2010 Dept. of Electronics Eng. 10
Reliable vs. Unreliable
Note! The Internet itself is unreliable
Best Effort Delivery
UDP, TCP, and SCTP in TCP/IP suite
A reliable transport?
flow and error control
Different transport-layer protocols
TCP, SCTP : connection-oriented and reliable UDP : connectionless and unreliable
Computer Networks 2010
Dept. of Electronics Eng.
11
Computer Networks 2010
Dept. of Electronics Eng.
12
User Datagram Protocol(UDP)
The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to-process communication instead of host-to-host communication.
User datagram format
Connectionless, unreliable Minimum overhead Simply adds port address to IP Checksum is optional
Dept. of Electronics Eng. 13 Computer Networks 2010 Dept. of Electronics Eng. 14
Computer Networks 2010
Use of UDP
Suitable for a process that requires simple request-response communication with little concern for flow and error control. Suitable for a process with internal flow and error control. e.g., Trivial File Transport Protocol (TFTP) Used for some route updating protocols such as RIP. Used in conjunction with RTP to provide a transport-layer mechanism for real-time data (Real-time applications).
Computer Networks 2010 Dept. of Electronics Eng. 15
Transmission Control Protocol(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.
Computer Networks 2010
Dept. of Electronics Eng.
16
Stream delivery Service
Sending and receiving buffers
TCP sees a sequence of data transmitted as a stream. TCP creates an environment in which two processes seem to be connected by an imaginary tube that carries their data across the Internet
Computer Networks 2010 Dept. of Electronics Eng. 17 Computer Networks 2010 Dept. of Electronics Eng. 18
TCP segments
TCP sequence number
Not segment number but byte number TCP offers full duplex service (segments are sent in both directions) Numbering is independent in each direction Numbering does NOT necessarily start from 0; it starts with a randomly generated number between 0 ~ 232 - 1
Computer Networks 2010
Dept. of Electronics Eng.
19
Computer Networks 2010
Dept. of Electronics Eng.
20
Numbering
The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. The value of the sequence number field in a segment defines the number of the first data byte contained in that segment. 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.
Computer Networks 2010 Dept. of Electronics Eng. 21 Computer Networks 2010 Dept. of Electronics Eng. 22
TCP segment format
Control field
Computer Networks 2010
Dept. of Electronics Eng.
23
Computer Networks 2010
Dept. of Electronics Eng.
24
TCP Header Format (1)
Source / Destination port (16bits) Seq. # (32bits) : Seq. # of the 1st data octet in this segment except when SYN flag is set. ACK # (32bits) : a piggybacked ACK #.
Source / Destination TCP user
Flags
TCP Header Format (2)
URG : Urgent pointer field significant ACK : ACK field significant PSH : Push function RST : The connection must be reset SYN : Synchronize the seq. numbers during connection FIN: No more data from sender (= Terminate the connection)
If SYN is set, this field is the initial seq. # (ISN) and the first data octet is ISN+1. Contains the seq. # of the next data octet that the TCP entity expects to receive.
Header length (4bits) : # of 32 bit words in the header (= Data offset) Reserved (6bits) : Reserved for future use.
Computer Networks 2010 Dept. of Electronics Eng.
Window (16bits): Flow control credit allocation (in octets) Checksum (16bits): Error detection code Urgent pointer (16bits): Points to the last octet in a seq. of urgent data. Options (variable): Optional features
25
Computer Networks 2010
Dept. of Electronics Eng.
26
TCP Connection
TCP is a connection-oriented. In TCP, a data transmission requires
Connection establishment Data transmission Connection termination
Conn. establishment using three-way handshaking
Computer Networks 2010
Dept. of Electronics Eng.
27
Computer Networks 2010
Dept. of Electronics Eng.
28
Data transfer
A SYN segment cannot carry data, but it consumes one sequence number.
A SYN + ACK segment cannot carry data, but does consume one sequence number.
An ACK segment, if carrying no data, consumes no sequence number.
Computer Networks 2010
Dept. of Electronics Eng.
29
Computer Networks 2010
Dept. of Electronics Eng.
30
Conn. termination using three-way handshaking
The FIN segment consumes one sequence number if it does not carry data.
The FIN + ACK segment consumes one sequence number if it does not carry data.
Computer Networks 2010
Dept. of Electronics Eng.
31
Computer Networks 2010
Dept. of Electronics Eng.
32
Half-close
Computer Networks 2010
Dept. of Electronics Eng.
33