Kyūkei Master Hub
SCS2111 | Phase 3: OSI & TCP/IP Reference Models
👁️ -- opens | 0%
SCS2111 Phase 3: OSI & TCP/IP Models
PHASE 03

OSI 7-Layer & TCP/IP 4-Layer Reference Models

Comprehensive layer-by-layer academic breakdown, protocol responsibilities, PDU encapsulation mechanics, and protocol header specifications.

2. Visual Architecture: 7-Layer OSI vs. 4-Layer TCP/IP Stack

ISO Standard

OSI 7-Layer Reference Model

7. Application (HTTP, DNS, SSH, FTP)Data
6. Presentation (SSL/TLS, ASCII, JPEG)Data
5. Session (NetBIOS, RPC, Sockets)Data
4. Transport (TCP, UDP, Port Addressing)Segment
3. Network (IPv4, IPv6, ICMP, Routers)Packet
2. Data Link (Ethernet, MAC, Switches)Frame
1. Physical (Cables, Bits, Voltages)Bits
Practical Internet Suite

TCP/IP 4-Layer Suite

4. Application (Combines OSI 5, 6, 7)Data
3. Transport (TCP / UDP)Segment
2. Internet (IP, ICMP, ARP)Packet
1. Network Access (Combines OSI 1, 2)Frame/Bits

3. Comprehensive Layer-by-Layer Breakdown: OSI 7-Layer Model

Each layer in the OSI (Open Systems Interconnection) reference model performs a distinct set of networking functions, serving the layer directly above it and requesting service from the layer directly below it.

LAYER 7

1. Application Layer (Layer 7)

Primary Function: Provides network interfaces and application protocols directly to end-user software applications. It does not represent the application program itself (e.g., Google Chrome), but rather the communication protocol services that the application relies on to transfer data across a network.

  • Key Responsibilities: Resource availability identification, user authentication, service request formatting, and protocol synchronization.
  • Protocol Data Unit (PDU): Data (Payload).
  • Core Protocols: HTTP / HTTPS (Web), FTP / SFTP (File Transfer), SMTP / IMAP / POP3 (Email), DNS (Domain Resolution), SSH / Telnet (Remote Terminal), DHCP (IP Allocation).
  • Exam Focus Note: Remember that Layer 7 is the closest layer to the end user. When a user enters a URL in a browser, HTTP initiates communication at Layer 7.
LAYER 6

2. Presentation Layer (Layer 6)

Primary Function: Acts as the "translator" for the network. It ensures that data sent from the application layer of one system can be understood and read by the application layer of another system, regardless of differences in internal data representation or operating systems.

  • Key Responsibilities:
    Syntax Translation: Translating between different data encodings (e.g., EBCDIC to ASCII, UTF-8, Big-Endian vs Little-Endian).
    Data Encryption & Decryption: Applying cryptographic protocols (TLS/SSL encryption) for secure transmission.
    Data Compression: Compressing data payloads (e.g., gzip, zip, JPEG, MPEG, PNG) to optimize network bandwidth utilization.
  • Protocol Data Unit (PDU): Data (Payload).
  • Core Examples: TLS / SSL security wrappers, ASCII, Unicode, JPEG, GIF, PNG, MP3, MPEG, XML, JSON syntax standards.
LAYER 5

3. Session Layer (Layer 5)

Primary Function: Establishes, manages, synchronizes, and terminates active communication dialogues (sessions) between distributed applications running on separate hosts.

  • Key Responsibilities:
    Session Establishment & Teardown: Opening active channels between client and server processes and tearing them down gracefully when complete.
    Dialog Control: Determining whether communication runs in Simplex, Half-Duplex, or Full-Duplex session modes.
    Checkpointing & Recovery: Inserting synchronization markers into long data streams. If a connection drops midway through a 1 GB file transfer, the session layer resumes transmission from the last verified checkpoint rather than restarting from 0 bytes.
  • Protocol Data Unit (PDU): Data (Payload).
  • Core Protocols / APIs: NetBIOS, RPC (Remote Procedure Call), Sockets API, PPTP, SQL Session negotiation.
