optional · CSS study notes
OSI Model
🧭
On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks
OSI Layer: Foundations & Models (reference model for every layer below)
1. 📖 Definition
The OSI (Open Systems Interconnection) model is a 7-layer conceptual framework standardised by ISO (1984) that divides network communication into functionally independent layers, each serving the layer above and using services of the layer below.
2. 🧱 Why Layering?
- Modularity — a layer can be redesigned without disturbing others
- Interoperability — vendors implement layers to a common standard
- Abstraction — each layer hides its internal complexity from neighbours
- Troubleshooting — faults isolated to a specific layer
- Peer-to-peer communication — layer n on the sender logically talks to layer n on the receiver
3. 🗂️ The Seven Layers (bottom-up)
3.1 Physical Layer
- Transmits raw bits over the medium
- Defines voltage levels, pin layout, connectors, data rate, transmission mode (simplex/half-duplex/full-duplex)
- Data unit: bit | Devices: repeater, hub, cables
3.2 Data Link Layer
- Node-to-node delivery on the same network
- Framing, physical (MAC) addressing, error detection (CRC), flow control, access control (CSMA/CD, CSMA/CA)
- Sublayers: LLC (logical link control) and MAC (media access control)
- Data unit: frame | Devices: switch, bridge, NIC
3.3 Network Layer
- Host-to-host delivery across multiple networks
- Logical addressing (IP), routing, fragmentation and reassembly
- Data unit: packet | Devices: router | Protocols: IP, ICMP, IGMP, OSPF, BGP
3.4 Transport Layer
- Process-to-process delivery using port numbers
- Segmentation and reassembly, connection control, end-to-end flow control, end-to-end error control
- Data unit: segment (TCP) / datagram (UDP) | Protocols: TCP, UDP, SCTP
3.5 Session Layer
- Establishes, maintains, synchronises, and terminates sessions
- Dialog control (half/full duplex) and synchronisation checkpoints for recovery of long transfers
- Protocols: NetBIOS, RPC, PPTP
3.6 Presentation Layer
- Translation (EBCDIC ↔ ASCII), encryption/decryption, compression
- Ensures data is meaningful to the receiving application
- Formats: JPEG, MPEG, ASCII; SSL/TLS conceptually sits here
3.7 Application Layer
- Provides network services directly to the user/process
- Protocols: HTTP, FTP, SMTP, DNS, DHCP, SNMP, Telnet
4. 🧠 Mnemonics
- Top → Bottom: All People Seem To Need Data Processing
- Bottom → Top: Please Do Not Throw Sausage Pizza Away
5. 📦 Encapsulation & Decapsulation
- Sender: each layer adds its own header (and Data Link adds a trailer with CRC)
- Receiver: each layer strips its own header — mirror process
- Data → Segment → Packet → Frame → Bits
6. ⚖️ OSI vs TCP/IP
| Basis | OSI | TCP/IP |
|---|---|---|
| Layers | 7 | 4 (or 5) |
| Origin | ISO, theoretical reference | DARPA, built from working protocols |
| Approach | Protocol-independent model | Protocol-driven model |
| Session & Presentation | Separate layers | Merged into Application |
| Transport | Connection-oriented only (originally) | Both TCP and UDP |
| Usage | Teaching/reference | Actually deployed on the Internet |
- TCP/IP layers: Network Access → Internet → Transport → Application
7. ❌ Criticism of OSI
- Bad timing — TCP/IP was already deployed before OSI standards matured
- Session and Presentation layers are thinly populated; Data Link and Network are overloaded
- Complex and slow implementations
8. 🧮 Numericals
Q1 — Encapsulation overhead
Application data = 1,000 bytes. Headers: TCP 20 B, IP 20 B, Ethernet header+trailer 26 B.
- Frame size = 1,000 + 20 + 20 + 26 = 1,066 bytes
- Overhead = 66 ÷ 1,066 = 6.19%
- Efficiency = 93.81%
Q2 — Fragmentation across MTU
Data = 4,000 bytes payload, MTU = 1,500 bytes, IP header = 20 bytes.
- Payload per fragment = 1,500 − 20 = 1,480 bytes
- Fragments = ⌈4,000 ÷ 1,480⌉ = 3 fragments (1,480 + 1,480 + 1,040)
- Total bytes on wire = 4,000 + (3 × 20) = 4,060 bytes
Q3 — Efficiency with small payload
Payload = 50 bytes, same 66 bytes of headers.
- Efficiency = 50 ÷ 116 = 43.1% → shows why small packets (VoIP) are overhead-heavy
9. 📝 Long-Question Outlines
✍️
Write this outline first (2–3 minutes), then develop each heading. Roman numerals = main headings · A / B / C = points · (1) / (2) = details.
Outline 1 — Explain the OSI reference model with the functions of each layer, a diagram and a comparison with TCP/IP (20 marks)
- I. Introduction
- A. Definition: 7-layer reference model by ISO (1984)
- B. Purpose: a common framework so different vendors can interoperate
- II. Need for Layering
- A. Modularity
- B. Interoperability
- C. Abstraction
- D. Easier troubleshooting
- III. Diagram: 7-layer stack with data unit, device and protocol against each layer
- IV. Functions of the Seven Layers (bottom-up)
- A. Physical: raw bits, signals, transmission mode; hub, repeater
- B. Data Link: framing, MAC addressing, CRC, flow and access control; switch
- C. Network: IP addressing, routing, fragmentation; router
- D. Transport: ports, segmentation, end-to-end flow and error control; TCP/UDP
- E. Session: dialog control, checkpoints
- F. Presentation: translation, encryption, compression
- G. Application: HTTP, FTP, SMTP, DNS
- V. Encapsulation and Decapsulation
- (1) Data → segment → packet → frame → bits
- (2) Overhead numerical (Q1)
- VI. OSI vs TCP/IP
- A. Comparison table
- B. Layer mapping (7 → 4)
- VII. Why TCP/IP Won in Practice
- A. Bad timing: TCP/IP already deployed
- B. Thin session/presentation layers
- C. Complex implementations
- VIII. Applied Example: opening a website traced through all seven layers
- IX. Conclusion: OSI for teaching and troubleshooting, TCP/IP for the real Internet
Marks guide: intro 2 · layering 2 · diagram 2 · seven layers 7 · encapsulation 2 · OSI vs TCP/IP 3 · conclusion 2
Outline 2 — What is encapsulation? Trace data from the sender's application to the receiver's application (8–10 marks)
- I. Introduction: definition of encapsulation and decapsulation
- II. Sender side, top to bottom
- (1) Application data
- (2) Transport header → segment
- (3) IP header → packet
- (4) Frame header and CRC trailer → frame
- (5) Bits on the medium
- III. Receiver side: each layer strips its own header (mirror process)
- IV. Diagram of nested headers
- V. Numerical: overhead and efficiency (Q1, Q3)
- VI. Conclusion: headers carry control information but cost bandwidth
Outline 3 — Why did OSI fail to displace TCP/IP? (6–8 marks)
- I. Introduction: two competing models
- II. Reasons
- A. Timing: TCP/IP standards were already in use
- B. Technology: overloaded data link/network layers, thin upper layers
- C. Implementation: complex and slow
- D. Politics: seen as a government-driven standard
- III. What OSI still offers: vocabulary for teaching and troubleshooting
- IV. Conclusion
10. 🎯 CSS Exam Angle
- Draw the 7-layer stack with data unit, device, and protocol against each layer — a full-marks diagram
- Always include the OSI vs TCP/IP table; questions are usually comparative
- Be precise: node-to-node (Data Link) vs host-to-host (Network) vs process-to-process (Transport)
- Trace a real example (opening a website) through all seven layers to show applied understanding
11. 🔁 Likely Questions
- Explain the OSI reference model with the function of each layer and a diagram.
- Compare the OSI and TCP/IP models.
- What is encapsulation? Trace data flow from sender's application to receiver's application.
- Why did OSI fail to displace TCP/IP in practice?
12. 📜 Past-Paper Questions & Structured Answers
Question wording is paraphrased. Answer emphasis is a study guide, not an official FPSC marking scheme. Papers reviewed: 2016–2026; MCQ coverage is limited to available sheets.
2018 · Paper-I · Q2(a) · 4 marks
Question (paraphrased): Name the layers of the TCP/IP stack.
Answer focus: Four names in order, with one function each.
| Layer, top to bottom | Main function / example |
|---|---|
| Application | Services used by applications: HTTP, DNS, SMTP |
| Transport | Process-to-process delivery: TCP or UDP |
| Internet | Addressing and forwarding across networks: IP |
| Network access / link | Local delivery over the medium: Ethernet or Wi-Fi |
The conventional model has four layers. A five-layer teaching model separates network access into data link and physical; state which model you are using.
2024 · Paper-II · Q4(a) · 7 marks
Question (paraphrased): Compare OSI with TCP/IP for simplicity and practical use; explain layering’s benefits.
Answer focus: Comparison table, layer mapping and benefits with an example.
Meaning: both divide communication into manageable functions. OSI is a seven-layer reference model; TCP/IP describes the Internet protocol suite.
| Aspect | OSI | TCP/IP |
|---|---|---|
| Layers | Application, presentation, session, transport, network, data link, physical | Application, transport, Internet, network access |
| Simplicity | More detailed separation; useful for explaining individual functions | Fewer layers; application software handles presentation/session functions |
| Practicality | Common framework for design and troubleshooting | Implemented through protocols such as IP, TCP, UDP and HTTP |
| Mapping | Top three layers; transport; network; bottom two layers | Application; transport; Internet; network access respectively |
Benefits of layering: modular development lets one function change without redesigning the whole stack; standard interfaces allow different vendors to interoperate; encapsulation separates responsibilities; faults can be isolated by layer. For example, replacing an Ethernet access link with Wi-Fi need not change an HTTP application or TCP. The trade-off is added headers and some duplicated functions. Thus TCP/IP is simpler to implement in practice, while OSI remains useful for systematic explanation.