Card 01/ 09

ConceptDifficulty: Beginner2 min

The OSI Model: Seven Layers From Cable to Application

Seven layers, each with one job, so a network problem can be pinned to one of them.

The OSI model (Open Systems Interconnection) divides network communication into seven layers, from the physical signal on a cable at layer 1 to the application at layer 7. Each layer has one job and depends only on the layer below it, which is why engineers use the model to say where a network problem lives.

Picture a web page that will not load. The cause could be an unplugged cable, a wrong address, a program that is not listening, or a crashed server, and from the browser all four look the same. Each belongs to a different layer, so asking the layers in order turns one vague complaint into a short list of yes or no questions.

Every layer speaks a protocol, an agreed set of rules for what two machines send each other, and adds a header, a small block of fields in front of the data. Three addresses in those headers recur: a MAC address names one network card on the local link, an IP address names a machine across networks, and a port names one program on that machine.

The seven OSI layers, top layer first, with what each holds and what it is for
LayerHoldsLives for
7 ApplicationRequests and responses a program sends, such as HTTPGiving the program the service it asked for
6 PresentationThe format of the data: encoding, compression, encryptionMaking the bytes mean the same at both ends
5 SessionA conversation between two programs, opened and closedKeeping track of which exchange a message belongs to
4 TransportSegments addressed to ports: TCP, UDPReaching the right program, reliably when asked
3 NetworkPackets addressed by IP addressChoosing a path across many networks
2 Data LinkFrames addressed by MAC address, as in Ethernet and Wi-FiMoving data to the next device on the same link
1 PhysicalBits as voltage, light or radioSending ones and zeros across a cable or the air

Each layer builds on the one below and hides it from the one above: Ethernet does not know a web page from an email, and HTTP does not know whether its bytes crossed copper or radio. That independence is why Wi-Fi could replace cables without a change to HTTP. A common way to remember the order from layer 1 upwards is "Please Do Not Throw Sausage Pizza Away".

The OSI model is a way to reason about networks, not software you install; the internet runs on the TCP/IP protocols, which fold the top three layers into one.

So when something fails, the first useful question is which layer it failed at, because the layer decides which tool can see the fault: a cable tester, ping, or the server's own logs.

← → move through sections and cards