The Presentation Layer handles data format translation, encryption/decryption, and compression/decompression. It ensures that data from the application layer is properly formatted for transmission and reception across different systems.
Layer 6 (Presentation) Technologies
The Presentation Layer is responsible for data format translation, encryption/decryption,
and compression/decompression. It ensures data is in the correct format for the receiving application and
provides syntax and semantics transformation, data security, and bandwidth optimisation.
Data Translation - Converting between different character encodings, data formats, and representations
Encryption/Decryption - Protecting data confidentiality during transmission with cryptographic algorithms
Compression/Decompression - Reducing data size for efficient transmission and storage
Syntax Transformation - Converting data structures and formats between applications
The Critical Role: While lower layers handle reliable delivery, Layer 6 ensures
data format compatibility and security between different applications and systems.
🖥️
Sender
Plain Data
Ready
Transform
Process
Deliver
DATA
DATA
Presentation Status:
Select a technology and mode to begin
Step 0 of 0
Processing Idle
📺
Receiver
Expected Format
Waiting
🎯 Primary Functions
Data Translation: Converting between different data formats
Encryption/Decryption: Securing data for transmission
Compression: Reducing data size for efficient transmission
Character Encoding: Converting text between character sets
Format Conversion: Translating between different file formats
🔧 Key Characteristics
Syntax Translation: Converting data structures and formats
Cryptography: Encryption algorithms and key management
Data Compression: Algorithms to reduce data size
Character Sets: ASCII, Unicode, EBCDIC conversion
Media Formats: Image, audio, video encoding/decoding
🌐 Presentation Layer Technologies
🔒 TLS/SSL (Transport Layer Security)
Encryption & Authentication
Transport Layer Security
TLS Record Layer: Handshake Protocol
Content Type: Handshake (22)
Version: TLS 1.3 (0x0304)
Cipher Suite: TLS_AES_256_GCM_SHA384
What you see in Wireshark: TLS handshake, certificate exchange, encrypted application data
Secures HTTPS, email, and many other protocols
📸 JPEG (Image Compression)
Lossy Image Compression
JPEG File Interchange Format
SOI Marker: 0xFFD8
APP0 Segment: JFIF identifier
Quantization Tables: Quality factor 85%
Huffman Tables: Compression data
What you see in Wireshark: JPEG headers when images are transferred over HTTP
What you see in Wireshark: MP3 headers in streaming audio protocols
Reduces audio file sizes for streaming and storage
🗜️ GZIP Compression
Lossless Data Compression
HTTP Content-Encoding: gzip
GZIP Header: Magic Number 0x1F8B
Compression Method: DEFLATE
Original Size: 15,420 bytes
Compressed Size: 3,847 bytes
What you see in Wireshark: Compressed HTTP responses, reduced bandwidth usage
Compresses web content for faster loading
🔤 UTF-8 Encoding
Unicode Character Encoding
HTTP Content-Type: text/html; charset=UTF-8
Character: "Hello 世界" (Hello World in Chinese)
UTF-8 Bytes: 48 65 6C 6C 6F 20 E4 B8 96 E7 95 8C
ASCII: H e l l o [space] [Chinese characters]
What you see in Wireshark: Text data in various languages encoded as UTF-8
Enables global communication with multiple languages
📄 ASN.1 (Abstract Syntax Notation)
Data Structure Definition
Abstract Syntax Notation One
Certificate (SEQUENCE)
Version: v3 (INTEGER: 2)
Serial Number: 0x1234567890ABCDEF
Signature Algorithm: sha256WithRSAEncryption
What you see in Wireshark: ASN.1 structures in SSL certificates, SNMP, LDAP
Defines data structures independent of machine representation
🔄 Data Format Transformation Demo
See how the Presentation Layer transforms data between different formats:
Original Text
"Hello World!"
ASCII Encoding
72 101 108 108 111 32 87 111 114 108 100 33
Base64 Encoding
SGVsbG8gV29ybGQh
URL Encoding
Hello%20World%21
Wireshark showing format transformations:
HTTP: Content-Type: text/plain; charset=UTF-8
HTTP: Content-Encoding: gzip
HTTP: Transfer-Encoding: base64
The same "Hello World!" appears as different byte sequences
depending on the encoding used at the Presentation Layer!
🔐 Encryption in Action
How TLS/SSL encrypts your data:
Before Encryption (Plaintext):
GET /login HTTP/1.1
Host: banking.com
Username: john_doe
Password: secret123
Wireshark TLS Analysis:
Transport Layer Security
TLS Record Layer: Application Data
Content Type: Application Data (23)
Version: TLS 1.2 (0x0303)
Length: 74
Encrypted Application Data: [encrypted login credentials]
Note: The actual login data is completely hidden from network sniffers!
How different character sets represent the same text:
Text
Language
UTF-8 Bytes
Character Count
Hello
English
48 65 6C 6C 6F
5 bytes
こんにちは
Japanese
E3 81 93 E3 82 93 E3 81 AB E3 81 A1 E3 81 AF
15 bytes
مرحبا
Arabic
D9 85 D8 B1 D8 AD D8 A8 D8 A7
10 bytes
Привет
Russian
D0 9F D1 80 D0 B8 D0 B2 D0 B5 D1 82
12 bytes
Wireshark Character Encoding Analysis:
HTTP: Content-Type: text/html; charset=UTF-8
Data shows mixed languages in single webpage:
English: "Welcome" (7 bytes)
Chinese: "欢迎" (6 bytes for 2 characters)
Russian: "Добро пожаловать" (32 bytes for 16 characters)
All properly decoded by browser's Presentation Layer!
🔍 Real-World Example: Secure Online Banking
Scenario: You log into your online banking account
What happens at the Presentation Layer:
TLS Handshake: Browser and bank negotiate encryption algorithms
Certificate Verification: Bank's identity verified using ASN.1 certificates
Data Encryption: Login credentials encrypted with AES-256
Character Encoding: Form data encoded as UTF-8
Compression: Web page content compressed with GZIP
Format Translation: JSON data converted to HTML display
Media Processing: Bank logo JPEG decompressed for display
🔒 1) TLS handshake
Client Hello: TLS 1.3; cipher suites: TLS_AES_256_GCM_SHA384; random [32B]
Server Hello: selected TLS_AES_256_GCM_SHA384; cert chain RSA 2048‑bit; random [32B]
Key exchange: session keys generated; secure channel established ✓
Format Converters: Transform between different data formats
Wireshark: analyse encrypted vs plaintext data flows
🎓 Teaching Analogy: Translation and Packaging Service
Think of the Presentation Layer like a professional translation and packaging service:
Translator (Character Encoding): Converts documents between languages and writing systems
Encryption Service (TLS/SSL): Puts sensitive documents in locked, tamper-proof containers
Compression Service (GZIP/JPEG): Packages items efficiently to save shipping space
Format Converter (Media Codecs): Converts documents between different formats (Word to PDF)
Quality Control (ASN.1/Standards): Ensures everything follows proper formatting rules
Package Labeling (Content-Type headers): Labels what's inside each container
Just like a translation service makes information accessible across different languages and formats, the Presentation Layer makes data understandable across different systems!
📚 Key Learning Points
Presentation Layer acts as data translator between application and network formats
Encryption/Decryption protects sensitive data during transmission
Compression reduces bandwidth usage and improves performance
Character encoding enables global communication across different languages
Format conversion ensures compatibility between different systems
Layer 6 is often invisible to users but critical for proper data handling