A distributed peer-to-peer chat application that enables direct communication between nodes without relying on a central server. The system focuses on decentralization, fault tolerance, and real-time messaging using networking fundamentals.
This project implements a P2P chat system where each participant (peer) can act as both a client and a server. Messages are exchanged directly between peers, reducing dependency on a centralized authority and improving resilience.
The application is designed to demonstrate core concepts of distributed systems, socket programming, and peer discovery.
- Peer-to-peer communication (no central chat server)
- Real-time message exchange
- Multiple peers can join the network
- Decentralized architecture
- Basic fault tolerance (peers can join/leave independently)
- Lightweight and fast
Each peer in the network:
- Opens a socket to listen for incoming connections
- Connects directly to other peers
- Sends and receives messages without a central coordinator
Peer A <––> Peer B
↕ ↕
Peer C <––> Peer D
- Language: Python (update if needed)
- Networking: Socket programming
- Architecture: Distributed peer-to-peer
- Protocol: TCP
- Clone the repository
git clone https://github.com/abhaymundhara/Distributed-P2P-Chat.git
cd Distributed-P2P-Chat- Install dependencies
pip install -r requirements.txt- Run a peer
python peer.pyRun the application in multiple terminals or on different machines to simulate multiple peers.
⸻
💬 Usage • Start peers on different ports or machines • Connect peers using IP address and port • Exchange messages directly between peers • Messages are delivered in real time
⸻
⸻
🔮 Future Improvements • End-to-end encryption • Automatic peer discovery • Message broadcasting • Chat rooms or group messaging • Graphical user interface • NAT traversal support
⸻
📚 Learning Outcomes
This project demonstrates: • Fundamentals of distributed systems • Peer-to-peer networking • Socket programming • Decentralized communication models • Fault tolerance principles