Skip to content
academia.sh

Lesson 01 / 18

OSI Model

The layer responsibilities of the seven-layer reference model, the service–interface–protocol distinction, and placing a fault at the correct layer.

Contents

The How the Internet Works course traced the end-to-end journey of a request typed into an address bar: the name was resolved, a connection was established, the request was sent, the response was rendered. In that account the network looked like a single, monolithic service — you make the request, the response arrives.

This course opens up that single piece by dividing the work into layers. Getting an application’s data from one computer to a computer on another continent involves independent problems: producing an electrical signal, addressing the neighboring device, choosing a path across networks, resending lost pieces, and preserving the meaning of the data. This lesson’s question is what criterion separates these problems.

Why Layering

Layered design is the networking counterpart of the top-down decomposition from the Programming Fundamentals course: each layer uses the service of the layer below it and offers a more abstract service above it. How a layer works is not the concern of the layer that uses it.

The concrete payoff of this separation is that layers can be changed independently of one another. Using fiber instead of copper cable affects no application running above it; changing an application protocol does not touch the routing mechanism beneath it. When a computer switches from a wireless connection to a wired one, most open sessions are unaffected, because the upper layers never see the change.

In a layered architecture, three concepts are carefully kept separate:

  • Service: What a layer offers to the layer above it. “A sequential, lossless byte stream” is a service definition.
  • Interface: How the layer above accesses this service. Function calls, parameters, the data transfer format.
  • Protocol: How two instances of the same layer on separate machines talk to each other. It is the internal matter of carrying out the service, and it is closed off from the layer above.

As long as the service stays the same, the protocol can change. The durability of the layered model comes from this promise.

The Seven Layers

The OSI reference model — Open Systems Interconnection — divides network functions into seven layers. From bottom to top:

No Layer Responsibility Addressing unit
7 Application Application-specific exchange rules Resource name
6 Presentation Data representation, encoding, encryption
5 Session Dialog setup, synchronization, recovery
4 Transport End-to-end reliability and multiplexing Port
3 Network Inter-network addressing and path selection IP address
2 Data Link Frame delivery between neighboring nodes Hardware address
1 Physical Bits turning into signals

The layers’ responsibilities are separated by a single criterion: the scope of a problem.

The Physical layer is concerned only with how a single bit is transmitted. Voltage levels, light pulses, radio carriers, connector shapes, and timing are this layer’s subject matter. There is no “address” at this layer; the signal placed on the medium carries no known meaning.

The Data Link layer carries traffic between devices sharing the same physical medium. It marks the start and end boundaries of a bit sequence, identifies the destination device by its hardware address, adds a check field for error detection, and arbitrates access when multiple devices share the medium. Its scope is a single link; it does not see beyond the next device.

The Network layer carries traffic between networks that are not directly adjacent. It takes on two new tasks: giving each endpoint an address independent of the network, and choosing the path to that address. Routers operate at this layer. It gives no guarantee of end-to-end delivery; it offers only a “best-effort” level of service.

The Transport layer turns communication between two endpoints into something applications can use. It distinguishes multiple applications running on the same machine by port number and — depending on the protocol — takes on the problems of loss, reordering, and duplication. The Network layer can lose packets; the Transport layer can hide this from the layer above.

The Session layer structures the dialog between two endpoints: which side speaks when, and where to resume after an interruption. The Presentation layer governs the representation of data: character encoding, byte order, compression, and encryption. In practice, the functions of these two layers mostly live inside the Application layer or in libraries.

The Application layer hosts the protocols the user’s program uses directly. How a resource is requested, and in what format a piece of mail is delivered, are this layer’s subject matter.

The Network Followed Throughout the Course

All of this course’s calculations will be carried out over a single example: the single-campus network of a research institution.

  • The institution has received a single public address from its provider: 203.0.113.10.
  • The internal network uses a private block: 192.168.10.0/24.
  • Dividing this block into segments will be designed step by step in the lessons following this topic.
  • The client followed is the machine at 192.168.10.196 in the administration department; its hardware address is 00:00:5e:00:53:01.
  • This machine’s default gateway is the institution’s router at 192.168.10.193.
  • The client’s destination in the outside world is a server at 198.51.100.20.

The blocks 203.0.113.0/24, 198.51.100.0/24, and 192.0.2.0/24 used in the example are reserved for documentation; they do not appear on real networks. The hardware addresses are likewise chosen from the 00:00:5e:00:53:xx range reserved for documentation purposes. This choice is deliberate: an example address stops being an example the moment it points at a real system.

When the client requests a resource on 198.51.100.20, each layer does its own part: the Application layer formats the request, the Transport layer fits it into a connection, the Network layer selects the path based on the destination address, the Data Link layer delivers the frame to the gateway, and the Physical layer puts the bits on the cable. Each of these steps will be opened up one by one in the lessons that follow.

Placing a Fault at a Layer

The everyday value of the layered model is that it fixes a diagnostic order. When it is not known which layer a problem is at, narrowing proceeds from the bottom up: if a lower layer is not working, none of the layers above it work either.

Symptom Responsible layer Reason
Interface link light is off Physical No signal is being carried
The neighboring device’s hardware address does not resolve Data Link Address mapping fails on the local network
The local network works, the external address is unreachable Network Path selection or gateway configuration is wrong
The address is reachable, the port is unresponsive Transport A listening process or filtering problem at the destination
A connection is established, the response is meaningless Presentation / Application Encoding or protocol mismatch

Reversing this order wastes a great deal of effort: hours can be spent on application configuration only to discover that the cable was never plugged in. The layered diagnostic method offers a systematic narrowing to prevent this waste.

Limits of the Model

OSI is a reference model; it is not an implementation. The protocol stack that runs on the Internet was not designed according to this model, and it does not fit it exactly. The model’s known limits must be stated plainly:

  • The Session and Presentation layers do not exist as separate layers in most stacks; their functions are distributed into the Application layer or into libraries.
  • Some protocols concern more than one layer at once. Secure transport protocols sit between the Transport and Application layers; address resolution protocols draw on both the Network and Data Link layers together.
  • When tunneling is used, the layer sequence repeats: a Network-layer packet can become the payload of another Network-layer packet.

Despite these limits, the model survives for two reasons. First, it offers a shared vocabulary: the phrase “a Layer 3 problem” carries a common meaning. Second, it gives a diagnostic order: it defines a systematic way of narrowing a problem’s scope.

Summary

  • Layered design separates network work by scope; each layer uses the service of the one below it and offers a more abstract service to the one above it.
  • Service (what is offered), interface (how it is accessed), and protocol (how peers talk to each other) are separate concepts; the protocol can change while the service stays fixed.
  • The OSI model defines seven layers: Physical, Data Link, Network, Transport, Session, Presentation, Application.
  • The fundamental distinction between layers is scope: a bit, a link, a path across networks, an end-to-end session.
  • Diagnosis narrows from the bottom up; if a lower layer is not working, none of the layers above it work either.
  • OSI is a reference model; implemented stacks do not fit it exactly, but it provides a shared vocabulary and a diagnostic order.

Next Step

The seven-layer model gives a design vocabulary, but the stack that runs on the Internet was not built according to it. The next lesson takes up the four-layer TCP/IP model that is actually implemented, maps the layers of the two models onto each other, and shows why the single common layer at the center of TCP/IP is so decisive.

To keep your progress and take notes, Log in

My notes

Log in to take notes.

Start typing to search.

↑↓ Esc navigate · open · close