CS Atlas GATE 2027
Computer Networks course
0 / 90 complete

Computer Networks/Phase 1 · Layering, Switching & Performance

Lesson 1.1.3 · Item 12 of 90

Encapsulation, headers, PDU names, addresses and devices per layer

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

On this page

Recall warm-up

  1. Which OSI layer is host-to-host? Which is process-to-process?
    Stuck? Peek at 1.1.2 The OSI 7 layers and the TCP/IP model
    • 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.

    Read lesson 1.1.2

  2. Service vs protocol in one line each?
    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

  3. Bits in 1500 bytes?
    Stuck? Peek at 0.2.1 Bits, bytes and prefixes: powers of 10 for rates, powers of 2 for sizes
    • 1 B = 8 b. Lower-case b = bit, upper-case B = byte.
    • Rates: k = 10³, M = 10⁶, G = 10⁹ (bps).
    • Sizes: K = 2¹⁰, M = 2²⁰, G = 2³⁰ (bytes) — unless the question says 1000.
    • Time to push out = (size in bits) ÷ (rate in bit/s).
    • ms = 10⁻³ s, µs = 10⁻⁶ s, ns = 10⁻⁹ s.

    Read lesson 0.2.1

The Hook

Put a letter in an envelope, put that envelope in a courier pouch, put the pouch in a mail bag on a truck. Each wrapper carries the address its handler needs — the truck driver reads only the bag label, never your letter. A message moving down a network stack is wrapped the same way, once per layer. GATE expects you to name each wrapping, size it, and say which box reads which label.

Predict First

A 500-byte message passes down through 5 layers and each adds 20 bytes of its own information. How big is it on the wire, and what fraction is your actual message?

,

500 + 5 × 20 = 600 bytes; your message is 500/600 ≈ 83.3 % of what is sent. The rest is per-layer bookkeeping called headers.

Core Concept

Encapsulation and decapsulation

Encapsulation: each layer takes the unit from the layer above as its payload and adds its own control information — a header in front (and sometimes a trailer at the end). Decapsulation: the receiver's layers strip these in reverse order.

A layer never looks inside its payload: to it, the upper layer's header and data are just bytes to carry.

Data link unit link header + … + link trailer
Network unit network header + …
Transport unit transport header + …
Application message your data
Wrappers nest: the outermost wrapper is the last one added and the first one removed.

The PDU names

The unit a layer exchanges with its peer is its PDU (protocol data unit). The names are fixed exam vocabulary:

LayerPDU nameHeader added
Applicationmessageapplication data (its own format)
Transportsegmenttransport header
Networkpacket (also called datagram)network header
Data linkframelink header and trailer
Physicalbits— (signals only)
Message → segment → packet/datagram → frame → bits. Only the data link layer typically adds a trailer as well as a header.

What a header carries

A header holds what the peer needs to do its job: addresses, lengths, sequence or type information, and check values. Each layer's header carries its own kind of address:

LayerAddress in the headerIdentifiesScope
Data linklink-layer (hardware) addressa network card on this linkchanges at every hop
Networknetwork-layer (logical) addressa host anywhere in the internetstays the same end to end
Transporta which-program identifiera process on that hostend to end
Applicationnames (like a site name)a service or userend to end
The precise names of these addresses arrive in Phases 2, 3 and 4. Key idea now: link addresses change hop by hop; network addresses stay fixed from source to destination.

Which device works at which layer

A box "works at" the highest layer whose header it reads to decide what to do:

DeviceTop layerReadsPlain-word job
Repeater / hub1 Physicalnothing — signals onlyregenerate and repeat bits
Bridge / switch2 Data linklink headerdeliver to the right host within a LAN
Router3 Networknetwork headerchoose the next network
Gateway / hostup to 7all headersend systems or translators between different stacks
Each step up the table reads one more wrapper. Higher-layer devices also implement every layer below.

A frame on the wire

Putting it together, a frame crossing one link looks like this (sizes illustrative):

048162453
link hdr14 bits
net hdr20 bits
trans hdr20 bits
application data50 bits
link trailer4 bits
Byte boxes of one frame: link header, network header, transport header, data, link trailer (widths not to scale).

Putting it together

  • Each layer wraps the unit from above with its own header (data link adds a trailer too).
  • PDUs: message, segment, packet/datagram, frame, bits.
  • A device works at the highest layer whose header it reads: hub 1, switch 2, router 3.

Visual

Worked visual sequence

The supplied notes include an interactive visual for this concept; this reading view preserves the surrounding explanation and sequence.

Encapsulation on the way down, decapsulation on the way up.

Worked Examples

Easy

