RTP - Reliable Transport Protocol

RTP was the term project for a course in network programming. It is designed to be a replacement for TCP on a Unix operating system, although it is not nearly as feature rich, stable, or efficient. Furthermore, it runs on top of UDP because the goal of the project was the learn how to implement the "reliable" part of the name without having to deal with all of the very low-level programming necessary to do a full network protocol stack. In addition to having to deal with all the problems that come with writing a network protocol, our RTP implementation was also expected to run as a service normally would. This means that we had to deal with keeping CPU usage down, waiting gracefully in loops, reporting errors in a way that the layer above RTP can handle, and gracefully handling any internal errors. Our professor provided the function stubs for the functions that would be called, but allowed us to implement them in whatever way we chose. The RTPConnection class I created handles a single RTP connection and altering the RTP functions to handle multiple connections would be trivial.

Over the course of the semester, we wrote or edited programs that ran at the Data Link, Transport, and Application layers. Here is a command-line battleship game that uses RTP to communicate with another client. The game code (with the exception of the AI strategy routine I wrote) were given to us by the professor and we simply had to implement the networking aspects of the game.

The professor gave us much of the skeleton code we needed so that we only had to implement the the parts relevant to the project. All files are copyright Brad Richards unless otherwise noted and are distributed here with his permission. The files that I wrote are RTPConnection.h, RTPConnection.cpp, and rtp.cpp. Given the finicky nature of Computer Science department's server (which is where all of this was tested), I'm not sure it will compile easily on other Unix systems.

Instructions:

Files: