The Open Systems Interconnection (OSI) reference model was developed by the International Organization for Standardization (ISO).
This model consist of 7 layers which describes how data is sent and received between hosts and networking devices on a network.
The application layer (Layer 7) is the one which is closest to the user within the protocol suite.
It provides an interface for the communication between the running applications of a local system and the underlying network protocols.
The Application Layer contains many protocols such as:
File Transfer Protocol (FTP)
Simple Mail Transfer Protocol (SMTP)
Domain name System (DNS)
Dynamic Host Configuration Protocol
HyperText Transfer Protocol (HTTP)
…and many more
When an application layer protocol such as HTTP sends it raw data to the network, it passes through the Presentation Layer which has to perform some tasks before sending it to the lower layers.
The Presentation Layer is responsible for the following functions:
Data Formatting
Data Compression
Data Encryption
Data Decryption
The session layer (Layer 5) has three (3) main functions on a network, these are:
Create or build a session between a sender and receiver
Maintain the established session during the transmission of messages between the sender and receiver
Terminates a session when both parties indicate they are no longer wants to communicate with other.
The Transport Layer (Layer 4) is responsible for moving datagrams between the Application layer and onto the network.
Within the Transport layer, there are 2 protocols which are responsible for transporting the message between a source and destination:
Transmission Control Protocol (TCP)
Connection-oriented
Provides guarantee of delivery
Provides segmentation and sequencing of messages
User Datagram Protocol (UDP)
Connection-less
Unreliable and does not provide guarantee of delivery
The Network Layer is responsible for the logical address of end devices on the network and the encapsulation of IP header which adds both the source (sender) and destination (receiver) IP version 4 (IPv4) and Internet Protocol version 6 (IPV6) addresses on the packet.
The Network layer provides the functionality of directing traffic flows on a network using routing protocols which operates using the Internet Protocol (IP).
At this layer, routers operates as they have the ability to read and understand IP addressing and the contents of a packet.
The Data Layer responsible for allowing the messages of the upper layers to access the network.
It also controls how the data are placed onto the physical network (media), handles error detection and flow control of inbound and outbound messages.
Within the Data Link layer there are two (2) sub layers, these are the Logical Link Control (LLC) and the Media Access Control (MAC).
Switches operates at this layer as they are only able to read and understand Frames which contains MAC addresses.
At the Data Link layer, the Protocol Data Unit (PDU) is known as a Frame.
The LLC encapsulates the packet received from the network layer into a frame by adding a layer 2 header containing the source (sender) and destination (receiver) Media Access Control (MAC) address.
At the end of the frame, a trailer is inserted which contains the Frame Check Sequence (FCS) and inside the FCS is the Cyclic Redundancy Check (CRC) which is used for error detection on a network.
The Media Access Control (MAC) address is made up of 48-bits and is presented in the format of hexadecimal values ranging from 0 to 9 and A – F.
An example of a MAC Address is 12:34:56:78:9A:BC.
The first 24-bits of the MAC address is known as the Organization Unique Identifier (OUI) which identifies the manufacturer of the Network Interface Card (NIC).
The second 24-bits is assigned by the manufacturer. The MAC address is also known as a burned in address since it is hard coded onto the hardware and it not changeable.
The Physical layer consists of the electrical signals and the physical structure of the network layout.
At this layer, the wireless signal, cables, etc. operates. At this layer, the Protocol Data Unit (PDU) is known as a Bit.
Note: Hubs operate at the physical layer since they only repeat a signal on the physical layer.