High Level Explanation:
Layer 6 is responsible for filtering and processing data to be later displayed to the end user or processed by the node in which the data was planed to be send , without it things would get very complicated because everyone is using a different OS or browser meaning that if the data was processed exactly as it was sended from the server the user would probably get a syntax error, each browser and OS has a different way to handle data received for example if you are writing a paragraph and it has spaces, tabs or any kind of special characteristic that needs to be added, layer six will do it so then layer seven can easily take care of the rest. In the end we can interpret it as a translator between different data formats and computer systems.
Low Level Explanation:
Layer 6 will get the mapping (a set of instructions) distributed by the browser, OS, framework, etc that the data needs to be received and encapsulated into session protocol data units, and passed down the stack, which means that data is processed, filtered and send into stacks of data to layer 7. For example when you send a string of data like “Bye World” it will be processed by layer six as “Bye\0World” because it is adding a null-terminated string which is a standart format to handle data. It also encrypts and decrypts data, so, if you are using https instead of http it needs to decrypts all data send to you using the key that you and the server has exchanged.
This layer doesn’t really have any hardware, because its only purpose is mainly presenting protocols.
All the following protocols have one main definition which is allowing data to be transferred between different kinds of computer systems.
Lightweight Presentation Protocol
External Data Representation (XDR)
Network Data Representation