P2P Communication among Computers and Smartphones Based on Bluetooth and Wi-Fi Direct Technologies

As result of the development of technology, most of modern computer and smartphones are Bluetooth and Wi-Fi direct wireless technologies enabled. While those wireless technologies come with the benefits of interconnecting devices without the need access point or central base station. However, computer and smartphones connected via Bluetooth based or via Wi-Fi Direct connection does not guarantee intercommunication or data transmission in meaningful way. Therefore, third party software is always needed to help for achieving data transmission. In this research an effort is done to design and develop P2P software applications and web based application by using C# and ASP.net MVC programming languages as features of Visual Studio 2017. Application would facilitate P2P communication of interconnected devices via the same channel. Built software system has been tested based on functional testing method, and usability testing. The result from functional testing shows that P2P communication meets functional requirements while usability testing has an average score of 72.2% from System Usability Scale method. The results from SUS scores brands our proposed P2P communication system to be good and highly accepted.


INTRODUCTION
Nowadays, the most manufacturers of computers and smartphones are bringing together Bluetooth and Wi-Fi technologies in use. Both Wi-Fi and Bluetooth technologies allow enabled computing devices to communicate with each other by radio waves. They can be on and active at the same time, with different frequencies, different protocols doing different jobs. The Wi-Fi Alliance launched specification that allowed two devices with Wi-Fi functionalities to communicate directly with each other without having to connect to a router. It is named Wi-Fi Direct and previously named Wi-Fi peer to peer by [1] [2]. According to [3], Wi-Fi direct offers Bluetooth services and as well classical Wi-Fi services, automatically detecting compatible devices to connect to it without access point.
Bluetooth devices operate between 2.402 GHz and 2.480 GHz frequency band which is unlicensed frequencies band for ISM (Industrial, scientific, Medical) and they can only maintain or connect to IEEE 802.15.1 devices by [4]. On the other hand, all Wi-Fi Direct devices operate in the 2.4 GHz frequency band and some devices work in the 5GHz frequency, which allow them to connect to 802.11a, g, and n devices. However, Computer and smartphones connected via Bluetooth based or via Wi-Fi Direct based connection does not guarantee intercommunication or data transmission in meaningful way. Therefore, a sophisticated software is always needed to help for achieving intercommunication or data transmission.
According to the paper [5], author has designed and implemented a scalable, secured, low cost, flexible and wireless solution to the home automation. The system was tested with wirelessly communication between Symbian OS cell phones and Arduino BT in the range of 50m (concreted building)-100m (open place). As, the Symbian OS supported only Python script, the author recommended the features work to develop GUI for the cellphone to be written in other programming language so that the home automation might supported by most of available smartphone.
According to [6] discusses the use of Wi-Fi Direct technology in home area networks (HAN) for Smart Grid. Their paper describes the main issues as power consumption and outage performance as parameters to be discussed in HAN. Therefore, based on Markov chain model, the author calculated number of devices, the traffic intensity, and the power consumption of the dynamic HAN. The numerical results show that Wi-Fi Direct technique improves the power saving in Smart Grid, and it enhances the reliability of communications in Smart Grid.
Based on previous research on Bluetooth and Wi-Fi Direct wireless technologies and their promising security protection as summarized by the author of the papers of [7][8] [9] and [10]. Those previous study have motivated to conduct this research of developing P2P Communication system for insuring intercommunication of connected devices via Bluetooth or Wi-Fi Direct protocol. Within a designed interface of P2P communication that would facilitate application users to sign for class attendance. In order to synchronize information on different devices, a web based application has been considered to allow users view database record and managing users locally or remotely on cross multi-platforms.  Research method consists of interrelated stages followed in doing research which  are divided into several stages  2.1 Library studies This stages studies library materials (scientific journals, and research reports), which deal with the Bluetooth and Wi-Fi direct protocols, and their basic functionalities and services associated with software development.

Data collection
This step is done by interviewing students for collecting information needed for class attendance.

System requirements analysis
The system to be built in this research is a P2P communication system in the form of software applications that run via P2P network of Bluetooth and Wi-Fi Direct connection. The proposed P2P communication consist of 3 software applications: Master-P2P Go application, Slave-client application and web based application that work in peer to peer mode.

Slave/client application
Preinstalled Slave-client application that will allow user of slave/client interface to search for peer, to connect, to chat (sending text message and files) and interface that allow users to send data to Master/ P2P Go application for class attendance/ presence.

Master / P2P Go application
Preinstalled application that will allow the users of Master-P2P interface to search for peer, to connect to the peer, to chat and recording data for presence into database. Data for presence will be typed manual or be received by master / P2P Go application from Slave/client application.

Web based application
Web based application will help to view the records saved into database by Master/ P2P GO application. Thus, the users of master / P2P Go and Slave/client will access on database's record via web based application through smartphone or computer. Despite viewing the record, the user of web based application can chat with other users already registered in db_campus.

