The Open Systems Interconnection (OSI) model describes seven layers that computer systems use to communicate over a network. It was the first standard model for network communications, adopted by all major computer and telecommunication companies in the early 1980s.

The stack contains 7 layers, namely - Application, Presentation, Session, Transport, Network, Data Link & Physical layer - & they are arranged from the highest level of abstraction i.e. the webpages & email protocol to the lowest level i.e. the cables actually relaying the internet.

Here's a picture to help you understand this :

Let's now look at the working logic & use of each of these layers, one by one :

Application Layer (Data)

  1. The application layer provides an interface between end-users and software applications.
  2. It receives data from end-users, and displays received data for them.
  3. This layer does not contain the end-user applications; instead, it facilitates communications with the lower layers.
  4. Some protocols found within this layer include HTTP, HTTPS, FTP, TFTP, Telnet, SNMP, DNS, Rlogin, SMTP, POP3, IMAP, and LDAP.

Presentation Layer (Data) - Translation, Compression, Encryption

  1. This layer facilitates the presentation of Data to the upper layer.
  2. Mainly, it provides the encoding scheme and encryption/decryption for secure transmission.
  3. For instance, it translates applications format to network format and vice-versa.
  4. Protocols of this layer: JPEG, BMP, GIF, TIF, PNG, MP3, MIDI, ASCII & ANSI, etc.

Session Layer (Data) - Session management, AuthN, AuthZ

  1. When two computing devices need to communicate, a session must be created, which happens at this layer.
  2. Some of this layer's functions are the establishment, management (coordination), and termination of sessions.
  3. Analogy : a telephone call where you first establish the connection, exchange a message, and finally terminate the session.
  4. Some of the protocols of this layer are SIP, NFS, SQL, ASP, and RDBMS.

Transport Layer (Segment) - Segmentation, Data Flow, Error Control, Connection and connectionless transmission

  1. This layer, often considered the heart of the OSI model, is responsible for controlling data flow between two devices.
  2. For example, this layer determines the amount of data needed to send and the location where it should be sent.
  3. This layer is also responsible for data flow and error control.
  4. For instance, the flow control determines the optimal speed of sending data to avoid flooding the receiver with data if the connection speed is different between the two communicating parties.
  5. Simultaneously, error control ensures retransmitting the data again if some packets were lost on the receiver side.
  6. This layer's best-known example protocol is the TCP protocol, which resides as part of the TCP/IP protocol suite. Some other protocols on this layer are TCP, UDP, and SPX.

Network Layer (Packet) - Packets from segments, IP address

  1. The network layer is responsible for data packet forwarding and routing data between routers.
  2. It facilitates data transfer between two devices residing in two different networks.
  3. For example, if you want to send a message from your computer in New York to a server in San Francisco, there are thousands of routers and – maybe- millions of paths between these two points.
  4. However, the routers at this layer help you do this efficiently by automatically selecting the nearest way.
  5. The network layer is also responsible for translating the logical addresses into physical addresses and is responsible for data fragmentation.
  6. Hence, it breaks segments of data into smaller units called packets before sending them to other networks.
  1. This layer provides a connection between two devices residing on the same physical network, for example, between two devices in the same LAN.
  2. This layer receives packets from the network layer and breaks them into small units called frames.
  3. The data link layer also performs data flow and error control within intranets. It contains two other sub-layers: the Media Access Control (MAC) layer and the Logical Link Control (LLC) layer.
  4. Most ordinarily, networking switches operate at this layer. Some protocols within this layer are PPP, HDLC, ATM, Frame Relay, SLIP, and Ethernet.

Physical Layer (Binary) - Physical stuff like cables, radios

  1. This layer exists at the bottom of the OSI layer.
  2. It represents the OSI model's physical component, including cable type, radio frequencies (when using a Wireless connection), the layout of pins, and voltages.
  3. This layer is responsible for delivering the raw data from the sending device's physical layer to the receiving device's physical layer.
  4. Popular devices found at this layer include network hubs, cabling, repeaters, and modems.

Summary

Although created years ago, the OSI model is still the primary model used to represent network architecture.

The OSI reference model is still the primary guide used by software developers and hardware vendors to create interoperable programs and devices that facilitate digital communications. A really cool acronym to remember the order in which these layers appear is :

💡
"All People Seem To Need Data Processing"

All - Application
People - Presentation
Seem - Session
To - Transport
Need - Network
Data - Data Link Layer
Processing - Physical Layer