ByteByte CityCity
All lessons
OSI Model

The OSI Model Explained: 7 Layers in One City

9:50 Watch on YouTube

The OSI model is the map every network engineer uses — and almost nobody explains where it came from or why it reaches far beyond networking. In this episode Professor Flows walks through all seven layers using Byte City, where every house is a host, every street is a subnet, the cube truck is TCP and the bullhorn is UDP.

You'll learn

Chapters

  1. 0:00The internet's down — where do you start?
  2. 0:36Before the standard: every vendor on its own
  3. 1:011977–1984: how the OSI model was born
  4. 1:48The big idea: division of labor
  5. 2:30Layers 7, 6 and 5
  6. 3:16Layers 4 to 1: TCP, UDP, ports, IP, MAC
  7. 4:37Encapsulation: tag, mail bag, crate — segment, packet, frame
  8. 5:15It was never just data: phones and VoIP
  9. 6:39Cellular and television
  10. 7:41Troubleshoot by layer: 5 questions
  11. 8:25The inconvenient truth: TCP/IP won
  12. 9:27Next time: Layer 1

The written lesson

The problem: "the internet's down"

A user calls. "The internet's down." Their computer is on. The cable is plugged in. The site loads on your phone. So where exactly is it broken?

Most people start restarting things until something works, and never find out why it did. The technicians who don't guess are working from a map. It was drawn in the late 1970s, and it is still the vocabulary every network engineer uses: the OSI model, short for Open Systems Interconnection.

Where the OSI model came from

In the 1970s every manufacturer built networking its own way. One vendor's computers talked to that vendor's computers and nothing else. Buy the machine and you bought the cables, the protocols and everything above them, and it could not talk to the machine across the hall. Picture a city where every neighbourhood built its roads to a different width, so the trucks from one could not drive into the next.

In 1977 the International Organization for Standardization (ISO) began work on a common design. In 1980 Hubert Zimmermann published the paper that set out the architecture, and in 1984 it became a formal standard: ISO 7498, published jointly with the international telecommunications body as X.200. That second publisher matters. The telephone world was in the room from the start, which is why the model reaches well beyond computers.

The big idea is not "seven"

A wrapped piece of data, a mail bag and a wooden crate side by side on a Byte City street
Each layer does one job, and ignores how the layer below does its job.

Seven is arbitrary. The internet's own model has four. The idea that matters is division of labour: each layer does one job, and does not care how the layer below does its job.

The driver doesn't need to know how asphalt is made. The road crew doesn't need to know what is inside the box. Engineers call this abstraction, and it is why you can replace copper with fiber, then fiber with Wi-Fi, and your email keeps working. You changed Layer 1. Nothing above it noticed. That is not a happy accident. It is the whole design.

The seven layers, in Byte City

In Byte City a computer is a house, a network is a street, and the data you send is a small wrapped package that never changes. Everything around it does.

LayerNameIn Byte CityIts one jobReal examples
7ApplicationThe storefront, the mail room, the Yellow PagesThe rules a program speaks to ask for somethingHTTP, SMTP, DNS
6PresentationThe packing roomPut the data in a form the far end can read: encoding, compression, encryptionUTF-8, JPEG, TLS
5SessionThe delivery windowOpen, maintain and close the conversationCall setup, logins
4TransportThe cube truck or the bullhorn, arriving at a numbered doorDeliver to the right program: reliably (TCP) or quickly (UDP)TCP, UDP, ports 443, 25, 22
3NetworkThe lawn sign, and the road atlas at each intersectionFind a path across networksIP addresses, routers
2Data LinkThe brass plaque and the crateDeliver across one local networkMAC addresses, switches, Ethernet
1PhysicalThe road itselfMove bits, with no idea what they meanCopper, fiber, radio
A Byte City house with three numbered garage doors, 443/80, 25 and 22, and a bullhorn labelled UDP
Layer 4: every service has a numbered door. Those are ports.

One thing people get wrong about Layer 7: it is not your email app or your browser. It is the set of rules that app speaks.

Encapsulation: segment, packet, frame

The same data shown as a segment, then inside a mail bag as a packet, then inside a crate as a frame, then as bits on the road
Same data, different wrapper on the outside.

Watch what happens on the way down. Every layer adds a wrapper and writes its own label on it.

Layer 4 ties a tag onto the data: which numbered door to knock on. That is a segment. Layer 3 puts it in a mail bag and writes the destination's lawn-sign number, the IP address, on the bag. That is a packet. Layer 2 puts the bag in a crate and fixes on the brass plaque of the next stop, the MAC address. That is a frame. Layer 1 puts it on the road as bits.

Each label is a header, and the stacking is encapsulation. At the far end it runs in reverse: each layer opens only its own wrapper, reads only its own label, and hands the rest up. So segment, packet and frame are not three different things. They are the same data with a different wrapper on the outside.

It was never just data

Byte City seen from above with a telephone exchange, a cell tower and a broadcast tower on the hills
Telephone, cellular and television systems are built in layers too.

