Transport layer protocols are communication protocols that enable end-to-end data transfer between applications on different devices.
- Operate between the application layer and network layer
- Enable process-to-process communication using port numbers
- Determine how data is transmitted, whether through reliable or fast delivery methods
- Provide reliability, flow control, and error handling when required

Functions of Transport Layer
- Process-to-Process Delivery: Ensures data is delivered between the correct sender and receiver processes.
- End-to-End Connection: Establishes and maintains a logical connection between communicating devices.
- Multiplexing and Demultiplexing: Allows multiple applications to send and receive data simultaneously using port numbers.
- Data Integrity and Error Correction: Detects and corrects errors to ensure reliable data transmission.
- Congestion Control: Controls data flow to prevent network congestion.
Characteristics of Transport Layer Protocol
- The transport layer uses two main protocols: TCP and UDP.
- It enables process-to-process communication between source and destination hosts.
- Data from the network layer is delivered to the correct application using port numbers.
- Each port is identified by a 16-bit port number, allowing multiple applications to run simultaneously.
- TCP provides reliable, connection-oriented communication with error control and flow control.
- UDP provides fast, connectionless communication with minimal overhead
Transport Layer Protocols
The transport layer is represented majorly by TCP and UDP protocols. Transport layer protocols work above the IP protocols and deliver the data packets from IP serves to destination port and from the originating port to destination IP services.
1. UDP
UDP (User Datagram Protocol) is a connectionless transport layer protocol that provides fast but unreliable data transmission. It is mainly used where speed is more important than reliability.
Features of UDP
- Connectionless and non-sequential data transmission
- No acknowledgment or retransmission
- Low overhead and fast delivery
- Used in applications like DNS, streaming, and online games

UDP Segment
| Field | Description |
|---|---|
| Source Port | Identifies sender’s port (16 bits) |
| Destination Port | Identifies receiver’s port (16 bits) |
| Length | Total length of UDP header + data |
| Checksum | Error detection using one’s complement |
Port range: 0 to 65535 (port 0 is reserved)

Advantages of UDP
- Supports broadcast and multicast
- Faster data transmission
- Suitable for small transactions
- No need for connection setup
Disadvantages of UDP
- No guarantee of data delivery
- No congestion control
- No sequencing of data
- Higher packet loss possible
2. TCP
TCP (Transmission Control Protocol.) is a connection-oriented and reliable transport layer protocol. It establishes a virtual connection before data transmission and ensures error-free delivery.

Features of TCP
- Reliable and ordered data delivery
- Uses acknowledgments and retransmissions
- Data sent as a byte stream
- Uses sequence numbers for tracking data
TCP Segment
| Field | Description |
|---|---|
| Source Port | Sender’s application port |
| Destination Port | Receiver’s application port |
| Sequence Number | Byte number of first data byte |
| Acknowledgement Number | Next expected byte |
| Header Length | Size of TCP header |
| Control Flags | URG, ACK, PSH, RST, SYN, FIN |
| Window Size | Flow control |
| Checksum | Error detection |
| Urgent Pointer | Urgent data indicator |

Advantages of TCP
- Reliable data transmission
- Error and flow control
- Connection-oriented communication
- Independent of operating system
Disadvantages of TCP
- Slower compared to UDP
- No support for broadcast or multicast
- Higher overhead
- Difficult protocol replacement in TCP/IP model
3. SCTP
SCTP (Stream Control Transmission Protocol) is a connection-oriented, reliable, and full-duplex protocol that combines features of TCP and UDP.

Features of SCTP
- Supports multihoming (multiple paths)
- Prevents half-open connections
- Suitable for voice and telephony services
- Independent of IP layer
Advantages of SCTP
- Reliable and secure transmission
- Full-duplex communication
- Combines benefits of TCP and UDP
- Better performance in wireless networks
Disadvantages of SCTP
- Requires changes in applications
- Transport stack modification needed
- Limited support compared to TCP/UDP