Name the PDU at the transport, network and data link layers.

Show the full solution

Transport: segment. Network: packet (datagram). Data link: frame.

Medium

A 500-byte message passes down 5 layers; each adds a 20-byte header. What size leaves the bottom, and what fraction is the original message?

Show the full solution

500 + 5 × 20 = 600 bytes. Fraction = 500/600 = 0.8333 (83.33 %).

GATE

A 1000-byte application message gets a 20-byte transport header, a 20-byte network header, and an 18-byte link header plus a 4-byte link trailer. What fraction of the bits on the wire is application data (4 decimals)? What fraction is overhead?

Show the full solution

Total = 1000 + 20 + 20 + 18 + 4 = 1062 bytes.

Data fraction = 1000/1062 = 0.9416. Overhead = 62/1062 = 0.0584.

GATE Traps

  • The data link layer adds a trailer too; the other layers add only headers.
  • "Packet" and "datagram" both name the network-layer PDU; "segment" is transport; "frame" is data link.
  • Link-layer addresses change at every hop; network-layer addresses stay the same from source to destination.
  • A switch reads only the link header — it never decides routes between networks.

Memory Hook

"My Sister Pours Fizzy Bubbles": Message, Segment, Packet, Frame, Bits — top to bottom.

Connect the Dots

We can now describe our message on the wire as a frame wrapping a packet wrapping a segment wrapping a message. Next (Ch 1.2): between our laptop and the server there are many routers — does the network reserve a whole path for us in advance like a phone call, or do our packets find their own way?

Self-Test

  1. MCQ

    The PDU of the network layer is called a:

    1. frame
    2. segment
    3. packet (datagram)
    4. message
  2. NAT

    A 900-byte message passes down 4 layers, each adding a 25-byte header. Total bytes sent?

    Write your answer before opening the key.

  3. MSQ

    Which statements are correct?

    1. A switch reads the link-layer header.
    2. A router reads the network-layer header.
    3. A hub reads the network-layer header.
    4. The link layer usually adds a trailer as well as a header.
  4. MCQ

    As a packet crosses three routers from source to destination, which address normally stays the same?

    1. The link-layer address
    2. The network-layer address
    3. Both
    4. Neither
  5. NAT

    Data 1460 B, headers 20 B + 20 B + 14 B, trailer 4 B. Fraction of the frame that is data (3 decimals)?

    Write your answer before opening the key.

Rule Card

  • Encapsulation: payload + header (+ trailer at data link); decapsulation in reverse.
  • PDUs: message (app) → segment (transport) → packet/datagram (network) → frame (data link) → bits.
  • Addresses: link (per hop, changes) · network (end to end, fixed) · which-program id · names.
  • Devices: hub/repeater 1 · bridge/switch 2 · router 3 · gateway/host up to 7.
  • Efficiency = data / (data + all headers + trailer).

Concept Ledger

  • encapsulation / decapsulation
  • header, trailer, payload
  • PDU
  • message (application PDU)
  • segment (transport PDU)
  • packet / datagram (network PDU)
  • frame (data link PDU)
  • link-layer address (changes per hop)
  • network-layer address (end to end)
  • repeater, bridge, gateway (device layers)

Answer Vault

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

Warm-up answers

  1. Network; transport.
  2. Service: what a layer does for the layer above. Protocol: rules between peer layers.
  3. 12,000.

Self-test answers

  1. C — Network layer → packet / datagram.
    • A: Frame is data link.
    • B: Segment is transport.
    • D: Message is application.
  2. 1000 — 900 + 4 × 25 = 1000.
  3. ABD — Switch = layer 2, router = layer 3, hub = layer 1 only.
    • C: A hub only repeats signals; it reads no header.
  4. B — Network addresses identify the end hosts; link addresses identify the current hop's neighbours and change each hop.
    • A: Link addresses change at every hop.
    • C: Only the network address is end to end.
    • D: The network address is constant.
  5. 0.961..0.962 — 1460 / 1518 ≈ 0.9618.

Flashcards

  1. PDU names top to bottom?
    Reveal answerMessage, segment, packet/datagram, frame, bits.
  2. Which layer adds a trailer?
    Reveal answerData link.
  3. Highest layer of a switch? a router?
    Reveal answerSwitch 2, router 3.
  4. Which address changes at every hop?
    Reveal answerThe link-layer address.

Exam shortcuts

  • Efficiency after encapsulation = data / (data + Σ headers + trailers). — one message carried in one unit at each layer (no splitting into smaller pieces).
  • Device layer = highest header it must read: hub 1, switch 2, router 3. — classic device-to-layer matching questions.

Ready for the next idea?

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