CS Atlas GATE 2027
Computer Networks course
0 / 90 complete

Computer Networks/Phase 1 · Layering, Switching & Performance

Lesson 1.1.2 · Item 11 of 90

The OSI 7 layers and the TCP/IP model

Read at your own pace. Try the questions before opening the answers.

On this page

Recall warm-up

  1. Same layer on two machines follows a ___; neighbouring layers on one machine meet at an ___.
    Stuck? Peek at 1.1.1 Why layer: protocol, service, interface, peers
    • Layer: one job in the stack; serves the layer above, uses the layer below.
    • Protocol: rules between peers (same layer, different machines): format, meaning, behaviour.
    • Service: what a layer does for the layer above. Interface: how the layer above asks for it.
    • Peer talk is logical; the real path is down → link → up.
    • Layering = modularity + reuse − some overhead.

    Read lesson 1.1.1

  2. 1's complement of 10110011?
    Stuck? Peek at 0.2.3 XOR, 1's complement addition and modulo-2 division
    • AND (mask), OR, NOT (flip), XOR (1 where bits differ).
    • a ⊕ a = 0, a ⊕ 0 = a, (a ⊕ k) ⊕ k = a.
    • 1's complement = flip all bits; 1's-complement addition wraps the end carry back in.
    • Modulo-2: + = − = XOR, no carries; bits ↔ polynomial.
    • Mod-2 division: leading 1 → XOR divisor; leading 0 → XOR zeros; remainder = (divisor length − 1) bits.

    Read lesson 0.2.3

  3. Hub, switch, router — which one joins different networks?
    Stuck? Peek at 0.1.2 Nodes, links, topologies, LAN/WAN and the boxes in the middle
    • Node = any device; host = node where messages start/end.
    • Point-to-point (2 nodes) vs broadcast (all hear all).
    • Simplex (one way) · half-duplex (two ways, one at a time) · full-duplex (both at once).
    • Links: mesh n(n−1)/2, star n, ring n, tree n−1, bus 1 backbone.
    • LAN (building) ⊂ WAN (cities) ⊂ the Internet (network of networks).
    • Hub repeats to all · switch delivers within a LAN · router picks the next network.

    Read lesson 0.1.2

The Hook

In the 1970s every company built its own incompatible network stack. The international standards body (ISO) answered with a reference model of seven layers: OSI. Meanwhile the Internet grew on a leaner stack named after its two best-known protocols, TCP/IP. GATE asks about both — which layer does what, and how the two models line up.

Predict First

Put these jobs in order from the wire upwards: (1) choose a route across many networks; (2) turn bits into signals; (3) deliver to the right program on a host; (4) move data to the next directly connected box.

,

2 → 4 → 1 → 3: physical (signals), data link (next box), network (route across networks), transport (right program, end to end). The application sits above them.

Core Concept

The seven OSI layers

From the wire up (mnemonic bottom-up: Please Do Not Throw Sausage Pizza Away):

7 Applicationservices for user programs (e-mail, web)
6 Presentationdata format: encoding, compression, encryption
5 Sessiondialogues: start, checkpoint, end a conversation
4 Transportprocess-to-process delivery, end to end
3 Networkroute across many networks, end-system addressing
2 Data linkhop to hop: deliver to the next directly connected node
1 Physicalbits → signals on the medium
OSI reference model. Layers 1–3 work hop by hop; layers 4–7 are end to end (only the two hosts run them).

Responsibility of each layer

  • Physical: bit-level signalling, voltages, cables, connectors, bit rate.
  • Data link: delivery between neighbouring nodes on one link, detecting damaged bits, deciding who uses a shared link.
  • Network: delivery from the source host to the destination host across many links, choosing routes.
  • Transport: delivery from a process (a running program) on one host to a process on the other; reliability and pacing end to end.
  • Session: opening, synchronising and closing a dialogue.
  • Presentation: translating formats, compression, encryption.
  • Application: the services programs use directly.
LayerScopeKey question it answers
Physicalone linkHow is a 1 sent?
Data linkone hopWhich neighbour gets it, and was it damaged?
Networkhost to hostWhich way across the networks?
Transportprocess to processWhich program, and did all of it arrive?
SessiondialogueWhere is the conversation up to?
Presentationdata formHow is it encoded?
Applicationuser serviceWhat does the user want?
One question per layer.

Hop-to-hop vs end-to-end

Layers 1–3 run on every node along the path, including routers in the middle: they work hop by hop. Layers 4–7 run only on the two end hosts: they work end to end. This is why a router cares about the network layer but never looks at the transport layer's business.

Host ARouterRouterHost B
7–4✓✓
3✓✓✓✓
2✓✓✓✓
1✓✓✓✓
Routers implement only layers 1–3; hosts implement all layers.

The TCP/IP (Internet) model

The Internet's practical stack has 5 layers in most textbooks (some count 4 by merging physical and data link into one "link" layer):

OSITCP/IP (5-layer)Notes
Application, Presentation, SessionApplicationthe top three OSI layers merge
TransportTransportsame job
NetworkNetwork (Internet)same job
Data linkData linksame job
PhysicalPhysicalsame job
Session and presentation duties are handled inside applications in the Internet model.

Why two models?

OSI is a clean reference for naming and teaching layers; TCP/IP is what the Internet actually runs. The name "TCP/IP" comes from two protocols you meet in Phases 3 and 4; for now it is just the model's name.

