π Advanced Real-Time Collaboration System
A distributed networking system showcasing custom protocol implementations
SyncroX is a real-time collaborative and communication platform demonstrating advanced networking concepts including custom TCP protocols, Tahoe/Reno congestion control, RTT estimation, and secure Docker-based code execution β all built entirely from scratch using Python sockets. It features reliable file sharing, instant messaging with image CDN, and synchronous collaborative editing.
|
|
|
|
π₯οΈ Application Interface
π Home Dashboard |
π File Transfer |
π» Code Editor |
β‘ Code Execution |
π Congestion Control Analytics
π RTT vs Chunk Sequence & CWND vs Event Sequence |
π Window Size vs Transmission Round |
π Service Details
| Service | Port | Protocol | Description |
|---|---|---|---|
| π₯οΈ Frontend | 8501 |
HTTP | Streamlit UI Gateway |
| π Room Manager | 9013 |
TCP | Room lifecycle management |
| π¬ Chat Service | 9009 |
TCP | Messaging & image CDN |
| π File Control | 9010 |
TCP | File listing & signaling |
| π‘ File Data | 9011 |
UDP | Reliable data transfer |
| π Collab Service | 9011 |
TCP | Document synchronization |
| π³ Exec Service | 9012 |
TCP | Docker code execution |
π§ Reliable UDP Protocol
{
"type": "DATA", // SYN | SYN-ACK | ACK | DATA | FIN | FIN-ACK
"seq": 105, // Sequence Number
"ack": 105, // Acknowledgement Number
"rwnd": 64, // Receiver Window Size
"room": "ABCD", // Room context
"filename": "doc.pdf", // File context
"payload_b64": "...", // Base64 encoded chunk (4KB)
"session_id": "a1b2c3d4" // Session token
}| Parameter | Formula | Value |
|---|---|---|
| Smoothed RTT | (1-Ξ±)Β·SRTT + Ξ±Β·RTTsample |
Ξ± = 0.125 |
| RTT Variance | `(1-Ξ²)Β·RTTVAR + Ξ²Β· | SRTT - RTTsample |
| RTO | SRTT + 4Β·RTTVAR |
Min: 200ms |
| Event | Tahoe π’ | Reno π¦ |
|---|---|---|
| Timeout | CWND = 1, Slow Start | Same |
| 3 Dup ACKs | CWND = 1, Slow Start | CWND = ssthresh + 3, Fast Recovery |
π¬ TCP Chat Protocol
| Command | Direction | Description |
|---|---|---|
HELLO <user> <room> |
C β S | Join room |
MSG <content> |
C β S | Send message |
IMG <filename> <b64> |
C β S | Upload image |
GET_IMG <filename> |
C β S | Fetch image |
BYE |
C β S | Disconnect |
| Step | Action | Description |
|---|---|---|
| 1 | π€ Broadcast | Server sends metadata only |
| 2 | πΌοΈ Render | Client shows placeholder |
| 3 | π₯ Fetch | On-demand binary request |
| 4 | πΎ Cache | Store in backend/data/cdn/ |
π‘οΈ Docker Security Profile
| Flag | Value | Purpose |
|---|---|---|
--network |
none |
Total network isolation |
--memory |
256m |
Prevent RAM exhaustion |
--cpus |
0.5 |
Fair CPU scheduling |
--pids-limit |
64 |
Prevent fork bombs |
--rm |
true |
Auto-cleanup containers |
β
Python 3.10+ (required for match-case syntax)
β
Docker Desktop (must be running for code execution)
β
pip (for dependency management)
# Clone the repository
git clone https://github.com/Abs-Futy7/SyncroX.git
cd SyncroX
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Build Docker image
docker build -t syncro-sandbox ./backend/code_exec/
# Start servers
python start_all_servers_venv.py
# Launch frontend (new terminal)
streamlit run frontend/streamlit_app/app.py
β οΈ Note: Ensure Docker Desktop is running before starting the servers.
| Step | Action | Expected |
|---|---|---|
| 1 | Click "Create New Room" | 4-digit code appears |
| 2 | Open new tab, enter code | Join as second user |
| 3 | Send chat message | Instant delivery |
| 4 | Upload file | See congestion graph |
| 5 | Run code | Docker execution works |
SyncroX/
βββ π backend/
β βββ π code_exec/ # π³ Docker execution engine
β βββ π collab/ # π Collaborative editor
β βββ π file_transfer/ # π‘ UDP file transfer
β βββ π room_mgmt/ # π Room management
β βββ π tcp_chat/ # π¬ Chat protocol
βββ π frontend/ # π₯οΈ Streamlit UI
βββ π App_Screenshots/ # πΈ Screenshots
βββ π assets/ # π¨ Branding
βββ π config.py # βοΈ Configuration
βββ π requirements.txt # π¦ Dependencies
βββ π start_all_servers_venv.py # π Launcher
H.M. Mehedi Hasan Β Β β’Β Β MD. Abu Bakar Siddique
Built with β€οΈ using Python Sockets & Streamlit
β Star this repository if you found it helpful!









