Chapter 3 System Architecture
3.2 Auction System Overview
Figure 3 - 2 System Architecture
The system architecture is shown in Figure 3 - 2. The system can divide into six components. There are graphic user interface (GUI), static data, functionalities frames,
19
P2P network data action function, web server and browser and P2P pub/sub system respectively. The details of the six components are described in the following section.
And the implementation detail will describe in next chapter.
3.2.1 Graphic User Interface (GUI)
The graphic user interface of auction system allows user to interact with it.
Graphic User Interface is the main part of the system and it consists of three mangers.
That are auction manager, search manager and chat manager. The auction manager handle all requirements about sales such as post a product for selling, modify the content of selling product, delete a selling product or set a auction to end. The search manager handles all search requirements that user needs. There are three types of search a user can use. First, user can search for already known OpenID and get the entire selling product which the searched OpenID sells. Second, user can type an upper bound and get all products in the range. Finally, user can use keyword search to search for products user wants. When the transaction is concluded, buyer and seller can use chat system to determine how to pay for the product, for example, they can make an appointment at a place to exchange money and product. What user has to do is to click discuss button invoke chat manager to list all sellers who are online and click the OpenID, then they can start to talk.
3.2.2 Static Data
Static data stores information about user; it is a special class which all variables are static such as user identifier and P2P environment parameters. The common
20
feature of these variables is that the whole system needs just one copy of each; it is similar to the existence of global variables. There are several static functions in Static Data, most of them are invoke at the beginning of the system, the functionality of them are to set or to retrieve P2P related operation. For example, Static Data gets configuration file and retrieves default port value and beginning to binding port by socket testing. Then invoke the function in Static Data to join into a P2P network.
The configuration file, config.properties, records some modifiable parameters.
For instance, it records web path of HTML page for user to enter OpenID or the web server’s path which the system must call up to start web server. All these modifiable parameters are related to join into P2P network or to start the web server.
3.2.3 Functionalities Frames
Functionalities frames act as an interface between GUI and P2P network data action function. It contains all frames which auction system uses such as the chat frame, selling frame, buying frame and evaluating frame. For example, when user wants to sell a product, after clicking the button of sell product, auction system will pop up a frame to let user input all the information about the selling product. The three manager of GUI will not invoke P2P network data action function directly, only functionalities frames can invoke the P2P network data action function.
3.2.4 P2P Network Data Action Function
P2P auction system has to put or to retrieve different data, such as the selling product or user profile onto P2P network frequently so that others can see the newly
21
update product condition at once. P2P network data action function achieves their functionalities by using the functions in P2P pub/sub module. When GUI is triggered, for example, user wants to publish a new product to sell, the GUI calls the corresponding functionalities frame and after user has input all information about the selling product, functionalities frame will invoke the corresponding P2P network data action function to put data onto P2P network and publish to every node that has subscribe the topic. All classes of P2P network data action function play not only observer role but also observable role.
3.2.5 Web Server and Web Browser
A web server is a program that is responsible for handling HTTP protocol, such as Apache or IIS. It accepts HTTP requests from client and sends HTTP responses.
Web browser is a program that displays documents in a web server, such as Internet Explorer or Mozilla Firefox. OpenID standard uses HTTP protocol to contact with each other. An OpenID provider offers service of registering OpenID URLs and providing OpenID authentication. A site in the authentication process is central website that user wants to login, but auction system can’t build a central website to let users to login which will result in bottleneck at the website. The site also needs to send absolute address of it to OpenID provider so that when getting authentication from OpenID provider, it will also redirect the page to the site. Thus, we still need a web site that can accept messages from OpenID Provider.
Based on the situation, our solution is to attach a light web server to user’s computer. That is, user plays the role of “site” and “user” both. User login into our web site via embedded web browser, after key in user’s OpenID, web server will
22
direct user to the web page of openID provider; user has to input username and password to get authentication from OpenID provider. Then the OpenID provider will direct user back to web server in the auction system.
3.2.6 P2P Pub/Sub Module (FreePastry)
As describe in the previous section, our pub/sub system put the self-define pub/sub content into P2P network through the implementation of P2P protocol. The implementation of P2P protocol we use in auction system is FreePastry[32].
FreePastry is an open-source implementation of Pastry which describe in chapter 2.
The functionalities of P2P pub/sub module are initializing P2P environment, building node, joining P2P network and some basic operation on P2P network such as storing data, retrieving data, publish data.
In the auction system, static data retrieves form configuration file, config.properties which records some modifiable parameters for P2P pub/sub module to initiating P2P environment and joining into P2P network. To building a node and joining P2P network need some element. We describe the steps as follow. First, while building a node we need a port to handle all messages on P2P network, a port value is specify in the configuration file. After a node is established, it needs a bootstrap which is an existing node on P2P network to join into P2P network. If bootstraps do not exist, the node will form a P2P network by itself. P2P pub/sub module also consists of some basic P2P network operations such as store data, retrieve data, and subscribe topics. All of which are achieved by some the functions of open source library, FreePastry.
23
In short, the difference between P2P network data action and P2P pub/sub module is that P2P pub/sub module uses functions in FreePastry to build some basic P2P network operations and P2P network data actions use the function in P2P pub/sub module to build more complex operation, such as finding a selling product.
24