NTL

Secure and concurrent client server program

Implemented for Lehigh CSE 303 - Operating System Design

I took a class focusing on operating system design. There were five major themes we focused on, security, concurrency, persistance, resource management, and virtualization. The majority of the classwork was a five phase project, each one relating to one of the themes of the class. The project is a concurrent client/server implemented in C++ using socket communication.

Phase 1: Security

This phase was dedicated to implementing communication between the client and server and ensuring that the messages transfered were secure. We used both RSA and AES encryption.

Phase 2: Concurrency

Our key/value storage table was not designed with concurrency in mind so this part was creating a new, thread safe implementation. The goal of this phase was to eliminate the possibility of deadlocks or invalid data when many clients are requesting storage operations on the server.

This is the phase where things started to get difficult. Writing robust code in a concurrent environment is challenging to implement and even more so to test. We created a thread pool on the server that would initialize a given number of threads to manage client work passed to a queue.

Phase 3: Persistence

Storage is hard to get right in a high volume, concurrent server. We needed to be able to write/read our whole storage object to/from disk and ensure that incremental changes were handled efficiently and that our storage file was consistent with the state of the object in memory.

Phase 4: Resource management

This phase added a MRU cache implementation to manage quota information for clients such as upload/download bandwidth and number of requests.

Phase 5: Virtualization

Here our goal is to use shared objects to allow an administrator to register functions with the server. For security purposes, these functions will be called in a child process and a pipe will be created to pass data back and forth and ensure that the parent process is handling all data access.