UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
University of West Attica · Department of Computer Engineering and Informatics
Distributed Systems
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Vasileios Mamalis, Professor
Supervisor: Grammati Pantziou, Professor
Co-supervisor: Doka Katerina, Senior Researcher
Athens, May 2023
This project involves creating a concurrent socket server using TCP AF_INET (Internet Domain) sockets in C. The server processes requests from clients to perform calculations based on two integer vectors and a real number. The computations are executed via Remote Procedure Calls (RPC) on a separate RPC server, which returns the results back to the client through the socket server.
| Section | Folder / File | Description |
|---|---|---|
| 1 | assign/ |
Assignment material |
| 1.1 | assign/DS-LAB-ASK-1-2022-23.pdf |
Laboratory assignment description (English) |
| 1.2 | assign/ΚΣ-ΕΡΓΑΣΤΗΡΙΟ-ΑΣΚ-1-2022-23.pdf |
Περιγραφή εργαστηριακής άσκησης (Greek) |
| 2 | docs/ |
Theoretical documentation |
| 2.1 | docs/Remote-Procedure-Call.pdf |
Remote Procedure Call (RPC) theory (English) |
| 2.2 | docs/Απομακρυσμένη-Κλήση-Διαδικασίας.pdf |
Απομακρυσμένη Κλήση Διαδικασίας – RPC (Greek) |
| 3 | src/ |
Source code implementation |
| 3.1 | src/Makefile |
Build automation file |
| 3.2 | src/rpc.x |
RPC interface definition (XDR specification) |
| 3.3 | src/rpc.h |
RPC shared header file |
| 3.4 | src/rpc_xdr.c |
XDR data serialization/deserialization |
| 3.5 | src/rpc_server.c |
RPC server implementation |
| 3.6 | src/rpc_svc.c |
RPC service-side stub code |
| 3.7 | src/rpc_client.c |
RPC client implementation |
| 3.8 | src/rpc_clnt.c |
RPC client-side stub code |
| 3.9 | src/socket_client.c |
Low-level socket client implementation |
| 4 | README.md |
Project documentation |
| 5 | INSTALL.md |
Usage instructions |
- Concurrent Server: The server handles multiple client requests concurrently using forked child processes.
- TCP Socket Communication: The clients connect to the server using TCP sockets to send and receive data.
- ONC RPC: The server, acting as an RPC client, communicates with an external RPC server to perform the required calculations.
- Remote Procedure Calls: The server uses three distinct RPC-based functions for calculations, depending on the user's choice:
- Inner Product of Two Vectors (
X * Y) - Average Value of Each Vector (
X̄,Ȳ) - Product r*(X + Y)
- Inner Product of Two Vectors (
-
Client Side:
- The user selects the desired computation (inner product, average, or product).
- The client sends the required data (
n, vectorsXandY, and real numberr) to the socket server. - The client waits for the result from the socket server, which is returned after processing.
-
Server Side:
- The server accepts the client's connection and receives the computation request.
- It forwards the data to the RPC server for processing.
- The server receives the computed result from the RPC server and sends it back to the client.
-
RPC Server:
- It performs the requested computation using the data provided by the socket server.

