Business Data Communication and NetworkingUnit 213 min read
OSI vs. TCP/IP: Models, Layers, Protocols & Real-World Use
Unit 2 of Business Data Communication and Networking explores the OSI 7-layer model (theoretical framework) and the TCP/IP 4-layer model (practical implementation), comparing their layers, functions, and protocols. It covers how data flows through each layer, real-world applications (e.g., WhatsApp, Ncell), and why TCP
Why Two Models?
Data communication is complex: devices must agree on how to send, receive, and interpret data. Two models solve this:
- OSI (Open Systems Interconnection): A theoretical 7-layer model designed by ISO to standardize communication. Used for teaching and troubleshooting.
- TCP/IP (Transmission Control Protocol/Internet Protocol): A practical 4-layer model used by the internet and most networks today.
mindmap
root((Network Models))
OSI
"Layer 7: Application (HTTP, FTP)"
"Layer 6: Presentation (Encryption, Compression)"
"Layer 5: Session (NetBIOS, RPC)"
"Layer 4: Transport (TCP, UDP)"
"Layer 3: Network (IP, Routing)"
"Layer 2: Data Link (MAC, Switching)"
"Layer 1: Physical (Cables, Signals)"
TCP/IP
"Layer 4: Application (HTTP, DNS, SMTP)"
"Layer 3: Transport (TCP, UDP)"
"Layer 2: Internet (IP, ICMP)"
"Layer 1: Network Access (Ethernet, Wi-Fi)"
Key Difference
"OSI: Theoretical, 7 layers"
"TCP/IP: Practical, 4 layers (merged some OSI layers)"1. The OSI Model: A Theoretical Blueprint
The OSI model is like a recipe book for communication. Each layer has a specific job, and data passes through all layers before transmission.
How Data Flows Through OSI Layers
When you send an email (e.g., via eSewa’s notification system), data undergoes encapsulation (adding headers/footers at each layer) and decapsulation (removing them at the destination).
sequenceDiagram
participant User as Application Layer (User)
participant App as Application (HTTP)
participant Pres as Presentation (SSL/TLS)
participant Ses as Session (NetBIOS)
participant Trans as Transport (TCP)
participant Net as Network (IP)
participant DLink as Data Link (Ethernet)
participant Phys as Physical (Cable)
User->>App: Sends Email (Data)
App->>Pres: Adds Encryption (e.g., HTTPS)
Pres->>Ses: Establishes Session
Ses->>Trans: Segments Data (TCP)
Trans->>Net: Adds IP Address (e.g., 192.168.1.1)
Net->>DLink: Adds MAC Address (e.g., Switch)
DLink->>Phys: Converts to Signals (0s & 1s)
Phys-->>Phys: Transmits via Cable/Fiber
Phys-->>DLink: Receives Signals
DLink-->>Net: Removes MAC, Checks IP
Net-->>Trans: Routes to Destination
Trans-->>Ses: Reassembles Segments
Ses-->>Pres: Decrypts Data
Pres-->>App: Delivers Plaintext
App-->>User: Email ReceivedOSI Layers Explained
| Layer | Name | Function | Protocols/Devices | Example in Nepal |
|---|---|---|---|---|
| Layer 7 | Application | Interface for user/apps (e.g., web browsers, email clients). | HTTP, FTP, SMTP, DNS | eSewa app (uses HTTP for payments) |
| Layer 6 | Presentation | Translates, encrypts, compresses data. | SSL/TLS, JPEG, MPEG | Khalti (encrypts transactions with TLS) |
| Layer 5 | Session | Manages connections (e.g., login sessions). | NetBIOS, RPC | Ncell MyAccount (session management) |
| Layer 4 | Transport | Ensures end-to-end delivery (reliable vs. fast). | TCP (reliable), UDP (fast) | WhatsApp (uses TCP for messages) |
| Layer 3 | Network | Routes data between networks (logical addressing). | IP, ICMP, Routers | NTC’s backbone network (routes traffic) |
| Layer 2 | Data Link | Handles MAC addressing, framing, and error detection on a single network. | Ethernet, Switches, MAC Addresses | Daraz’s internal LAN (switches packets) |
| Layer 1 | Physical | Transmits raw bits (0s & 1s) via media (cables, signals). | Hubs, Repeaters, Fiber Optic, Wi-Fi | Nepal Telecom’s fiber cables |
2. The TCP/IP Model: The Internet’s Backbone
TCP/IP is simpler (4 layers) and practical. It combines some OSI layers for efficiency.
How TCP/IP Differs from OSI
| Feature | OSI Model | TCP/IP Model |
|---|---|---|
| Number of Layers | 7 (detailed) | 4 (merged layers) |
| Layer 5 (Session) | Separate layer | Merged into Application Layer |
| Layer 6 (Presentation) | Separate layer | Merged into Application Layer |
| Layer 4 (Transport) | TCP/UDP | Same (TCP/UDP) |
| Layer 3 (Network) | IP, Routing | Same (IP, ICMP) |
| Layer 2 (Data Link) | Ethernet, MAC | Network Access (Ethernet, Wi-Fi) |
| Layer 1 (Physical) | Cables, Signals | Same (Physical Media) |
| Use Case | Teaching, troubleshooting | Real-world networks (Internet, LANs) |
TCP/IP Layers in Action: How YouTube Works
When you watch a video on YouTube (accessed via Ncell’s mobile data):
- Application Layer: Your browser sends an HTTP request to YouTube’s server.
- Transport Layer: TCP ensures the video data arrives complete and in order.
- Internet Layer: IP routes the data through Ncell’s network → Google’s servers.
- Network Access Layer: Wi-Fi/Ethernet transmits the signal to your device.
flowchart TD
A["YouTube Video Request"] --> B["Application Layer: HTTP"]
B --> C["Transport Layer: TCP"]
C --> D["Internet Layer: IP Routing"]
D --> E["Network Access: Wi-Fi/Ethernet"]
E --> F["Your Device: Screen"]3. Real-World Applications
In the Real World
eSewa (Nepal)
- Layers Used: Application (HTTP), Transport (TCP), Internet (IP), Network Access (Wi-Fi/Ethernet).
- How? When you pay bills via eSewa:
- Application Layer: Your app sends payment data via HTTPS.
- Transport Layer: TCP ensures the bank transaction is error-free.
- Network Layer: IP routes the request to Nabil Bank’s server.
- Physical Layer: Data travels via NTC’s fiber optic cables.
WhatsApp (Global)
- Layers Used: Application (XMPP), Transport (TCP/UDP), Internet (IP).
- How? When you send a message:
- Application Layer: Your phone uses XMPP protocol.
- Transport Layer: UDP (for fast delivery) or TCP (for reliability).
- Internet Layer: IP routes it to WhatsApp’s servers in Ireland.
Nepal Telecom (NTC) Network
- Layers Used: All 4 TCP/IP layers.
- How? When you call someone:
- Network Access: Your VoIP call uses Ethernet/Wi-Fi.
- Internet: IP routes the call to the recipient’s Ncell tower.
- Transport: UDP (for real-time voice) ensures low latency.
4. Worked Example: Tracing a Daraz Order
Let’s track a Daraz order from your phone to the seller’s warehouse.
Step-by-Step Trace
| Step | Layer | Action | Real-World Example |
|---|---|---|---|
| 1 | Application | You click "Buy Now" → HTTP request sent to Daraz’s server. | Daraz website loads product details. |
| 2 | Transport | TCP splits data into segments and ensures delivery. | Your order confirmation appears. |
| 3 | Internet | IP routes the request to Daraz’s data center in Kathmandu. | NTC’s routers forward the packet. |
| 4 | Network Access | Wi-Fi/Ethernet sends the signal to your phone. | Your phone connects to Ncell’s 4G network. |
| 5 | Physical | Radio waves carry the signal to the nearest Ncell tower. | Your phone’s antenna receives the data. |
Visual: Daraz Order Flow
sequenceDiagram
participant User as Your Phone
participant Daraz as Daraz Server
participant NTC as NTC Router
participant Seller as Seller's Warehouse
User->>Daraz: HTTP Request (Buy Now)
Daraz->>NTC: IP Packet (Order Data)
NTC->>Seller: Routes to Warehouse
Seller-->>Daraz: Confirms Order
Daraz-->>User: TCP Acknowledgment
User->>Daraz: Payment via Khalti5. Advantages and Disadvantages
OSI Model
✅ Pros:
- Standardized (used globally for troubleshooting).
- Clear separation of layers (easier to teach).
- Helps in network design and debugging.
❌ Cons:
- Too theoretical (not used in real networks).
- Complex for real-world implementation.
TCP/IP Model
✅ Pros:
- Simpler (4 layers) → easier to implement.
- Used by the internet (universal compatibility).
- Efficient (merged layers reduce overhead).
❌ Cons:
- Less detailed (harder to troubleshoot).
- No strict separation between layers.
6. Case Study: How Nabil Bank Uses TCP/IP
Scenario: You transfer Rs. 5,000 from your Nabil Bank account to a friend via Internet Banking.
Step-by-Step Breakdown
Application Layer:
- Your browser uses HTTPS (secure HTTP) to connect to Nabil Bank’s server.
- Protocol: SSL/TLS (Presentation Layer function merged into Application).
Transport Layer:
- TCP ensures the transaction data is split into segments and delivered without errors.
- If a segment is lost, TCP retransmits it.
Internet Layer:
- IP assigns source (
your_IP) and destination (Nabil_Bank_IP). - Routing: The packet travels via NTC’s backbone network → Nabil Bank’s data center.
- IP assigns source (
Network Access Layer:
- Wi-Fi/Ethernet transmits the signal to your device.
- Switches/routers forward the packet to the bank’s server.
Why TCP/IP Works Better Here
- Speed: TCP/IP’s 4-layer simplicity reduces processing time.
- Reliability: TCP’s error-checking ensures no money is lost in transit.
- Security: HTTPS (Application Layer) encrypts your password and transaction details.
Exam Tip
How This Unit is Examined (TU/PU/NEB Pattern)
Definitions (5 marks)
- Expect questions like: "Define the OSI model and explain the function of the Transport Layer."
- Answer Tip: Use the table format above and mention protocols/devices.
Comparison Questions (7-10 marks)
- "Compare OSI and TCP/IP models with a suitable example."
- Answer Tip:
- Use the Markdown comparison table above.
- Add a real-world example (e.g., "While OSI is used in textbooks, TCP/IP powers WhatsApp calls.").
Worked Examples (10-15 marks)
- "Trace the path of an email sent from your Gmail to a friend using both OSI and TCP/IP models."
- Answer Tip:
- Draw a sequence diagram (like the Daraz example).
- Label each layer’s role (e.g., "At the Transport Layer, TCP ensures the email arrives intact.").
Short Answer (3-5 marks)
- "What is the role of the Data Link Layer in a LAN?"
- Answer Tip:
- Mention MAC addressing, framing, and error detection.
- Give an example: "In Daraz’s internal network, switches use the Data Link Layer to forward packets."
Application-Based Questions (10 marks)
- "How does Ncell’s 4G network use the TCP/IP model?"
- Answer Tip:
- Break it into 4 layers (like the Nabil Bank case study).
- Mention real protocols (e.g., "IP routes voice data to the recipient’s tower.").
Common Mistakes to Avoid
❌ Mixing OSI and TCP/IP layers (e.g., calling "Presentation Layer" in TCP/IP). ❌ Forgetting real-world examples (examiners love Nepali apps like eSewa/Khalti). ❌ Not showing data flow (always draw a sequence diagram for tracing questions). ❌ Ignoring protocols (always name HTTP, TCP, IP, MAC where relevant).
Quick Revision Table
| Topic | Key Points | Exam Focus |
|---|---|---|
| OSI Model | 7 layers, theoretical, used for teaching. | Definitions, layer functions. |
| TCP/IP Model | 4 layers, practical, powers the internet. | Comparison with OSI. |
| Encapsulation | Adding headers at each layer (e.g., IP → TCP → HTTP). | Worked examples (email, Daraz order). |
| Protocols per Layer | Application: HTTP; Transport: TCP/UDP; Internet: IP; Network Access: Ethernet. | Matching questions. |
| Real-World Use | eSewa (TCP/IP), NTC (IP routing), WhatsApp (UDP/TCP). | Application-based questions. |
Based on the TU BITM syllabus for Business Data Communication and Networking (IT240), unit 2.
Discussion
Loading…