skip to content

What are the four layers of the TCP/IP model, and which OSI layers does each one correspond to?

level: juniorimportance: must knowfreq 72%

answer

  1. RFC 1122 host layers
  2. bottom layer: one directly connected network
  3. IP fills the whole middle
  4. top layer is never subdivided

basics

~10 s

RFC 1122 names four TCP/IP layers: link (OSI L1-L2, one directly connected network), internet (L3, IP across networks), transport (L4, TCP and UDP between applications) and application (conventionally L5-L7).

solid answer

~40 s

The TCP/IP model, as RFC 1122 lays out host requirements, has four layers. The **link** layer moves frames across one directly connected network and conventionally covers OSI layers 1 and 2. The **internet** layer is `IP` (with `ICMP` and `IGMP` beside it): a connectionless datagram service that addresses hosts and carries packets across many networks, OSI layer 3. The **transport** layer gives applications end-to-end communication, `TCP` reliable and ordered, `UDP` connectionless, OSI layer 4. The **application** layer is everything above: RFC 1122 says the internet suite does not subdivide it, so the conventional mapping puts OSI layers 5 to 7 there. The middle pairings are exact; the edges are convention, because the two models were designed separately.

go deeper

for a junior

Recall the four names bottom-up — link, internet, transport, application — one protocol for each, and the OSI numbers each one sits against.

for a middle

Explain each layer's job: link for one network, IP for best-effort host-to-host delivery, transport for application-to-application with TCP adding reliability, and why the top layer absorbs OSI's upper layers.

for a senior

Show that the mapping is convention at the edges: RFC 1122 defines no physical layer and names only presentation and application as absorbed, so treat layer numbers as vocabulary, not law.

for a principal

Treat the models as shared language across teams: ask for the function to be named (framing, addressing, reliability) whenever a bare layer number could mean different things to different people.

## The four layers, as RFC 1122 names them RFC 1122, *Requirements for Internet Hosts -- Communication Layers* (October 1989), is the document that states the internet's own layering. It says a host "must implement the layered set of protocols comprising the Internet protocol suite" and lists four layers, top to bottom: **application**, **transport**, **internet** and **link**. RFC 1122 itself covers link, internet and transport; its companion, RFC 1123, covers the application and support protocols. The **OSI reference model** is the seven-layer model from the ISO standards effort: physical (L1), data link (L2), network (L3), transport (L4), session (L5), presentation (L6) and application (L7). It supplies the layer numbers most engineers speak in. Mapping one model onto the other is approximate, because the two were designed separately, but the conventional mapping is well settled: | TCP/IP layer (RFC 1122) | Its job | Conventional OSI equivalent | Protocols RFC 1122 discusses | |---|---|---|---| | Application | Everything the program actually speaks | L5-L7 | Telnet, FTP, SMTP; support protocols such as DNS and SNMP | | Transport | End-to-end communication between applications on two hosts | L4 | `TCP`, `UDP` | | Internet | Carrying datagrams from source host to destination host across many networks | L3 | `IP`, with `ICMP` and `IGMP` | | Link | Talking to the one directly connected network | L1-L2 | many link protocols, e.g. Ethernet | ## What each layer does - **Link layer.** RFC 1122 describes it as the protocol a host uses "to interface to" its directly connected network, "a link layer or media-access layer protocol". It moves a unit across one network, not across the internet. OSI splits this job into a physical layer (signals on the medium) and a data link layer (framing and local addressing); TCP/IP does not. - **Internet layer.** IP is "a connectionless or datagram internetwork service, providing no end-to-end delivery guarantees": datagrams may arrive damaged, duplicated, out of order or not at all. IP provides addressing and gets packets from network to network. RFC 1122 treats `ICMP` as an integral part of IP even though ICMP messages are carried inside IP. - **Transport layer.** It "provides end-to-end communication services for applications". RFC 1122 names two primary protocols: `TCP`, a reliable connection-oriented service with resequencing and flow control, and `UDP`, a connectionless datagram service. Reliability lives here, at the endpoints, because the layer below promises none. - **Application layer.** The top of the suite. RFC 1122 says the internet suite "does not further subdivide the application layer", although some application protocols have internal sub-layering of their own. ## Where the mapping is fuzzy Two edges of the table are conventions rather than statements from the RFC: 1. **The bottom.** RFC 1122 defines no physical layer. Its link layer is whatever the attached network requires, so "link = OSI L1 + L2" is a useful convention the RFC never states. 2. **The top.** RFC 1122's own text says the internet application layer "essentially combines the functions of the top two layers -- Presentation and Application -- of the OSI reference model". It does not name the session layer. The everyday "application = L5-L7" still holds up because no internet protocol implements a session layer: part of that role (a conversation that opens and closes) is what a TCP connection gives, and the rest (checkpoints, resumption) is done by applications. The middle is the tight part: internet with L3 and transport with L4 are the pairings nobody disputes. RFC 1122 even notes that internet IP was the model for OSI's Connectionless Network Protocol. ## Mistakes that cost points - Listing five layers and calling them "the TCP/IP model" — the physical/data-link split is a textbook hybrid, not RFC 1122. - Placing `TCP` in the internet layer because it "handles the network". - Saying the transport layer delivers host to host. That is the internet layer's job; transport delivers application to application, and ports pick the application. - Presenting the mapping as exact. It is a correspondence between two independently designed models. ## A compact interview answer 1. Name the four layers bottom-up: link, internet, transport, application. 2. Give each one's job in a phrase and one protocol as an example. 3. Map them: link to L1-L2, internet to L3, transport to L4, application to L5-L7. 4. Add the honest caveat: OSI is the reference vocabulary, TCP/IP is what shipped, and the edges of the mapping are convention.

  • Why does reliable delivery sit at the TCP/IP transport layer rather than the internet layer?
    RFC 1122 defines IP as a connectionless datagram service with no end-to-end delivery guarantees: datagrams may be lost, duplicated, damaged or reordered, and the layers above IP are responsible for reliability when it is required. TCP supplies it end to end; UDP deliberately does not, so applications that prefer timeliness over retransmission can skip it.
  • Which OSI layers does RFC 1122 itself say the internet application layer combines?
    RFC 1122 says the application layer 'essentially combines' the functions of OSI's presentation and application layers; it does not mention the session layer. The everyday 'application = L5-L7' mapping is still reasonable, because no internet protocol implements a session layer: TCP connections and the applications themselves cover that role.

saying these in an interview costs you the question

  • TCP/IP has five layers: physical, data link, network, transport, application.
  • TCP belongs to the internet layer because it moves data across the network.
  • The transport layer routes packets between networks.
  • The TCP/IP application layer corresponds to OSI layer 7 only.
  • The OSI and TCP/IP models line up exactly, layer for layer.