Skip to content

Distributed UDP Chat with GUI, Lamport ordering, and P2P discovery

Notifications You must be signed in to change notification settings

abhaymundhara/Distributed-P2P-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed P2P Chat

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.


🚀 Overview

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.


✨ Features

  • 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

🧠 System Architecture

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


🛠️ Tech Stack

  • Language: Python (update if needed)
  • Networking: Socket programming
  • Architecture: Distributed peer-to-peer
  • Protocol: TCP

📦 Setup & Installation

  1. Clone the repository
git clone https://github.com/abhaymundhara/Distributed-P2P-Chat.git
cd Distributed-P2P-Chat
  1. Install dependencies
pip install -r requirements.txt
  1. Run a peer
python peer.py

Run 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

⚠️ Limitations • No message encryption (plain text communication) • No persistent message storage • Manual peer discovery • Intended for learning and experimentation, not production use

🔮 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

About

Distributed UDP Chat with GUI, Lamport ordering, and P2P discovery

Topics

Resources

Stars

Watchers

Forks

Languages