IDRASAcademic OS
Unit 1: Network Architecture & The TCP/IP Protocol Suite 35 mins study timeFOUNDATION

TCP/IP Protocol Architecture & The TCP 3-Way Handshake Connection Lifecycle

OSI 7-layer model vs TCP/IP 4-layer model, SYN/SYN-ACK/ACK connection establishment, sliding window, and flow control.

Verified: Faculty Peer Review Board

Learning Objectives

    Essential Prerequisites

      Layer 1: Intuition & Why It Matters

      The Core Mental Model

      “Internet ko samajhne ke liye ek Walkie-Talkie conversation samjhiye: Jab do log baat karte hain: - Banda A: "Kya aap meri aawaz sun sakte hain? (SYN)" - Banda B: "Haan, main sun sakta hoon, kya aap mujhe sun sakte hain? (SYN-ACK)" - Banda A: "Haan, bilkul saaf aawaz hai! (ACK)" Ab dono ke beech connection establish ho gaya! Yahi TCP ka 3-Way Handshake hai! TCP reliable kyun hai? Kyunki agar koi packet raste me gir gaya (packet loss), to TCP receiver batata hai ki "Yeh byte nahi mila", aur sender usko turant dobara bhejta hai (Retransmission)!”

      Why This Exists

      Internet par har web page, API call, aur video stream TCP/IP protocol suite par travel karta hai.

      Beginner Foundation

      Internet ko samajhne ke liye ek Walkie-Talkie conversation samjhiye: Jab do log baat karte hain: - Banda A: "Kya aap meri aawaz sun sakte hain? (SYN)" - Banda B: "Haan, main sun sakta hoon, kya aap mujhe sun sakte hain? (SYN-ACK)" - Banda A: "Haan, bilkul saaf aawaz hai! (ACK)" Ab dono ke beech connection establish ho gaya! Yahi TCP ka 3-Way Handsh...

      Micro Concepts Decomposition

      MICRO CONCEPT 1Canonical Object

      Layered Protocol Encapsulation (PDUs)

      Data descends layers gaining headers: Application (Data) -> Transport (Segment) -> Network (Packet) -> Data Link (Frame) -> Physical (Bits).

      Key Takeaway: Decoupling protocol layers enables swapping physical Wi-Fi for Ethernet without altering application HTTP code.
      MICRO CONCEPT 2Canonical Object

      TCP 3-Way Handshake State Transitions

      Client sends SYN (seq=x); Server responds SYN-ACK (seq=y, ack=x+1); Client sends ACK (seq=x+1, ack=y+1). Both reach ESTABLISHED.

      Key Takeaway: The 3-way handshake synchronizes sequence numbers, establishing reliable bidirectional byte streams.
      Layer 3 & 4: Formal Specification & Mechanism

      Hardware State Machine Architecture

      TCP State Transition Lifecycle: 1. Client sends SYN=1, ACK=0, ISN_c. State: SYN_SENT. 2. Server responds SYN=1, ACK=1, ack=ISN_c + 1, ISN_s. State: SYN_RCVD. 3. Client acknowledges with ACK=1, seq=ISN_c + 1, ack=ISN_s + 1. Both endpoints reach ESTABLISHED. Flow Control: Advertised Window (rwnd) in TCP header header throttles sender to prevent buffer overflow.
      1. Client constructs TCP segment. 2. Server validates listening socket on port. 3. Allocates Transmission Control Block (TCB). 4. Socket transitions to ESTABLISHED. 5. Byte stream read/write queues activated.
      Layer 7: Interactive Laboratory

      Interactive Simulator

      NETWORKS • SIMULATIONTCP 3-Way Handshake & Socket State Machine Laboratory
      Launch Fullscreen Lab
      NETWORKS • TRANSPORT LAYERTransmission Control Protocol (TCP)

      TCP 3-Way Handshake (SYN → SYN-ACK → ACK) Laboratory

      State: SYN_SENT
      Handshake Packet:1/ 3
      Client Host (Initiator)
      192.168.1.10:52410
      Socket State: SYN_SENT
      Packet in Transit (CLIENT TO SERVER)
      [SYN]
      Seq = 1000 | Ack = 0
      ═════════▶
      Server Host (Listener)
      10.0.0.1:443 (HTTPS)
      Socket State: LISTEN -> SYN_RCVD
      Protocol Step #1:

      Client initiates connection: Sends SYN packet with Initial Sequence Number (ISN_c = 1000).

      Layer 5: Step-by-Step Worked Numerical Example

      End-to-End Execution Trace

      TCP Window Calculation: If receiver buffer has 64 KB free space, rwnd = 65,535 bytes. Sender transmits up to 64 KB of unacknowledged data before pausing.
      Layer 6: Active Runtime CodeLab

      Step-by-Step Code Execution (PYTHON)

      SQL Studio
      Font
      main.pyGlacier Light
      Ln 1 • Python 3.12
      1
      2
      3
      4
      5
      6
      7
      8
      152 chars • 8 lines • Ln 1UTF-8 • 4 Spaces
      Interactive Terminal Shell

      Sandbox Terminal Ready

      Click Run Code or press Ctrl+Enter to compile and execute.

      ⚡ AURXON Bitstream Runtime v4.8IDRAS Academic Virtual Node
      Layer 8: Practice & Knowledge Verification

      Active Assessment Quiz

      No Practice Questions Configured

      Questions for this topic are currently undergoing faculty review.

      Academic Evaluation Preparation

      Viva Examination & University Scoring Strategy

      Standard Viva Examination Questions

      How to Write High-Scoring University Exam Answers

      Draw the timing diagram for the 3-Way Handshake with sequence numbers, explain sliding window, and contrast TCP and UDP.