This project implements a custom application-layer protocol over TCP that enables session-based multipath data transmission and deterministic reconstruction at the server.
The system demonstrates how multiple concurrent TCP connections can be unified into a single logical session, allowing data to be split across paths while preserving correctness at the application layer.
The current implementation uses UTF-8 text payloads. However, the protocol is agnostic to payload type and supports arbitrary binary data.
This repository is organized as a sequence of incremental prototypes, each introducing a new networking concept and building toward the final system.
Each directory represents a self-contained milestone in the design process.
-
1_BasicClientServerMinimal TCP client-server communication.
-
2_MessageBoundariesDemonstrates why TCP requires application-layer framing and buffering.
-
3_MultipleClientsIntroduces concurrent client handling using threads.
-
4_ChunkedTransmissionImplements application-layer chunking and deterministic reconstruction.
-
5_MultiPath (final integrated implementation)Adds server-assigned session identifiers and control-plane handshake. Routes chunks across multiple concurrent TCP connections and unifies state at the session level for correct reconstruction.
The final design builds directly on concepts introduced in earlier stages.
-
Application-Layer Framing
TCP provides a byte stream without message boundaries. All protocol messages are explicitly framed using newline delimiters and reconstructed using byte buffers. -
Session Establishment (Control Plane)
A server-assignedsession_idis negotiated via a lightweight control handshake. This allows multiple TCP connections to be associated with the same logical session. -
Multipath Data Transfer (Data Plane)
Application data is chunked and transmitted across multiple TCP sockets concurrently. The server reconstructs messages by unifying state at the session level. -
State Unification Across Connections
All connections belonging to a session share reconstruction state, enabling correct reassembly even when chunks arrive via different paths.
- Client initiates a session using the frame
SESSION|NEW - Server assigns a unique session identifier
- Additional connections attach using the same session ID
- Messages are split into fixed-size chunks
- Chunks are framed as:
[item_id|chunk_id|total_chunks|payload] - Chunks are routed deterministically across multiple sockets
- Server reconstructs the original message once all chunks arrive
server.py— Session management, framing, and reconstruction logicclient.py— Session handshake, chunking, and multipath transmission
Future extensions of this system include integrating cryptographic encoding, adaptive routing policies, and systematic performance evaluation under controlled failure conditions.
The current implementation chunks application data directly and transmits it across multiple independent paths. This architecture naturally supports the integration of secret sharing schemes such as Shamir’s Secret Sharing, where each transmitted chunk represents a share of the original message. In such a design, confidentiality is preserved even if individual paths are compromised, as reconstruction is only possible upon receiving a sufficient subset of shares.
This layering aligns with post-quantum resilient communication models, where security is achieved through distributed encoding and path diversity rather than reliance on a single cryptographic primitive.
This project was developed to explore foundational networking concepts relevant to resilient and post-quantum communication systems, including session management, multipath routing, and application-layer protocol design.