This project is due at 11:59pm on September 18, 2017.
The protocol works as follows. The client initiates the protocol by creating a TCP socket connection to the server. Once the socket is connected, the client sends a HELLO message to the server. The format of the HELLO message is:
cs3700fall2017 HELLO [your NEU ID]\nIn your program you should replace [your NEU ID] with your NEU ID (including any leading zeroes). You must supply your NEU ID so the server can look up the appropriate secret flag for you. The server will reply with a STATUS message. The format of the STATUS message is:
cs3700fall2017 STATUS [a number] [a math operator] [another number]\nThe three variable fields represent a simple mathematical expression, e.g. "5 + 10". The server may return plus, minus, multiplication, or division expressions. All numbers will be between 1 and 1000. Your program must solve the mathematical expression and return the answer to the server in a SOLUTION message. The SOLUTION message has the following format:
cs3700fall2017 [the solution]\nIt is okay for the solution to be negative. In the case of division, round the answer down to the nearest integer (do not send floating point numbers to the server).
The server will respond to the SOLUTION message with either another STATUS message, or a BYE message. If the server terminates the connection, that means your solution was incorrect. If the server sends another STATUS message, your program must solve the expression and return another SOLUTION message. The server will ask your program to solve hundreds of expressions; the exact number of expressions is chosen at random. Eventually, the server will return a BYE message. The BYE message has the following format:
cs3700fall2017 [a 64 byte secret flag] BYE\nOnce your program has received the BYE message, it can close the connection to the server. If the server returns "Unknown_Husky_ID" in the BYE message, that means it did not recognize the NEU ID that you supplied in the HELLO message. Otherwise, the 64-byte string is your secret flag: write this value down, since you need to turn it in along with your code.
$ ./client <-p port> <-s> [hostname] [NEU ID]Your program must follow this command line syntax exactly, i.e. your program must be called client and it must accept these exact parameters in exactly this order. If you cannot name your program client (i.e. your program is in Java and you can only generate client.class) then you must include a script called client in your submission that accepts these parameters and then executes your actual program. Keep in mind that all of your submissions will be evaluated by grading scripts; if your program does not conform exactly to the specification then the grading scripts may fail, which will result in loss of points.
The -p port parameter is optional; it specifies the TCP port that the server is listening on. If this parameter is not supplied on the command line, assume the port is 27998. The -s flag is optional; if given, the client should use an SSL encrypted socket connection. Your client only needs to support -s if you are trying to get the extra credit points. The [hostname] parameter is required, and specifies the name of the server (either a DNS name or an IP address in dotted notation). The [NEU ID] parameter is required. Your code must support NEU IDs that have leading zeroes (do not strip them!).
Your program should print exactly one line of output: the secret flag from the server's BYE message. If your program encounters an error, it may print an error message before terminating. Your program should not write any files to disk, including writing to the secret_flags file.
$ /course/cs3700f17/bin/register-student [your-NUID-number]To register yourself in a group, execute the following script:
$ /course/cs3700f17/bin/register project1 [team name]This will either report back success or will give you an error message. If you have trouble registering, please contact the course staff. You and your partner(s) must all run this script with the same [team name]. This is how we know you are part of the same group.
To turn-in your project, you should submit your (thoroughly documented) code along with three other files:
$ /course/cs3700f17/bin/turnin project1 [project directory][project directory] is the name of the directory with your submission. The script will print out every file that you are submitting, so make sure that it prints out all of the files you wish to submit! Only one group member needs to submit your project. Your group may submit as many times as you wish; only the last submission will be graded, and the time of the last submission will determine whether your assignment is late.
When you successfully run your SSL-enabled client against the SSL version of the server, you will receive a new secret flag (that is different from the normal secret flag). You and your partner add these SSL secret flags into the secret_flags file when you turn in your project. You will only receive the extra credit point if your code successfully implements the -s option, and you include the SSL secret flags in the secret_flags file.