OSI Model

OSI Model Chart
Tech Articles

OSI Model

A computer is a tool that can be configured for an infinite number of uses. Some key steps in the evolution of computers was organizing its various components into conceptual models based on abstraction layers.

A good comparison is a calculator, which is hardware and software designed to do specific things with no abstraction layers involved. In contrast, the programmers that developed spreadsheets like Excel did not have to be concerned with the specific hardware being used. The hardware, the OS (operating system) and Excel are in different layers, Excel works with the OS, and the OS in turn works with the hardware. Google Sheets took this one step further and works with specific browsers and does not know about the OS.

The most famous models for networking are the OSI reference model, which is based on seven abstraction layers, and the TCP/IP model , based on four abstraction layers. The TCP/IP model pre-dates the OSI Model and niether strictly follows the other. A layer serves the layer above it and is served by the layer below it. Vendors will typically focus their products on certain layers of a network. In the same manner that Excel and Google Sheets are designed to be independent of hardware, this allows various components of the network to be from different vendors and still work together.

If you are not familiar this topic, read about the TCP/IP model first.

Note that one source of confusion is that sometimes certain challenges can be solved on different layers. For example, network interface bonding can be implemented on any of the first three layers.

There are many explanations of the OSI reference model, please email me if this one is not clear.

The OSI Reference Model

1. The physical layer defines the electrical and physical specifications of the data connection and the relationship between a device and a physical transmission medium. The physical layer is the only layer where data is physically moved across the network interface. All messages are transmitted down the protocol stack to the physical layer where they are

The physical layer is responsible for the following:
  • Hardware Specifications Definition (also partially the data link layer)
  • Encoding and Signaling Functions that transform the data into signals that can be sent over the network
  • Data Transmission and Reception. The physical layer encodes, transmits and receives the data. (Note that this applies to wireless networks as well).
  • Topology and Physical Network design

Example: Ethernet has dozens of different physical implementations, each of which use the same data link layer.

Note that the physical layer is not hardware per se. Hardware devices can be implemented in multiple layers of the OSI model, depending on their function. For example, an Ethernet network interface card performs functions at both the physical layer and the data link layer.

2. The data link layer: data transfer across the physical link between nodes including detecting and possibly correcting errors. Defines how interconnected networks function. Works within a LAN, meaning whatever can be reached without routing. Responds to service requests from network layer and issues service requests to physical layer. Examples include Token Ring, ARP, Ethernet. Network interface bonding can be implemented on this layer. Network interfaces (NICs) implement a specific data link layer technology. Physical (MAC) addresses are layer 2, while IP addresses are layer 3. ARP is used to translate between the layer 2 (MAC) addresses and layer 3 (IP) addresses.

3. The network layer: responsible for packet forwarding including routing. Responds to service requests from the transport layer and issues service requests to the data link layer. Examples: connectionless protocols like IP, multicast group management, network layer address assignment (IP addresses).

4. The transport layer: Makes sure that data reaches its destination. Responds to service requests from the session layer and issues service requests to the network layer. Examples: UDP (User Datagram Protocol) and TCP (Transport Connection Protocol). TCP will create a connection called a network socket using the ip address and port number.

5. The session layer: Provides the mechanism for opening, closing and managing a session between end-user application processes. Establishes and terminates connections (and therefore, communications between computers). Responds to service requests from the presentation layer and issues service requests to the transport layer. Examples: RPC (Remote Procedure Call), authentication, authorization. Note that in the OSI model, the graceful closing of connections is layer 5, while in the TCP/IP model, TCP is respondisble for this as well as layer 4 functionality.

6. The Presentation layer: translates between application and network formats. Responds to service requests from the application layer and issues service requests to the session layer. Lowest level that deals with data structure rather than data grams. Responsible for making sure that data sent from the application layer of one system can be read by the application layer of the other system. Examples: compression, conversion of a file into ascii.

7. The Application Layer: layer used by applications. The layer closest to users. Provides services to end-user software. Users interact with applications and applications interact with this layer.  Responds to service requests from the applications and issues service requests to the presentation layer. Note, does not refer to the actual applications themselves (after all, the OSI model is about networking). Examples: telnet, HTTP, NTP, DNS, SMTP.

Real-life implications
When a cable plugged into a network interface shows a link light, that means the data link layer is working. Since the data link layer depends on the physical layer, the link light also indicates the physical layer is working. Routing can be completely misconfigured and so the network drop does not work, but the link light can be on, because routing is part of the network layer.

Data is sent at layer 3 (network layer) using a layer 3 address, the IP address. The actual transmission of the data occurs at layer 2 (data link layer) using a layer 2 address, the MAC address. Taking a network layer address and determining what data link layer address goes with it is handled by the TCP/IP protocol ARP (Address Resolution Protocol).

OSI Model Chart
Tech Articles