The Internet protocol suite contains four layers, and is responsible for providing the software systems of the Internet. The transport layer of the Internet protocol suite is an intermediate layer that helps application layer (highest layer) protocols to accurately communicate data across the networks of the Internet.
The transport layer is responsible for providing an end-to-end service that transfers data independent of networks and data structure. Due to the Internet Protocol (IP) being inherently unreliable in how it routes data across IP networks, transport layer protocols are used by Internet applications to reliable transport data; which is achieved by providing: congestion control; error checking; multiplexing; flow control; and same order delivery.
The transport layer of the Internet protocol suite has two primary transport protocols:
Internet applications typically use either TCP or UDP, and can be identified because they will use either a TCP port or a UDP port. TCP and UDP ports are assigned to application layer protocols: for example, port number 20 is assigned to the File Transfer Protocol. TCP and UDP use a combination of an IP address and a port number to complete a communications session.
The difference between the two protocols is that TCP creates a connection-oriented communication: this means that a permanent connection is established before the data is transferred. This makes TCP reliable, providing an accurate transportation process that ensures that data is received 'in-order' and without error. This is important for application layer protocols that provide services like Email; where it is more important that the data is sent accurately than in a timely manner.
The User Datagram Protocol (UDP) creates a connectionless-oriented communication: this means that a permanent connection is not established between source and destination, and the data will be sent in a 'best effort' procedure. Therefore, data transported in a UDP datagram has less error checking than a TCP datagram, and the data may not be sent in an accurate manner. The User Datagram Protocol (UDP) is useful for application protocols that are more concerned with time than accuracy: for example, protocols that provide real time voice and video services.