Implementation of client-server communication systems demonstrating progressive concurrency concepts through TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) protocols, all developed using Java SE 21. This project evolves from basic single-threaded operations to sophisticated message object exchange and detailed performance analysis under varying data loads.
- Objective: Client sends a single integer number to the server, the server increments it by one and returns the result, and the client prints the final result.
- Protocol: TCP
- Features: Single-threaded, one-time operation.
- Files:
Server_1.java,Client_1.java
- Objective: Extend Task 1 to use custom message objects transmitted between client and server.
- Message Object Contents:
- Incrementing number (the payload)
- Sender name identifier (
String) - Timestamp in milliseconds (
long)
- Protocol: TCP (requires Object Serialization)
- Files:
Server_2.java,Client_2.java,Message_2.java
- Objective: Extend message objects to include large data blobs for performance benchmarking.
- Data Blob Sizes (byte arrays): 1 KiB, 2 KiB, 4 KiB, 8 KiB, 16 KiB, 128 KiB.
- Execution: 1000 iterations for each specified data size.
- Analysis: Compute average transmission times (client send to client receive), and observe the performance impact of increasing payload size on both protocols.
- Protocol: Separate TCP and UDP implementations.
- Files (TCP):
Server_3.java,Client_3.java,Message_3.java - Files (UDP):
Server_3.java,Client_3.java,Message_3.java(shared b/w task_3 and task_4)
- Objective: Implement sophisticated concurrency patterns (e.g., Thread Pools, Executors, non-blocking I/O) and potential optimizations.
- Protocol: Separate TCP and UDP implementations.
- Files:
Server_4.java,Client_4.java,Message_3(Message_3.java(shared b/w task_3 and task_4))
Concurrency_task/
├── TCP/
│ ├── Server_1.java # Single-threaded TCP (Task 1)
│ ├── Server_2.java # Message object TCP (Task 2)
│ ├── Server_3.java # Performance analysis TCP (Task 3)
│ ├── Server_4.java # Advanced TCP (Task 4)
│ ├── Client_1.java # Basic TCP client
│ ├── Client_2.java # Message object client
│ ├── Client_3.java # Performance test client
│ ├── Client_4.java # Advanced client
│ ├── Message_2.java # Message class for Task 2
│ └── Message_3.java # Message class for Task 3 and Task 4
└── UDP/
├── Server_3.java # UDP server (Task 3)
├── Server_4.java # Advanced UDP (Task 4)
├── Client_3.java # UDP client (Task 3)
├── Client_4.java # Advanced UDP client (Task 4)
└── Message.java # Shared message class (Tasks 3-4)