Skip to content

thakurankeshkumar/ipcDebugger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPC Debugger

Interactive operating-systems project for simulating and analyzing Inter-Process Communication (IPC) behavior.
The platform lets you create processes, connect them using IPC channels, send messages, visualize communication, detect deadlocks, analyze bottlenecks, and export secure logs.

Table of Contents

Overview

IPC Debugger is a full-stack web application built with Next.js App Router that simulates process communication patterns and system behavior.

It is designed for:

  • Operating systems coursework and labs
  • IPC concept demonstration
  • Deadlock/bottleneck experimentation
  • Event auditing and export for reports

The system currently stores data in-memory (server process lifetime), making it lightweight and fast for academic and local analysis workflows.

Key Features

1) Simulation Lifecycle

  • Create, start, stop, inspect, and delete simulations
  • Auto-track simulation status and timestamps

2) Process Management

  • Add processes with priorities
  • Update process states (ready, running, waiting, blocked, terminated)
  • Delete processes with automatic cleanup of associated channels

3) IPC Channel Management

  • Create channels between processes
  • Supported channel types:
    • pipe
    • queue
    • shmem
  • Delete channels and related message records

4) Message Transmission Simulation

  • Send messages through channels with IPC-type-aware delays
  • Pipe transfer checks buffer constraints
  • Queue transfer supports priority effect on latency
  • Shared memory simulates mutex/no-mutex behavior

5) Deadlock Detection

  • Resource Allocation Graph (RAG)-style cycle detection
  • Returns deadlock status, process cycle, and mitigation suggestion
  • Generates events when deadlock is detected

6) Bottleneck Analysis

  • Tracks and analyzes process/channel delays
  • Flags slow processes/channels based on threshold (default 500ms)
  • Returns optimization suggestions

7) Real-Time Visualization UI

  • Canvas-based process/channel graph
  • Live process status and channel views
  • Deadlock and bottleneck simulation triggers for visual demo

8) Event Logging & Secure Export

  • Centralized event stream for simulation activities
  • Filtering, searching, and pagination in UI
  • Optional anonymization in logs page
  • Export logs in JSON/CSV

Tech Stack

  • Framework: Next.js 16.2.2 (App Router)
  • UI: React 19.2.4
  • Rendering/Visualization: Canvas API, Chart.js 4.5.1
  • Backend: Next.js Route Handlers (app/api/**)
  • Storage: In-memory singleton store (lib/store.js)
  • Language: JavaScript

Project Structure

app/
	page.js                     # Landing page
	about/page.js               # Project documentation page
	dashboard/page.js           # Main control panel (create/process/channel/message/control)
	visualization/page.js       # Live IPC graph and anomaly simulation
	logs/page.js                # Event logs, filters, export, anonymization
	api/
		simulation/*              # Simulation lifecycle APIs
		process/*                 # Process creation/state/delete APIs
		ipc/*                     # IPC channel creation/deletion/message send APIs
		deadlock/*                # Deadlock analysis APIs
		bottleneck/*              # Bottleneck analysis APIs
		statistics/*              # Aggregate simulation statistics
		events/*                  # Event feed APIs
		export/logs/*             # Log export endpoints
		reset/*                   # Reset in-memory store

lib/
	store.js                    # In-memory entities + CRUD + stats + event store
	services/
		IPCSimulator.js           # IPC-type-specific message delay simulation
		DeadlockDetector.js       # Cycle detection logic
		BottleneckAnalyzer.js     # Delay analysis and recommendations

How It Works

  1. User creates a simulation from the dashboard.
  2. User adds processes and configures IPC channels.
  3. User sends messages across channels.
  4. System computes IPC delay, updates process states, and stores events.
  5. Stats, logs, visualization, deadlock checks, and bottleneck reports read from the same in-memory state.

Setup & Run

Prerequisites

  • Node.js 18+ (recommended latest LTS)
  • npm (or compatible package manager)

Installation

npm install

Development

npm run dev

Open: http://localhost:3000

Production Build

npm run build
npm run start

API Reference

All APIs are under the /api prefix.

Simulation APIs

Method Endpoint Purpose
POST /api/simulation/create Create a simulation
POST /api/simulation/start Set simulation status to running
POST /api/simulation/stop Set simulation status to stopped
GET /api/simulation/:simId Get simulation with processes and channels
DELETE /api/simulation/:simId Delete simulation and related data

Example payloads:

{
	"name": "OS Lab Simulation",
	"config": {}
}
{
	"simulation_id": 1
}

Process APIs

Method Endpoint Purpose
POST /api/process/create Create a process
PUT /api/process/:procId/state Update process state
DELETE /api/process/:procId Delete process and associated channels

Create process payload:

{
	"simulation_id": 1,
	"name": "Producer",
	"priority": 5
}

State update payload:

{
	"state": "running"
}

IPC APIs

Method Endpoint Purpose
POST /api/ipc/create Create IPC channel
POST /api/ipc/send Send message through channel
DELETE /api/ipc/:channelId Delete channel

Create channel payload:

{
	"simulation_id": 1,
	"type": "pipe",
	"sender_id": 1,
	"receiver_id": 2,
	"config": {}
}

Send message payload:

{
	"channel_id": 1,
	"content": "hello from producer"
}

Analysis APIs

Method Endpoint Purpose
GET /api/deadlock/detect/:simId Detect deadlocks using process-resource graph
GET /api/bottleneck/analyze/:simId Analyze process/channel delays and bottlenecks
GET /api/statistics/:simId Aggregate counts, latency, deadlock count, IPC distribution

Event & Export APIs

Method Endpoint Purpose
GET /api/events/:simId?limit=100 Fetch simulation events
GET /api/export/logs/:simId?format=json Export logs as JSON
GET /api/export/logs/:simId?format=csv Export logs as CSV
POST /api/reset Reset entire in-memory store

Typical Workflow

  1. Go to Dashboard.
  2. Create a simulation (auto-created on first load if none exists).
  3. Add processes (e.g., Producer, Consumer, Worker).
  4. Create IPC channels between processes.
  5. Send messages and observe delay feedback.
  6. Open Visualization for network view and anomaly simulation.
  7. Open Logs for filtered event analysis and secure export.
  8. Use analysis APIs or pages to inspect deadlocks and bottlenecks.

Data Model (In-Memory)

Entities managed by lib/store.js:

  • simulations
  • processes
  • channels
  • messages
  • events

ID counters are auto-incremented in memory.

Statistics include:

  • Total processes/channels/messages
  • Average latency
  • Deadlock event count
  • IPC distribution by channel type

Important Notes

  • Data is not persistent across server restarts.
  • The app keeps the current simulation id in browser localStorage.
  • Reset endpoint clears all in-memory entities and resets id counters.
  • Latency is simulated (not measured from actual OS kernel IPC primitives).

Future Enhancements

  • Add persistent DB support (SQLite/PostgreSQL/MongoDB)
  • Add authentication and multi-user simulation ownership
  • Add advanced deadlock prevention strategies
  • Add message replay and timeline mode
  • Add performance trend dashboards over time

Author

Operating Systems Project — IPC Debugger (2026)

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors