UDP Pervasive Protocol Implementation for Smart Home Environment on MyRIO using LabVIEW

ABSTRACT


INTRODUCTION
The internet utilization not only in devices such as computers or mobile phones, but in nearly every electronic device will require the use of the internet. This requirement aims to monitor and control for use of the device. One of six technologies will continue to evolve is Internet of Things (IoT), which will continue to evolve until 2025 [1]. On IoT Concept of electronics devices that locate in Smart Home concept is assumed by internet nodes, where each device expected to be connected with internet or different device inside of different object [2]. So that each device has a sensor, actuator, operating system, input/output control, internet connection and has a programming language [3]. A concept of smart home is to connect the device to perform control and the device to be controlled. But this technology must have the characteristics of cost, they do not have cable (all devices connected to wireless/radio frequency), it can evolve as we get the device, and can identify all devices that have varying services (ubiquitous) [4].
Pervasive computing is an environment where there are planted technologies that on certain environment object and that technology has too much influence of human activities [5]. Pervasive introduced much area for usability method, mobility usage and computation size of pervasive device [6]. So that the existence of these technologies is not felt and do not interference with human activities [7]. Pervasive technology would be very suitable to implement the smart home environment, where the home environment there are devices that are used daily, but their operation still has many limitations [8]. Some examples suppose the television and air conditioner (AC), both have a device like a remote control. However remote possessed both have different functions, in terms of functions and usefulness. And the existence of remote proficiency level is not always the human's grasp. So pervasive technology very suitable for a ubiquitous environment and the implementation on smart home where all devices have four models of which include device connectivity to the cloud, the device to the gateway, device to device and the back end of the data sharing [9]. In this study focused only on the model of device connectivity to the gateway only, so this study will show the relationship between the Host / Gateway with Device / Client owned by smart home devices.
On connectivity to the gateway device required a communication protocol, a communication protocol in the Application Layer are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). The use of TCP is the Client will perform data transmission to the host, then the client will ensure full data on the Host of the data sent or not [10]. On UDP, the client sends the data to the host, but the Client and Host will negotiate when before performing communication. TCP will be very efficient when the data is sent in large amounts, but in smart home environment is not required large amounts of data [11]. With UDP behavior that did not validate whether the data sent by the client has come to host and vice versa will make the process faster data transfers. UDP provides a feature broadcast packets to a local network or multicast to all subscribers [12].
LabVIEW is a graphical programming language that uses icons instead of text to create applications [13]. In contrast to text-based programming languages, where instructions determine program execution, Labview uses dataflow programming, where the flow of data determines execution [14]. LabView can easily connect other devices such as microcontroller, Arduino, IP camera and even computer networks [15]. Additionally, National Instruments has also developed highly compatible with the hardware such as NI LabVIEW MyRIO, NI CompactRIO and NI ELVIS is easier to develop a system [16]. NI myRIO is an embedded hardware that can be used for technology proven industry researchers and enable them to design systems with real, complex engineering systems faster and more affordable than ever before [18]. So in this research the implementation of Pervasive Protocol UDP will be used LabVIEW as a programming language by utilizing MyRIO as client devices with the PC as a Gateway.
Another study conducted using Salutation Discovery Protocol and Service Location Protocol [18], and implementing HTTP-CoAP at LabVIEW [19]. At our previous research, it is introduced how UDP work in two PC, one as Client and one else as Gateway [20]. UDP and Pervasive protocol were designed by the state machine and work well implemented with LabVIEW. In this research we will implement the Gateway in a PC and Client modeling with MyRIO. So the design of the system can be tested functionally to obtain correspondence between the designs of a system that was developed with the results obtained.

RESEARCH METHOD
In this section explained design of host and server network, Gateway -Client Design and Test design. The domain in this research is how Gateway / Host can communicate with Client at Local Area Network. So that it can be made the design for system testing and the results obtained on the availability of the system between a Host and Client. Tests will be performed to test the functionality of the system, not only to do with the fruit Client but the test will be performed up to three clients.

