In this programming assignment, you will implement a client process and a server process on eustis.eecs.ucf.edu and eustis2.eecs.ucf.edu, respectively, to communicate with each other. The client and server will accomplish some very simple application-layer functions similar to HTTP. If you never SSH login to eustis and eustis2 machines, your account should has the usual NID as your username and default password (Pyymmdd) with your birth year, month and day. If your computer is out of campus network, you need to first VPN to UCF then connect to Eustis machine. For how to set up VPN to UCF campus network, please check this website.

You can use either C, C++, or Java, or Python to program this project. Eustis and eustis2 servers support all these programming languages.

For secure remote connection to eustis Unix machine, you need to use SSH client software to do it. I recommend PuTTY for command-line remote login, and WinSCP for graphic-based FTP style file transfer. Both are free open-source software.

Your client program and server program should operate as follows. Your server runs first on one machine and it contains a buffer with an initial text string in it. The server process waits for connections from a client process that runs on another eustis machine. The server should use a server port number choosing by yourself and must be bigger than 1024.

Your client operates by sending TRANSLATE, GET, STORE, and EXIT commands to the server. You should create a single client that is able to send all of the four commands above. If the client sends an invalid command, the server should respond by sending back a message "400 Command not valid."

When you submit this assignment to me, please submit the following (put in a .zip file):

  • A brief report: write a brief description of your program codes, then copy the screen output images showing your client running screen and server running screen into your report (must be screen shot images, not the text you directly copy and paste onto your report).
  • Submit client source code and server source code as attachments in the webcourse submission page. The TA will try to download and run your code by himself! Be sure to explain clearly in your report how to compile and run your code and which one is running on which machine.

In the following, I will explain the details of commands that you need to implement.

Initially, when the server accepts the connection from a client, the server should display "server: got connection from client x.x.x.x" where x.x.x.x is the IP address of the client. It should also reply client with the message "Server is ready..." and be displayed at the client side.

TRANSLATE

This command requires the server process to translate the ASCII text sent from the client process to be in all upper-letter text and return back to the client process. The ASCII text sent from the client is ended with "." in the last line (similar as in the SMTP protocol). The server should reply "200 OK" and then return back the upper-letter text to the client. A client-server interaction looks like (shown at the client side):

c: TRANSLATE
s: 200 OK
c: Hello.
c: Nice to meet you!
c: .
s: HELLO.
s: NICE TO MEET YOU!

At the server side, the server process should display "x.x.x.x sends TRANSLATE" when receiving this command. For all other commands, the server should also do this kind of display.

GET

This command asks the server to return back the text string saved in the buffer of the server process. When your server receives a GET command from a client, it should return the string "200 OK" (terminated with a newline), followed by the text. A client-server interaction with this command thus looks like (suppose the server's buffer contains a text "I don't think we're in Kansas anymore."):

c: GET
s: 200 OK
I don't think we're in Kansas anymore.

STORE

This command asks the server to store the text string that input from the client. When the server receives the STORE command from a client, it should return the acknowledgement "200 OK" (terminated with a newline) and then wait for client's input. The client input text is ended by "." after the last line of text (the saved string should not contain this ending line of "."). After saving the text, the server should return back the code "200 OK".

A client-server interaction with this command thus looks like:

c: STORE
s: 200 OK
c: One small step for man, one giant leap for mankind
c: Read my lips, no new taxes
c: .
s: 200 OK

EXIT

This command close the client program and inform the server to close, too. After receiving this command, the server should respond the acknowledgement "200 OK" to the client, display the "x.x.x.x sends EXIT", then close itself. A client-server interaction thus looks like:

c: EXIT
s: 200 OK
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.