The Open Systems Interconnection model, or OSI model, is a conceptual model used to describe the parts that make up a computer network. It is intended primarily to create an everyday understanding for developing networking standards and protocols. The model is pretty useful to help understand the basics of computer networking.
However, it is very worth keeping in mind that the real-world implementation of protocols differs somewhat. There are plenty of layer-crossing protocols. Modern networking concepts also don’t necessarily fit into the OSI model well. Still, it is helpful to understand the basics.
The OSI model has seven layers, with the lower numbers getting closer to the bare metal cables that transmit data. The transport layer is layer four. The transport layer is responsible for providing end-to-end communication services between communicating devices. Transport layer protocols can be connection-oriented. They can, however, also be connectionless.
TCP, which stands for Transmission Control Protocol, is the best-known and most-used transport layer protocol. It is connection-oriented forming bidirectional communication, and features error detection and retransmission functionality. UDP, the most popular transport layer protocol, stands for Universal Datagram Protocol. It is connectionless, and the sender never knows if the recipient ever received a transmission. Together these two protocols make up most of the network traffic on the Internet. They are also the only two protocols implemented on all major operating systems.
TLS, or Transport Layer Security, is an encryption protocol used in HTTPS, amongst other things. Despite including the words “Transport Layer” in its name, TLS operates at layer 6 of the OSI model, the presentation layer, and encrypts data before it gets to the actual transport layer protocols.
Features of Transport Layer Protocols
Transport layer protocols can be connection-oriented. This is typically easier for an application to manage as there is a single stream of data rather than a potentially incomplete series of datagrams. The sequence of data is also generally important. While networks typically will result in the packets being delivered in the order in which they were sent, this can’t necessarily be relied upon. Segments can be numbered so that they can be reordered if shown in the incorrect order.
Error detection can be implemented using error-detecting codes such as a checksum. A receipt message can be sent confirming successful receipt with an ACK and an error with a NACK. Upon receipt of a NACK or a timeout, the sender may automatically repeat the transmission. Flow control can ensure that the sender does not transmit so fast that the receiver can’t keep up.
Congestion avoidance helps to ensure optimum network performance even under heavy loads. Slow start, for example, forces some connections to start slow and ramp up in speed, allowing them to avoid overwhelming the network. This is especially important regarding retransmissions, as network congestion could have been the cause of the first issue, and retransmitting again exacerbates the problem. Multiplexing enables the definition of port numbers so that multiple transmissions can happen simultaneously on the same machine and all get to the proper application without interfering with each other.
None of these features are mandatory for transport layer protocols. TCP, for example, does support all of the above features. UDP, however, only supports Multiplexing.
Connection-Oriented vs. Connectionless
Typically, most network communications are bidirectional and follow a request-response pattern. Web traffic is an excellent example of this. For request-response use cases, TCP is ideal. It offers a reliable connection between the two parties. If a segment fails to be appropriately received, this could cause a webpage not to display correctly. However, automatic error checking and replaying help detect and correct these errors as fast as possible. The additional transport time is less of an issue than broken content.
This isn’t always the case, though. Transmission time can be necessary when watching a live video stream, streaming audio, or playing an online video game. It’s certainly not ideal for losing a datagram, but waiting for it to be retransmitted is preferable, as the content will have already moved on by the time it has been. As such, real-time and streaming content tends to use UDP. It’s lighter weight and faster because it doesn’t guarantee a successful transmission, unlike TCP.
Conclusion
The transport layer is layer 4 of the OSI model. It is responsible for providing end-to-end communication services between communicating devices. Protocols at this layer can offer reliable connections, even over unstable connections or connectionless ones, assuming that most traffic gets through fine. Both options are helpful and have many use cases. Combined, TCP and UDP make up most of the network traffic on the Internet.
Did this help? Let us know!