It needs to enable two neighbouring (i.e., directly connected) devices to communicate.
It also needs to enable two devices separated by multiple hops to communicate.
The Open Systems Interconnection (sometimes Open Systems Interconnect or simply OSI) model 1️⃣ enables networking software to be built in a structured manner; 2️⃣ provides an interoperability framework for networking protocols.
History: The OSI model was introduced in 1983 by several major computer and telecom companies; and was adopted by ISO as an international standard in 1984 [Imp22].
The second and latest edition of the international standard is ISO/IEC 7498-1:1994 [ISO94].
The OSI model is a logical (as opposed to physical) model that consists of seven nonoverlapping layers (going bottom-up, opposite to Fig. 1):
Layer 1 (L1), physical layer [TW11, p. 43]: This layer transmits and/or receives raw bits (see Fig. 2) over a communication channel (e.g., coaxial cable, optical fibre, RF channel).
This layer deals with mechanical, electrical, and timing interfaces, as well as the physical transmission medium, which lies below the physical layer.
For example, the IEEE Standard for Ethernet [IEE22] specifies several variants of the physical layer and one data link layer.
Layer 2 (L2), data link layer [TW11, p. 43]: This layer transforms a raw transmission facility into a line that appears free of undetected transmission errors, by masking the real errors so the network layer above does not see them.
Input data is encapsulated in data frames (see Fig. 2) which are transmitted sequentially.
For example, the Challenge-Handshake Authentication Protocol (CHAP, see RFC 1994 and RFC 2433)
is a link-layer protocol.
Fig. 2: The OSI model and associated terms [TW11, Figure 1-20]. While the bottom three layers are peer-to-peer, the upper layers are end-to-end.
Layer 3 (L3), network layer [TW11, pp. 43-44]: This layer controls the operation of a subnet (see Fig. 2), by determining how packets (see Fig. 2) are routed from a source to
a destination.
For example, the Internet Protocol Security (IPsec) is a network-layer protocol.
Layer 4 (L4), transport layer [TW11, pp. 44]: This layer accepts data from above it, split it up into smaller units, called transport protocol data units (TPDUs, see Fig. 2), if need be, passes these to
the network layer, and ensures that all pieces arrive correctly and efficiently at the other end.
For example, the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are transport-layer protocols (see Fig. 1).
Layer 5 (L5), session layer [TW11, pp. 44-45]: This layer enables users on different machines to establish sessions between them.
Sessions offer various services, including dialog control (keeping track of whose turn it is to transmit),
token management (preventing two parties from attempting the same critical operation simultaneously), and synchronisation (checkpointing long transmissions to allow them to pick up from where they left off in the event of
a crash and subsequent recovery).
For example, SOCKS5 (see RFC 1928) is a session-layer protocol.
Layer 6 (L6), presentation layer [TW11, p. 45]: This layer manages the syntax and semantics of the information to be transmitted.
For most protocols however, the distinction between the presentation layer and application layer is blur. For example, the HyperText Transfer Protocol (HTTP) is commonly classified as an application-layer protocol although it has clear presentation-layer functions such as encoding, decoding, and managing different content types [FNR22].
Layer 7 (L7), application layer [TW11, p. 45]: This layer implements a suite of protocols for supporting end-user applications.
For example, HTTP is a stateless application-layer protocol for distributed, collaborative, hypertext information systems [FNR22]. HTTP supports eight “methods”, including the GET method for requesting transfer of a target resource in a specified representation [FNR22, Sec. 9.3.1].
The OSI model is not the only networking model. The TCP/IP reference model plays an equally important role in the history of networking.
The APRANET and its descendent — the Internet as we know it — are based on the TCP/IP model.
The TCP/IP model has only four layers, as shown in Fig. 3.
Fig. 3 also shows the different protocols occupying the different layers of the TCP/IP model.
Both models use 1️⃣ the transport and lower layers to provide an end-to-end, network-independent transport service; and 2️⃣ the layers above transport for applications leveraging the transport service.
Most real-world protocol stacks are developed based on a hybrid of the OSI and TCP/IP models, consisting of these layers (from bottom to top): physical, data link, network, transport, application [TW11, Sec. 1.4.3].
Fig. 3: Comparing the OSI model and TCP/IP model [Imp22].
The salient differences between the OSI and TCP/IP models are summarised in Table 1 below.
Table 1: Salient differences between the OSI and TCP/IP models [TW11, Secs. 1.4.2-1.4.5].
OSI model
TCP/IP model
Created before the protocols residing in the different layers were.
Created after the protocols were.
The OSI model differentiates services (provided by each layer), interfaces (between adjacent layers) and protocols (implementing different layers) from each other. This abstraction is consistent with object-oriented programming.
The TCP/IP model appears to be more monolithic, and this provides little help with engineering a non-TCP/IP stack.
The data link layer originally only catered for point-to-point communications. For broadcast networks, a medium access control sublayer had to be grafted onto the OSI model.
No sublayering is needed within the network access layer.
Too many layers, because the top three layers can often be collapsed into a single application layer in practical implementations.
Not enough layers, because the network access layer should really be split into two layers: physical and data link. For example, IEEE 802.3 (Ethernet) and IEEE 802.11 (Wi-Fi) protocols have distinct specifications for the physical and data link layers.
The OSI model supports both connectionless and connection-oriented communication in the network layer, but only connection-oriented communication in the transport layer.
The TCP/IP model supports only connectionless communication in the network layer, but both connectionless and connection-oriented communication in the transport layer. Having these two choices in the transport layer is good for simple request-response protocols.
References
[CCI91]
CCITT, ITU, Security architecture for Open Systems Interconnection for CCITT applications, Recommendation X.800 (03/91), 1991. Available at https://www.itu.int/rec/T-REC-X.800-199103-I/en.
ISO/IEC, Information technology – open systems interconnection – basic reference model: The basic model, International Standard ISO/IEC 7498-1:1994 second edition, November 1994, corrected and reprinted 1996-06-15. Available at https://www.iso.org/standard/20269.html.
[TW11]
A. S. Tanenbaum and D. J. Wetherall, Computer Networks, 5th ed., Prentice Hall, 2011.