Erlang as an alternative to a non-functional language for communication in a faulttolerant IoT sensor network

University essay from Göteborgs universitet/Institutionen för data- och informationsteknik

Abstract: This thesis compares a C++ prototype and an Erlang prototype for an Internet of Things application. Internet of Things applications are difficult to program because they consist of a distributed environment of heterogeneous devices, where each device can have limited resources and connectivity technologies. Erlang is a high-level distributed functional language, which can help solve these problems, but an Erlang program may use more resources than an equivalent C++ program. In this thesis one C++ prototype and one Erlang prototype were developed to handle the communication between sensors in a Wireless Sensor Network using the ZigBee communication technology. These prototypes were evaluated against each other based on power consumption, memory utilization, CPU utilization and lines of code. The result of the evaluation was unexpected: The Erlang prototype used less memory and CPU in most cases. Therefore, one process in the C++ prototype was further investigated to see why this was the case and it was found that much of the resources required by the C++ prototype came from using dbus for inter-process communication. Without dbus included the C++ prototype would use less resources compared to the Erlang prototype. The recommendations that can be derived from the investigation in this thesis are that Erlang should be used if the point is to use as little memory as possible and that as long as more than one data packet per second is sent Erlang uses less CPU. Even if the packet rate is less than one per second it can be worth considering the use of Erlang because the code is significantly shorter. Therefore, an Erlang solution should have fewer bugs and fewer security problems.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)