Project

NetworkComm

TCP client-server messaging application demonstrating networking, concurrency, protocol design, and systems fundamentals.

Quick Facts

Type: TCP messaging app

Focus: Networking and concurrency

Role: Client implementation and server refinement

Stack: Python, sockets, threading

The system running

A real session: the server and two clients, Alice and Bob, running locally. Alice broadcasts a message and creates a chat room, Bob joins it and replies, they exchange a private message, and Bob hides his connection and disconnects.

Three terminals showing the NetworkComm server log and the Alice and Bob clients exchanging messages
Server log and two clientsBroadcast, chat rooms, direct messages, visibility controls and timestamped server-side logging.

Overview

A practical networking project focused on real-time communication, concurrent execution, and client-server coordination.

NetworkComm is a Python-based TCP client-server messaging application built to explore networking, concurrency, and protocol design through real-time communication.

The system allows multiple clients to connect to a central server and exchange messages using TCP sockets, multithreading, and a text-based messaging protocol.

The project prioritised correctness, coordination, and realistic networking behaviour over interface complexity while providing practical exposure to client-server architectures and concurrent execution.

My Contribution

Server refinement, independent client implementation, and reliability improvements.

Server Work

The server component was originally developed collaboratively as part of coursework. I independently extended and refined it by improving reliability, readability, and coordination behaviour.

Enhancements included structured logging, improved disconnect handling, clearer routing behaviour, better message formatting, and stronger coordination between connected clients.

Message Routing Error Handling Structured Logging Client Coordination Maintainability

Client Work

I implemented the client independently, including user interaction, connection handling, retry logic, and concurrent message processing.

Sending and receiving execute independently so incoming messages remain responsive without blocking user interaction.

Async Receive Retry Logic CLI Interface Thread Coordination

Key Features

Messaging functionality built on top of an explicit text protocol.

TCP socket communication Multithreaded server Broadcast messaging Private messaging Chat rooms User visibility controls Timestamped formatting Graceful disconnect handling Connection retry logic

Communication is routed through the server to simplify coordination and maintain consistent shared state across connected users.

Client operations execute concurrently to support interactive messaging without blocking incoming traffic.

Architecture

Client-server coordination and concurrent execution model.

The application follows a centralised client-server architecture. The server listens on a configurable host and port while clients establish TCP connections and register identities.

For every connected client, the server creates a dedicated handler thread responsible for receiving messages, routing communication, maintaining state, and managing disconnect behaviour.

Messages are routed according to communication type, including broadcast messaging, private communication, and room-based interactions.

Client-side sending and receiving are handled concurrently using separate threads to preserve responsiveness and avoid blocking socket reads.

Thread-per-client Model Concurrent Execution Server Routing Shared State Coordination Async Client Behaviour

Tech Stack

Tools and technologies used.

Python socket threading UTF-8 Localhost LAN Testing

Getting Started

Running the server and connecting clients.

Start the server, then launch multiple clients to simulate concurrent users.

Run Server

python server.py

Run Client

python mbylut003_client.py

Default connection settings: 127.0.0.1:44444

What I Learned

Systems concepts explored during development.

This project strengthened my understanding of TCP/IP communication, concurrency using threads, client-server coordination, and protocol behaviour.

It also introduced practical networking concerns including retry behaviour, disconnect recovery, state consistency, synchronization, message ordering, and failure handling.

TCP/IP Concurrency Protocol Design Network Debugging Failure Handling Systems Thinking

Limitations and Scope

Intentionally excluded production features.

The project prioritises networking concepts and correctness over production security.

Authentication, encryption, persistence, distributed coordination, and scalability mechanisms remain intentionally out of scope.

No Encryption No Authentication In-memory State Single-server Model

Future Enhancements

Logical next steps for making the system more robust.

Planned improvements include protocol framing, authentication, TLS support, persistent chat history, room metadata storage, asynchronous I/O, configurable logging, automated testing, and performance benchmarking under larger client loads.

Message Framing Authentication TLS Persistence Async I/O Testing Benchmarking
Back to Projects