Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

OSI vs TCP/IP Deep Dive

Lesson 3 of 15 in the free Computer Networks notes on Siksha Sarovar, written by Rohit Jangra.

OSI vs TCP/IP — Deep Dive

The OSI (Open Systems Interconnection) model is a conceptual framework standardising network functions into seven layers. The TCP/IP model is the four-layer practical model used in real-world internet communication. Both are essential knowledge for networking.

---

1. OSI 7-Layer Model — Complete Reference Table

Layer #NameFunctionPDUKey ProtocolsDevices
7ApplicationProvides network services directly to user applications; interface between applications and networkDataHTTP, HTTPS, FTP, SMTP, DNS, Telnet, SNMP, DHCP
6PresentationData translation (ASCII↔EBCDIC), encryption/decryption (SSL/TLS), compression (JPEG, MPEG)DataSSL, TLS, JPEG, MPEG, ASCII, GIF
5SessionEstablishes, maintains, and terminates sessions; synchronisation checkpoints; dialog controlDataNetBIOS, RPC, NFS, SAP, SQL sessions
4TransportEnd-to-end delivery; segmentation/reassembly; error recovery; flow control; multiplexing via portsSegmentTCP, UDP, SCTP, SPX
3NetworkLogical IP addressing; routing; path determination; fragmentation and reassemblyPacketIP, ICMP, ARP, OSPF, RIP, BGPRouter
2Data LinkPhysical MAC addressing; framing; error detection (CRC); media access controlFrameEthernet (802.3), Wi-Fi (802.11), PPP, HDLCSwitch, Bridge
1PhysicalTransmission of raw bits over medium; defines voltages, timing, connectorsBitsRS-232, USB, DSL, SONETRepeater, Hub

---

2. Layer-by-Layer Explanation

Layer 1 — Physical: Deals with actual physical transmission. Defines cable types, connectors, voltage levels, bit timing, and modulation. Devices: Repeaters, Hubs, cables. PDU = Bits.

Layer 2 — Data Link: Node-to-node delivery across a single link. Encapsulates packets into frames, adds MAC addresses, performs CRC error detection. Split into LLC (flow/error control) and MAC (media access) sub-layers. PDU = Frame. Devices: Switches, Bridges.

Layer 3 — Network: Routes packets from source to destination across multiple networks using IP addresses. Functions: logical addressing, path determination, packet forwarding, fragmentation. PDU = Packet. Device: Router.

Layer 4 — Transport: End-to-end communication between processes (identified by port numbers). TCP provides reliable, ordered, error-checked delivery. UDP provides fast, connectionless, best-effort delivery. PDU = Segment.

Layer 5 — Session: Manages communication sessions. Provides synchronisation (checkpoints for large transfers so they can resume after failure), dialog control (half-duplex vs full-duplex management). Example: NetBIOS session for Windows file sharing.

Layer 6 — Presentation: Acts as a data translator. Converts data formats (EBCDIC to ASCII), handles encryption/decryption (TLS), and compression (JPEG for images, MPEG for video). Ensures data is in a usable format.

Layer 7 — Application: Provides network services to end-user applications. NOT the application itself (browser, email client) but the protocols applications use. Examples: HTTP (web), FTP (file transfer), SMTP (email sending), DNS (name resolution).

Exam Tip: Mnemonic bottom-to-top: "Please Do Not Throw Sausage Pizza Away" = Physical, Data Link, Network, Transport, Session, Presentation, Application. Top-to-bottom: "All People Seem To Need Data Processing."

---

3. TCP/IP 4-Layer Model

Layer #TCP/IP LayerOSI EquivalentKey Protocols
4ApplicationOSI Layers 5, 6, 7 combinedHTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, DHCP, SSH, Telnet, SNMP
3TransportOSI Layer 4TCP, UDP
2InternetOSI Layer 3IPv4, IPv6, ICMP, ARP
1Network Access (Link)OSI Layers 1 + 2Ethernet (802.3), Wi-Fi (802.11), PPP, Frame Relay

---

4. OSI vs TCP/IP — 7 Key Differences

#FeatureOSI ModelTCP/IP Model
1Number of layers74
2Developed byISO (International Standards Organisation)DARPA (US Defense Advanced Research Projects Agency)
3ApproachGeneric, protocol-independent reference modelPractical, built around specific TCP/IP protocols
4Session & PresentationSeparate dedicated layers (5 and 6)Merged into single Application layer
5Development timingTop-down: model designed before protocolsBottom-up: protocols already existed when model formalised
6UsageReference/teaching model — not directly implementedActual implementation used on the internet today
7ReliabilityTransport layer specifies both reliable and unreliable optionsTCP (reliable) and UDP (unreliable) at Transport layer

---

5. Encapsulation and Decapsulation

When sending, each layer adds a header (encapsulation):

Application Data
→ [L7 Header | Data]  →  [L6 Header | Data]  →  [L5 Header | Data]
→ [L4 Header | Segment]
→ [L3 Header | Packet]
→ [L2 Header | Frame | L2 Trailer]
→ Bits on wire

When receiving, each layer strips its header (decapsulation). The process is perfectly symmetric.

Study Deep: Why OSI if TCP/IP is Used?

  • OSI is a universal troubleshooting vocabulary: saying "this is a Layer 3 problem" instantly means routing/IP, narrowing diagnosis from hundreds of possibilities to a handful.
  • Certification exams (CCNA, CompTIA Network+, CISSP) use OSI as their primary framework even though TCP/IP is what runs on the internet.
  • Protocol encapsulation is an OSI concept used in TCP/IP: HTTP data → TCP segment → IP packet → Ethernet frame → bits.
  • OSI Session and Presentation functions are handled by libraries (TLS, codec libraries) in TCP/IP implementations — which is why TCP/IP merges them into the Application layer.
Exam Tip: Know all PDU names: Physical=Bits, Data Link=Frame, Network=Packet, Transport=Segment, Application/Session/Presentation=Data. These names appear in almost every networking exam.