Proposed framework for Master -P2P Go application
It is an architecture description of the whole system activities that establishes a common understanding of how Master P2P Go application will work as it is shown on Figure 1. 2. Run master P2P Go application If a connection is established, the user has to run or open master P2P application which is directly connected to db_campus database which keeps records for class attendance.
3. db_campus: It is a local database which is designed to keep records for class attendance/presence. 4. Slave/client application searches for peer User of Slave client application will send the request for connection to the interface of master P2P Go application.
5. Connect buttons to respond to peer. Master/ P2P Go application will be designed such that it will accept the request/ incoming request of the host who needs to connect to it. In order to accept it, the user has to accept authentication by clicking on connect button. 6. Connected(Connection status) If a Slave/Client application and Master P2PGo application are connected, then our P2P communication system is authenticated. Thus, users can start intercommunication. Or, Slave/client application could research again or Master P2P Go can initiate the search for peer itself.
7. Chat Button that will allow the paired devices to exchange text messages and multiple format of files.
8. Signing the presence In order to extend the use of software interface, it was designed such that user can record the presence for class attendance. The user can type manually or receive data from Slave/client and then save the records into db_campus database. 9. Save Its function is for saving or recording the presence, Master P2P Go application will save information into database, information loaded or generated from Slave Client application 10. Disconnect If intercommunication is over, the user can disconnect from the peered device 11. End

Proposed framework for Slave -client application
It is a design of the whole system activities that establishes a common understanding of how Slave Client application will work as it is shown in Figure 2.
Here's the explanation of 2. Slave client application searches for peer User of Slave client application clicks on search button for the request for connection to the master P2P Go application. Master P2P Go application will be designed such that it will accept the request incoming from slave/client application for authentication. In order to accept it, the host has to accept authentication by clicking on connect button. 4. Connected(Connection status) If Slave/Client application and Master /P2P Go application are connected, our P2P communication software is authenticated, then peers can start intercommunication. Or, Slave client application can search again.
5. Chat Chat button will allow the paired devices to exchange text message and multiple format of files.
6. Signing the presence Slave client interface was designed such that a user could sign the presence for class attendance by loading data pre-written in local file and send it to the Master/ P2P GO application to be saved into database. 7. Disconnect Once intercommunication is over, the user can disconnect from the peered device.

Proposed framework for web based application
In order to view the list of presence recorded into database, both users of Slave/ client and Master/P2PGo application need a web based application to access on database locally by user of master/P2PGo or remotely via Bluetooth and Wi-Fi direct connection on different platform by slave/client's users with the access of managing records of db_campus database. Flow diagram of Web based application can be seen on Figure 3. 2. Open sever IP address through web browser User does access on the webserver IP address through any web browser.
3. Login page Webserver will display login page as homepage for web based application. The user will need username and password to login (provided by database administrator).
4. Display record page. Every user who successfully logged in the system, login page will direct him to the record management page which displays list of presence from db_campus database.
5. Chat menu From record page, there is a chat menu that handles chat room. Though web based application, user using smartphone or a computer will be able to chat with other users through chat menu.

Functional Requirements Master P2P Go -Slave/ Client application requirements
-User of Master/ P2P Go application should be able to Search for peers, to connect, to chat, save data into database, and to disconnect from peer. -User of Slave/client application should be able to search for peer, to connect, to chat, to load and send data to Master/P2P GO, and to disconnect from peer.

Web Interface or web based application requirements
-Every user will be able to login, to chat, to change his password, and to log out.
-User with administrator rights will be able to manage database records: to add, edit, delete user's data. -User without administrator right will only view record.

System design 2.4.1 User case diagram for P2P Communication system
Both Master P2P Go and Slave /will permit all users to use Search for peer, Connect, Chat, and Disconnect buttons. Each similar name of buttons on both application interface play the same role. Based on Figure 4, there are 2 actors: User of master/P2P Go and User of Slave /Client that interact with software system via 8 events or cases which are: Search for peer, connect, chat (send text message and SendFile), load Data, Send Data, Save data and Disconnect events. User case diagram for P2P desktop application is shown in Figure 4. Except Load and Send buttons for Slave/client which deal with loading and sending data to master, and save button for master P2P Go which deal with recording data into Database. Other buttons have the same functionalities on both applications.

User case diagram for web based application
User of master P2P Go saves data into database, there is a need of view records and accessing on them; this could be done by using either smartphone or computer pc locally and remotely via Bluetooth Network connection or Wi-Fi direct. In order to achieve this, our research will use web based application. The following Figure 5 that shows user case diagram of web based application where actor are Username Admin, Username Operator, Username user which are users of database db_campus designed for class attendance.

