OSI or Open-System Interconnection Model is a reference model which describes seven layers that computer systems use to communicate over the network. It was developed by ISO in 1980. It is the first ever model for network communication. OSI gives guidelines on how communication needs to be done over the network. The minimum OSI data packet header size is 5 bytes.
Advantages:
It determines the required hardware and software to build the network.
It helps to understand and communicate the process followed by components communicating across a network.
It also performs troubleshooting, to determine which layer is causing an issue.
It guides technology vendors and developers to create digital communication products and software programs and is able to work on different layers of OSI Model.
Also, OSI Model helps in identifying threats and make possible to have a data focused security posture.
Disadvantages:
The fitting of protocols is a tedious task.
It can just be used as a reference model.
It doesn’t define any specific protocol.
In the OSI network layer model, some services are duplicated in many layers such as the transport and data link layers
Layers can’t work in parallel as each layer needs to wait to obtain data from the previous layer.
Layers of OSI Model:
Physical Layer : The lowest model of the OSI reference model is layer 1, the physical layer. It is the only layer where data is physically moved across the network interface. This layer converts the binary from the upper layers into signals and transmits them over local media. These can be electrical, light, or radio signals; it depends on the type of media used. The following are the main responsibilities of the physical layer- definition of hardware specification, encoding and signaling, data transmission and reception, topology and physical network design. Technologies like wifi, ethernet cables, bluetooth, CAN bus, usb, cables(fiber optic, coaxial),etc.
Data Link Layer : The second-lowest layer(layer 2) is the data link layer. It is also known as the link layer, where many wired and wireless local area networking (LAN) technologies primarily function. For example, Ethernet, Token Ring, FDDI and 802.11 (“wireless Ethernet” or “Wi-Fi’) are all sometimes called “data link layer technologies”. Media Access Control(MAC) & Logical-Link Control(LLC) are the sub-layers. Encapsulation, frame synchronization, flow control, packet switching(LAN switching), vlan’s, mac addressing, collision control are the main aspects.
Network Layer : The third-lowest model is known as the network layer. It helps to transmit data segments between networks in the form of packets. This layer assigns source and destination IP addresses to the data segments. Layer 3 also determines the best paths for data delivery. The following functionalities of the network layer such as- logical addressing, routing, datagram encapsulation, fragmentation and reassembly , error handling and diagnostics. Protocols: IPSEC, IPv4/IPv6, EGP, BGP, RIP, ICMP,etc.
Transport Layer : The fourth and the middle layer of OSI Model is the transport layer. It receives data from Layer 5 and segments it. Each segment, or data unit, has a source and destination port number, as well as a sequence number. The port number ensures that the segment reaches the correct application. The sequence number ensures that the segments arrive in the correct order. This layer also controls the amount of data transmitted. Process-level addressing, connection-oriented, reliability, management and termination, flow control, congestion, multiplexing and demultiplexing, segmentation, packaging and reassembly of data packets are the main functions. TCP and UDP are both very well-known protocols, and they exist at Layer 4. TCP favors data quality over speed, whereas UDP favors speed over data quality.
Session Layer : It is the fifth layer in OSI Model. It determines which data packets belong to which files, as well as where these packets go. Layer 5 also establishes, maintains, and ends communication between devices. Session restoration, authentication and authorisation is the major concern. Protocols like Netbios, PAP, SOCKS, RPC, ZIP,etc used in this layer.
Presentation Layer : It is the sixth layer of the OSI Model and second from the top. It receives application data from Layer 7, translates it into binary, and compresses it. Encryption and decryption of data happens in this layer of OSI Model. Therefore,translation, compression and encryption are its main functions.
Application Layer : The top layer of OSI Model stack which provides services for users applications to employ. For example, a web browser is an application running on a computer which uses the services offered by a protocol that operates at the application layer. Protocols like ftp, http, ssh, dns, dhcp, telnet etc. used in this layer of OSI.

OSI Model

OSI Reference Model Interfaces for Vertical Communication between the layers

OSI Reference Model Interfaces for Horizontal Communication between the layers

PDUs in OSI Model

Devices at each layer of OSI Model

Protocols at each layer of OSI Model
Helpful Resources :
Youtube: