skip to content

Why does the TCP/IP model have no separate session or presentation layer, and where do those OSI functions live in practice?

level: middleimportance: should knowfreq 42%

answer

  1. RFC 1122: application layer not subdivided
  2. needs differ per application
  3. the end-to-end argument
  4. FTP restart markers, Telnet CR LF

basics

~20 s

The internet suite never split the application layer because session and presentation needs differ per application. A TCP connection supplies the conversation; each application protocol, or a library it links, handles checkpoints, data representation and encryption itself.

solid answer

~50 s

RFC 1122 says the internet suite "does not further subdivide the application layer" and that this layer essentially combines OSI's presentation and application functions. The reasoning follows the end-to-end argument in RFC 1958: functions that only the endpoints can perform correctly belong at the endpoints, and representation, dialogue and recovery rules differ for every application, so a generic layer would either do too little or impose one scheme on everyone. In practice the work is spread out: a `TCP` connection gives the ordered conversation that OSI's session layer described; checkpoint and restart live in application protocols, such as FTP's restart markers (RFC 1123 §4.1.3.4); data representation is fixed per protocol, as Telnet's `CR LF` line terminator is, or by the data format the application chooses; and encryption usually comes from TLS in a library the application links.

go deeper

for a junior

Know that TCP/IP has one application layer where OSI has three, and name one job, such as encryption or data format, that ended up inside applications.

for a middle

Explain the mechanism: TCP connections give the conversation, applications do checkpoints and representation, and the end-to-end argument is why no shared layer was built for them.

for a senior

Draw the operational consequence: a dropped TCP connection resumes nothing, so retries, idempotency and resumable transfers are the application's design problem, not the stack's.

for a principal

Weigh shared libraries against a shared layer: common session and security logic still gets centralised, but as code applications opt into rather than a mandatory protocol layer.

## What OSI layers 5 and 6 were meant to do In the seven-layer OSI reference model, two layers sit between transport (L4) and application (L7): - The **session layer (L5)** manages a dialogue between two applications: opening and closing it, deciding whose turn it is to send, and inserting **synchronization points** so that a long exchange can resume from a checkpoint instead of starting over. - The **presentation layer (L6)** handles **data representation**: agreeing on character sets, number formats and how structures are encoded. Many textbook accounts also file compression and encryption here. The idea was that these jobs are common to many applications, so they should be done once, below the application. ## What the internet suite did instead RFC 1122, which states the internet's host layering, lists four layers — link, internet, transport, application — and says of the top one: "The Internet suite does not further subdivide the application layer, although some of the Internet application layer protocols do contain some internal sub-layering." It adds that this layer "essentially combines the functions of the top two layers -- Presentation and Application -- of the OSI reference model". Notice what the RFC does *not* say: it never maps the session layer anywhere. The everyday shorthand "application = OSI L5-L7" is a convention, and it works because no internet protocol implements a session layer of its own. ## Why a separate layer never paid off 1. **The end-to-end argument.** RFC 1958 (§2.3) states that "end-to-end functions can best be realised by end-to-end protocols": a function that can only be done correctly with the knowledge of the application at the endpoints belongs there. How to encode a mail message, a file or a terminal line is exactly that kind of knowledge. 2. **One size does not fit.** A file transfer wants restartable checkpoints; an interactive terminal wants line conventions; a simple request/response exchange wants neither. A generic layer either does too little to help or forces one design on all of them. 3. **Every layer costs something.** RFC 3439 (§3, "Layering Considered Harmful") argues that layers hide information the others need and that increased layering "frequently increases complexity". A layer that every application must pass through while few need it is mostly cost. ## Where each OSI function actually lives | OSI function | Where it lives in the internet stack | Example from the specifications | |---|---|---| | Open, hold and close a conversation (L5) | The transport connection | A `TCP` connection: a reliable, ordered byte stream with its own open and close | | Checkpoint and resume (L5) | The application protocol | FTP restart markers, `110 MARK ssss = rrrr`, in RFC 1123 §4.1.3.4 | | Sessions that outlive one connection (L5) | The application | Identifiers or tokens the application carries in its own messages | | Data representation (L6) | The application protocol or its data format | Telnet chose `CR LF` as the standard network line terminator (RFC 1123) | | Encryption (often filed under L6) | A security protocol the application uses | TLS, run by a library the application links; where exactly it sits is argued elsewhere | Two consequences follow. First, a TCP connection is not a session in the OSI sense: once it is reset or closed its state is gone, and a new connection shares nothing with the old one, so any resumption is the application's job. Second, "layer 5" and "layer 6" labels on internet protocols are after-the-fact classifications, which is why engineers disagree about them. ## How to say it in an interview - Lead with the fact: the TCP/IP model has one application layer, by design (RFC 1122). - Give the reason: session and presentation needs are application-specific, and the end-to-end argument puts such functions at the endpoints. - Show where the functions went, with one concrete example each: the TCP connection, FTP restart markers, Telnet's line terminator, TLS in a library. - Close with the honest summary: OSI is the reference vocabulary, TCP/IP is what shipped, and the missing layers are a design choice, not an oversight.

  • If TCP provides the conversation, why is a TCP connection still not an OSI-style session?
    An OSI session was meant to survive disruptions through synchronization points and resume from a checkpoint. A TCP connection has no such mechanism: once it is reset or closed its state is gone, and a new connection shares nothing with the old one. Resuming a transfer, re-authenticating or replaying a request is therefore the application's job; FTP's restart markers are one specified example.
  • Does an undivided TCP/IP application layer mean application protocols have no internal layers?
    No. RFC 1122 says the suite does not subdivide the application layer, 'although some of the Internet application layer protocols do contain some internal sub-layering'. An application can run its messages over a security protocol, or put a framing scheme under its semantics. The point is only that the internet architecture does not mandate those sub-layers for everyone.

saying these in an interview costs you the question

  • TCP/IP dropped session and presentation because nobody needed those functions.
  • TCP resumes a broken connection from the last acknowledged byte, so it is the session layer.
  • Every TCP/IP host runs a hidden presentation protocol between TCP and the application.
  • An undivided application layer means application protocols have no internal structure.