OSI/RM stands for Open System Interconnection Reference Model introduced by the International Organization for Standardization(ISO) to describe the concept of Computer Networking(CN) with internal structure and technology.
In simple language, it shows the flow of data over the network moving from 1 software application of one device to another software application of another device.
This Model is nothing but some standards adopted all over the globe.
The OSI model divides the data communication into 7 layers and each layer has its tasks, which are performed independently regardless of any technology or vendor, allowing open interoperability.
Example:
There are two computers. These two computers are trying to communicate with each other over the network.
Physical, Data Link and Network layers are the hardware layers of this model, and Session, Presentation, and Application are the software layers of the Model. The transport layer is the Heart of the OSI Model.
The computers talk to each other by creating and exchanging data packets. The data packetization process starts at the Application Layer(Layer 7) each time when we want to send the data on the network, and later on, it has to be handled appropriately by each layer.
Each time, when the data is passed through a layer, a header is added with it that references the layer. This process is called Packetization.
When your computer is finished processing the data you want to send, this data is encapsulated in six headers, and then placed on a wired or wireless network as a stream of bits (e.g., 011101001). The physical layer doesn’t add a header as it describes the process of creating the actual network bitstream.
When the receiving node or cloud service you’re using receives that data, it then reverses the packetization process, removing each header to read the data you sent.
The intermediate node only works with hardware layers, it does not have access to application data.
OSI Layers
The OSI model is divided into seven layers to represent network architecture. Each layer performs its own set of tasks and communicates with the layers above and below it to carry out successful network transmission.
7. Application Layer
It is the only layer that involves direct interaction with the data from the end user. In other words, this layer provides human-computer interaction, such that the web browsers or email client applications rely on it to ensure communication. It provides protocols that allow the software to send and receive information and present meaningful data to users.
Some of the most common application layer protocols are HTTP, SMTP, FTP, DNS, etc.
- HTTP(HyperText Transfer Protocol): Data such as text, images, and other multimedia files are shared over the World Wide Web using HTTP. It is a protocol used to access the data on the World Wide Web(www).
It is a stateless protocol, meaning the client and server are only aware of each other while the connection between them is intact(not closed completely).
- SMTP (Simple Mail Transfer Protocol): SMTP is a protocol designed to transfer electronic mail reliably and efficiently. SMTP is used to send emails, whereas POP(Post Office Protocol) and IMAP are used to retrieve emails on the end user's side. SMTP transfers emails between systems and notifies of incoming emails.
- POP(Post Office Protocol) - The end-user can download emails from the mail server to their email client using this protocol.
- IMAP(Internet Message Access Protocol) - This protocol lets end-users access and manipulates messages stored on a mail server from their email client as if they were present locally on their remote device.
- FTP(File Transfer Protocol): FTP enables file sharing between hosts, both local and remote, and runs on top of TCP(Transmission Control Protocol). For file transfer, FTP creates two TCP connections: control and data connection.
The control connection is used to transfer control information like passwords, commands to retrieve and store files, etc, and the data connection is used to transfer the actual file.
Both of these connections run in parallel during the entire file transfer process.
- DNS(Domain Name System): The DNS protocol helps in translating or mapping hostnames to IP addresses.
Hosts are identified based on their IP addresses, but memorizing an IP address is difficult due to its complexity. IPs are also dynamic, making it all the more necessary to map domain names to respective IP addresses. DNS helps in resolving this issue by converting the domain names of websites into numerical IP addresses.
Telnet(Terminal Emulation Protocol) - Telnet enables a user to communicate with a remote device. Telnet is mostly used by network administrators to access and manage remote devices.
SNMP(Simple Network Management Protocol) - This protocol is used to manage nodes, like servers, workstations, routers, switches, etc., on an IP network. It enables network admins to monitor network performance, identify network glitches, and troubleshoot them.
6. Presentation Layer
This layer prepares the data and makes it presentable using encoding, encryption, formatting, or semantics, to be rightfully consumed by the application layer. It gets the incoming data from the layer below it and translates it into an application-understandable syntax that’s why it is also known as the syntax layer. It also receives data from the application layer and compresses it to transmit over the session layer.
- LPP(Lightweight Presentation Protocol) - This Protocol helps to provide streamlined support for OSI application services in networks running on TCP/IP protocols for some constrained environments.
5. Session Layer
This layer is responsible for creating a communication channel between devices called a session. This layer keeps the communication channel open long enough for successful and uninterrupted data exchange. Eventually, after complete transmission, it terminates the session to avoid resource wastage.
- RPC(Remote Procedure Call Protocol) - It is a protocol for requesting a service from a program in a remote computer through a network, and can be used without having to understand the underlying network technologies.
In simple words, It is a distributed computing technique in which a computer program calls a procedure (subroutine or service) to execute in a different address space than its own.
4. Transport Layer
It receives data from the session layer, breaks it up into smaller bits at the transmitting end called segments, and sends it to the network layer. The transport layer is also responsible for sequencing and reassembling segments at the receiving end.
The transport layer carries out flow control, sending data at a rate that matches the connection speed of the receiving device, and error control, checking if data is received correctly and if not, requesting it again.
- TCP(Transmission Control Protocol) - This protocol lets 2 hosts connect and exchange data streams. It delivers the data and packets in the same order as they were sent. It also ensures the packets are reliably delivered, and error-free.
TCP cannot be used for broadcast and multicast connections. It supports a 3-way handshake(requires a source and destination to establish).
UDP(User Datagram Protocol) - It is a faster protocol than TCP but adds no reliability, flow control, or error-recovery functions. Retransmission of lost data packets isn't possible with UDP. It is suitable for real-time or high-performance applications that don’t require data verification or correction. It does not support a 3-way handshake.
3. Network Layer
The network layer is responsible for receiving segments from the transport layer and dividing them into even smaller units called packets. These packets are then reassembled at the receiving device. The network layer uses network addresses (typically Internet Protocol addresses) to route packets to a destination node.
It performs logical addressing to find the best possible physical route to transmit the packet.
IPv4(Internet Protocol Version4) - IPv4 is a network layer protocol that contains addressing and control information, which helps packets be routed in a network. Under this IP, each host is assigned a 32-bit address comprised of two major parts: the network number and the host number.
IPv6(Internet Protocol Version6) - IPv6 is the protocol that possesses addressing and controls information for enabling packets to be routed in the network. IPv6 was created to deal with IPv4 exhaustion. It increases the IP address size from 32 bits to 128 bits to support more levels of addressing.
ICMP(Internet Control Message Protocol) - ICMP is a network layer supporting protocol used by network devices to send error messages and operational information.
2. Data Link Layer
The data link layer establishes and terminates a connection between two physically-connected nodes on a network. It breaks up packets into frames and sends them from source to destination. This layer is composed of two parts—Logical Link Control (LLC), which identifies network protocols, performs error checking, and synchronizes frames, and Media Access Control (MAC) which uses MAC addresses to connect devices and define permissions to transmit and receive data.
ARP(Address Resolution Protocol) - The Address Resolution Protocol helps map IP addresses to physical machine addresses (or a MAC address for Ethernet) recognized in the local network.
SLIP(Serial Buses IP) - SLIP is used for point-to-point serial connections using TCP/IP. SLIP is useful for allowing mixes of hosts and routers to communicate with one another; for example, host-host, host-router, and router-router are all common SLIP network configurations.
1. Physical Layer
The physical layer is responsible for the physical cable or wireless connection between network nodes. It defines the connector, the electrical cable, or wireless technology connecting the devices, and is responsible for the transmission of the raw data, which is simply a series of 0s and 1s while taking care of bit rate control.