At which OSI layer does TLS work?
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
HTTP request plain text, written by the browser
|
TLS encrypts it into records
|
TCP splits into segments, delivers reliably
|
IP / Ethernet packets and framesA 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.