What is the presentation layer?
The presentation layer resides at Layer 6 of the Open Systems Interconnection (OSI) communications model and ensures that communications that pass through it are in the appropriate form for the recipient application. In other words, the presentation layer presents the data in a readable format from an application layer perspective.
For example, a presentation layer program could format a file transfer request in binary code to ensure a successful file transfer. Because binary is the most rudimentary of computing languages, it ensures that the receiving device can decipher and translate it into a format the application layer understands and expects.
How the presentation layer works
Once the application layer passes data meant for transport to another device in a certain format, the presentation layer then prepares this data in the most appropriate format the receiving application can understand.
Common data formats include the following:
- American Standard Code for Information Interchange and Extended Binary Coded Decimal Interchange Code for text;
- JPEG, GIF and TIFF for images; and
- MPEG, MIDI and QuickTime for video.
Encryption and decryption of data communications are also performed at the presentation layer. Here, encryption methods and keys exchange between the two communicating devices. Only the sender and receiver can properly encode and decode data so it returns to a readable format.
The presentation layer can serialize -- or translate -- more complex application data objects into a storable and transportable format. This helps to rebuild the object once it arrives at the other side of the communications stream. The presentation layer also deserializes the data stream and places it back into an object format that the application can understand by the application.
The tool that manages Hypertext Transfer Protocol (HTTP) is an example of a program that loosely adheres to the presentation layer of OSI.
Although it's technically considered an application-layer protocol per the TCP/IP model, HTTP includes presentation layer services within it. HTTP works when the requesting device forwards user requests passed to the web browser onto a web server elsewhere in the network.
HTTP receives a return message from the web server that includes a Multipurpose Internet Mail Extensions (MIME) header. The MIME header indicates the type of file -- text, video, or audio -- that has been received so that an appropriate player utility can present the file to the user.
Functions of the presentation layer
- ensures proper formatting and delivery to and from the application layer;
- performs data encryption; and
- manages serialization of data objects.
Editor's note: This article was republished in January 2023 to improve the reader experience.