PHASE 3 · MODULE 1

OSI & TCP/IP Model Deep Dive

Master the layered architecture that underpins every network you'll troubleshoot.

Learning Objectives

The OSI 7-Layer Model

The Open Systems Interconnection (OSI) model, developed by ISO in 1984, provides a conceptual framework for understanding network interactions as seven distinct layers. Each layer serves the one above it and is served by the one below.

7 Application Layer

What it does: Provides network services directly to end-user applications. This is where users interact with the network through software like browsers, email clients, and file transfer apps.

Key functions: Service discovery, user authentication, data format conversion, session management coordination.

HTTP/HTTPS FTP SMTP DNS SSH SNMP
Real-World Example

When you open a web browser and type google.com, the Application layer prepares your request — formatting the HTTP GET method, adding headers, and passing it down to the next layer for transport.

6 Presentation Layer

What it does: Translates data between the application format and the network format. Handles encryption, compression, and character encoding so that data from one system can be read by another.

Key functions: Data encryption/decryption (TLS/SSL), compression/decompression, character set conversion (ASCII to UTF-8).

TLS/SSL JPEG GIF MPEG ASCII UTF-8
Real-World Example

TLS (Transport Layer Security) sits at this boundary — when your browser establishes an HTTPS connection, the Presentation layer encrypts the data before handing it to the Transport layer.

5 Session Layer

What it does: Establishes, manages, and terminates connections (sessions) between two applications. Handles dialogue control — whether communication is simplex, half-duplex, or full-duplex.

Key functions: Session establishment and tear-down, checkpointing (for long transfers), dialog control.

NetBIOS RPC SIP NFS
Real-World Example

A video conferencing app uses the Session layer to establish a dialogue with a remote participant, manage the exchange of audio and video streams, and cleanly terminate the session when either party hangs up.

4 Transport Layer

What it does: Provides end-to-end communication between devices. Ensures complete data transfer with error checking, flow control, and segmentation/reassembly. Determines whether to use connection-oriented (reliable) or connectionless (fast) delivery.

Key functions: Segmentation, error detection/correction, flow control, congestion control, multiplexing via ports.

TCP UDP SCTP
Real-World Example

When downloading a file, TCP (Transport Control Protocol) segments the data, acknowledges each piece received, retransmits lost packets, and manages the speed to avoid overwhelming the receiver. A live video stream may use UDP instead for lower latency despite occasional packet loss.

3 Network Layer

What it does: Handles logical addressing and routing. Determines the best path for data to travel from source to destination across multiple networks (internetworking).

Key functions: Logical addressing (IP addresses), routing decisions, path determination, fragmentation, reverse path forwarding.

IPv4 IPv6 ICMP IPsec OSPF BGP Router
Real-World Example

Your router examines the destination IP address in each packet and consults its routing table to determine which interface should forward the packet toward its final destination — possibly hopping through several routers across the internet.

2 Data Link Layer

What it does: Provides node-to-node data transfer on the same physical network segment. Handles physical addressing (MAC addresses), error detection (not correction), and access to the physical medium.

Sub-layers: LLC (Logical Link Control) — frames packets and handles error checking. MAC (Media Access Control) — controls how devices gain access to the medium and permission to transmit.

Ethernet (IEEE 802.3) Wi-Fi (IEEE 802.11) PPP ARP Switch Bridge VLAN
Real-World Example

When your computer sends a frame to your router on the local LAN, the Data Link layer adds the source and destination MAC addresses, wraps the IP packet in a frame, and appends a Frame Check Sequence (FCS) for error detection.

1 Physical Layer

What it does: Transmits raw bit streams over a physical medium. Defines electrical, mechanical, procedural, and functional specifications for activating, maintaining, and deactivating the physical link.

Key functions: Bit-level transmission, cabling specifications, connector types, signal encoding, voltage levels, topologies.

Ethernet cables (Cat5e/6/6a) Fiber optic RS-232 Hubs Repeaters
Real-World Example

A Cat6 Ethernet cable carrying 1 Gbps signals uses specific voltage levels, wire pair twisting patterns, and RJ-45 connectors. The Physical layer defines exactly how those electrical pulses represent 1s and 0s traveling across the copper wires.

Memory Techniques

Mnemonic for OSI Layers (Top → Bottom):
"All People Seem To Download Massive Packages"
Application · Presentation · Session · Transport · Network · Data Link · Physical
Mnemonic for OSI Layers (Bottom → Top):
"Please Don't Toss Sausage Pizza Away"
Physical · Data Link · Network · Transport · Session · Presentation · Application

The TCP/IP 4-Layer Model

The TCP/IP model, developed by the U.S. Department of Defense, is the practical model that powers the modern Internet. It condenses the OSI's 7 layers into 4 functional layers.

4 Application Layer

Covers: OSI Application + Presentation + Session layers combined.

Protocols: HTTP, HTTPS, FTP, SMTP, DNS, SSH, SNMP, DHCP

Why Combined?

In practice, the concerns of session management, data formatting, and application interaction are handled together by application-layer protocols. The TCP/IP model prioritizes practical implementation over strict theoretical separation.

3 Transport Layer

Covers: Same as OSI Transport layer.

Protocols: TCP, UDP

Key concept: End-to-end reliability. TCP guarantees delivery; UDP provides fastest delivery without guarantees.

2 Internet Layer

Covers: Same as OSI Network layer.

Protocols: IP (IPv4/IPv6), ICMP, IGMP, ARP (sometimes placed at Link layer)

Key concept: Logical addressing and routing across networks. Packets are addressed with IP and routed hop-by-hop.

1 Network Access (Link) Layer

Covers: Same as OSI Data Link + Physical layers combined.

Protocols: Ethernet, Wi-Fi (802.11), PPP, ARP, VLAN tagging

Key concept: Physical transmission media and local network delivery using MAC addresses.

Layer-by-Layer Protocol Mapping

OSI Layer Protocol Data Unit (PDU) Key Protocols Primary Devices Addressing
7 — Application Data HTTP, FTP, SMTP, DNS, SSH, SNMP — Application-level identifiers
6 — Presentation Data TLS/SSL, JPEG, MPEG, ASCII, UTF-8 — Encoding formats
5 — Session Data NetBIOS, RPC, SIP, NFS — Session IDs
4 — Transport Segment (TCP) / Datagram (UDP) TCP, UDP, SCTP Firewall, Load Balancer Port numbers
3 — Network Packet IPv4, IPv6, ICMP, IPsec, OSPF, BGP Router, Layer 3 Switch IP addresses
2 — Data Link Frame Ethernet, PPP, ARP, VLAN, HDLC Switch, Bridge, Hub MAC addresses
1 — Physical Bits USB, DSL, T1/E1, Fiber, Copper Hub, Repeater, NIC Electrical/optical signals

Encapsulation & De-encapsulation

Encapsulation is the process of wrapping data with protocol information as it moves down the layers on the sending side. De-encapsulation is the reverse — stripping headers as data moves up the layers on the receiving side.

App / Pres / Ses
DATA
›
Transport
+ TCP/UDP Header
= Segment
›
Network
+ IP Header
= Packet
›
Data Link
+ MAC Headers/FCS
= Frame
›
Physical
Bits on wire
De-encapsulation (Receiving Side)

At the destination, each layer removes its corresponding header: Physical converts bits back to frames → Data Link strips MAC headers to reveal packets → Network strips IP headers to reveal segments → Transport strips port info to reveal data → Upper layers process the original application data.

Protocol Data Unit (PDU) Quick Reference

LayerPDU NameWhat Gets Added
Application / Presentation / SessionDataUser data / API calls
TransportSegment (TCP) / Datagram (UDP)Source port, Destination port, Seq/Ack numbers, Flags
NetworkPacketSource IP, Destination IP, TTL, Protocol field
Data LinkFrameSource MAC, Destination MAC, EtherType, FCS
PhysicalBitsElectrical/optical signal representation

OSI vs TCP/IP Comparison

OSI Model

  • 7 layers — more granular
  • Theoretical reference model
  • Developed by ISO (1984)
  • Layers are strictly separated
  • Both connectionless & connection-oriented at Network layer
  • Used primarily for education/troubleshooting
  • No specific protocols attached originally

TCP/IP Model

  • 4 layers — more consolidated
  • Practical implementation model
  • Developed by DoD (1970s)
  • Some layers combine functions
  • Connection-oriented only at Transport layer
  • The actual basis of the Internet
  • Built around real protocols (TCP, IP)
AspectOSITCP/IP
Number of layers74
Model typeReference modelProtocol suite
DevelopmentTheory first, protocols laterProtocols first, model later
Transport reliabilityBoth connectionless & oriented at Network layerOnly Transport layer supports both
Real-world useTroubleshooting frameworkActual Internet operation
AdoptionEducational standardInternet standard

Using the Model for Troubleshooting

A structured, layer-by-layer approach prevents wasted effort. Start at the bottom (Physical) and work up — most problems are at lower layers.

Systematic Troubleshooting Method

Step 1: Identify the symptom and scope (one host? entire subnet? internet-wide?)
Step 2: Check Layer 1 — cables connected? link lights on? correct cable type?
Step 3: Check Layer 2 — MAC learning? VLAN configuration? spanning tree blocking?
Step 4: Check Layer 3 — IP configuration? routing tables? ACLs blocking traffic?
Step 5: Check Layer 4 — firewall rules? port conflicts? service listening?
Step 6: Check Layers 5-7 — application errors? DNS resolution? certificate issues?

LayerCommon SymptomsDiagnostic CommandsCommon Fixes
L1 — PhysicalNo link, intermittent connectivity, collisionsshow interfaces, cable tester, ping localhostReplace cable, renegotiate duplex, check power
L2 — Data LinkSame-subnet unreachable, MAC Flooding, VLAN mismatcharp -a, show mac address-table, show vlanVerify VLAN config, clear ARP cache, check switch port
L3 — NetworkCan't reach remote networks, routing loopsping, traceroute, show ip route, ipconfig /allFix default gateway, update routing table, check ACLs
L4 — TransportService unreachable, connection refusednetstat -an, telnet <host> <port>, ss -tulpnStart service, adjust firewall, verify port not blocked
L5-7 — Session/AppApplication errors, slow responses, auth failuresnslookup, curl -v, browser dev tools, log inspectionRestart service, renew certificates, fix DNS, update config

Knowledge Check

Q1: At which OSI layer does routing occur?
Correct answer: B. Network Layer — Routing is the core function of Layer 3, using logical IP addresses to determine paths across networks.
Q2: Which PDU is associated with the Transport layer?
Correct answer: C. Segment (or Datagram for UDP). The Transport layer creates segments that contain source/destination port numbers and sequence information.
Q3: Which layer handles encryption and data formatting?
Correct answer: C. Presentation Layer — Encryption (TLS/SSL), compression, and character encoding are all Presentation layer responsibilities.
Q4: In the TCP/IP model, which layer combines OSI's Application, Presentation, and Session layers?
Correct answer: C. Application Layer — The TCP/IP Application layer subsumes the functionality of OSI's top three layers.
Q5: A server's link light is off and no traffic flows. Which OSI layer should you investigate first?
Correct answer: C. Physical Layer — No link light means a Layer 1 issue. Always start troubleshooting from the bottom (Physical) and work upward. Check cables, NICs, switch ports, and power.

Resources

← Phase 3 Overview Next: IP Addressing & Subnetting →