Group 133 - CSE 434 Computer Networks Fall 2025
This project implements a distributed storage system (DSS) using Block-Interleaved Distributed Parity (BIDP) with socket programming. The system consists of three main components:
- Manager Process - Central coordinator managing DSSs, users, and disks
- Disk Processes - Storage nodes implementing the disk array
- User Processes - Clients that store and retrieve files from the DSS
The system implements a RAID-like distributed storage system where:
- Files are striped across multiple disk processes
- Parity blocks provide fault tolerance
- Block-interleaved distributed parity ensures even distribution of parity across disks
- Multi-threading enables parallel operations for improved performance
register-user- Register a user with the systemregister-disk- Register a disk with the systemconfigure-dss- Create a new DSS with specified parametersls- List all DSSs and their filescopy- Copy a file to a DSS (two-phase operation)read- Read a file from a DSSdisk-failure- Simulate disk failure and recoverydecommission-dss- Decommission a DSSderegister-user- Remove a user from the systemderegister-disk- Remove a disk from the system
- Block-Interleaved Distributed Parity (BIDP) - Files are striped with parity distributed across disks
- Parallel Operations - Multi-threaded copy, read, and recovery operations
- Error Detection - Parity verification with retry mechanisms
- File Integrity - Automatic verification using diff command
- Disk Failure Simulation - Random disk failure with data reconstruction
- Recovery Mechanisms - Automatic reconstruction of failed disks using parity
- Critical Sections - Proper synchronization for file operations
- Python 3.6+
- All processes must use ports in the range 67500-67999 (Group 133)
- Start the Manager:
cd /path/to/socket-project
PYTHONPATH=. python3 manager/main.py --port 67500 --verbose- Start Disk Processes:
PYTHONPATH=. python3 disk/main.py --name D1 --mgr-ip 127.0.0.1 --mgr-port 67500 --m-port 67501 --c-port 67502 --verbose
PYTHONPATH=. python3 disk/main.py --name BigD --mgr-ip 127.0.0.1 --mgr-port 67500 --m-port 67503 --c-port 67504 --verbose
PYTHONPATH=. python3 disk/main.py --name GigD --mgr-ip 127.0.0.1 --mgr-port 67500 --m-port 67505 --c-port 67506 --verbose- Start User Processes:
PYTHONPATH=. python3 user/main.py --name User1 --mgr-ip 127.0.0.1 --mgr-port 67500 --m-port 67513 --c-port 67514 --verboseYou can test the system by following the demo commands in docs/demo_commands.md or by manually running the components and testing the commands.
See docs/demo_commands.md for complete demo sequences including:
- System startup across multiple hosts
- File operations (copy, read, list)
- Disk failure simulation and recovery
- DSS decommissioning
socket-project/
├── manager/
│ └── main.py # Manager process implementation
├── disk/
│ └── main.py # Disk process implementation
├── user/
│ └── main.py # User process implementation
├── common/
│ └── config.py # Configuration and port management
├── docs/
│ ├── DESIGN.md # Design document
│ ├── CHECKLIST.md # Submission checklist
│ └── demo_commands.md # Demo command sequences
├── samples/
│ ├── day-of-affirmation.txt
│ ├── in-flanders.txt
│ ├── tale-of-two-cities.txt
│ └── wizard-of-oz.txt
├── .gitignore # Git ignore file
├── LICENSE # Project license
├── Makefile # Build configuration
├── requirements.txt # Python dependencies
├── Socket-Project.pdf # Project specification
└── README.md # This file
The system uses JSON-based UDP messages with the following structure:
{
"cmd": "command-name",
"param1": "value1",
"param2": "value2"
}{
"cmd": "write-block|read-block|fail|decommission",
"dss_name": "DSS1",
"file_name": "example.txt",
"stripe_idx": 0,
"block_type": "data|parity",
"block_data": "hex_encoded_data"
}Group 133 uses ports 67500-67999. The system maps logical ports to OS ports in the ephemeral range (49152-65535) to ensure compatibility.
The system uses multi-threading for:
- Manager: Separate threads for m-port and c-port communication
- Disk: Separate threads for m-port and c-port communication
- User: Separate threads for m-port and c-port communication
- File Operations: Parallel block operations during copy, read, and recovery
- Network Errors: Automatic retry with exponential backoff
- Parity Errors: Automatic retry with error detection
- Disk Failures: Graceful handling with reconstruction
- Invalid Commands: Proper error responses with detailed messages
The system includes comprehensive testing:
- Unit Tests: Individual component testing
- Integration Tests: Full system testing
- Demo Scripts: Complete demonstration sequences
- Error Scenarios: Failure and recovery testing
- JSON Messages: Human-readable and easy to debug
- UDP Sockets: Lightweight for high-performance operations
- Threading: Parallel operations for improved performance
- BIDP: Even distribution of parity across disks
- Port Mapping: Logical to OS port mapping for compatibility
- Persistent Storage: File system integration
- Load Balancing: Dynamic DSS selection
- Compression: Data compression for storage efficiency
- Encryption: Data encryption for security
- Monitoring: Real-time system monitoring
This is a course project for CSE 434. Please refer to the course guidelines for submission requirements.
This project is part of CSE 434 coursework at Arizona State University.