Abstract
Large-scale and realistic simulations have been a pending issue in IoT research and development, hampering the design and optimization of networked systems. This paper presents new features added to the Dockemu open-source project, aimed at making it a valuable framework for such studies. The framework is based on the use of Linux Docker containers for the individual constrained nodes, and the ns-3 network simulator to emulate the network and connect the nodes during the simulation. Both technologies combined enable the capacity to simulate a huge number of lightweight nodes under realistic network conditions. The Linux interface mechanism used to interconnect the containers and the ns-3 simulation are described in detail. We also explain how LTE and LR-WPAN network technologies were added to the framework in order to cover a wide range of scenarios. Details on how Ansible has been used to orchestrate the setup and execution of the testing framework are given, too, showing how this widely-used devops tool can replace different programming and scripting languages for the orchestration of a simulation framework. Finally, the paper includes an example of IoT scenario simulation, using a real implementation of the CoAP protocol and involving a relevant number of nodes.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
Security is a key point in IoT deployments since it normally controls and monitors critical infrastructures, and also due to the huge number of devices and the difficulties to update the software in many constrained devices. An extensive report of MQTT and CoAP vulnerabilities and attack patterns detected in production devices can be found at [14].
- 4.
The Ansible version of Dockemu framework presented in this paper is publicly available under GPLv3 license at: https://github.com/antonroman/dockemu-ansible. In doing so, we try to follow good practices [15] in terms of research impact and reproducibility.
- 5.
- 6.
- 7.
- 8.
We started to use the term hybrid in [27] to refer to simulations where some of the elements is not simulated but a real element, like the client/server software in Dockemu. With ‘pure simulation’ we refer to simulations where all the elements (nodes, IoT software, networks, etc.) are simulated.
- 9.
ns-3 supports distributed simulations as explained in Sect. 7.1.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
Ansible Best Practices to write playbooks and organize the files can be found in Ansible doc site: https://docs.ansible.com/.
- 18.
The roles are the way that Ansible separates groups of actions to be performed in the server.
- 19.
Please note that it is a .cc which must be re-compiled even when we refer to it as a script.
- 20.
The container can not execute the client or server daemon just after being started but it must start with a few-second (at least 10 s) delay to make sure the network interfaces are connected to ns-3.
- 21.
/var/run/netns.
- 22.
eNodeB comes from E-UTRAN Node B and it is the name given to base stations in LTE, the hardware which connects the mobile devices (UE in LET terminology) and the rest of the network.
- 23.
The name of the module used to simulate wired Ethernet networks in ns-3 is called CSMA.
- 24.
This means in Virtual Box terminology that a full physical CPU is assigned to the virtual CPU.
- 25.
Please note that modern hypervisors does not consume all the reserved RAM when the virtual machine is launched but it is used under demand, however the RAM required to keep the system up and running.
- 26.
glibc is the GNU C Library used by most Linux distributions.
- 27.
This page contains a very detailed comparison of performance and characteristics of the main C libraries http://www.etalabs.net/compare_libcs.html.
- 28.
Playbook is the name given by Ansible framework to the scripts where all the instruction needed to carry out a task are written.
- 29.
The CSMA model can be considered very close to a Ethernet cabled network.
- 30.
International Electrotechnical Comission.
- 31.
IKEA smartlights are one of the most well-known examples of CoAP usage in mass market products: https://learn.pimoroni.com/tutorial/sandyj/controlling-ikea-tradfri-lights-from-your-pi.
- 32.
- 33.
In our case the packet loss can be simulated by both ns-3 and also by the libcoap reference applications [23] used for the tests.
- 34.
This scenario is not recommended by [11] however is neither forbidden by the RFC nor the current CoAP libraries.
- 35.
- 36.
References
3GPP: Standardization of NB-IOT completed (2016). http://www.3gpp.org/news-events/3gpp-news/1785-nb_iot_complete. Accessed 3 Mar 2019
Cohn, R.J., et al.: Mqtt version 3.1.1. http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
Bai, J., Bi, J., Kuang, P., Fan, C., Zhou, Y., Zhang, C.: NS4: enabling programmable data plane simulation. In: Proceedings of the Symposium on SDN Research, SOSR 2018, pp. 12:1–12:7. ACM, New York (2018). https://doi.org/10.1145/3185467.3185470, http://doi.acm.org/10.1145/3185467.3185470
Baldo, N., Requena-Esteso, M., Núñez-Martínez, J., Portoles-Comeras, M., Nin-Guerrero, J., Dini, P., Mangues-Bafalluy, J.: Validation of the IEEE 802.11 MAC model in the ns3 simulator using the EXTREME testbed. In: SimuTools (2010)
Bormann, C., Shelby, Z.: Block-Wise Transfers in the Constrained Application Protocol (CoAP). RFC 7959 (Proposed Standard), August 2016. https://doi.org/10.17487/RFC7959, https://www.rfc-editor.org/rfc/rfc7959.txt
D’Angelo, G., Ferretti, S., Ghini, V.: Simulation of the internet of things. CoRR abs/1605.04876 (2016). http://arxiv.org/abs/1605.04876
Docker-Team: Best practices for writing dockerfiles. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/. Accessed 3 Jan 2019
Ebert, C., Gallardo, G., Hernantes, J., Serrano, N.: DevOps. IEEE Softw. 33(3), 94–100 (2016). https://doi.org/10.1109/MS.2016.68
Gupta, S.G., Ghonge, M., Thakare, P.D.P.M., Jawandhiya, P.: Open-source network simulation tools an overview. Int. J. Adv. Res. Comput. Eng. Technol. 2 (2013)
Gluhak, A., Krco, S., Nati, M., Pfisterer, D., Mitton, N., Razafindralambo, T.: A survey on facilities for experimental internet of things research. IEEE Commun. Mag. 49(11), 58–67 (2011). https://doi.org/10.1109/MCOM.2011.6069710
Hartke, C.: Observing Resources in the Constrained Application Protocol (CoAP). RFC 7641 (Proposed Standard), September 2015. https://doi.org/10.17487/RFC7641, https://www.rfc-editor.org/rfc/rfc7641.txt
Hasan, A.B., Kiong, T., Paw, J.K., Musa, A.B., Mohamed, H.: Real-time video streaming over NS3-based emulated LTE networks. Int. J. Electron., Comput. Commun. Technol. 4 (2017). https://www.researchgate.net/publication/282219796_Real-Time_Video_Streaming_over_NS3-based_Emulated_LTE_Networks
Iglesias Urkia, M., Urbieta, A., Parra, J., Casado Mansilla, D.: IEC 61850 meets CoAP: towards the integration of smart grids and IoT standards, pp. 1–9, October 2017. https://doi.org/10.1145/3131542.3131545
Maggi, F., Vosseler, R., Quarta, D.: The fragility of industrial IoT’s data backbone - security and privacy issues in MQTT and CoAP protocols. Trend Micro Res. (2018). https://documents.trendmicro.com/assets/white_papers/wp-the-fragility-of-industrial-IoTs-data-backbone.pdf
Patrick Vandewalle, J.K., Vetterli, M.: Reproducible research in signal processing. IEEE Signal Process. Mag. 37, 47 (2009). https://infoscience.epfl.ch/record/136640/files/VandewalleKV09.pdf
Pei, G., Henderson, T.R.: Validation of OFDM error rate model in ns-3 (2010)
Pino, D.: Network namespaces. https://blogs.igalia.com/dpino/2016/04/10/network-namespaces/ (2016). Accessed 22 Apr 2018
Rampf, S.: Network simulation and its limitations. In: Seminar Future Internet SS2013 (2010)
ur Rehman Khan, A., Bilal, S.M., Othman, M.: A performance comparison of network simulators for wireless networks. CoRR abs/1307.4129 (2013)
Rescorla, E., Modadugu, N.: Datagram Transport Layer Security Version 1.2. RFC 6347 (Proposed Standard), January 2012. https://doi.org/10.17487/RFC6347, https://www.rfc-editor.org/rfc/rfc6347.txt
Román, A., López, M.: Dockemu: extension of a scalable network simulation framework based on Docker and NS3 to cover IoT scenarios. In: Proceedings of 8th International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH). INSTICC, INSTICC, Porto, Portugal, July 2018
Sharma, P., Chaufournier, L., Shenoy, P., Tay, Y.C.: Containers and virtual machines at scale: a comparative study. In: Proceedings of the 17th International Middleware Conference, Middleware 2016, pp. 1:1–1:13. ACM, New York (2016). https://doi.org/10.1145/2988336.2988337, http://doi.acm.org/10.1145/2988336.2988337
libcoap team: libcoap: A CoAP (RFC 7252) implementation in C (2019). Accessed 12 Jan 2019. https://github.com/obgm/libcoap
NS3 Team: Mobility model library guide (2018). Accessed 21 Apr 2018. https://www.nsnam.org/docs/models/html/mobility.html
NS3 Team: Mobility model library guide (2018). Accessed 22 Apr 2018. https://www.nsnam.org/docs/models/html/tap.html
NS3 Team: NB-IOT guide (2019). Accessed 3 Mar 2019. https://www.nsnam.org/wiki/NB-IOT
To, M.A., Cano, M., Biba, P.: DOCKEMU – a network emulation tool. In: 2015 IEEE 29th International Conference on Advanced Information Networking and Applications Workshops. IEEE, March 2015. https://doi.org/10.1109/waina.2015.107
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Portabales, A.R., Nores, M.L. (2020). Dockemu: An IoT Simulation Framework Based on Linux Containers and the ns-3 Network Simulator — Application to CoAP IoT Scenarios. In: Obaidat, M., Ören, T., Rango, F. (eds) Simulation and Modeling Methodologies, Technologies and Applications. SIMULTECH 2018. Advances in Intelligent Systems and Computing, vol 947. Springer, Cham. https://doi.org/10.1007/978-3-030-35944-7_4
Download citation
DOI: https://doi.org/10.1007/978-3-030-35944-7_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-35943-0
Online ISBN: 978-3-030-35944-7
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)