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.
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.
-
Part 1 – Word Counting Client
- TCP client-server word frequency counter using memory-mapped files.
- Experiments with varying packet sizes (
p).
-
Part 2 – Concurrent Clients
- Server extended to support multiple simultaneous clients.
- Performance analysis across 1–32 clients.
-
Part 3 – Grumpy Server
- Distributed communication protocols under collision handling:
- Slotted ALOHA
- Binary Exponential Backoff (BEB)
- Carrier-Sensing + BEB
- Distributed communication protocols under collision handling:
-
Part 4 – Friendly Server
- Centralized scheduling at the server:
- FIFO Scheduling
- Round Robin Scheduling
- Fairness experiments with rogue clients.
- Centralized scheduling at the server:
- Language: C++ (POSIX sockets, pthreads for concurrency)
- Config:
config.jsondefines server IP, port, clients, and parameters. - Build System:
Makefilefor compilation & automation (make build,make run,make plot). - Plotting: Python/Matplotlib scripts for performance visualization.
- 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.
- 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.