4.1 Transport Layer TCP, UDP
4.1 Transport Layer TCP, UDP
Module 4
Transport Layer Services
• Process-to-Process Communication
Transport Layer Services
• Addressing: Port Numbers
• To define the processes, we need second identifiers,
called port numbers.
• Acknowledgment
• both positive and negative ack signals as error
control
Transport Layer Services
• Congestion Control
• Congestion control refers to the mechanisms and
techniques that control the congestion and keep
the load below the capacity.
• Error Control
• There is no error control mechanism in UDP except for the checksum.
• When the receiver detects an error through the checksum, the user
datagram is silently discarded.
• The lack of error control means that the process using UDP should
provide for this service, if needed.
UDP Services
• Congestion Control
• UDP is a connectionless protocol, it does not
provide congestion control.
• Byte Number
• TCP numbers all data bytes (octets) that are
transmitted in a connection.
• Numbering is arbitrary
TCP Features
• Sequence Number
1. The sequence number of the first segment is
the ISN (initial sequence number),
• which is a random number.
• Data Transfer
• Connection Termination
Connection Establishment
• TCP transmits data in full duplex mode.
• Three-Way Handshake
– Server program tells its TCP that it is ready to
accept a connection. This request is called a
passive open.
– The client program issues a request for an active
open.
Connection Establishment
Connection Establishment
• The client sends the first segment, a SYN
segment
– Only the SYN flag is set.
– This segment is for synchronization of sequence
numbers
– segment does not contain an acknowledgment
number
– Does not define window size.
– SYN segment cannot carry data, but it consumes
one sequence number ( for one imaginary byte).
Connection Establishment
• Server sends the second segment, a SYN + ACK.
• This segment has a dual purpose:
– SYN segment for communication in the other
direction(initialize a sequence number for numbering
the bytes sent from the server to the client).
– The server also acknowledges the receipt of the SYN
segment from the client by setting ACK flag.
• Because segment contains an ACK, it also need to
define window size, rwnd(to be used by client).
• A SYN + ACK segment cannot carry data, but it
does consume one sequence number.
Connection Establishment
TCP
Error Control
• TCP is a reliable transport layer protocol.
• Application program that delivers a stream of data
to TCP relies on TCP to deliver the entire stream to
the application program on the other end in order,
without error.
• TCP provides reliability using error control.
• Error control includes mechanism for:
– detecting and resending corrupted segments,
– resending lost segments,
– storing out of order segments until missing segments
arrive, and
– detecting and discarding duplicated segments.
Error Control
• Error control in TCP is achieved through the
use of three simple tools:
– checksum, acknowledgment, and time-out.
Acknowledgment
• Control segments that carry no data, but
consume a sequence number, are also
acknowledged.
• ACK segments are never acknowledged.
Acknowledgment Type
̶ Cumulative Acknowledgment (ACK)
̶ Selective Acknowledgment (SACK)