EE450 Socket Programming Project
Part3
OBJECTIVE
The objective of project is to familiarize you with UNIX socket programming. It is an individual assignment, and no collaborations are allowed. Any cheating will result in an automatic F in
the course (not just in the assignment). If you have any doubts/questions, please email TA, or come by TA’s office hours. You can ask TAs any question about the content of the project,
but TAs have the right to reject your request for debugging.
PROBLEM STATEMENT
In this project, you will implement a Student Performance Analysis system, a software application that allows students to check their GPA, percentage ranks, and other relevant data. This
information can be used by students to identify areas where they need to focus their efforts and improve their performance. It can also be used by administrators to identify areas where teaching teams need to improve or provide additional resources to help students succeed.
This system generates academic statistics based on user queries. There are two types of clients, student (Student 1 and Student 2) and administrator (Admin) in the system. A student can query a student’s academic performance, while the admin can also query academic statistics of a certain department. The students/admin would send a request to a main server and receive results replied from the main server. Now since there are many departments, the university use a distributed system design where the main server is further connected to many (in our case, three) backend servers. Each backend server stores the academic records for a list of departments. For example, backend server A may store the student data of ECE and CS department, and backend server B may store the student data of Art department. Therefore, once the main server receives a user (student) query, it decodes the query and further sends a request to the corresponding backend server. The backend server will search through its local data, analyze the academic statistics, and reply to the main server. Finally, the main server will reply to the client to conclude the process.
The detailed operations to be performed by all the parties are described with the help of Figure 1.
There are in total 7 communication endpoints:
● Student 1 and Student 2: two different student clients possibly in different department
● Admin: a client that can query student and department academic statistics
● Main server: responsible for interacting with the clients and the backend servers
● Backend server A/B/C: responsible for loading data (from dataA/B/C.csv) generating the statistics of the students’ academic performance
The full process can be roughly divided into four phases (see also “DETAILED EXPLANATION” section), the communication and computation steps are as follows: Bootup
1. [Computation]: Backend server A/B/C read the file dataA.csv, dataB.csv and dataC.csv respectively and store the information in data structures.
○ Assume a “static” system where contents in dataA/B/C.csv do not change
throughout the entire process.
○ Backend servers only need to read the text files once. When Backend servers are handling user queries, they will refer to the data structures, not the text files.
○ For simplicity, there is no overlap of departments or students among data files.
2. [Communication]: After step 1, Main server will ask each of Backend servers which departments they are responsible for. Backend servers reply with a list of departments to the main server.
3. [Computation]: Main server will construct a data structure to book-keep such information from step 2. When the client queries come, the main server can send a request to the correc Backend server.
Query
1. [Communication]: Each client (students and admin) sends a query to the Main server.
○ A student client sends department name and student ID to the main server.
○ The admin client can perform two types of queries: (a) sending department name and student ID to query a student academic record (b) sending only a department name to query department academic statistics
○ A client can terminate itself only after it receives a reply from the server (in the Reply phase).
○ Main server may be connected to all three clients at the same time.
2. [Computation]: Once the Main server receives the queries, it decodes the queries and decides which backend server(s) should handle the queries.
Analysis
1. [Communication]: Main server sends a message to the corresponding Backend server so that the Backend server can perform computation.
2. [Computation]: For query (a), once the department name and student ID are received, Backend server generates academic record for this student.
3. [Computation]: For query (b), once the department name is received, Backend server generates academic statistics for the department.
4. [Communication]: Backend servers, after generating the results, will reply to Main server.
Reply
1. [Computation]: Main server decodes the messages from Backend servers and then decides which academic statistic result correspond to which client query.
2. [Communication]: Main server prepares a reply message and sends it to the appropriate Client.
3. [Communication]: Clients receive the results from Main server and display it. Clients should keep active for further inputted queries, until the program is manually killed.
my wechat:_0206girl
Don't hesitate to contact me