Host and Server Network
This research design conducted by ETSI standard [21] which systems have Machine to Machine (M2M) area network domain and implemented in Local Area Network. So design at pervasive using UDP shown in Figure 1 which has a Host and Client. Host / Gateway will be implemented on PC with LabVIEW interfaces, and Client will be implemented on MyRIO which has many features like analog input/output, wifi, led, push button, accelerometer etc.
Where the initial conditions, Host are in condition to wait Client listen to broadcast. Next after the Client to broadcast and broadcast packets are received by Host Client to introduce himself to the host to provide such review client name recognition, IP and services on the host. In Check Duplication Host Client is not directly accept the client, but to review the duplication check, whether the client already exists or not, even if the client already on other hosts. When there is no duplication Client, Host then sends ack, hostname, IP and host header will be stored by the Client.
Once the Client recognizes the host and the process are completed, Host will be back on the broadcast Client Listen to wait for another, but for the Client that have been identified previously will be done the next process is to communicate. As for the service that can be provided is a Client Services (Sensor, Input / Output etc) or the host can take control of all the features possessed by the Client. Design the way work is designed in this study Host and Client will be described in section Host and Client Design

Gateway / Host and Client Design
Based on previous research [20], the Gateway / Host and Client has designed but at implementation, they're implemented on PC and the Client will be implemented in MyRIO. The Host and Client process was designed in state machine diagram, as seen in Figure 2 and Figure 3 the design was conducted by Figure 1, where Host and Client don't have a connection until they well communicate.  [20] Each condition that designed on state machine diagram in Figure 2 for Host will explain as follows: a. Initialize: in this condition shown by Idle. At this state, the host performs open UDP Port that given 6300 for Listener ID as a broadcast receiver. The second port is 6400 that given for Client ID, Client ID default is set by "0" it will increase by "1" increment if Host receives broadcast from Client. That id is used to communicate with Client to perform Send ACK and do Check Appliance Data Status to perform checking Client connection. Open UDP Port 6500, 6600 and 6700 for accelerometer each for x, y and z.  Each condition that designed on state machine diagram in Figure 3for Host will explain as follows: Control Message is client waiting is that any request from host received by UDP Port through Service ID 1. If there is a request, then Client will send data through UDP Port Service ID 3. At the moment Service ID 2 will send Boolean data or other data to host. While Service ID 1 used to receive data from Host that contain data to turn on led Client. Check Control Device used to check any Client that disconnect or not. If there is no disconnect device, Client will continue to communicate with the host. But if Client disconnects with Host, then Client going back to broadcast state.

Functional Testing Scenario
To perform the test on whether the system is working properly or not, will be conducted a test of what has been done. In this system, the design of the system has to offer is made by a state machine, so the testing is done with state transition testing. State transition testing is used when the system designed and states defined by a finite number [22]. The state transition testing test is the valid testing to test system transition from one state to another and also test the valid transition   Figure 2 test conducted by Table 1, every state representing by a header number at the table and every sub number representing any possibilities that could happen at that state. For example "1" it representing first state that namely Idle, then another example "3.1","3.2",etc "x.1,"x.2"; "x" or "3" is representing the name of the state then "3.y"; "y" represent possibilities that happen in "x" state. By that definition, is used to give another state in Client from [20] Figure 3 to conduct Table 2. N-Client test scenario would carried out with 2 and 3 clients. Client Initial State defining a starting testing state, then Test Scenario and Description given in order how to test that state, which gives an overview of how testing will be done. When we did the tests specified, we also determine the state of interest represented by Destination State. So in the functional testing scenario it will determine an expected result and actual result that generated by the system. So from this test can be measured as the level of conformity with the system design objectives.

RESULTS AND ANALYSIS
In this section will be presented on how the system has been built. The initial Chapter 3.1. section will be used to indicate that the system has been made according to the design that was created earlier. Then in the second part Chapter 3.2. will be tested in accordance with the functional testing with the points that have been formulated previously at Table 2 and Table 3.