Textbooks differ on 4 vs 5 layers for TCP/IP. GATE questions mostly use the 5-layer version (application, transport, network, data link, physical). If a question says "4-layer TCP/IP", the bottom two are merged into one link layer.
OSI (7)
reference model, precise vocabulary
TCP/IP (5)
what the Internet runs
Learn the OSI names; know which ones TCP/IP merges.

Putting it together

  • OSI has 7 layers; TCP/IP has 5 (top three OSI layers merged into application).
  • Layers 1–3 are hop by hop and run on routers; 4–7 are end to end and run only on hosts.
  • Transport = process to process; network = host to host; data link = hop to hop.

Visual

#OSI layerTCP/IP layerRuns on routers?
7ApplicationApplicationno
6PresentationApplicationno
5SessionApplicationno
4TransportTransportno
3NetworkNetworkyes
2Data linkData linkyes
1PhysicalPhysicalyes
The one table to remember: OSI numbers, the TCP/IP merge, and which layers routers implement.

Worked Examples

Easy

Which OSI layer: (a) compresses and encrypts data; (b) decides the route between two cities' networks; (c) specifies the voltage for a 1?

Show the full solution

(a) Presentation (6). (b) Network (3). (c) Physical (1).

Medium

Which OSI layers are implemented by a router in the middle of the path, and which only by the two hosts?

Show the full solution

Router: physical, data link, network (1–3). Hosts only: transport, session, presentation, application (4–7), because these are end-to-end jobs.

GATE

Match: (P) process-to-process delivery, (Q) hop-to-hop delivery, (R) host-to-host delivery across networks, (S) dialogue control — with (1) data link, (2) session, (3) transport, (4) network.

Show the full solution

P → 3 (transport), Q → 1 (data link), R → 4 (network), S → 2 (session). Answer: P-3, Q-1, R-4, S-2.

GATE Traps

  • Process-to-process is transport, host-to-host is network — GATE swaps them in options.
  • Encryption and compression are presentation in OSI, not application.
  • TCP/IP folds session and presentation into the application layer — they do not disappear, they move into programs.
  • "Data link = hop to hop", not end to end.

Memory Hook

"Please Do Not Throw Sausage Pizza Away" = Physical, Data link, Network, Transport, Session, Presentation, Application (bottom to top).

Connect the Dots

We know which layer does what. Next (1.1.3): when a message moves down the stack, each layer adds its own bookkeeping to it — what does the message look like on the wire, what is each layer's unit called, and which boxes look at which part?

Self-Test

  1. MCQ

    Process-to-process delivery is the responsibility of the:

    1. network layer
    2. transport layer
    3. data link layer
    4. session layer
  2. MSQ

    Which OSI layers does a router implement?

    1. Physical
    2. Data link
    3. Network
    4. Transport
  3. MCQ

    In the 5-layer TCP/IP model, OSI's session and presentation duties belong to the:

    1. transport layer
    2. application layer
    3. network layer
    4. data link layer
  4. MCQ

    Encryption of data in the OSI model belongs to:

    1. Application
    2. Session
    3. Presentation
    4. Transport
  5. NAT

    How many OSI layers run only on end hosts (not on routers)?

    Write your answer before opening the key.

Rule Card

  • OSI bottom-up: Physical, Data link, Network, Transport, Session, Presentation, Application.
  • Scope: link → hop → host-to-host → process-to-process.
  • Routers: layers 1–3; hosts: 1–7.
  • TCP/IP (5): application (= OSI 5–7), transport, network, data link, physical.
  • Encryption/compression = presentation; dialogue control = session.

Concept Ledger

  • OSI model (7 layers)
  • physical / data link / network / transport / session / presentation / application layers
  • TCP/IP (Internet) model, 5 layers
  • process (a running program)
  • hop-to-hop vs end-to-end

Answer Vault

Try the questions first. Open when you are ready to check.

Warm-up answers

  1. Protocol; interface.
  2. 01001100.
  3. The router.

Self-test answers

  1. B — Transport delivers from a process on one host to a process on another.
    • A: Network is host to host.
    • C: Data link is hop to hop.
    • D: Session controls dialogues, not delivery.
  2. ABC — A router works hop by hop: layers 1–3.
    • D: Transport is end to end, run only by hosts.
  3. B — The top three OSI layers merge into the application layer.
    • A: Transport keeps only its OSI job.
    • C: Network keeps only routing/host delivery.
    • D: Data link is far below.
  4. C — Format, compression and encryption are presentation-layer duties.
    • A: A common trap; OSI puts encryption one layer lower, in presentation.
    • B: Session manages dialogues.
    • D: Transport delivers between processes.
  5. 4 — Layers 4, 5, 6, 7.

Flashcards

  1. OSI layers bottom-up?
    Reveal answerPhysical, Data link, Network, Transport, Session, Presentation, Application.
  2. Host-to-host vs process-to-process?
    Reveal answerNetwork vs transport.
  3. Layers on a router?
    Reveal answer1–3.
  4. Where does encryption sit in OSI?
    Reveal answerPresentation (6).

Exam shortcuts

  • Scope ladder: link (physical) → hop (data link) → host-to-host (network) → process-to-process (transport). — deciding which of layers 1–4 a delivery job belongs to.
  • Routers = layers 1–3; hosts = all layers. — classic middle-of-path questions (bridges/switches stop at 2, repeaters at 1 — next lesson).

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.