User Interface Design
Master P2P Go application interface has buttons such as Search, Connect, Chat, Save and Disconnect. And textboxes such as Course ID, Student ID, Time, Hostname, and IP address for generated page reserved for the presence. Slave client application interface has buttons for Search, Connect, Chat, load, Send and Disconnect. And text boxes such as Course ID, Student ID, Time, Hostname, and IP address for Data generation. Generated data consists of text boxes which are attributes of the table designed in database of presence. Class ID: Class Identification Number, Student ID: NIM, Time: Current local time of the device used for signing the presence, Hostname: The device name used to send data, IP address: IP address used by the device to send data. The user interface design of proposed P2P communication system can be seen on Figure 6.

Implementation and Testing
The implementation of proposed P2P software application has been done after establishing P2P network connection based on Bluetooth and Wi-Fi direct. P2P framework works with device that are connected via the same channel of wireless technology. Bluetooth personal Area network (BPAN) has been configured in order to get connection between Master machine and Slave/ client machine. BPAN provides public IP address to the slave machine. While for Wi-Fi Direct, we have installed Connectify hotspot 2017 software tool in windows 10 PC. Connectify hotspot 2017 turns windows PC into wireless hotspot (P2P Go) which provides IP address to clients which are connected to it in peer-to-peer mode.
The settled IP addresses for both Bluetooth and Wi-Fi Direct facilitate our software application to be authenticated in P2P mode. P2P Communication system have been programmed such that every user must run his application in order to connect to other peers like it has been explained above in flow of activities diagram. This application is written in Visual Studio 2017 using C# ASP.net and IIS as web server as features of Visual studio.net framework. SQL server 2016 and SSMS for managing designed database (db_campus).

Functional testing of P2P Communication system.
Testing conducted in this research is the functional testing, it is a test that against the functionality of the system as they are prerequisite in system requirements. Both Master P2P Go application and Slave-Client application consists of FormMain, FormChat, and FormSendFile classes. Their manual factional testing have been done based on main method for each class.

FormMain class has several methods which are
• buttonSearch()) which deals with searching for peers in range to connect to by advertising its device name and IP address. • buttonConnect() function that deals with connection with selected devices, • sendData() function that deals with sending data , • receiveData() function that deal with receiving data, • buttonDisconnect() function that deals with disconnecting from peer, • buttonLoad () function that deals with load or generating information (Slave/Client). • buttonSend() function that deals with sending data for presence ( Slave/Client). Manual Functional testing has been done for each class within all methods associated to it. Each function or method has been tested manually using predefined scenarios: describing input to be inserted to produce output. Each and every output of the function matches with the expected output. And result from the tests showed that overall tests meet user functional requirements.

Result and discussion 3.1 Network connectivity test
Based on ping statistics, connectivity test comparison of Bluetooth latency is huge compared to Wi-Fi Direct latency. While the larger the number of latency the worse your connection it is. That means that the Wi-Fi Direct performance is better than Bluetooth network performance. Thus, this research recommends Wi-Fi Direct to be preferable. However, the Wi-Fi Direct is still a new technology, not integrated or compatible with all devices, we have put in consideration Bluetooth based as alternative when user of devices which are not compatible with Wi-Fi direct technologies. This research did not focus on parameters such as performance, range, flexibility, security issue of Bluetooth and Wi-Fi Direct protocols, since they are already discussed in previous studies [7], [5], [11].

Usability testing
In order to conduct usability testing, this research approached Posttest survey of software usability Scale that is primary based on the System Usability Scale (SUS) method. After analyzing data from the survey, usability Scores of proposed P2P communication system has an average score of 72.5% of System Usability Scale method which is above of 68% [12] required to make the system good. SUS scores of 72.5 marks our Proposed P2P communication to be good and highly accepted [12]. The summary of the usability testing result is shown in Figure 7.

Portability testing
According to Rahul [13], and Wilcox [14], portability refers to the ease use by which a software system can be made to operate on different platforms. Since web based application of P2P communication has been developed with ASP.net MVC programming language, and it runs over different desktop and mobile web browsers either locally or remotely over P2P network. After several testing that has been done successfully, it can be conclude that P2P communication meets portability requirement.

Conclusion
This research has successfully developed P2P communication system which run into peer-to-peer mode to solve the problem of intercommunication among the peered devices through Bluetooth based and Wi-Fi direct based. Proposed P2P communication consists of Master P2P Go application and Slave client application that allow interface's users to search for peers, to connect to the host, and exchanging text messages and files through chat box. Within a designed interface that facilitate for generating and saving records for class attendance for the students. And web based application which helps the user of computers and smartphones to access and views record for attendance, to chat through chat box. As well as synchronizing or viewing information via different devices in peer-to-peer mode.
Based on manual functional testing, result shows that all function test cases of designed system run properly over Wi-Fi Direct and Bluetooth wireless technology. Whereas the result from usability testing has a score of 72.2 % based on posttest survey of SUS method. Thus, it can be concluded that the objectives of this research has been achieved with a successfully highly acceptable P2P communication system. However, a developed P2P communication system still have shortcomings, therefore, as for some suggestion, it is necessary to improve application interface and implement it via other peer-to-peer protocols apart of Bluetooth and Wi-Fi direct protocols, as well as improving the security of application by sending encrypted messages.