Recall warm-up
- 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.
- 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.
- 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.
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
A layer never looks inside its payload: to it, the upper layer's header and data are just bytes to carry.
The PDU names
The unit a layer exchanges with its peer is its PDU (protocol data unit). The names are fixed exam vocabulary:
| Layer | PDU name | Header added |
|---|---|---|
| Application | message | application data (its own format) |
| Transport | segment | transport header |
| Network | packet (also called datagram) | network header |
| Data link | frame | link header and trailer |
| Physical | bits | — (signals only) |
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:
| Layer | Address in the header | Identifies | Scope |
|---|---|---|---|
| Data link | link-layer (hardware) address | a network card on this link | changes at every hop |
| Network | network-layer (logical) address | a host anywhere in the internet | stays the same end to end |
| Transport | a which-program identifier | a process on that host | end to end |
| Application | names (like a site name) | a service or user | end to end |
Which device works at which layer
A box "works at" the highest layer whose header it reads to decide what to do:
| Device | Top layer | Reads | Plain-word job |
|---|---|---|---|
| Repeater / hub | 1 Physical | nothing — signals only | regenerate and repeat bits |
| Bridge / switch | 2 Data link | link header | deliver to the right host within a LAN |
| Router | 3 Network | network header | choose the next network |
| Gateway / host | up to 7 | all headers | end systems or translators between different stacks |
A frame on the wire
Putting it together, a frame crossing one link looks like this (sizes illustrative):
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
The supplied notes include an interactive visual for this concept; this reading view preserves the surrounding explanation and sequence.
Worked Examples
Name the PDU at the transport, network and data link layers.
Show the full solution
Transport: segment. Network: packet (datagram). Data link: frame.
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 %).
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
- MCQ
The PDU of the network layer is called a:
- frame
- segment
- packet (datagram)
- message
- 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.
- MSQ
Which statements are correct?
- A switch reads the link-layer header.
- A router reads the network-layer header.
- A hub reads the network-layer header.
- The link layer usually adds a trailer as well as a header.
- MCQ
As a packet crosses three routers from source to destination, which address normally stays the same?
- The link-layer address
- The network-layer address
- Both
- Neither
- 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
- Network; transport.
- Service: what a layer does for the layer above. Protocol: rules between peer layers.
- 12,000.
Self-test answers
- C — Network layer → packet / datagram.
- A: Frame is data link.
- B: Segment is transport.
- D: Message is application.
- 1000 — 900 + 4 × 25 = 1000.
- ABD — Switch = layer 2, router = layer 3, hub = layer 1 only.
- C: A hub only repeats signals; it reads no header.
- 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.
- 0.961..0.962 — 1460 / 1518 ≈ 0.9618.
Flashcards
- PDU names top to bottom?
Reveal answer
Message, segment, packet/datagram, frame, bits. - Which layer adds a trailer?
Reveal answer
Data link. - Highest layer of a switch? a router?
Reveal answer
Switch 2, router 3. - Which address changes at every hop?
Reveal answer
The 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.