The layered model did not stay in computer networking. Almost every modern transmission system is built this way, because everybody hit the same problem ISO hit.

  • The telephone network. SS7, the signalling system that sets up phone calls worldwide, is built in levels that map onto the bottom of this model: Level 1 is the physical link, Level 2 handles error-free delivery over that link, Level 3 handles routing.
  • A voice call over the internet. One protocol sets up the call, keeps it open and hangs up cleanly: the job Layer 5 describes. A codec squeezes the audio to fit the line: the job Layer 6 describes. And the voice rides UDP, the bullhorn, because a re-sent word arriving two seconds late is worse than a word you never heard.
  • Cellular. The 4G and 5G radio specifications are written in layers: a physical layer moving symbols over the air, a layer above it handling reliable delivery, a control layer above that.
  • Television. A digital broadcast is modulated radio at the bottom, a standard stream of packets above it, and compressed video and audio above that.

Once you can see the layers, you see them everywhere.

How the map pays you back: five questions, bottom up

A green link light over the brass MAC address plaque beside a house door
Question one: is there a link light? If it is dark, stop right there.

Back to the user with the broken internet. With a map you don't guess. You cut the problem in half, from the bottom up.

  1. Is there a link light? Layer 1. If it is dark, stop there.
  2. Can the machine see its neighbours on its own network? Layer 2.
  3. Can it reach the default gateway? Layer 3.
  4. Is the port open on the far end? Layer 4.
  5. Does the name resolve to an address? Layer 7, asking DNS.

Five questions, each removing whole categories of cause. That is the difference between twenty minutes and two hours.

OSI vs TCP/IP

The seven OSI layers beside the four TCP/IP layers: Application, Transport, Internet and Link
OSI has seven layers; TCP/IP, the model the internet runs on, has four.

While governments were mandating OSI protocols (the United States required them for federal purchasing in 1990), engineers were building the internet on a simpler stack: TCP/IP, with four layers. It was already working, already deployed and free. By the mid-1990s the mandates were gone, and no network today runs the OSI protocols.

So why learn it? Because OSI lost as an implementation and won as a language. Say "that's a Layer 2 problem" and every engineer in the room knows what you mean. The mapping is simple: OSI Layers 5 to 7 are TCP/IP's Application layer, Layer 4 is Transport, Layer 3 is Internet, and Layers 1 and 2 are Link.

The Network+ exam tests both. Learn OSI as the map, and remember TCP/IP is the territory.

Quick answers

What is the OSI model in simple terms?

A seven-layer description of how data gets from one program to another across a network. Each layer does one job and hands off to the next.

What are the seven OSI layers in order?

From the top: Application, Presentation, Session, Transport, Network, Data Link, Physical. From the bottom, Layer 1 to Layer 7: Physical, Data Link, Network, Transport, Session, Presentation, Application.

Is the OSI model still used?

Not as a set of protocols: real networks run TCP/IP. It is used every day as the shared vocabulary for design and troubleshooting, and it is tested on CompTIA Network+.

What is the difference between a segment, a packet and a frame?

They are the same data with a different wrapper. A segment is the Layer 4 unit (with TCP; with UDP it is called a datagram), a packet is the Layer 3 unit, and a frame is the Layer 2 unit.

What is the difference between OSI and TCP/IP?

OSI is a seven-layer reference model used to describe networks. TCP/IP is the four-layer model, and the actual protocols, that the internet runs on.

Key terms

Encapsulation
—
each layer wrapping the data from the layer above and adding its own header.
Header
—
the label a layer adds, read only by the same layer at the far end.
Abstraction
—
each layer doing its job without needing to know how the others do theirs.
Port
—
the numbered door that identifies a service on a host (Layer 4).
IP address
—
the logical address that identifies a host across networks (Layer 3).
MAC address
—
the hardware address used to deliver across one local network (Layer 2).
Next: Slow PC After an Office Move? Physical Layer Explained | OSI Layer 1

Quick quiz

Five questions on this lesson. Pick an answer to see why.

  1. 1. A technician troubleshoots bottom-up. The link light is on and the PC can reach other hosts on its own network. Which check comes next?
  2. 2. On the sending host, data is wrapped on its way down the stack. In which order are these units created?
  3. 3. A student says, "My web browser is the Application layer." What does Layer 7 of the OSI model actually describe?
  4. 4. An office replaces its copper cabling with fiber. Email, web and file sharing keep working with no software changes. Which OSI idea explains this?
  5. 5. The internet runs on the four-layer TCP/IP model. Which OSI layers are combined into its single Application layer?

Keep learning

Next

Thumbnail for Slow PC After an Office Move? Physical Layer Explained | OSI Layer 14:59
OSI Model

Slow PC After an Office Move? Physical Layer Explained | OSI Layer 1

The road: copper, glass and radio, and what a dark link light means.

4:59 Watch

Related

Thumbnail for What Happens When You Click a Link: All 7 OSI Layers in One Trip8:28
OSI Model

What Happens When You Click a Link: All 7 OSI Layers in One Trip

One click, seven floors down, across the city, and back. Every layer in one trip.

8:28 Watch

Related

Exam objectives: CompTIA Network+ N10-009: 1.1 (OSI model). Vendor-neutral.

Byte City is not affiliated with or endorsed by CompTIA.