The server program will start first and keep listening to the specified port. Your client will connect to the port that your server is listening to, and a socket between your client and server is constructed. Your client program will first prompt a welcome message that asks the user to enter a username using the keyboard. This username will then be sent to the server. Then, your server, after receiving the username from your client, will send an acknowledgment message to the client. Your client, after receiving the acknowledgment message from your server, will prompt a message that asks the user to enter the corresponding password. This password will then be sent to the server. Then, your server, after receiving the password from your client, will verify the received pair of username and password against the list of legitimate pairs. If the result is positive, the server will send a success message along with the current market value of the stock to the client. If the result is negative, the server will send a failure message to the client. Your client, after receiving the result message, will print out the result and close the socket. Your server will close the socket following the client, and keep listening for the next client request. Your server will close the socket after waiting for the username or the password for 30 seconds.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
2. The server program will start first and keep listening to the specified port. Your client will connect to
the port that your server is listening to, and a socket between your client and server is constructed.
3. Your client program will first prompt a welcome message that asks the user to enter a username using
the keyboard. This username will then be sent to the server. Then, your server, after receiving the
username from your client, will send an acknowledgment message to the client.
4. Your client, after receiving the acknowledgment message from your server, will prompt a message
that asks the user to enter the corresponding password. This password will then be sent to the server.
Then, your server, after receiving the password from your client, will verify the received pair of
username and password against the list of legitimate pairs. If the result is positive, the server will
send a success message along with the current market value of the stock to the client. If the result is
negative, the server will send a failure message to the client.
5. Your client, after receiving the result message, will print out the result and close the socket. Your
server will close the socket following the client, and keep listening for the next client request.
6. Your server will close the socket after waiting for the username or the password for 30 seconds.
3
Programming Notes
I suggest you to start modifying the TCP server program (echoserver.c) provided. Your server program
needs to handle FILE I/O for authentication. When the server is up and running, you can start modifying the
TCP client program (echoclinet.c). Both echoserver.c and echocleint.c are provided in netProgramming.tar
file (check course website-¿materials tab).
This project will help you to understand the basic client-server interaction using TCP sockets.
You can use azuread jupyterhub server for this project. You can run server program in one
terminal window and a client program in another terminal window.
Transcribed Image Text:2. The server program will start first and keep listening to the specified port. Your client will connect to the port that your server is listening to, and a socket between your client and server is constructed. 3. Your client program will first prompt a welcome message that asks the user to enter a username using the keyboard. This username will then be sent to the server. Then, your server, after receiving the username from your client, will send an acknowledgment message to the client. 4. Your client, after receiving the acknowledgment message from your server, will prompt a message that asks the user to enter the corresponding password. This password will then be sent to the server. Then, your server, after receiving the password from your client, will verify the received pair of username and password against the list of legitimate pairs. If the result is positive, the server will send a success message along with the current market value of the stock to the client. If the result is negative, the server will send a failure message to the client. 5. Your client, after receiving the result message, will print out the result and close the socket. Your server will close the socket following the client, and keep listening for the next client request. 6. Your server will close the socket after waiting for the username or the password for 30 seconds. 3 Programming Notes I suggest you to start modifying the TCP server program (echoserver.c) provided. Your server program needs to handle FILE I/O for authentication. When the server is up and running, you can start modifying the TCP client program (echoclinet.c). Both echoserver.c and echocleint.c are provided in netProgramming.tar file (check course website-¿materials tab). This project will help you to understand the basic client-server interaction using TCP sockets. You can use azuread jupyterhub server for this project. You can run server program in one terminal window and a client program in another terminal window.
2 Project Specification
In this project, you are required to do socket programming in C language (Linux environment) to implement
a pair of client and server that can achieve simple password verification to indicate the current market value
of the stock. Your client will send a pair of username and password to your server and your server will
verify whether the pair of username and password is legitimate or not for retrieving the stock value. Assume
the only legitimate pairs of usernames and passwords that will be accepted by your server are as follows.
Username Password Stock Value
welpa23e
ghqwo31a
lcid
mrvl
snap
cl1
bro
CVS
tyjli14d
rjwqe83f
gnmds28z
rhkt187c
13.93
41.23
10.21
85.09
56.43
91.34
Table 1: Content of StockFile.txt
Specifically, your client and server programs entail to achieve the following requirements:
1. Your client program needs to take two arguments that specify the name of server and the port that it
is trying to connect to. Your program for server needs to take an argument that specifies the port that
it is listening to. You can use (5000+last 4 digits of your student-id number) as a port number.
1
Transcribed Image Text:2 Project Specification In this project, you are required to do socket programming in C language (Linux environment) to implement a pair of client and server that can achieve simple password verification to indicate the current market value of the stock. Your client will send a pair of username and password to your server and your server will verify whether the pair of username and password is legitimate or not for retrieving the stock value. Assume the only legitimate pairs of usernames and passwords that will be accepted by your server are as follows. Username Password Stock Value welpa23e ghqwo31a lcid mrvl snap cl1 bro CVS tyjli14d rjwqe83f gnmds28z rhkt187c 13.93 41.23 10.21 85.09 56.43 91.34 Table 1: Content of StockFile.txt Specifically, your client and server programs entail to achieve the following requirements: 1. Your client program needs to take two arguments that specify the name of server and the port that it is trying to connect to. Your program for server needs to take an argument that specifies the port that it is listening to. You can use (5000+last 4 digits of your student-id number) as a port number. 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY