OSI vs TCP/IP Models & Packet Encapsulation
“Layer responsibilities, protocol data units (PDU), and header encapsulation.”
1.The Principle of Layering & Architectural Separation
§ 1.1.Computer networks rely on modular layering to decompose massive communication complexity into independent functional abstractions. Each layer n provides specific services to layer (n+1) via a Service Access Point (SAP), while relying on the services of layer (n-1).
Protocols vs Services: A protocol is a set of formal rules governing peer-to-peer communication across hosts at the same layer. A service is a set of operations that a layer provides to the layer immediately above it through an interface.
Encapsulation & Decapsulation: As user data travels down the sender's protocol stack, each layer prepends a protocol-specific header (and occasionally an error-detecting trailer at Layer 2). The resulting packet is termed a Protocol Data Unit (PDU): Application Message → Transport Segment/Datagram → Network Datagram/Packet → Data Link Frame → Physical Raw Bits.
GATE questions often test exact terminology: Application Layer produces 'Messages', Transport Layer produces 'Segments' (TCP) or 'User Datagrams' (UDP), Network Layer produces 'Packets/Datagrams', and Data Link Layer produces 'Frames'.
2. OSI 7-Layer vs TCP/IP 5-Layer Architectural Comparison
Standard comparison of responsibilities, protocol units, and design philosophies:
| Layer | OSI Model (Theoretical) | TCP/IP Model (Practical Standard) |
|---|---|---|
| Layer 7 (Application) | User network interface (HTTP, SMTP, DNS, FTP) | Merges OSI Session, Presentation & App into one application layer |
| Layer 6 (Presentation) | Data serialization, ASCII/EBCDIC, SSL/TLS encryption format conversion | Handled directly inside user application libraries |
| Layer 5 (Session) | Dialogue control, token management, synchronization checkpoints | Integrated into application or transport layer |
| Layer 4 (Transport) | End-to-end process-to-process delivery (TCP, UDP with port numbers) | End-to-end host communication with port addressing |
| Layer 3 (Network) | Host-to-host routing, logical IP addressing across networks | Internet Protocol (IPv4/IPv6), ICMP, routing |
| Layer 2 (Data Link) | Hop-to-hop node delivery, framing, CRC error detection, MAC access | Network Interface / Data Link (Ethernet, Wi-Fi) |
| Layer 1 (Physical) | Raw bit transmission, signal voltages, cable pins | Physical transmission medium (Copper, Fiber, Radio) |
3.End-to-End Delay Analysis: The Four Delay Components
§ 1.3.Whenever a packet travels from source to destination across a store-and-forward packet-switched network, total node delay d_nodal comprises exactly four components: d_nodal = d_proc + d_queue + d_trans + d_prop.
1. Nodal Processing Delay (d_proc): Time taken by the router to examine the packet header, verify the checksum, and determine the output link via routing table lookup (typically microseconds).
2. Queuing Delay (d_queue): Time the packet waits in the router output buffer queue before transmission. Depends on network congestion and traffic intensity I = (L * a) / R, where L = packet size (bits), a = average arrival rate (packets/sec), and R = transmission rate (bps). If I > 1, queue grows without bound and packets drop.
3. Transmission Delay (d_trans): Time required to push all packet bits onto the physical link: d_trans = L / R, where L = packet length in bits, R = link bandwidth/capacity in bits per second (bps).
4. Propagation Delay (d_prop): Time taken for a single bit to travel across the physical medium from sender to receiver: d_prop = d / s, where d = physical distance in meters, s = signal propagation speed in the medium (typically 2 10^8 m/s in copper/fiber, 3 10^8 m/s in vacuum).
Transmission delay depends strictly on packet size L and bandwidth R (L / R). Propagation delay depends strictly on distance d and signal velocity s (d / s). Bandwidth does NOT speed up signal travel; it only pushes bits onto the wire faster!
4. GATE Step-by-Step Numerical: Store-and-Forward Packet Switching Delay
In store-and-forward packet switching, intermediate routers must receive the ENTIRE packet before forwarding the first bit to the next link!
Problem: A source host sends a file of size F = 1.5 Megabytes over a path of N = 4 identical links. Each link has bandwidth R = 10 Mbps and propagation delay d_prop = 5 ms. The file is split into packets of size P = 1500 bytes (including 20 bytes header). Neglect processing and queuing delays.
Step 1: Compute packet transmission delay per link: d_trans = (1500 8 bits) / (10 10^6 bps) = 12,000 / 10,000,000 = 1.2 milliseconds.
Step 2: Number of packets M = Total Data / Packet Data. Here, packet payload = 1500 - 20 = 1480 bytes. M = ceil(1.5 * 10^6 / 1480) = ceil(1013.51) = 1014 packets.
Step 3: Pipelined store-and-forward transmission formula: Total Time T = (Time for Packet 1 to reach destination) + (Remaining M - 1 packets arriving back-to-back at destination).
Packet 1 traverses 4 links: 4 d_trans + 4 d_prop = 4 1.2 ms + 4 5 ms = 4.8 ms + 20 ms = 24.8 ms.
Remaining (M - 1) = 1013 packets arrive one by one spaced by d_trans: 1013 * 1.2 ms = 1215.6 ms.
Total End-to-End Delay = 24.8 ms + 1215.6 ms = 1240.4 ms = 1.2404 seconds.
Worked example: header overhead on one packet
Each layer wraps the layer above: data, then TCP segment, IP packet, Ethernet frame.
Useful bytes over total bytes.
Practice: test yourself
Original practice questions in the GATE style, with worked explanations. Not past-paper questions.
A router works mainly at which OSI layer?
What is the unit of data at the transport layer called, for TCP?
Same headers (TCP 20, IP 20, Ethernet 18 bytes), but the application sends only 40 bytes. What percentage of the frame is data? Round to the nearest whole number.
Primary Academic References & Exam Sources
Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.
Curated for clarity, rigorous numerical solving, and semester excellence:
GATE-level numerical drilling and PYQ analysis.
Step-by-step conceptual walkthroughs with worked GATE numericals.
Clear whiteboard lectures for foundational and semester exam coverage.