OSI · seven layers
Learn
01 / 07 · OverviewOSI / ISO 7498-1
Seven layers. One story.
Read one screen at a time. Continue at your own pace.
OSI / ISO 7498-1
From an HTTP request to a signal on the wire. Understand what each layer handles, how data is wrapped, and where to start when a connection fails.
A model for reasoning
A reference model for reasoning about networks. Real Internet protocols do not fit seven separate software modules.
Application → medium · choose a layer
Overview · Seven layers. One story. · Screen 1 / 24
OSI / ISO 7498-1
From an HTTP request to a signal on the wire. Understand what each layer handles, how data is wrapped, and where to start when a connection fails.
A model for reasoning
A reference model for reasoning about networks. Real Internet protocols do not fit seven separate software modules.
Application → medium · choose a layer
Responsibility · 1 / 2
Which network service?
Provides network services to application processes and defines request, response and business-data semantics. A browser is an application; HTTP is an
Responsibility · 2 / 2
application-layer protocol it uses.
Protocols & illustrations
HTTP, DNS, SMTP
Data unit
Application data / message
What to look at
Names, URLs, resources and service semantics
Troubleshooting clue
HTTP 404 / 500 or DNS resolution failure: inspect the request, DNS configuration and service logs.
Keep the boundary clear
An HTTP error shows that some HTTP service responded. Identify whether it was the origin, a proxy or a gateway.
Responsibility · 1 / 2
How is data represented?
Coordinates data representation and transfer syntax, including conversion between representations. Encoding, compression and encryption illustrate
Responsibility · 2 / 2
related responsibilities.
Protocols & illustrations
Character encoding, serialization; TLS illustrates some security functions
Data unit
Presentation PDU (often simplified to data)
What to look at
Data format and representation
Troubleshooting clue
Garbled text, decoding failure or certificate errors: inspect encodings, formats and security configuration.
Keep the boundary clear
TLS is not formally an “OSI layer 6 protocol.” In a typical HTTPS-over-TCP stack, it sits between HTTP and TCP.
Responsibility · 1 / 2
How is a dialogue organized?
Organizes communication dialogues through dialogue control, synchronization points and recovery mechanisms that support structured, long-running
Responsibility · 2 / 2
exchanges.
Protocols & illustrations
Dialogue control, synchronization points, session recovery (concepts)
Data unit
Session PDU (often simplified to data)
What to look at
Dialogue and synchronization state
Troubleshooting clue
A long exchange cannot resume: check whether the protocol supports recovery, checkpoints and retained state.
Keep the boundary clear · 1 / 2
A login session, cookie or WebSocket connection is not automatically an OSI session-layer mechanism. These are commonly implemented by applications or
Keep the boundary clear · 2 / 2
application protocols.
Responsibility · 1 / 2
Which endpoint gets the data?
Provides transfer services between end systems and demultiplexes data to application endpoints. Reliability, ordering, flow control and congestion
Responsibility · 2 / 2
control depend on the protocol.
Protocols & illustrations
TCP, UDP; QUIC provides transport capabilities over UDP
Data unit
TCP segment / UDP datagram (common terms)
What to look at
Ports and transport endpoints
Troubleshooting clue
Timeouts, refused connections or TCP retransmissions: inspect listening ports, firewalls and path quality.
Keep the boundary clear · 1 / 2
Transport does not always mean reliable delivery. TCP provides a reliable ordered byte stream; UDP does not guarantee delivery, ordering or duplicate
Keep the boundary clear · 2 / 2
protection.
Responsibility
How do we cross networks?
Provides logical addressing and forwarding across networks. Routing selects a next hop as packets travel across successive links toward a destination.
Protocols & illustrations
IPv4, IPv6, ICMP; IP forwarding by routers
Data unit
IP packet (common term)
What to look at
IP addresses, subnets, routes and next hops
Troubleshooting clue
Unreachable networks or unexpected paths: inspect IP configuration, subnet masks, gateways and routing tables.
Keep the boundary clear
IP is best effort. Successful ping does not prove a TCP port or HTTP service works; failed ping may simply mean ICMP is filtered.
Responsibility
How does this hop carry a frame?
Organizes frames on a local link and handles media access, link addresses and error detection. The exact service depends on the link technology.
Protocols & illustrations
Ethernet MAC, 802.11 MAC, VLANs; layer 2 switches
Data unit
Frame (common term)
What to look at
MAC addresses / VLAN on the current link
Troubleshooting clue
Same-subnet failures, VLAN mismatches or frame-check errors: inspect neighbor tables, switch ports and link counters.
Keep the boundary clear · 1 / 2
For an off-subnet destination, the local Ethernet destination MAC normally belongs to the next-hop gateway. Routers build a new link frame for each
Keep the boundary clear · 2 / 2
outgoing hop.
Responsibility
How do bits become signals?
Defines the physical, mechanical, electrical or optical means of carrying a bit stream, including signaling, encoding and timing.
Protocols & illustrations
Copper, fiber, radio signals; PHYs and hubs
Data unit
Bit stream
What to look at
Signals, media, rates and timing
Troubleshooting clue
No link light, link flaps or a weak signal: inspect cables, transceivers, power and radio conditions.
Keep the boundary clear
Ethernet and Wi-Fi specify both physical and data-link functions; neither technology belongs exclusively to one layer.
Follow a request down the stack
A simplified HTTPS over TCP / Ethernet example. Change direction to follow reception.
At the receiver · 1 / 2
The receiver processes the outer layer first, then hands its payload upward. Data may need buffering and reassembly before the next protocol can
At the receiver · 2 / 2
consume it.
Send · encapsulate ↓ · Application side · 1 / 2
The browser creates an HTTP/1.1 request. Assume DNS resolution, the TCP connection and the TLS handshake have completed; we follow a piece of request
Send · encapsulate ↓ · Application side · 2 / 2
data.
Schematic data layout · not to scale · 1 / 1
HTTP message: GET /guide HTTP/1.1
Keep this boundary clear
The method, resource path and headers express application semantics.
Send · encapsulate ↓ · Application-side security · 1 / 2
TLS carries application data in protected records with encryption and integrity protection. This does not require separate OSI session and
Send · encapsulate ↓ · Application-side security · 2 / 2
presentation headers.
Schematic data layout · not to scale · 1 / 2
TLS record header
Schematic data layout · not to scale · 2 / 2
Protected HTTP data and authentication information
Keep this boundary clear
HTTP messages, TLS records and TCP segments do not have a one-to-one relationship.
Send · encapsulate ↓ · L4 · Transport · 1 / 2
TCP segments the byte stream and adds ports and sequence numbers. The receiver reassembles the stream; acknowledgments and retransmissions support
Send · encapsulate ↓ · L4 · Transport · 2 / 2
reliable delivery.
Schematic data layout · not to scale · 1 / 2
TCP header: ephemeral port → 443
Schematic data layout · not to scale · 2 / 2
TLS record data
Keep this boundary clear
One TLS record can span multiple TCP segments. This diagram follows one simplified fragment.
Send · encapsulate ↓ · L3 · Network
IP carries source and destination IP addresses so routers can choose a next hop. The diagram shows one IP packet carrying a TCP segment.
Schematic data layout · not to scale · 1 / 3
IP header: source IP → destination IP
Schematic data layout · not to scale · 2 / 3
TCP header
Schematic data layout · not to scale · 3 / 3
TLS record data
Keep this boundary clear
Without NAT, tunneling and similar mechanisms, endpoint IP addresses usually persist while TTL / Hop Limit decreases at each hop.
Send · encapsulate ↓ · L2 · Data Link · 1 / 2
For Ethernet, a frame header and FCS surround the IP packet. For an off-subnet destination, the destination MAC normally identifies the gateway, not
Send · encapsulate ↓ · L2 · Data Link · 2 / 2
the remote server.
Schematic data layout · not to scale · 1 / 5
Ethernet header: local MAC → gateway MAC
Schematic data layout · not to scale · 2 / 5
IP header
Schematic data layout · not to scale · 3 / 5
TCP header
Schematic data layout · not to scale · 4 / 5
TLS record data
Schematic data layout · not to scale · 5 / 5
FCS
Keep this boundary clear
A router removes the incoming link frame and creates an outgoing one. MAC addresses change with the link.
Send · encapsulate ↓ · L1 · Physical
Physical encoding turns bits into electrical, optical or radio signals. The receiver recovers the bits and processes them upward through its stack.
Schematic data layout · not to scale · 1 / 1
01001101 · 10110010 · 01101001
Keep this boundary clear
The bits are illustrative, not the real encoding of the request. Preambles, segmentation details and possible retransmissions are omitted.
One network, several useful models
A common teaching correspondence, not an exact equivalence between protocol specifications.
OSI · 7 layers
7 Application / 6 Presentation / 5 Session
TCP/IP · 4 layers: Application Teaching model · 5 layers: Application
OSI · 7 layers
4 Transport
TCP/IP · 4 layers: Transport Teaching model · 5 layers: Transport
OSI · 7 layers
3 Network
TCP/IP · 4 layers: Internet Teaching model · 5 layers: Network
OSI · 7 layers
2 Data Link
TCP/IP · 4 layers: Link Teaching model · 5 layers: Link
OSI · 7 layers
1 Physical
TCP/IP · 4 layers: Link Teaching model · 5 layers: Physical
Why the models differ · 1 / 2
The four-layer model groups link and physical functions together; the five-layer teaching model separates them. Session and representation functions
Why the models differ · 2 / 2
may live in libraries, applications or other protocols.
Use layers to narrow the search
Start with the symptom. These are clues, not proof that a failure belongs to a single layer.
Start at L1 / L2
No link at all
Check the cable, link state, radio signal and VLAN before changing application code.
Inspect L4 and policy
IP reachable, port unavailable
Check the service listener and firewall. ICMP and TCP may follow different policy rules.
Inspect application-side behavior
Connection works, request fails
Check TLS certificates, HTTP status and server logs. DNS is an application protocol even when it fails early.
Think first, then reveal the explanation.
Does HTTPS always use TCP?
Explanation · 1 / 2
No. This demonstration uses HTTPS over TCP. HTTP/3 runs over QUIC, which carries its packets in UDP datagrams and integrates TLS security. QUIC
Explanation · 2 / 2
supplies reliable streams even though UDP itself does not.
Think first, then reveal the explanation.
Which destination MAC is used to reach a remote network?
Explanation · 1 / 2
On a typical Ethernet LAN, the frame is addressed to the next-hop gateway. The IP destination still identifies the remote endpoint, subject to NAT,
Explanation · 2 / 2
tunneling and similar mechanisms.
Think first, then reveal the explanation.
Does every OSI layer add its own header?
Explanation · 1 / 2
No. Encapsulation depends on the actual protocol. TCP, IP and Ethernet have their own headers; the seven-layer model does not require seven distinct
Explanation · 2 / 2
headers.
Primary specifications
Layer responsibilities follow X.200. Internet examples are teaching comparisons based on IETF specifications.
Open specification ↗
ITU-T X.200 / ISO 7498-1 ↗
Open specification ↗
RFC 1122 · Internet host layers ↗
Open specification ↗
RFC 9293 · TCP ↗
Open specification ↗
RFC 9000 · QUIC ↗
Open specification ↗