Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The solution should be in c++ ============================= CMPE/ISYE/ITEC 431 Computer Network Design and Applications Project Details (2022121901) Objectives: After finished this project students develop their

The solution should be in c++ ============================= CMPE/ISYE/ITEC 431 Computer Network Design and Applications Project Details (2022121901) Objectives: After finished this project students develop their own simple short message server and client applications. The purpose of this assignment is to introduce you to the socket programming API as well as a variety of operating system concepts that are widely used in the construction of networked applications. Recommendations & Rules: The applications must be written in C/C++ in Linux Platform. Server application should operate in concurrent mode. (So, application serve more than one user at a time) Dont use any special library for protocols when coding. Write your own functions if its necessary. Unless otherwise explicitly specified, all written assignments or code that is submitted is to be entirely the students own work. Using any code or copying any assignment from others is strictly prohibited without advance prior permission from the instructor. All students work is their own. Students who do share their work with others are as responsible for academic dishonesty as the student receiving the material. Students who encourage others to cheat or plagiarize, or students who are aware of plagiarism or cheating and do not report it are also participating in academically dishonest behavior. In this case (academically dishonest behavior), students to be punished with no grade. Project Details: 1) Server should bind (listen) port that passed as argument. This port uses for command exchange and data transfer purpose. All data exchange should use TCP transport layer protocol for reliability. The server should be run as following arguments: # ./serverapplication -d directory -p port -u password -d: Specify running directory which messages to be accessed/modified/erased -p: Define server port number -u: User file that uses delimiter separated format which is delimiter is : (https://en.wikipedia.org/wiki/Delimiter-separated_values) For example, $ server -d /home/student/files -p 1888 -u user.txt File server listening on localhost port 1888 2) Message Server application should operate as defined below. Then client should authenticate itself with User Keyword. Given values must check from user file. If given values correct so client can pass next stage. USER UserID Password Possible Responses: +OK UserID and password okay go ahead. -ERR Either UserID or Password is wrong. After authentication clients can give following commands: LIST [num] This command can be used for listing user message that available in server. Num is optional. Possible Responses: +OK listing follows. Server list messages with date order. Format looks like; : Message number that can be used with RET and DEL commands. : This is represent who was send this message. : This is unix timestamp that starting 1970. : Message size as byte. Note: All message attributes should take from message filename. Please check SEND command. Example: 1 1001 1671483089 100 2 1005 1668891089 120 -ERR there are no message. RET ID This command can be used for reading user message with given ID. Possible Responses: +OK message follows. -ERR no such message. DEL ID This command can be used for deleting user message with given ID. Possible Responses: +OK message deleted. -ERR no such message. SEND UserID TXT This command can be used for sending text message (TXT) to given UserID. The sent message should store on the storage. While message TXT is sent to UserID in this case server must store this message with using following structure. Directory path should be Running directory/UserID Ex: Path=/data/home/20110500/server/10000 Each message should store into this directory with following structure: __.msg Ex: 1368479000_10001_100.msg This file format should be use in LIST command as well. Possible Responses: +OK message sends to . -ERR message cannot send to . QUIT This command can be used for disconnect from server. Possible Responses: +OK Bye . -ERR Error occurred Signoff not possible. 3) Appropriate response codes should be implemented. 4) All sent message should store to running directory (which is defined as argument -d ). But each user should have their own subdirectory. 5) Server should also log all client activities like Authentication (Good and Bad attempts), Send message from to whom etc. 6) Client should get username and password from user and pass to Server side. 7) Following parts represent typical client server interaction. S represent as Server and C represent as Client. S: +OK My Chat Server v0.1 Ready. C: USER 10000 myPass S: +OK UserID and password okay go ahead. S: -ERR Either UserID or Password is wrong. If Ret Code is OK: C: LIST S: +OK 3 messages (Total 350 Octets) S: 1 10001 1368479000 100 S: 2 10002 1368479300 120 S: 3 10001 1368479500 130 S: . For checking size of 2nd message. C: LIST 2 S: +OK 2 10002 1368479300 120 S: . S: -ERR There are no message in your mailbox. C: LIST 4 S: -ERR no such message, only 4 messages in maildrop C: RET 1 C: RET 3 S: +OK 10002 1368479300 100 Octets S: This is my first message that i got from this system. S: . S: -ERR no such message available. C: DEL 2 C: DEL 3 S: +OK message 1 deleted. S: -ERR message 3 already deleted. C: SEND 10001 Hello world C: SEND 10011 Hello world S: +OK message sent to 10001. S: -ERR message cannot send to 10011. User 10011 not available. C: QUIT C: QUIT S: +OK Good Bye 10000. -ERR Error occurred Sign-off not possible. 8) Client should have following features; a) Client should read all configuration parameters as arguments. # ./smsclient -h server -p port -u user -p password -h: Specify target server port -p: Define server port number that client will connect -u: Username that will be used in authentication -p: Password that will be used in authentication b) Client should give option to users for closing and terminating connection. (QUIT) c) All application layer commands should hide by client application. Just informative messages should be show by clients. Ex: Client should can be represent following menu for user Hello 10001, Please choose your option: 1) Read/Delete Messages 2) Write Message to User 3) Change config parameters 4) Quit Option-> If you select 1 Option; Step 1 Your Messages listed below: 1) From: 10001,Date: 2013-05-13 15:00, 100 Byte 2) From: 10002,Date: 2013-05-13 15:30, 120 Byte 3) From: 10001,Date: 2013-05-13 15:32, 130 Byte Type R for Reading, D for deleting -> Step 2 R1 Step 3 Your Message: This is my first message. Step 4 D1 Step 5 Do you want to delete message ? Step 6 Y Step 7 Your message was deleted. If you select 2 Option; Step 1 Give target UserID-> Step 2 10001 Step 3 Please type text-> Step 4 Hello world. Step 5 Would you like to Send message to 10001? (Y/N) Step 6 Y If you select 3 Option; Step 1 Would you change any following value? 1) TargetServer : 127.0.0.1 2) TargetPort : 1888 3) UserID : 10000 4) Passwd: myPass Option-> Step 2 1 Step 3 Please give new TargetServer-> Step 4 172.16.32.10 Step 5 Do you want to use this new value? (Y/N) Step 6 Y APPENDIX U ser.txt #UserID:Password 10000:myPass 10001:TesT 10002:Something

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Progress Monitoring Data Tracking Organizer

Authors: Teacher'S Aid Publications

1st Edition

B0B7QCNRJ1

More Books

Students also viewed these Databases questions