An open API service indexing awesome lists of open source software.

https://github.com/sroman0/psr

PSR - Network Systems Programming is a project developed during the "Programmazione di Sistemi in Rete" (Network Systems Programming) course at UniversitΓ  degli Studi del Sannio. This repository provides practical implementations focused on web systems programming, with a particular emphasis on using UDP and TCP sockets in both C and Java.
https://github.com/sroman0/psr

c-programming concurrency educational-project html http java network-systems process-synchronization producer-consumer reader-writer restful-api tcp-socket udp-socket

Last synced: 3 months ago
JSON representation

PSR - Network Systems Programming is a project developed during the "Programmazione di Sistemi in Rete" (Network Systems Programming) course at UniversitΓ  degli Studi del Sannio. This repository provides practical implementations focused on web systems programming, with a particular emphasis on using UDP and TCP sockets in both C and Java.

Awesome Lists containing this project

README

        

# PSR - Network Systems Programming

This repository contains practical implementations developed during the *"Programmazione di Sistemi in Rete (PSR)"* (Network Systems Programming) course at **UniversitΓ  degli Studi del Sannio**. The project focuses on web systems programming with an emphasis on TCP and UDP socket communication in both **C** and **Java**. It includes examples of client-server architectures, concurrent connection handling, and data transmission over networks.

---

## πŸ“‘ Table of Contents
- [Project Overview](#project-overview)
- [Repository Structure](#repository-structure)
- [Requirements](#requirements)
- [Installation and Usage](#installation-and-usage)
- [1. Clone the Repository](#1-clone-the-repository)
- [2. Compile and Run (C Projects)](#2-compile-and-run-c-projects)
- [3. Compile and Run (Java Projects)](#3-compile-and-run-java-projects)
- [Implemented Features](#implemented-features)
- [Testing and Results](#testing-and-results)
- [License](#license)
- [Acknowledgments](#acknowledgments)

---

## πŸ“– Project Overview
The **PSR** project aims to provide hands-on experience with network programming concepts and practical implementations. It covers:
- **TCP and UDP communication**
- **Client-server models** in both C and Java
- **Concurrent connections management** (e.g., multi-threaded servers)
- **Data serialization and transmission** techniques
- **Socket creation and management** in different scenarios (e.g., echo servers, file transfer applications)

This repository serves as a learning tool for understanding low-level network communication and building robust networked applications.

---

## πŸ—‚οΈ Repository Structure
```
PSR/
β”œβ”€β”€ C/
β”‚ β”œβ”€β”€ tcp_server.c # TCP server implementation in C
β”‚ β”œβ”€β”€ tcp_client.c # TCP client implementation in C
β”‚ β”œβ”€β”€ udp_server.c # UDP server implementation in C
β”‚ β”œβ”€β”€ udp_client.c # UDP client implementation in C
β”‚ └── Makefile # Build automation for C programs
β”œβ”€β”€ Java/
β”‚ β”œβ”€β”€ TCPServer.java # TCP server implementation in Java
β”‚ β”œβ”€β”€ TCPClient.java # TCP client implementation in Java
β”‚ β”œβ”€β”€ UDPServer.java # UDP server implementation in Java
β”‚ β”œβ”€β”€ UDPClient.java # UDP client implementation in Java
β”œβ”€β”€ tests/ # Test scripts and sample data
β”œβ”€β”€ results/ # Execution logs and output files
β”œβ”€β”€ LICENSE # Project license information
└── README.md # Project documentation
```

---

## βš™οΈ Requirements
Ensure you have the following installed:
- **GCC** compiler (for C programs)
- **Java JDK** (version 8 or higher)
- **Make** (for compiling C projects)
- Terminal or command-line interface for running programs

### Install Dependencies (Ubuntu/Debian):
```bash
sudo apt update
sudo apt install build-essential default-jdk
```

---

## πŸš€ Installation and Usage

### 1. Clone the Repository
```bash
git clone https://github.com/sroman0/PSR.git
cd PSR
```

### 2. Compile and Run (C Projects)
#### Compile all C programs:
```bash
cd C
make all
```
#### Run TCP Server and Client:
```bash
./tcp_server
./tcp_client
```
#### Run UDP Server and Client:
```bash
./udp_server
./udp_client
```

### 3. Compile and Run (Java Projects)
#### Navigate to the Java folder and compile:
```bash
cd ../Java
javac TCPServer.java TCPClient.java UDPServer.java UDPClient.java
```
#### Run TCP Server and Client:
```bash
java TCPServer
java TCPClient
```
#### Run UDP Server and Client:
```bash
java UDPServer
java UDPClient
```

---

## πŸ’‘ Implemented Features
- **TCP and UDP Servers/Clients**: Establish and manage connections.
- **Concurrent Servers**: Handle multiple clients simultaneously.
- **Reliable and Unreliable Data Transmission**: Demonstrate the differences between TCP and UDP.
- **File Transfer Applications**: Send and receive files over the network.
- **Error Handling**: Robust error detection and reporting.

---

## πŸ§ͺ Testing and Results
- Test scripts are available in the `tests/` directory.
- Execution results and logs can be found in the `results/` folder.
- Example test run:
```bash
./tests/test_tcp_connection.sh
./tests/test_udp_packet_loss.sh
```

---

## πŸ“œ License
This project is licensed under the **GNU General Public License v3.0**.
See the [LICENSE](https://github.com/sroman0/PSR/blob/main/LICENSE) file for details.

---

## πŸ™ Acknowledgments
Developed during the *"Programmazione di Sistemi in Rete (PSR)"* course at **UniversitΓ  degli Studi del Sannio**.
Special thanks to the instructors and classmates for their support and guidance.