Interview Q&A / Computer Networks

IntermediateQuick answer1 min readUpdated 3 Oct 2026

At which OSI layer does TLS work?

SHORT ANSWER

TLS has no clean place in OSI. It runs on top of TCP and below HTTP, so it is usually described as layer 6 (presentation) or between layers 4 and 7. In the TCP/IP model it simply sits inside the application layer.

Explain it simply

The OSI model was drawn before TLS existed, so TLS is like a lockbox you bolt onto a delivery van after the van's route is already planned. It does not move data (that is TCP's job) and it is not the web page itself (that is HTTP). It sits between them and scrambles whatever HTTP hands over.

Example

text
HTTP request         plain text, written by the browser
   |
TLS                  encrypts it into records
   |
TCP                  splits into segments, delivers reliably
   |
IP / Ethernet        packets and frames

A packet capture of an HTTPS visit shows readable Ethernet, IP and TCP headers, but the payload is unreadable. That shows TLS wraps the application data and nothing below it. Encryption and encoding are presentation-layer jobs in OSI, which is why textbooks put TLS at layer 6.

What to say in the interview

"TLS is not strictly in OSI. It is commonly mapped to layer 6 because it encrypts, but in practice it runs over TCP and under HTTP. The honest answer is that OSI is a reference model and real protocols like TLS and QUIC straddle layers." Saying that shows you understand the model is a teaching tool.

Common mistakes

  • Answering with one confident layer number as if it were official.

#tls#osi#layers

Related questions

Practise more Computer Networks questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Computer Networks quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.