Speed Comparison OF Websocket And HTTP In IOT Data Communication

  • Friendly Friendly Politeknik Negeri Medan
  • Ajulio Padly Sembiring Politeknik Negeri Medan
  • Sharfina Faza Politeknik Negeri Medan
  • Andam Luckyhasnita Politeknik Negeri Medan
Keywords: iot, websocket, api


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.



Download data is not yet available.

Author Biography

Ajulio Padly Sembiring, Politeknik Negeri Medan




S. Cavalieri, G. Cantali and A. Susinna, "Integration of IoT Technologies into the Smart Grid," Sensors, p. online, 23 March 2022.
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.
How to Cite
Friendly, F., Sembiring, A. P., Faza, S., & Luckyhasnita, A. (2022). Speed Comparison OF Websocket And HTTP In IOT Data Communication. INFOKUM, 10(5), 46-51. https://doi.org/10.58471/infokum.v10i5.852