USC Web Registration
Overview
For my computer networks class, our task was to recreate the USC Web Registration servers. These servers were made in c++ to run on linux. There is a TCP client which connects to the Main TCP server. The main server waits to receive authorization creditials from the client. After receiving the credentials from the client, the main server encrypts the authroization creditientials and sends it to the credential server. The credential server then tells the main server if the credentials are valid. If the credentials are valid, the client is then able to querry information on various EE and CS courses. The main server when asked to querry a course will reach out to the specified server (CS or EE) to find the information.
Socket Programming
All TCP and UDP servers were bound to a pre-defined port with IPv4 protocol using the socket.h module. The port number for the TCP client is dynamically allocated. All servers and client run on the localhost IP address. The main server accepts one client at a time. After a client connection is terminated it begins looking/accepting the next client request. Forking would be necessary for a legitmate registration site. The mainserver has a UDP port to communicate with the backend UDP servers. All servers run until cntrl C is pressed. Upon termination, the ports will be properly closed before exiting the program.
Authentication
The TCP client asks the user to enter their username and password. This is concatentated and sent to the main server. The main server then encrypts the credentials using a Ceasar Shift Cipher. The credential server has a text file with the accepted credentials. The credential server will then send back to the main if the authorization is correct, the password is incorrect, or the username does not exist. The main server forwards this response to the client. A client has three attempts for logging in before it shuts down.
Course Querry
Once authorized the user has the option of querrying multiple classes, or the credits, days, professor or course name of a certain class. The client ensures each course is properly formatted. The main server once receiving this requests checks if the department code is valid. If the department code is valid, it requests the information from the proper backend server. If it is a multicourse request, the main server will parse all information received from the backend servers before sending to the client.
Code
Here is the github link to my project. Feel free to look at the code or download it to give it a try.