Question: A Chat Application Protocol Message Sent by HELLO-FROM Client HELLO Server WHO Client WHO-OK , ..., Server SEND Client SEND-OK UNKNOWN Server Server

A Chat Application Protocol Message Sent by HELLO-FROM Client HELLO Server WHOClient WHO-OK , ..., Server SEND \ Client SEND-OK UNKNOWN Server Server

A Chat Application Protocol Message Sent by HELLO-FROM Client HELLO Server WHO Client WHO-OK , ..., Server SEND \ Client SEND-OK UNKNOWN Server Server Server Description First hand-shake message. Second hand-shake message. Request for all currently logged-in users. A list containing all currently logged-in users. A chat message for a user. Note that the message cannot contain the newline character, because it is used as the message delimiter. Response to a client if their 'SEND' message is processed successfully. Sent in response to a SEND message to indicate that the destination user is not currently logged in. A chat message from a user. Sent during handshake if the user cannot log in because the chosen username is already in use. Sent during handshake if the user cannot log in because the maximum number of clients has been reached. DELIVERY Server IN-USE Server BUSY BAD-RQST-HDR BAD-RQST-BODY Server Server Sent if the last message received from the client contains an error in the header. sent if the last message received from the client contains an error in the body. Table 1: Chat Application Protocol. Angular brackets ( ) indicate variable content. In this assignment, you implement a text-based chat client. For this, you use Python, sockets, and the Transmission Control Protocol (TCP). Once you are comfortable using the socket interface, using sockets in other programming languages should be straightforward.3 After completing this assignment, you will be able to exchange messages with your fellow students using your own client. The chat client and chat server are built on top of TCP and use their own application-layer protocol. This means the client and server can request the other to perform actions by sending predefined types of messages. For example, your client can ask the server to forward a message to another user's client by sending the string "SEND username insert your message here " to the server, where "username" is the user to whom you want to send your message. If your message is correct, the server will send two messages: one to the destination user, forwarding your message, and one back to you that says "SEND-OK ", to notify you that your message was forwarded successfully.4 The full details of the protocol are listed in Appendix A. Similar to Web browsers and other modern applications, your chat client does not expose the protocol it uses to the user. Instead, it provides a user-friendly text-based interface that makes it easy for users to chat with others without knowing the protocol specifications. The specifications of this interface, and the requirements of this assignment, are listed below. Requirements Your application must: 1. Implement the chat protocol described in Appendix A. 2. Connect to the chat server and let the user log in using a unique name. 3. Ask for another name if the chosen name is already taken. 4. Let the user shutdown the client by typing !quit. 5. Let the user list all currently logged-in users by typing !who. 6. Let the user send messages to other users by typing @username message. 7. Receive messages from other users and display them to the user.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!