The Open Systems Interconnection (OSI) is a model of networking framework that uses seven types of network layers to implement protocols. All these types of network layers together comprise the OSI stack. The stack is divided into two sets: the upper and the lower layers. The upper layers include the application, the presentation and the session layers. The lower layers include the transport layers, network layers,physical layers and data link.
Below they are listed in order of lowest in the hierarchy (the Physical layer) to the highest (the Application layer).
Of the seven types of network layer, this lowest layer performs the task of receiving and transmitting the raw and unstructured bit stream (electrical impulse, light or radio signal) over a physical medium at the electrical and mechanical level. It also provides data encoding to aid in bit and frame synchronization.
Data Link layer
The task of this layer is to provide error free transfer of data frames in the physical layer from one node to another. It also works to provide link establishment and termination, frame traffic control, sequencing, error checking. It is divided into two sub types of network layers: Media Access Control (MAC) layer, and Logical Link Control (LLC) layer.
This layer, on the basis of factors like network conditions and priority of service,controls the subnet, deciding which is the path that the data should take. It routes frames among networks, controls subnet traffic, performs frame fragmentation, translates logical addresses into physical addresses. It also has accounting functions to keep track of the frames that are forwarded by subnet intermediate systems.
This layer performs the function of ensuring error-free delivery of messages, without losses or duplications and in sequence. A network layer that is reliable and has virtual circuit capability works well with even a minimal transport layer. But if the network layer is unreliable, the transport protocol should have the capabilities of extensive error detection and recovery. Transport layer provides complete end-to-end message delivery with message acknowledgement.
The session layer provides establishment of two application processes on two different machines and also maintains and terminates a connection, which is called a session. It also has the features of session support that includes allowing the communication between these processes over the network, logging, name recognition and others.
The chief task of presentation layer is to control the formatting of data before it is presented to the application layer. It works as a two-way translator for the network: at the sending station, it may translate data from the format used by the application layer to a common format, or at the receiving station, it may translate the common format it receives into a format that is known by the application layer. It also provides data encryption and compression.
This layer is the last and highest of all the types of network layers. This layer contains a variety of functions that serve as the window for users and application processes for accessing the network services. This includes file transfer, electronic messaging, and other network software services.