Open In App

Transport Layer Protocols

Last Updated : 25 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

The transport layer is the fourth layer in the OSI model and the second layer in the TCP/IP model. The transport layer provides with end to end connection between the source and the destination and reliable delivery of the services. Therefore transport layer is known as the end-to-end layer. The transport layer takes the services from its upward layer which is the application layer and provides it to the network layer. Segment is the unit of data encapsulation at the transport layer.

In this article, we are going to discuss all the important aspects of Transport Layer Protocol which include: Functions of Transport Layer protocol, characteristics of TLP, UDP & UDP Segemnts and their Advantages and Disadvantages, TCP & TCP Segemnts and their Advantages and Disadvantages, SCTP and its Advantages & Disadvantages.

Transport Layer ProtocolsFunctions of Transport Layer

  • The process to process delivery
  • End-to-end connection between devices
  • Multiplexing and Demultiplexing
  • Data integrity and error Correction
  • Congestion Control
  • Flow Control

Characteristics of Transport Layer Protocol

  • The two protocols that make up the transport layer are TCP and UDP.
  • A datagram is sent by the IP protocol at the network layer from a source host to a destination host.
  • These days, an operating system can support environments with multiple users and processes; a programme under execution is referred to as a process.
  • A source process is transmitting a process to a destination process when a host sends a message to another host. Certain connections to certain ports, referred to as protocol ports, are defined by the transport layer protocols.
  • A positive integer address, consisting of 16 bits, defines each port.

Transport Layer Protocols

The transport layer is represented majorly by TCP and UDP protocols. Today almost all operating systems support multiprocessing multi-user environments. This transport layer protocol provides connections to the individual ports. These ports are known as protocol ports. 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. Below are the protocols used at the transport layer.

1. UDP

UDP stands for User Datagram Protocol. User Datagram Protocol provides a nonsequential transmission of data. It is a connectionless transport protocol. UDP protocol is used in applications where the speed and size of data transmitted is considered as more important than the security and reliability. User Datagram is defined as a packet produced by User Datagram Protocol. UDP protocol adds checksum error control, transport level addresses, and information of length to the data received from the layer above it. Services provided by User Datagram Protocol(UDP) are connectionless service, faster delivery of messages, checksum, and process-to-process communication.

UDP

UDP Segment

While the TCP header can range from 20 to 60 bytes, the UDP header is a fixed, basic 8 bytes. All required header information is contained in the first 8 bytes, with data making up the remaining portion. Because UDP port number fields are 16 bits long, the range of possible port numbers is defined as 0 to 65535, with port 0 being reserved.

UDP-header

UDP

  • Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
  • Destination Port: This 2-byte element is used to specify the packet’s destination port.
  • Length: The whole length of a UDP packet, including the data and header. The field has sixteen bits.
  • Cheksum: The checksum field is two bytes long. The data is padded with zero octets at the end (if needed) to create a multiple of two octets. It is the 16-bit one’s complement of the one’s complement sum of the UDP header, the pseudo-header containing information from the IP header, and the data.

Advantages of UDP

  • UDP also provides multicast and broadcast transmission of data.
  • UDP protocol is preferred more for small transactions such as DNS lookup.
  • It is a connectionless protocol, therefore there is no compulsion to have a connection-oriented network.
  • UDP provides fast delivery of messages.

Disadvantages of UDP

  • In UDP protocol there is no guarantee that the packet is delivered.
  • UDP protocol suffers from worse packet loss.
  • UDP protocol has no congestion control mechanism.
  • UDP protocol does not provide the sequential transmission of data.

2. TCP

TCP stands for Transmission Control Protocol. TCP protocol provides transport layer services to applications. TCP protocol is a connection-oriented protocol. A secured connection is being established between the sender and the receiver. For a generation of a secured connection, a virtual circuit is generated between the sender and the receiver. The data transmitted by TCP protocol is in the form of continuous byte streams. A unique sequence number is assigned to each byte. With the help of this unique number, a positive acknowledgment is received from receipt. If the acknowledgment is not received within a specific period the data is retransmitted to the specified destination.

TCP

TCP Segment

A TCP segment’s header may have 20–60 bytes. The options take about 40 bytes. A header consists of 20 bytes by default, although it can contain up to 60 bytes.

TCPSegmentHeader-1

  • Source Port Address: The port address of the programme sending the data segment is stored in the 16-bit field known as the source port address.
  • Destination Port Address: The port address of the application running on the host receiving the data segment is stored in the destination port address, a 16-bit field.
  • Sequence Number: The sequence number, or the byte number of the first byte sent in that specific segment, is stored in a 32-bit field. At the receiving end, it is used to put the message back together once it has been received out of sequence.
  • Acknowledgement Number : The acknowledgement number, or the byte number that the recipient anticipates receiving next, is stored in a 32-bit field called the acknowledgement number. It serves as a confirmation that the earlier bytes were successfully received.
  • Header Length (HLEN): This 4-bit field stores the number of 4-byte words in the TCP header, indicating how long the header is. For example, if the header is 20 bytes (the minimum length of the TCP header), this field will store 5 because 5 x 4 = 20, and if the header is 60 bytes (the maximum length), it will store 15 because 15 x 4 = 60. As a result, this field’s value is always between 5 and 15.
  • Control flags: These are six 1-bit control bits that regulate flow control, method of transfer, connection abortion, termination, and establishment. They serve the following purposes:
    • Urgent: This pointer is legitimate
    • ACK: The acknowledgement number (used in cumulative acknowledgement cases) is valid.
    • PSH: Push request
    • RST: Restart the link.
    • SYN: Sequence number synchronisation
    • FIN: Cut off the communication
    • Window size: This parameter provides the sender TCP’s window size in bytes.
  • Checksum: The checksum for error control is stored in this field. Unlike UDP, it is required for TCP.
  • Urgent pointer: This field is used to point to data that must urgently reach the receiving process as soon as possible. It is only valid if the URG control flag is set. To obtain the byte number of the final urgent byte, the value of this field is appended to the sequence number.

Advantages of TCP

  • TCP supports multiple routing protocols.
  • TCP protocol operates independently of that of the operating system.
  • TCP protocol provides the features of error control and flow control.
  • TCP provides a connection-oriented protocol and provides the delivery of data.

Disadvantages of TCP

  • TCP protocol cannot be used for broadcast or multicast transmission.
  • TCP protocol has no block boundaries.
  • No clear separation is being offered by TCP protocol between its interface, services, and protocols.
  • In TCP/IP replacement of protocol is difficult.

3. SCTP

SCTP stands for Stream Control Transmission Protocol. SCTP is a connection-oriented protocol. Stream Control Transmission Protocol transmits the data from sender to receiver in full duplex mode. SCTP is a unicast protocol that provides with point to point-to-point connection and uses different hosts for reaching the destination. SCTP protocol provides a simpler way to build a connection over a wireless network. SCTP protocol provides a reliable transmission of data. SCTP provides a reliable and easier telephone conversation over the internet. SCTP protocol supports the feature of multihoming ie. it can establish more than one connection path between the two points of communication and does not depend on the IP layer. SCTP protocol also ensures security by not allowing the half-open connections.
SCTP

Advantages of SCTP

  • SCTP provides a full duplex connection. It can send and receive the data simultaneously.
  • SCTP protocol possesses the properties of both TCP and UDP protocol.
  • SCTP protocol does not depend on the IP layer.
  • SCTP is a secure protocol.

Disadvantages of SCTP

  • To handle multiple streams simultaneously the applications need to be modified accordingly.
  • The transport stack on the node needs to be changed for the SCTP protocol.
  • Modification is required in applications if SCTP is used instead of TCP or UDP protocol.

Frequently Asked Questions on Transport Layer Protocol – FAQs

How does the SCTP protocol provide more security?

SCTP makes use of 4-way handshake whereas TCP makes use of 3-way handshake. SCTP provides with protection against SYN flooding attacks, man in the middle attack, large cookies and half open connections.

What are the advantages of SCTP over TCP protocol?

The advantages of SCTP over TCP are SCTP has a fault tolerance mechanism and provides with protection against the attacks such as SYN flooding, man in the middle etc.

Comparing TCP and UDP which protocol is faster?

Comparing TCP and UDP, UDP protocol is more faster and efficient as compared to TCP. UDP protocol is a connectionless protocol and does not need to establish any connection for transmission of data.

What is the use of a port in IP?

Port number is used to identify a specific service or application on the system.

How TCP ensures reliability?

TCP ensures reliability through a mechanism called thrre-way Handshakeing mechanism.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads