OSI model explained: the 7 layers of networking
The OSI model explained: what the 7 layers (physical to application) do, how data moves through them, and how the model compares with the real TCP/IP stack.
On this page
- The idea behind the model
- The seven layers
- Layer 1: Physical layer
- Layer 2: Data link layer
- Layer 3: Network layer
- Layer 4: Transport layer
- Layer 5: Session layer
- Layer 6: Presentation layer
- Layer 7: Application layer
- How data travels: an example
- OSI vs the real Internet: TCP/IP
- Why the model is still useful
- FAQ
- What does OSI stand for?
- How do I remember the 7 layers?
- Is the OSI model the same as TCP/IP?
- Which OSI layer is HTTP?
The OSI model (Open Systems Interconnection model) is a conceptual framework that divides computer networking into seven layers, from the physical cable up to the application you use. Each layer handles a specific job and communicates only with the layers directly above and below it, so any layer can be swapped or upgraded without touching the others. It was standardized in 1984 as ISO 7498 and ITU-T X.200, and it is still the standard way to teach, document, and debug networks — even though the Internet itself does not follow it strictly.
The idea behind the model
Communication protocols enable an entity in one host to interact with a corresponding entity at the same layer in another host. In the model, a layer N provides services to the layer above it (N+1) and uses services from the layer below it (N−1). Two devices talk to each other through their peer layers: for example, the transport layer on your computer "speaks" to the transport layer on the server, even though the data physically travels through every lower layer on the way.
Data processing works by encapsulation. The data to be transmitted is composed at the topmost layer into a protocol data unit (PDU), which is passed down as a service data unit (SDU) to the next layer. That layer concatenates the SDU with a header, a footer, or both, producing its own PDU, and passes it further down. The process continues until the lowest layer transmits the data to the receiving device. On the receiving side the process is reversed: each layer strips its own header or footer until the topmost layer consumes the original data.
The seven layers
The recommendation X.200 describes seven layers, labelled 1 to 7. Layer 1 is the lowest layer in the model.
Layer 1: Physical layer
The physical layer is responsible for the transmission and reception of unstructured raw data between a device — a network interface controller, an Ethernet hub, or a switch — and a physical transmission medium. It converts digital bits into electrical, radio, or optical signals. Its specifications define voltage levels, the timing of voltage changes, physical data rates, maximum transmission distances, modulation schemes, channel access methods, and physical connectors. Bit rate control happens here, and the layer may define transmission as simplex, half-duplex, or full-duplex. Physical layer specifications are included in the standards for Bluetooth, Ethernet, and USB.
Layer 2: Data link layer
The data link layer provides node-to-node data transfer — a link between two directly connected nodes. It detects and possibly corrects errors that occur in the physical layer, and defines protocols to establish and terminate the connection between two physically connected devices, including flow control between them. The IEEE 802 standards divide this layer into two sublayers: the MAC (medium access control) layer, which controls how devices gain access to a medium and permission to transmit, and the LLC (logical link control) layer, which identifies and encapsulates network layer protocols and handles error checking and frame synchronization. Ethernet (802.3), Wi-Fi (802.11), and Zigbee (802.15.4) all operate at this layer.
Layer 3: Network layer
The network layer provides the means of transferring packets from one node to another across different networks. Every node on a network has an address, and the network finds the way to deliver a message to the destination node, possibly routing it through intermediate nodes. If a message is too large for the data link layer between two nodes, the network layer splits it into fragments, sends them independently, and reassembles them at the destination. Delivery is not necessarily reliable: a network layer protocol may provide reliable delivery, but it does not need to. Routing protocols, multicast group management, and network-layer error and address-assignment functions live here, and security at this layer can be applied with IPsec.
Layer 4: Transport layer
The transport layer transfers variable-length data sequences from a source host to a destination host, from one application to another, while maintaining quality-of-service functions. Because the network layer imposes a maximum packet size (the MTU), the transport layer may break large data streams into smaller chunks called segments. For example, over Ethernet the MTU is 1500 bytes; subtracting the minimum 20-byte TCP header and 20-byte IPv4 header leaves a maximum segment size of 1460 bytes. The transport layer also controls reliability through flow control, error control, and acknowledgments. TCP and UDP of the Internet protocol suite are commonly categorized as layer 4 protocols, although they were not developed under the OSI model. TCP is connection-oriented and reliable; UDP is connectionless and is used by streaming media, real-time games, and VoIP, where some packet loss is acceptable.
Layer 5: Session layer
The session layer creates, controls, and ends the connection between two or more computers — the "session". Common functions include user logon and logoff, and it establishes procedures for checkpointing, suspending, restarting, and terminating a session between two related streams of data, such as audio and video in a web-conferencing application. The session layer is commonly implemented explicitly in environments that use remote procedure calls.
Layer 6: Presentation layer
The presentation layer establishes data formatting and translation. Outgoing messages are converted into a format specified by the application layer during encapsulation, and incoming messages are converted back during de-encapsulation. It handles protocol conversion, encryption and decryption, compression and decompression, and incompatibilities of data representation between operating systems. Because it converts data into a display format for the application layer, it is sometimes called the syntax layer. In the modern Internet, TLS (Transport Layer Security) is often cited as a real example: it contains characteristics of both the transport and presentation layers.
Layer 7: Application layer
The application layer is the layer closest to the end user — it is what software applications use to communicate. Application programs such as web browsers and email programs implement application-layer protocols, the most common being HTTP, FTP, SMB/CIFS, TFTP, and SMTP. An important distinction exists between the application entity and the application itself: a reservation website might use HTTP to talk to its users and a remote database protocol to record reservations — neither protocol knows anything about reservations; that logic lives in the application. The application layer determines the identity and availability of communication partners, but it has no means to determine the availability of resources in the network.
How data travels: an example
Imagine loading a website. Your browser (application layer) sends an HTTP request, which the presentation and session layers pass down with their own formatting and session management. The transport layer (TCP) splits the request into segments and numbers them for reliability. The network layer (IP) wraps each segment into a packet with source and destination addresses and routes it across the network. The data link layer puts each packet into a frame for the local link, and the physical layer sends the frames as electrical, radio, or optical signals. The server performs the same process in reverse, from physical layer up to its own application layer — and its response travels back down the same way.
OSI vs the real Internet: TCP/IP
The OSI model is a reference, not a description of the Internet. The design of protocols in the TCP/IP model does not concern itself with strict hierarchical encapsulation and layering — RFC 3439 even contains a section titled "Layering considered harmful". TCP/IP recognizes four broad layers, which are often compared with the OSI scheme like this:
- The Internet application layer maps to the OSI application, presentation, and most of the session layer.
- The TCP/IP transport layer maps to the graceful close function of the OSI session layer plus the OSI transport layer.
- The Internet (internetworking) layer performs functions of a subset of the OSI network layer.
- The link layer corresponds to the OSI data link layer and may include similar functions as the physical layer, plus some network layer protocols.
The OSI protocol suite itself — the specific protocols designed for the model — was considered by many as too complicated, inefficient, and to a large extent unimplementable. It took a "forklift upgrade" approach: replacing all existing protocols at all layers of the stack, which vendors and users with investments in other technologies resisted. The Internet protocol suite won because of its pragmatic, simplified approach. Still, some OSI-era specifications remain in use: IS-IS, specified for OSI as ISO/IEC 10589 and adapted for the Internet as RFC 1142, is one example.
Why the model is still useful
The OSI model remains the standard framework for teaching networking and for documentation, and it is the shared vocabulary engineers use to describe problems: "that's a layer 2 issue" or "the problem is at layer 7". Each layer has real protocols and hardware attached to it, which makes the model a practical map for debugging — from the cable (layer 1) up to the application (layer 7). Its limitations are just as instructive: the Internet works because protocols do not obey strict layering, which is why TCP/IP, with its four pragmatic layers, became the standard for networking.
FAQ
What does OSI stand for?
OSI stands for Open Systems Interconnection. The model is formally the Basic Reference Model for Open Systems Interconnection, published in 1984 as ISO 7498 and ITU-T X.200.
How do I remember the 7 layers?
From top to bottom: Application, Presentation, Session, Transport, Network, Data link, Physical — one word per layer, from layer 7 to layer 1.
Is the OSI model the same as TCP/IP?
No. OSI is a seven-layer reference model; TCP/IP is the four-layer model of the protocols the Internet actually uses. The Internet does not follow OSI strictly, but the two are usually compared layer by layer because the OSI model is the common teaching vocabulary.
Which OSI layer is HTTP?
HTTP operates at layer 7, the application layer, like FTP and SMTP. The model treats these protocols as the interface between the user's application and the network below.
Sources
- Wikipedia — OSI model (en.wikipedia.org/wiki/OSI_model)
- RFC 3439 — Some Internet Architectural Guidelines and Philosophy (ietf.org/rfc/rfc3439)
Share this guide
Related guides
- TCP vs UDP: what's the difference?
TCP and UDP are the two main ways data travels over the internet. TCP is reliable but slower; UDP is fast but lossy. Here's when each one is used.
- What is HTTP/3? A plain explanation
The newest version of HTTP runs on QUIC, a transport built on UDP instead of TCP. Here's what changes — and why pages feel faster with it.
- What are WebSockets? A plain explanation
WebSockets keep a two-way connection between browser and server open, so either side can send data any time. Here's how the handshake, frames, and close codes work — and when to use them.