Recall warm-up
- 5 senders each speak with probability 0.2. P(exactly one)?
Stuck? Peek at 0.2.4 Exponents, logarithms and basic probability
- 2ᵃ·2ᵇ = 2ᵃ⁺ᵇ; 2¹⁰ ≈ 10³ (estimates only).
- log₂ x = power of 2 giving x; bits for N values = ⌈log₂ N⌉.
- P(none) = (1−p)ⁿ · P(≥ 1) = 1 − (1−p)ⁿ · P(exactly 1) = n·p·(1−p)ⁿ⁻¹.
- (1 − 1/n)ⁿ → 1/e ≈ 0.368; 1/(2e) ≈ 0.184.
- 1 + 2 + … + 2ᵏ⁻¹ = 2ᵏ − 1; expected tries = 1/p.
- 1 Mbps is how many bits per second, exactly?
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.
- Where does the meaning of bits come from?
Stuck? Peek at 0.1.1 Why networks exist: hosts, links and sending data
- Network = devices + links that exchange data.
- Host = where a message starts or ends (laptop, phone, server).
- Link = physical path: copper (voltage), fibre (light), wireless (radio).
- All content → bits → signals → bits → content; meaning comes from an agreed encoding.
- One link per pair of n hosts: n(n − 1)/2 links — too many, so links are shared.
The Hook
Sending a letter abroad involves you (writing), the post office (sorting and stamping), the airline (flying bags), customs, and a postman at the other end. You never talk to the airline, and the pilot never reads your letter. Each party does one job and trusts the next one. Networks are built exactly like this: as a stack of layers, each doing one job for the layer above it.
Predict First
A company replaces copper cables with optical fibre. Should the e-mail program on your laptop need to change? Guess yes or no, and why.
,No. The e-mail program only talks to the layer directly beneath it through a fixed set of requests ("send these bits to that machine"). How the bits travel — copper or light — is hidden inside lower layers. Hiding changes behind a fixed boundary is the whole point of layering.
Core Concept
The problem: one giant job
Getting a message from your laptop to a server involves turning it into bits, carrying bits across a wire, choosing a route through many networks, putting chunks back in order, and handing the result to the right program. Writing that as one huge piece of software would be impossible to build, test or upgrade. So engineers split it into layers, each solving one part of the problem.
Protocol
This gives a name to the "agreed rules" from Lesson 0.1.1. Every layer has its own protocol, spoken only with its peer layer on the other machine.
Service and interface
- A layer offers a service to the layer above: "give me data and an address; I will deliver it".
- The interface is the exact set of requests the upper layer may make of the lower one at that boundary.
Rule of thumb: service = what a layer does for the layer above; protocol = how it does it with its peer; interface = where and through which calls the two adjacent layers meet.
| Term | Between | Question it answers |
|---|---|---|
| Service | layer n → layer n + 1 (same machine) | What do you do for me? |
| Interface | boundary between layers n and n + 1 | How do I ask you? |
| Protocol | layer n ↔ layer n on another machine | How do peers cooperate? |
Peer-to-peer (logical) vs actual flow
Each layer behaves as if it talks directly to its peer: the sender's layer 4 "talks to" the receiver's layer 4. That is logical (peer-to-peer) communication. In reality, data moves down the stack on the sender, across the physical link, and up the stack on the receiver. Only the bottom layer actually touches the wire.
Why layering wins (and what it costs)
- Modularity: change one layer (copper → fibre) without touching the others.
- Reuse: many programs share the same lower layers.
- Simpler design and testing: each layer is a small problem.
Cost: each layer adds its own bookkeeping (extra bits on every message) and some duplicated work. We measure that overhead in Lesson 1.1.3.
Putting it together
- Big job → stack of layers, each with one responsibility.
- Peers share a protocol; neighbours share an interface; a layer offers a service upward.
- Communication between peers is logical; actual data goes down, across, and up.
Visual
| Sender machine | Receiver machine | ||
|---|---|---|---|
| Layer 3 | L3 | ⟷ protocol 3 ⟷ | L3 |
| ↓ interface | ↑ interface | ||
| Layer 2 | L2 | ⟷ protocol 2 ⟷ | L2 |
| ↓ interface | ↑ interface | ||
| Layer 1 | L1 | ═══ physical link ═══ | L1 |
Worked Examples
Classify each as service, interface or protocol: (a) "Layer 2 promises to deliver data to the next machine." (b) "Two layer-2 peers agree that every unit starts with a special start pattern." (c) "Layer 3 calls the function send(data, next_machine) of layer 2."
Show the full solution
(a) Service — what layer 2 does for layer 3. (b) Protocol — rules between peers. (c) Interface — the call through which layer 3 asks layer 2.
A university upgrades every link from copper to fibre. Which parts must change: the lowest layer, the programs on laptops, both?
Show the full solution
Only the lowest layer (and its peer on each neighbouring machine) changes, because only it touches the medium. The interface it offers upward stays the same, so every layer above — and every program — is untouched. That is the modularity benefit.
Which statements are correct? (i) Peers on different machines communicate directly through their own protocol over a direct physical path. (ii) A layer's service is defined independently of how its protocol works. (iii) Two adjacent layers on the same machine use a protocol to talk to each other.
Show the full solution
(i) False — peer communication is logical; the real path goes down, across the link, and up. (ii) True — the service says what, the protocol says how; the protocol can be replaced without changing the service. (iii) False — adjacent layers on one machine meet at an interface, not a protocol.
GATE Traps
- Protocol and service are not synonyms: the service is the promise upward; the protocol is the method between peers.
- Peer-to-peer communication in layering is logical; only the bottom layer actually sends signals.
- Layering is not free — every layer adds bookkeeping bits to each message.
Memory Hook
"Service is the menu, interface is the waiter, protocol is the recipe the two kitchens share."
Connect the Dots
Phase 0 said bits only make sense through agreed rules; now those rules are protocols, organised in layers. Next (1.1.2): how many layers do real networks use, and which job sits in which layer?
Self-Test
- MCQ
Rules followed by two peer layers on different machines are called:
- an interface
- a service
- a protocol
- a topology
- MSQ
Which are benefits of layering?
- A layer can be changed without changing the others.
- Messages get shorter.
- Design and testing become simpler.
- Many programs can share the same lower layers.
- MCQ
Layer 3 asks layer 2 to send data by calling a fixed set of operations. That set is the:
- protocol of layer 2
- interface between layers 2 and 3
- peer of layer 3
- physical link
- MCQ
In the layered model, which layer actually transmits signals on the medium?
- Every layer
- Only the top layer
- Only the bottom layer
- Only the middle layer
Rule Card
- 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.
Concept Ledger
- layer
- protocol
- peer
- service
- interface
- logical (peer-to-peer) vs actual flow
Answer Vault
Try the questions first. Open when you are ready to check.
Warm-up answers
- 5 × 0.2 × 0.8⁴ = 0.4096.
- 10⁶.
- From rules (an encoding) agreed in advance by sender and receiver.
Self-test answers
- C — Peers on different machines follow a protocol.
- A: An interface is between adjacent layers on one machine.
- B: A service is what a layer offers to the layer above.
- D: Topology is the shape of the network.
- ACD — Modularity, simplicity and reuse.
- B: Each layer adds bookkeeping bits, so messages get longer, not shorter.
- B — The calls at the boundary of two adjacent layers form the interface.
- A: A protocol is between peers on different machines.
- C: A peer is the same layer on another machine.
- D: The physical link is below layer 1's job.
- C — Higher layers communicate logically; only the bottom layer touches the medium.
- A: Higher layers pass data down; they do not drive the wire.
- B: The top layer is the furthest from the wire.
- D: Middle layers also pass data down.
Flashcards
- Protocol vs interface?
Reveal answer
Protocol: between peers on different machines. Interface: between adjacent layers on the same machine. - Service?
Reveal answer
What a layer promises to do for the layer above. - Which layer touches the medium?
Reveal answer
Only the bottom (physical) layer.
Exam shortcuts
- "Between" test: same machine, neighbouring layers → interface/service. Same layer, different machines → protocol. — any question that asks which term applies to an interaction.