Skip to content

RohitPatidar123-hub/socket-programming-tcp-distributed-scheduling

Repository files navigation

socket-programming-tcp-distributed-scheduling

Implementation of socket programming concepts in C++: TCP client-server communication, concurrent connections, distributed access protocols (Slotted ALOHA, Binary Exponential Backoff), and centralized scheduling (FIFO, Round Robin). Includes performance analysis, experiments, and plotting results.

Socket Programming & Scheduling Algorithms

📌 Overview

This repository implements socket programming and scheduling algorithms as part of the COL334/672 (Computer Networks) assignment at IIT Delhi.
The project covers TCP client-server communication, concurrent connections, distributed protocols, and centralized scheduling policies with performance analysis and experiments.


📂 Assignment Parts

  1. Part 1 – Word Counting Client

    • TCP client-server word frequency counter using memory-mapped files.
    • Experiments with varying packet sizes (p).
  2. Part 2 – Concurrent Clients

    • Server extended to support multiple simultaneous clients.
    • Performance analysis across 1–32 clients.
  3. Part 3 – Grumpy Server

    • Distributed communication protocols under collision handling:
      • Slotted ALOHA
      • Binary Exponential Backoff (BEB)
      • Carrier-Sensing + BEB
  4. Part 4 – Friendly Server

    • Centralized scheduling at the server:
      • FIFO Scheduling
      • Round Robin Scheduling
    • Fairness experiments with rogue clients.

⚙️ Implementation Details

  • Language: C++ (POSIX sockets, pthreads for concurrency)
  • Config: config.json defines server IP, port, clients, and parameters.
  • Build System: Makefile for compilation & automation (make build, make run, make plot).
  • Plotting: Python/Matplotlib scripts for performance visualization.

📊 Experiments & Results

  • Completion time vs packet size (p)
  • Completion time per client vs number of clients
  • Comparison of Slotted ALOHA, BEB, and CS-BEB
  • FIFO vs Round Robin scheduling fairness (Jain’s index)

Plots and detailed analysis included in report.pdf.


🚀 How to Run

  1. Clone the repository:
    git clone https://github.com/<your-username>/socket-programming-tcp-distributed-scheduling.git
    cd socket-programming-tcp-distributed-scheduling

Navigate to a part (e.g., part1):

bash Copy Edit cd part1 make build make run make plot Generated plots will be saved as plot.png.

About

Implementation of socket programming concepts in C++: TCP client-server communication, concurrent connections, distributed access protocols (Slotted ALOHA, Binary Exponential Backoff), and centralized scheduling (FIFO, Round Robin). Includes performance analysis, experiments, and plotting results.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors