EE450 Socket Programming Project

发布时间:2024年01月16日
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 correct 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.
文章来源:https://blog.csdn.net/2301_81917451/article/details/135617420
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。