The Internet's transport layer is an intermediate network communications layer that is positioned between the application and internet layer of the Internet protocol suite; the second highest layer of a four layer model. Internet applications use transport layer protocols to help them reliable or efficiently send their data from host-to-host. The two protocols that dominate the transport layer are:
The difference between the two protocols is that TCP is a connection-oriented communications protocol and UDP is connectionless: a connection-oriented method is reliable and ensures that data sent arrives in the order it was sent, whereas a connectionless method is 'best effort' and unreliable. TCP uses a three way handshake (SYN, SYN-ACK, ACK) process and data segment numbering to provide reliability; alongside multiplexing and flow control. UDP does not feature a handshake or data segment sequence method. TCP is described as a heavyweight transport protocol and UDP as a lightweight transport protocol: TCP is used by Internet application that require high reliability and UDP is used by Internet application that require speed and efficiency. Application layer protocols that use TCP are: HTTP, FTP, HTTPs, SMTP and Telnet, and application layer protocols that use UDP are: DNS, SNMP, and VOIP.
TCP and UDP take a data stream from Internet applications (application layer protocols) then produce TCP / UDP data segments that are then encapsulated (encased) into an IP packet. The Internet Protocol (IP) then delivers the data. Therefore, transport layer protocols interact between the application layer and the internet layer: application layer > transport layer > internet layer. The Internet is based upon a connectionless network layer protocol ( IPv4 and IPv6), therefore, transport layer protocols are required to ensure data is sent from and arrives at the correct location: TCP and UDP use port numbers to achieve this. IANA assigns a port number to application layer protocols: for example, FTP is port number 20/21. The process has often been described as the following: the Internet Protocol uses an IP number to locate the correct house and a port number is used by transport layer protocols to locate the correct room in that house. The process of combining a port number with an IP address is referred to as creating a socket.
Alternative Transport Layer Protocols
While most Internet applications use either TCP or UDP, and IANA only tends to officially assign port numbers to these two transport layer protocols, they are not the only transport layer protocols. The following protocols tend to have been experimental implementations, and many are obsolete.