LAYER 4

4. Transport Layer (Layer 4)

Primary Function: Responsible for end-to-end (process-to-process) communication, data segmentation, port addressing, connection multiplexing, flow control, and error recovery across the network.

  • Key Responsibilities:
    Port Addressing (Multiplexing): Uses 16-bit Port Numbers (0 – 65,535) to direct data stream segments to the specific software application running on a device (e.g., Port 80 for HTTP, Port 443 for HTTPS, Port 22 for SSH).
    Segmentation & Reassembly: Dividing large application payloads into smaller managed segments on the sender side, and reordering out-of-order segments at the destination using Sequence Numbers.
    Flow Control: Utilizing Sliding Window mechanisms to prevent a fast sender from flooding a slow receiver.
    Reliability & Error Recovery: Acknowledging received segments (ACKs) and retransmitting lost segments (TCP).
  • Protocol Data Unit (PDU): Segment (for TCP) / Datagram (for UDP).
  • Core Protocols: TCP (Transmission Control Protocol - Reliable, Connection-Oriented), UDP (User Datagram Protocol - Unreliable, Connectionless, High-Speed), SCTP.
LAYER 3

5. Network Layer (Layer 3)

Primary Function: Responsible for host-to-host logical IP addressing, packet encapsulation, dynamic inter-network routing, and optimal path determination across intermediate routers and subnets.

  • Key Responsibilities:
    Logical IP Addressing: Assigning hierarchical global source and destination IP addresses (IPv4 / IPv6) to identify nodes across different networks.
    Routing & Path Selection: Evaluating routing tables and executing dynamic routing protocols (OSPF, BGP, RIP) to forward packets across multi-hop router paths.
    Packet Encapsulation & Fragmentation: Wrapping transport segments into IP packets and breaking down packets that exceed a link's Maximum Transmission Unit (MTU).
  • Protocol Data Unit (PDU): Packet.
  • Hardware Devices: Routers, Layer 3 Managed Switches, Firewalls.
  • Core Protocols: IPv4, IPv6, ICMP (Ping / Traceroute diagnostics), IPsec, IGMP, OSPF, BGP, RIP.
LAYER 2

6. Data Link Layer (Layer 2)

Primary Function: Responsible for hop-to-hop physical node delivery across a single physical link or local network segment. It converts packets into frames and handles physical MAC addressing and error detection.

  • Sublayer Structure:
    LLC (Logical Link Control - IEEE 802.2): Interfaces with Layer 3, manages protocol multiplexing, and controls frame sequencing.
    MAC (Media Access Control - IEEE 802.3 / 802.11): Manages hardware 48-bit MAC addressing, frame creation, and media access control methods (CSMA/CD for Ethernet, CSMA/CA for Wi-Fi).
  • Key Responsibilities: Physical MAC addressing (Source & Destination MAC), framing, Media Access Control, and Error Detection via Frame Check Sequence (FCS) CRC polynomials.
  • Protocol Data Unit (PDU): Frame.
  • Hardware Devices: Layer 2 Managed Switches, Network Interface Cards (NICs), Bridges, Wireless Access Points.
  • Core Standards: Ethernet (802.3), Wi-Fi (802.11), PPP, HDLC, ARP, 802.1Q VLAN Tagging.
LAYER 1

7. Physical Layer (Layer 1)

Primary Function: Transmits raw unstructured binary bits (1s and 0s) over a physical transmission medium (copper cable, optical fiber strand, or radio frequency wireless channel).

  • Key Responsibilities: Bit representation (encoding binary values into electrical voltage levels, optical light pulses, or RF carrier phase shifts), bit synchronization, transmission rate (bit rate), physical topology layout, and hardware interface specifications.
  • Protocol Data Unit (PDU): Bits.
  • Hardware & Media: CAT5e / CAT6 Copper Cabling, Single-mode & Multi-mode Fiber Optics, RJ45 connectors, SFP Transceivers, Network Hubs, Repeaters.

