Question: Description: Your task for this project is to implement a simple TCP protocol following an RFC-style specification. You will write a server application that listens



Description: Your task for this project is to implement a simple TCP protocol following an RFC-style specification. You will write a server application that listens on TCP port 8008. You will also write a corresponding client application that connects to this port to run the commands that the server implements. The server can run in the foreground and should take no arguments. It should print informational messages to the screen as the client connects. The server can be single-threaded and only accept one client connection at a time. Example: C:Ipython server.py The client should also run in foreground and take no arguments. The server name and port number are in the client code. The client should print informational messages as it runs different commands over the TCP connection. The client is NOT interactive and should not prompt the user for input. Your client should run each command the server implements at least once. Example: C:Ipython client.py Requirements You will write the programs in python. I will compile/run them on a standard python3 interpreter. You can develop on Windows, OSX, or Your server must implement the following commands. 1. HELO Upon successful connection, a client MUST say hello. The client MUST send the string "HELO " where is the client's hostname. Examples: Client: HELO mycomputer Server: Hello mycomputer, pleased to meet you. 2. REQTIME The client can request the server's current time with the REQTIME command. The server MUST respond in ISO8601 format hh:mm:ss. Examples: Client: REQTIME Server: 22:23:14 3. REQDATE The client can request the server's current date with the REQDATE command. The server MUST respond in ISO8601 format YYYY-MM-DD. Examples: Client: REQDATE Server: 2014-01-29 4. ECHO The client can request the server echo back a text string using the ECHO command. This is useful when debugging a client. Client: ECHO this is some random text. Server: this is some random text. 5. REQIP The client can request the server print the client's IP address. This is useful to find the client's real IP if behind a NAT router. Client: REQIP Server: 147.174.73.237 6. BYE The client can request the server end the TCP connection. The server MUST respond and immediately close the connection. Client: BYE Server: See ya later
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
