The OSI reference model, introduced by ISO in 1984, is a standard way to describe how network communication is organized. It divides the process into seven layers, ordered from bottom to top: physical, data link, network, transport, session, presentation, and application. Each layer has its own job, interacts with neighboring layers through interfaces, and contributes to encapsulating data on the way down and decapsulating it on the way up.
Layer 1: Physical
The physical layer defines interface standards for cables and connectors, carries the raw bit stream of 0s and 1s, and deals with electrical, mechanical, and timing characteristics. Representative specifications include EIA/TIA-232, a serial communication standard used by traditional serial devices such as modems; RJ-45, which defines the physical connection between Ethernet cable and port; and IEEE 802.3, the Ethernet physical-layer family that sets transmission media and signal rates, with examples such as 10BASE-T and 100BASE-TX.
Layer 2: Data Link
This layer moves data between adjacent nodes. It handles frame synchronization, error detection through CRC, flow control, and addressing through MAC addresses. Ethernet defines the frame structure, including source and destination MAC addresses and the data payload, and is widely used in LANs. PPP is a point-to-point link protocol for dial-up access and router-to-router connections, with authentication options such as PAP and CHAP. HDLC is a WAN link protocol used for synchronous communication and does not use a frame boundary identifier. MAC addressing identifies devices with addresses such as 00:1A:2B:3C:4D:5E.
Layer 3: Network
The network layer delivers data across networks. It uses IP addresses for addressing, chooses routes, and handles packet fragmentation and reassembly. IP is the core protocol and defines packet fields such as source and destination IP and TTL; current versions include IPv4, for example 192.168.1.1, and IPv6, for example 2001:DB8::1. ICMP reports network errors and is the basis for tools such as ping, which uses ICMP Echo request and reply. ARP resolves an IP address to a MAC address, while RARP performs the reverse lookup from MAC to IP and is rarely used. Routing protocols exchange route information between routers; RIP is distance-vector based, and OSPF is link-state based.
Layer 4: Transport
The transport layer provides end-to-end service for applications. It can support reliable or connectionless transmission and uses port numbers to distinguish applications. TCP is connection-oriented and reliable. It establishes a connection with a three-way handshake: the client sends SYN, the server replies SYN+ACK, and the client sends ACK. TCP keeps data ordered and guards against loss, which is why HTTP and FTP rely on it. UDP is connectionless and does not guarantee delivery; it is efficient and is used by DNS queries, video streams, and VoIP. Port numbers identify application processes, such as TCP 80 for HTTP and UDP 53 for DNS.
Layer 5: Session
The session layer establishes, manages, and terminates sessions between applications. It also supports session synchronization, such as resuming a transfer after an interruption. NetBIOS was used in early Windows networks to establish sessions for file and printer sharing. SSH uses session-layer functions in some scenarios to create encrypted remote sessions. API interfaces also provide session management, as seen in NFS.
Layer 6: Presentation
The presentation layer converts data formats so different systems can interoperate. Its work includes encryption and decryption, compression and decompression, and character encoding conversion. SSL/TLS encrypts data for HTTPS and email transport such as SMTP over TLS. JPEG and PNG are image compression formats that encode image data at this layer. ASCII and UTF-8 are character encoding standards that turn characters into binary data; in ASCII, for example, 'A' corresponds to 65. MIME defines formats for multimedia content in email, such as image and audio attachments.
Layer 7: Application
The application layer provides services directly to user applications and handles business logic such as file transfer, web browsing, and email. HTTP and HTTPS support web browsing; HTTPS adds TLS encryption on top of HTTP, as in https://www.example.com. FTP transfers files and uses TCP 20 for data and TCP 21 for control. SMTP, POP3, and IMAP handle email: SMTP sends mail on TCP 25, while POP3 on TCP 110 and IMAP on TCP 143 receive mail. DNS resolves domain names such as www.baidu.com into IP addresses and uses UDP 53. DHCP automatically assigns IP addresses and network parameters such as subnet mask and gateway, using UDP 67 on the server and UDP 68 on the client. Telnet and SSH provide remote login; Telnet sends data in plaintext and is insecure, while SSH encrypts the session and is used for tasks such as remote router management. SNMP monitors network device status, including traffic statistics on switches and routers, and uses UDP 161 and 162.
How the layers map to common protocols
<table> <thead> <tr> <th>OSI layer</th> <th>Core function</th> <th>Common protocol examples</th> </tr> </thead> <tbody> <tr> <td>Application</td> <td>Business logic</td> <td>HTTP, FTP, SMTP, DNS, DHCP</td> </tr> <tr> <td>Presentation</td> <td>Data format conversion</td> <td>SSL/TLS, JPEG, UTF-8, MIME</td> </tr> <tr> <td>Session</td> <td>Session management</td> <td>NetBIOS, SSH session control</td> </tr> <tr> <td>Transport</td> <td>End-to-end communication</td> <td>TCP, UDP, port number management</td> </tr> <tr> <td>Network</td> <td>Network addressing and routing</td> <td>IP, ICMP, ARP, OSPF, RIP</td> </tr> <tr> <td>Data link</td> <td>Adjacent-node data transfer</td> <td>Ethernet, PPP, HDLC, MAC addressing</td> </tr> <tr> <td>Physical</td> <td>Physical signal transmission</td> <td>EIA/TIA-232, RJ-45, IEEE 802.3</td> </tr> </tbody> </table>Why the model remains useful
The OSI model's value comes from its separation of concerns. Because each layer has a distinct role, protocols can be developed and maintained with less interference from changes elsewhere; updating an application-layer protocol, for example, does not require redesigning the physical layer. The layering also helps with troubleshooting: an issue can be traced to a specific level, whether it is a damaged cable at the physical layer or an incorrect IP configuration at the network layer. It also clarifies what different protocols are responsible for, such as TCP's focus on reliable transport and IP's focus on network routing.
Taken together, the layers and their protocols describe the full path of network communication, from physical signals to application interaction. Each layer supports the one above it, and together they make complex network communication possible.