Gateway / Host and Client Implementation Result
After doing the design for the system along with its testing, the system implemented on LabVIEW. The system design for the host to be run on a PC while the Client can be run on a PC which can be uploaded and executed on MyRIO. Features provided on a customized system with a design created in the previous design, so it can be tested with scenarios designed to accommodate all the possibilities that occur in the system environment. to if the client wants to do communications and to check the host, whether the host is connected or not. In this case applied to the State Check Control Device which is owned by the Client. The stop is used to stop the whole series of programs. In Figure 5, provided one example of creating a state that represents the design that was created earlier. In the picture shown one example of a State that is Send Req. On State Send Req made a lot of possibilities to accommodate the problems that will occur in the system environment. It is represented by the Sub-State by conditioning the Error / No Error and False / True that as in the conventional coding using the If / Else or Switch Case. After creating code for Host / Gateway also made the front panel for the client. A front panel like on Figure 6 and block diagram in Figure 7. MyRIO does not have a front panel, but for coding the front panel must still be made to perform initial testing prior to deployment on MyRIO, Input and Output owned by MyRIO is physical not a form of software. At Figure 6 Front Panel of MyRIO, has been given several functions such as IP Broadcast to show the range of IP broadcast how he was carrying out. Then the Service Name is the name of the Client itself, for this name can be changed in accordance with the desired name or device is what is desired. Host Name function is to detect MyRIO which has been connected with Host and IP Host shows the IP owned by Host / Gateway. Broadcast Time is to indicate the length of time from Client / MyRIO to do a broadcast to find hosts and ACK Time indicates how long the exchange of ACK conducted between Client and Host.
Service 0-3 is a service that is owned by the client as indicated by LED owned, when service is turned on it will be indicated by the LED. Actually, there are four LED LED starting 0-3, but the Service is activated only 1 and 3 so that the LED that serves only 1 and 3. This can be done as desired or service that is owned by the Client. At Figure 7 shows one state from several that have been created on the block diagram, the figure shows one of the states owned by the client, namely Broadcast State.

Functional Testing Result and Analysis
After implementation and deployment system, system testing will be done according to the design in Table 1 and Table 2. In the examination table, Table 3 given multiple columns. The first column is T.ID, this column shows the same column in Table 1 and Table 2, which describes the testing of each side and stateowned. Expected Result show about the expected performance of the system, while the Actual Result is the actual results obtained from tests performed.
Having obtained the Actual Result will do the comparison given in the Status column. In the column will be given two conditions to declare the success of the system. The first condition is "Pass" indicates compatibility between Expected Result with Actual Result. The second condition is "Fail" which shows the discrepancy between the two. But in Actual result although not in accordance with Expected Result will be given the actual conditions occur although there is the possibility of a program error. Check and find duplication Client ID at the same client conducted by 1 client with duplication occur.
Host checking and did not find duplication, deleting old ID then given new ID for 1 client. Pass

4.2
Check and find duplication Client ID at the same client conducted by 2 and 3 clients with duplication occur.
Host checking and did not find any duplication, deleting old ID then given new ID for 2 and 3 clients. Pass

4.3
Check and find duplication Client ID at the same client conducted by 1 client without duplication occur.
Host found duplication, deleting old ID then given new ID for 1 client. Pass

4.4
Check and find duplication Client ID at the same client conducted by 2 and 3 clients without duplication occur.
Host found duplication, deleting old ID then given new ID for 2 and 3 clients. This test aims to obtain correspondence between the design was done, the implementation of the design of the system and to demonstrate the suitability of the design of the behavior and performance of LabVIEW and MyRIO. So it can be given any conclusions about the suitability of whether the system works or not. The design successfully implemented on LabView and successfully deploy on MyRIO, both can communicate well.

CONCLUSION
This research successfully compiling running, the design is working well as expected. The client can communicate well with host pervasively. Service discovery in this research performed by Client which can identify and start communicate with Host. After send and deliver the ACK, both can communicate well. The host can control any of service that owned and provided by Client. Host conducted by a PC and Client conducted by 3 MyRIO. System testing conducted by Design that created, the functional testing scenario was conducted by any possibilities that could happen in system environment seen from both sides between Host and Client. All functional testing scenario is Pass. But there are after several minutes communicate it performed error 56. That error conducted by random access memory buffer that owned by PC or MyRIO, but that error not conducted by design that created. For future work it can be performed again with various approaches to reduce memory running and implementing this system at any household environment.