4. Layer-by-Layer Breakdown: TCP/IP 4-Layer Internet Suite

The TCP/IP suite was designed by the US Department of Defense (DoD) and refined by the IETF. It prioritizes practical internetworking by consolidating functions into 4 operational layers:

TCP/IP LAYER 4

1. Application Layer

Consolidates OSI Layers 5, 6, and 7. Handles high-level application communication, data formatting, encryption, character encoding, and session control directly within application protocols.

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

TCP/IP LAYER 3

2. Transport Layer

Maps directly to OSI Layer 4. Manages end-to-end process-to-process data delivery, port multiplexing, segmentation, flow control, and error recovery.

Protocols: TCP (Connection-Oriented), UDP (Connectionless).

TCP/IP LAYER 2

3. Internet Layer

Maps directly to OSI Layer 3. Responsible for logical IP addressing, packet routing across autonomous networks, path determination, and ICMP diagnostic messaging.

Protocols: IPv4, IPv6, ICMP, ARP, BGP, OSPF.

TCP/IP LAYER 1

4. Network Access / Link Layer

Consolidates OSI Layers 1 and 2. Manages hardware device drivers, Network Interface Cards (NICs), physical MAC addressing, Ethernet framing, and electrical/optical signal transmission.

Standards: Ethernet (802.3), Wi-Fi (802.11), PPP, Fiber SFP.

5. Comparison Matrix: OSI vs. TCP/IP Architecture

Architectural Feature OSI 7-Layer Reference Model TCP/IP 4-Layer Internet Suite
Standardization Body ISO (International Organization for Standardization) IETF (Internet Engineering Task Force) / DoD
Number of Layers 7 Strict Functional Layers 4 Practical Operational Layers
Development Order Model created before protocols were written (Theoretical) Protocols developed first, model created to describe suite (Practical)
Session & Presentation Explicit separate layers (Layer 5 & Layer 6) Integrated directly into the Application Layer (Layer 4)
Primary Purpose Conceptual guide for educational & vendor standardization Actual commercial architecture powering the global Internet

6. Deep Dive Protocol Header Specifications

TCP Header Format (20-60 Bytes)

TCP provides reliable, connection-oriented, ordered byte-stream delivery with flow control (sliding window) and error recovery.

TCP Segment Header Structure
+-------------------------------+-------------------------------+
|     Source Port (16 Bits)     |  Destination Port (16 Bits)   |
+-------------------------------+-------------------------------+
|                 Sequence Number (32 Bits)                     |
+-------------------------------+-------------------------------+
|              Acknowledgment Number (32 Bits)                  |
+-------+-------+---------------+-------------------------------+
| Data  | Resv  | Flags (6 Bits)|     Window Size (16 Bits)     |
| Offset|       |U|A|P|R|S|F|   |                               |
+-------+-------+---------------+-------------------------------+
|    Header Checksum (16 Bits)  |    Urgent Pointer (16 Bits)   |
+-------------------------------+-------------------------------+

Key TCP Control Flags: SYN (Synchronize), ACK (Acknowledge), FIN (Finish connection), RST (Reset connection), PSH (Push data immediately), URG (Urgent data pointer valid).

UDP Header Format (8 Bytes)

UDP provides lightweight, connectionless, unreliable datagram delivery without handshake overhead or retransmission delays.

UDP Datagram Header Structure
+-------------------------------+-------------------------------+
|     Source Port (16 Bits)     |  Destination Port (16 Bits)   |
+-------------------------------+-------------------------------+
|      Length (16 Bits)         |     Checksum (16 Bits)        |
+-------------------------------+-------------------------------+

UDP Applications: VoIP, Live Video Streaming, DNS Query (Port 53), DHCP (Port 67/68), SNMP.

7. Interactive TCP 3-Way Handshake Connection Simulator