What is a Presentation Layer?
- Presentation layer is the 6th layer of the OSI model. It is basically used for translation, compression and encryption of data.
- Translation: Different computers have different encoding system. So, data sent from one computer from its encoding system may be not be the same as the encoding system of other computer. Communication on the presentation layer at sender side translates information to common format, and the receiver side changes this common format to its receiver dependent format.
- There are many types of translation available. One is bit order translation. In this type of translation, it uses binary number like 01010101. In this, it uses MSB (most significant bit) and LSB (least significant bit) for communication. So at the receiver side you’ll know what are the start bit and the last bit.
- The second type is byte order translation, which is a translation using bytes. In this, less significant byte or most significant byte sends first. Intel uses least significant byte which is referred as little Endian while Motorola uses most significant byte which is called Big Endian.
- The third one is character code translation. It uses many codes like ASCII which uses 7-bit representation of characters, EBCDIC uses 8 bits to represent characters. So presentation layer is responsible for the translation of data from one code to another.
- The fourth one is File Syntax Translation. In this, one PC uses DOS-based system and other uses Apple Mac file. The presentation layer takes care of all this.
- Encryption: Encryption is basically used for security purposes. Before sending data, sender converts it into encrypted form. Then, the receiver side, converts from the encrypted form to its original form which is known as decryption.
- To encrypt a message, we need an encryption algorithm, an encryption key, and plain text. To decrypt an encrypted message, we need a decryption algorithm, a description key and the cipher text. There are two types of key that can be used. One is the public key in which both sender and receiver uses the same key. Another is the private key which uses an algorithm to make it public. Private key is kept by the receiver while public key is announced to the public. So, without using a private key it will not decrypt the data.
- Compression: Data compression reduces the number of bits contained in the information. It is used to transmit data like text, audio and video.
- In Lossless data compression, data can be compressed. After recompression, it will remain the same as the original. The ratio of compression is 2:1 or 8:1. An example is zip.
- Loosely data compression is used when data is not stored properly.
- For audio compression, it uses speech and music. For speech compression, it needs 64 kHz digital signal while music needs 1.411 MHz signal to compress.
- Predictive encoding and perceptual encoding techniques are used for audio compression.
- Video compression: Video is composed of multiple frames. Each frame is one image.JPEG is used for compressing an image while MPEG is used to compress video.
- Huffman Encoding is a technique used to encode symbols according to the frequency of their use.