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)
- The application layer provides an interface between end-users and software applications.
- It receives data from end-users, and displays received data for them.
- This layer does not contain the end-user applications; instead, it facilitates communications with the lower layers.
- 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
- This layer facilitates the presentation of Data to the upper layer.
- Mainly, it provides the encoding scheme and encryption/decryption for secure transmission.
- For instance, it translates applications format to network format and vice-versa.
- Protocols of this layer: JPEG, BMP, GIF, TIF, PNG, MP3, MIDI, ASCII & ANSI, etc.
Session Layer (Data) - Session management, AuthN, AuthZ
- When two computing devices need to communicate, a session must be created, which happens at this layer.
- Some of this layer's functions are the establishment, management (coordination), and termination of sessions.
- Analogy : a telephone call where you first establish the connection, exchange a message, and finally terminate the session.
- 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
- This layer, often considered the heart of the OSI model, is responsible for controlling data flow between two devices.
- For example, this layer determines the amount of data needed to send and the location where it should be sent.
- This layer is also responsible for data flow and error control.
- 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.
- Simultaneously, error control ensures retransmitting the data again if some packets were lost on the receiver side.
- 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
- The network layer is responsible for data packet forwarding and routing data between routers.
- It facilitates data transfer between two devices residing in two different networks.
- 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.
- However, the routers at this layer help you do this efficiently by automatically selecting the nearest way.
- The network layer is also responsible for translating the logical addresses into physical addresses and is responsible for data fragmentation.
- Hence, it breaks segments of data into smaller units called packets before sending them to other networks.
Data Link Layer (Frame) - Frames from packets, MAC address
- This layer provides a connection between two devices residing on the same physical network, for example, between two devices in the same LAN.
- This layer receives packets from the network layer and breaks them into small units called frames.
- 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.
- 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
- This layer exists at the bottom of the OSI layer.
- It represents the OSI model's physical component, including cable type, radio frequencies (when using a Wireless connection), the layout of pins, and voltages.
- This layer is responsible for delivering the raw data from the sending device's physical layer to the receiving device's physical layer.
- Popular devices found at this layer include network hubs, cabling, repeaters, and modems.
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 - Application
People - Presentation
Seem - Session
To - Transport
Need - Network
Data - Data Link Layer
Processing - Physical Layer