Speed Comparison OF Websocket And HTTP In IOT Data Communication
Abstract
IOT devices is connected using various method. Two of most commonly used methods are websocket and HTTP Api. According to the results of the test, number of loads and data size can increase the time duration for each communication method either websocket or HTTP api. Api and websocket has a wider range usage and large data transfer. API and websocket is more preferred than other method as these methods is easy to implement and the server configuration is not complicated. API is most common as the protocol is HTTP that can be setup by using common hosting service. Incontrolling IOT devices, response time is very important. Delay in sending message may cause bad user experience as user may think that the devices might be malfunction. In this research we measured the time needed to control an IOT devices using HTTP using API protocol and websocket. Base on our research, The process between pushing the controller button and the IOT devices execute the task is faster when using the websocket while using the HTTP. Websocket is much better option in data exchange than the HTTP api. The average time of websocket in data exchange between the server and IOT devices is between 554-711 mili second while the average time of HTTP api is between 2.7-4.5 second. This test is done by calculating the round trip of the process, thus the process in the IOT devices where the data is processed is included and measured.
Downloads
References
M. A. Amrullah, K. M. Lhaksmana and D. Adytia, "Pembangunan dan pengujian protokol MQTT & WebSocket untuk Aplikasi IoT Rumah Cerdas berbasis Android," in eProceedings of Engineering, Telkom University, 2018.
A. Bhawiyuga, R. Primananda, W. Yahya and Y. R. Deantama, "Rancang Bangun Sistem Kontrol Dan Monitoring Berbasis Websocket Pada Perangkat Arduino," in Prosiding SNRT (Seminar Nasional Riset Terapan), Banjarmasin, 2016.
L. F. Permatasari and H. Dhika, "Optimasi Jalur Transfer Data dari HTTP menjadi MQTT pada IoT menggunakan Cloud Services," JISA (Jurnal Informatika dan Sains), vol. Vol. 01, no. No. 02, Desember 2018, pp. 67-72, 2018.
G. M. B. O. e. al, "Comparison Between MQTT and WebSocket Protocols for IoT Applications Using ESP8266," Workshop on Metrology for Industry 4.0 and IoT, pp. 236-241, 2018.
P. B. Muhammad, W. Yahya and A. Basuki, "Analisis Perbandingan Kinerja Protokol Websocket dengan Protokol SSE pada Teknologi Push Notification," Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 2, no. 6, pp. 2235-2242, 2018.
Y.-B. Chika and O. K. Esther, "Financial stock application using websocket in Real Time Application," International Journal of Informatics and Communication Technology (IJ-ICT), p. 139, 2019.
R. T. Fielding, "Architectural Styles and the Design of Network-based Software Architectures," 6 June 2022. [Online]. Available: https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm.
K. Gilani, J. Kim, J. Song, D. Seed and C. Wang, "Semantic Enablement in IoT Service Layers—Standard Progress and Challenges,," IEEE Internet Computing, vol. 22, no. 4, pp. 56-63, Jul./Aug. 2018.
J. M. Hughes, "Arduino: A Technical Reference by J. M. Hughes," 6 June 2022. [Online]. Available: https://www.oreilly.com/library/view/arduino-a-technical/9781491934319/ch01.html.
A. Minteer, "IoT networking data messaging protocols," in Analytics for the Internet of Things (IOT), Birmingham, Packt Publishing Ltd., 2017, p. 55.
D. Mozilla, "An Overview of HTTP," 06 June 2022. [Online]. Available: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview.
A. Neumann, N. Laranjeiro and J. Bernardino, "An Analysis of Public REST Web Service APIs," IEEE Transactions on Services Computing, vol. 14, no. 4, pp. 957 - 970, 2021.
Tuya, "Tuya Smart and BARDI Smart Home Partner to Promote Smart Life in the Southeast Asia Market," 12 Juni 2022. [Online]. Available: https://www.tuya.com/news-details/tuya-smart-and-bardi-smart-home-partner-to-promote-smart-life-in-the-southeast-asia-market-Ka5kewlx1z02p.
M. J. M. Zedan, A. I. Abduljabbar, F. L. Malallah and M. G. Saeed, "Controlling Embedded Systems Remotely via Internet-of-Things Based on Emotional Recognition," Advances in Human-Computer Interaction, p. 1, 2020.