Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Kumar 2019

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Journal of Discrete Mathematical Sciences and

Cryptography

ISSN: 0972-0529 (Print) 2169-0065 (Online) Journal homepage: https://www.tandfonline.com/loi/tdmc20

WSN and IoT based smart city model using the


MQTT protocol

Vishal Kumar, Gayatri Sakya & Chandra Shankar

To cite this article: Vishal Kumar, Gayatri Sakya & Chandra Shankar (2019) WSN and IoT
based smart city model using the MQTT protocol, Journal of Discrete Mathematical Sciences and
Cryptography, 22:8, 1423-1434, DOI: 10.1080/09720529.2019.1692449

To link to this article: https://doi.org/10.1080/09720529.2019.1692449

Published online: 13 Jan 2020.

Submit your article to this journal

Article views: 8

View related articles

View Crossmark data

Full Terms & Conditions of access and use can be found at


https://www.tandfonline.com/action/journalInformation?journalCode=tdmc20
Journal of Discrete Mathematical Sciences & Cryptography
ISSN  0972-0529 (Print), ISSN  2169-0065 (Online)
Vol. 22 (2019), No. 8, pp. 1423–1434
DOI : 10.1080/09720529.2019.1692449

WSN and IoT based smart city model using the MQTT protocol

Vishal Kumar *
Gayatri Sakya †
Chandra Shankar §
Department of Electronic and Communication Engineering
JSS Academy of Technical Education
Noida 201301
Uttar Pradesh
India

Abstract
The Internet of things in integration with wireless sensor networks changed the world
exponentially by connecting a huge number of devices and providing the ability to control
them remotely and globally. This research work is emphasized on proposing the smart city
model and implementation that model based on IoT using MQTT protocol. The comparison
is done with HTTP protocol. HTTP is used for transferring the information using request and
response model so require control packets overhead. To handle the limitation of HTTP, MQTT
is proposed. It uses publish/subscribe model, reduces control packets overhead and suitable
for IoT. It uses “Named based routing” and prevents IP address in IoT data transfer. The smart
city model is proposed and developed using Network Simulation Software (Cisco Packet
Tracer v7.2).Cisco introduces IoT and MQTT feature in version 7.1. Here Message Queuing
Telemetry Transport (MQTT) protocol is used which gives fast and reliable performance for
IoT devices. A network model is developed with multiple sensors and IoT Devices which acts
as MQTT client. Here a data center is created which has multiple Servers (MQTT Broker).
Using the MQTT broker all the IoT devices can be monitored by just logging in to the broker.
A prototype model is implemented and tested in real time using Node MCU. The devices
are remotely monitored from anywhere in the world which fulfill the requirement of smart
city model. Future aspects include the integration of machine learning algorithms in the
protocols developed for IoT for quick smart decisions in monitoring the critical applications.

Subject Classification:  Wireless Sensor networks


Keywords: IoT, Cisco packet tracer, MQTT, HTTP, Performance, Smart city

*E-mail:  vishalkumar757@gmail.com (Corresponding Author)



E-mail:  gayatri.sakya@rediffmail.com
§
E-mail:  chandrashankar@jssaten.ac.in

©
1424 V. KUMAR, G. SAKYA AND C. SHANKAR

1. Introduction
In Today s World, Security and Storage are key points of any
organization. Users want more security towards their data and also
want to compress data in less space. Smart City model will use smart
phones for its practical implementations as we already have a readymade
infrastructure. To accomplish that,we need some connectivity across the
city at every point. Using Router, Switch, Firewall, Server, Access point,
Cell Tower, Optical cables we can achieve this goal. After that, we need
good sensors and Actuators that can give us information. By processing
this information we can control things. This all termed as IoT (Internet
of things) where internet denoted as connectivity and things denoted as
physical devices. This paper discusses the HTTP VS MQTT protocol on
cisco packet tracer and node MCU. Usually, accessibility to computer
network requires application protocols over transport layer of Internet
protocol stack. Hyper Text Transfer Protocol (HTTP) is one of them.
When HTTP is applied to IoT , a large amount of small data blocks are
transmitted and received. The problem of control overhead and hence
performance degradation is noticed. To overcome these problems MQTT
is used. It introduced “Named based routing” and gives an alternate for
IP address based routing for IoT.
We create smart city model using Network Simulation Software (Cisco
Packet Tracer v7.2) .Cisco introduces IoT and MQTT feature in version 7.1.
The previous suggested models are based on RESTFUL Protocol which
is a heavy weight protocol. Here Message Queuing Telemetry Transport
(MQTT) protocol is used which gives QoS and reliability to IoT devices.
A network model is developed with multiple sensors and IoT Devices
which are MQTT client. The model is tested implemented and tested
in real time using Node MCU. It is observed that the appliances in the
city are remotely monitored and controlled through user.There are some
standard protocols which are used to connect things to the internet like
MQTT, CoAP, AMQP, WebSocket, Node, etc. A newer version of packet
tracer has MQTT feature. In the second section of paper literature survey
is done and the third section does simulation and comparison of HTTP
protocol in Cisco packet tracer. In the third section a smart city model is
proposed using MQTT protocol. In the fourth section, the proposed model
is implemented in Cisco Packet Tracer and also Hardware implementation
is done. In the fifth section, the testing is done of the proposed model.
Finally section six ends with conclusion and future scope for the proposed
work [22-24].
WSN AND IOT BASED SMART CITY MODEL 1425

2.   Literature Review and Motivation


Since last few years, IoT integration with wireless sensor networks
gave a new pace to the advancements in smart world. Researchers
have suggested various smart city models during last few years. Also
the research concentrated on IoT protocols used for smart cities. These
protocols are designed according to the specific needs of data transfer
requirement. The requirements may include security at priority, data
transfer rate, timely and reliable data delivery performance. Tetsuya
Yokotani [4] discussed the comparison of MQTT and HTTP and it
concludes that MQTT is better than HTTP for IOT communication. Ravi
Kishore Kodali [3] discusses implementation of MQTT on ESP8266 form
making smart home applications. Isa Shemsi [2] used Cisco packet tracer
simulator for modeling of smart home applications. P Gopi Krishna et al
[7] discussed implementation of MQTT protocol on embedded network
having limited resources. He concluded that HTTP requires computer and
demand more power, which affects the efficiency of the system. But MQTT
uses a single microcontroller board with low specifications and this type
of setup can be used where cost and space. Lohokare et al [4] discussed
a public buses tracking system based on MQTT. In this paper Message
Queue Telemetry Transport (MQTT) and Hypertext transfer protocol
(HTTP) are compared. Poongothai et. al in [5] discussed implementation
of IoT based smart library. Here all ESP8266s act as MQTT clients and
online server acts as an MQTT broker. R A Atmoko et. al in [8] discussed
IoT real time data acquisition using MQTT protocol . Here data acquisition
is done in real-time and stored in database using MQTT. Result in the
paper shows the enhancement of data quality and reliability using MQTT
protocol. F.Jerald et al. in [9] discussed IoT architecture using MQTT for
connecting industry networks with internet based cloud platforms. Ullas
BS et. al in [10] discussed smart system implementation using MQTT
Client protocol for industrial and home automation applications. Here the
smart system has microcontroller for implementation of MQTT Client, a
IEEE 802.3 standard Ethernet connectivity for internet and sensors for data
collection in real time. S Mohanty et. al [11] discussed MQTT in IoT based
messaging protocol. The goal of this paper wasto develop a protocol with
better bandwidthalong with less power consumption.From the above
research,we got the idea to do the performance analysis of MQTTin the
implementation of IoT for smart city applications. Also many research
papers used HTTP protocol for smart city model implementation, so
we compared MQTT and HTTP features in the next section. Pallavi et.
1426 V. KUMAR, G. SAKYA AND C. SHANKAR

Fig. 1
HTTP IoT Network

al discussed in detail the IoT [12] and G. Sakya et. al discussed wireless
sensor networks for critical applications [13]. So integration of IoT and
WSN [18-21] is an important aspect in smart city model implementation
[14-17].

3.   The simulation of HTTP and MQTT protocols in IoT


When HTTP used as an application protocol above TCP/IP in IoT,
the connection established by TCP is released on each access. This is
because data transmission is based on IP addressing and URL which keeps
on changing. So the communication is completed after many times of
establishment-release of a connection. So because that the control packets
overhead and wastage of channel bandwidth in network is observed.
There is a feature in Cisco packet tracer called simulation panel where
you can capture packets.

Fig. 2
Packet capture
WSN AND IOT BASED SMART CITY MODEL 1427

In this network we switch ON fan by using website portal. In


simulation panel you can clearly see that total time to ON the Fan By
Laptop 0 is 18.627s – 18.581s = 0.046s.
MQTT protocol features: In IoT the device communication is based
on low throughput is possible using small packets with very low control
packets overhead. There is no need to use FTP or HTTP traditionally
used in internet with huge overhead data. MQTT is designed for such IoT
applications which uses small size packets and based on publish subscribe
model [1]. The protocol is based on publish/subscribe model and used
for machine to machine communication. The data collection is done on
different topics like temperature, soil fertility etc and is sent to the cloud
using MQTT broker. Devices which are subscribed to the MQTT broker
are monitored based on the message published on the topic. In figure 3(a)
the model is shown and in figure 3(b) it is simulated.
The model is simulated using the Cisco Packet Tracer 7.1. Using
publish feature of MQTT we publish a message topic name “fan” from
User to MQTT Broker To ON Fan.

Fig. 3 (a)
MQTT protocol model

Fig. 3(b)
MQTT IoT Network
1428 V. KUMAR, G. SAKYA AND C. SHANKAR

Fig. 4
Packet Capture of MQTT Network

In simulations, it is clearly observed that time taken is 0.007s to ON


Fan or receive message by IoT device.

3.1  Comparison of HTTP VS MQTT


MQTT is a used for small data transfer between M2M whereas HTTP
is used preferably for huge data collection in big data applications. MQTT
message uses 2 bytes header and transfer the data in bytes. So it is best
for battery operated devices. When a device sends temperature sensor’s
readings, based on which we remotely want to monitor the AC, the
MQTT is used. On the other hand if the data collection is done for a city
to take actions then HTTP is preferable. Clearly it is observed from above
simulation result MQTT protocol is 6.5 times faster than HTTP.

4.   Implementation of the Smart city model


4.1 Procedure for Implementation of proposed model
First of all the proposed model is developed in Cisco packet tracer for
smart city which is described below in figure 5. First we have to simulate
a network in packet tracer. A network consists of some important protocol

Fig. 5
Smart City Scenario
WSN AND IOT BASED SMART CITY MODEL 1429

Fig. 6
Smart Home and Connection of sensors in Home

IP, OSPF, etc. After assigning an IP address to interfaces of router and end
devices.
All the home, offices, etc are connected to routers, DSL Modem and
wireless AP.
Then we have to place sensors and actuators at a suitable place
according to their respective need. To make a smart city we need to make
first smart home, offices, hospital, school, police station, etc. All the sensors
and devices connected to Access Point (AP) as shown in figure 6.Then
we have to create a server as shown in figure 7 in area which provides
services to those devices. Some Important services are DHCP, DNS, AAA,
HTTP, FTP, etc.
To install MQTT Broker on the server first goto the programming tab
and click on a new project then select Global script Project and click on
create button. Then click on Install to desktop and then click on Run. We
need to go to the Desktop tab search for MQTT Broker Icon. Then create a
username and password. The IP address of the broker is same as the local
machine IP.For MQTT client select end devices like laptop IoT devices or
MCU etc. Go to I/O Config tab select show desktop then click the desktop
tab and search for user app manager. Go to the available tab and install
the MQTT client. Then go to MQTT Client application in Desktop.Here
we have to give a broker IP address, Username, and Password. After
Connecting to MQTT broker we get an event log message. Next step is

Fig. 7
Server
1430 V. KUMAR, G. SAKYA AND C. SHANKAR

Fig. 8
Create new block in Adafruiteio Dashboard

to subscribe IoT devices to broker by giving a Topic name. After that, we


can publish messages to any client by defining their Topic, Payload, QoS.

4.2  Hardware Implementation


For MQTT broker we use Adafruiteio and MQTT client we use Node
MCU.
Configuration ProcedureTo set up broker , create an account on
Adafruiteio, then create feed then create a new block Then setup our
dashboard as shown in figure 8. We can save our AIO_Key, Username,
feed name, address.
Now to create MQTT client we can use the open source code and
just modify according to need. Here we set program to control Relay on
pin D3 on Node MCU. You can download code from Adafruite IO MQTT
library (mqtt _esp8266).Upload it to ESP8266 and connect D3 pin to Relay.

Fig. 9
Node MCU with 1 channel relay
WSN AND IOT BASED SMART CITY MODEL 1431

Fig. 10
Adafruite IO Dashboard

The relay connected to Light bulb. From Adafruite IO dashboard we


can control light of our home as shown in figure 10.

5. Results
After Successful completion of the hardware setup, we go to the
MQTT broker and login the credential. By publishing our message we can
control our home devices. So every smart home, Offices, Motor vehicle in
the city makes city smart. We try to do that in Cisco packet tracer. But in
packet tracer, we use traditional HTTP protocol at the application layer.
MQTT is a good protocol over HTTP and it has the ability to send data
packets faster than HTTP. The implementation is successfully completed
and the model developed can be used in real time for controlling several
devices during the Smart city development in real time application.

6.  Concluding Remarks


We have discussed the implementation of MQTT on cisco packet
tracer and Node MCU. We used Adafruiteio to MQTT Broker and Node
MCU as an MQTT client. In Packet tracer, we used Server as MQTT
Broker and MCU as a client. MCU provides a programming environment
to manage different Sensors and IoT appliance. Here MQTT broker
(Adafruiteio) is the heart of network in which the IoT devices register
them as client and send the information on any topic, also the subscriber
use this information. MQTT Protocol can be used for fast and timely data
transfer between M2M. In this paper, we are using Quality of Service
0. This is the minimum level of reliability standard. It also provides
authentication, which we have discussed little in this paper. For secure
Delivery of message, it uses SSL. So the proposed model for smart city is
first simulated in Cisco Packet Tracer and then tested for the performance
1432 V. KUMAR, G. SAKYA AND C. SHANKAR

of MQTT on hardware. This model gives an overview to make the world


smarter by accessing the devices remotely within a short desirable time.

References

[1] Krishna, P.G., Ravi, K.S., Kumar, V.S. and Kumar MS: Implementa-
tion of MQTT Protocol On Low Resourced Embedded Network, Int.
J. Pure Appl. Math (IJPAM), 116, pp.161-166 (2017).
[2] Isa Shemsi: Implementing Smart Home using Cisco Packet Tracer
Simulato, International Journal of Engineering Science Invention Research
& Development, Vol. iv, Issue vii, January (2018).
[3] R. K. Kodali and S. Soratkal :MQTT based home automation system
using ESP826, IEEE Region 10 Humanitarian Technology Conference
(R10-HTC), Agra, 2016, pp. 1-5,(2016)
[4] T. Yokotani and Y. Sasaki : Comparison with HTTP and MQTT
on required network resources for IoT,2016 International Confer-
ence on Control, Electronics, Renewable Energy and Communications
(ICCEREC),Bandung,2016,pp.1-6, (2016).
[5] M Poongothai, A L Karupaiya and R Priya dharshini : Implementa-
tion of IoT based Smart Laboratory, International Journal of Computer
Applications 182(15):31-34, September ( 2018)
[6] J. Lohokare, R. Dani, S. Sontakke and R. Adhao :Scalable tracking
system for public buses using IoT technologies , 2017 International
Conference on Emerging Trends & Innovation in ICT (ICEI), Pune,
2017,pp.104-109, (2017)
[7] P Gopi Krishna, K Sreenivasa Ravi, V.S.S Sailendra Kumar, M.V.S.N
Sai Kumar: Implementation of MQTT protocol on low resourced em-
bedded network” , International Journal of Pure and Applied Mathemat-
ics, pp 161-166,(2017)
[8] R A Atmoko, R Riantini, M K Hasin : IoT real time data acquisition
using MQTT protocol”,  Journal of Physics Conference Series 853(1),
May (2017) 
[9] F.Jerald, M.Anand, N.Deepika: Design of an Industrial IOT Architec-
ture Based on MQTT Protocol for End Device to Cloud Communica-
tion, International Journal of Recent Technology and Engineering (IJRTE)
ISSN: 2277-3878, Volume-7, Issue-6S2, April (2019)
WSN AND IOT BASED SMART CITY MODEL 1433

[10] Ullas B S, Anush S, Roopa J : Machine to Machine Communication


for Smart Systems using MQT, International Journal of Advanced Re-
search in Electrical, Electronics and Instrumentation Engineering, Vol. 3,
Issue 3, March 2014
[11] Suvam Mohanty, Sagar Sharma, Vaibhav Vishal: MQTT – Messaging
Queue Telemetry Transport IOT based Messaging Protocol, Interna-
tional Research Journal of Engineering and Technology, volume 03, issue
09 ,sep (2016)
[12] Pallavi Sethi, Smruti R.Sarangi :Internet of Things: Architectures,
Protocols, and Applications” , Hindawi Journal of Electrical and Com-
puter Engineering, Volume 2017, Article ID 9324035, 25 pageshttps://
doi.org/10.1155/2017/9324035,(2017)
[13] 
Gayatri Sakya and Vidushi Sharma , “ADMC-MAC: Energy ef-
ficient adaptive MAC protocol for mission critical applications in
WSN”, in Sustainable Computing: Informatics and Systems,Volume
23,2019,Pages 21-28,ISSN 2210-5379.
[14] Khan, Tayyab, Karan Singh, Mohamed Abdel-Basset, Hoang Viet
Long, Satya P. Singh, and Manisha Manjul. “A Novel and Compre-
hensive Trust Estimation Clustering-Based Approach for Large Scale
Wireless Sensor Networks.” IEEE Access, vol. 7, pp. 58221-58240,
(2019).
[15] Abie, Habtamu, and Ilangko Balasingham. “Risk-based adaptive se-
curity for smart IoT in eHealth.” Proceedings of the 7th International
Conference on Body Area Networks. ICST (Institute for Computer
Sciences, Social-Informatics and Telecommunications Engineering),
2012.
[16] Nurse, Jason RC, Sadie Creese, and David De Roure. “Security risk
assessment in Internet of Things systems.” IT Professional 19.5 (2017):
20-26.
[17] Jing Q, Vasilakos AV, Wan J, Lu J, Qiu D. Security of the Internet of
Things: perspectives and challenges. Wireless Networks. 2014 Nov
1;20(8):2481-501.
[18] Lingaraj, K., Rajashree V. Biradar, and V. C. Patil. “OMMIP: An opti-
mized multiple mobile agents itinerary planning for wireless sensor
networks.” Journal of Information and Optimization Sciences 38, no. 6
(2017): 1067-1076.
1434 V. KUMAR, G. SAKYA AND C. SHANKAR

[19] Durugkar, Santosh, and Ramesh C. Poonia. “Optimum utilization of


natural resources for home garden using wireless sensor networks.”
Journal of Information and Optimization Sciences 38, no. 6 (2017): 1077-
1085.
[20] Zhao, Bing, and Gaiwen Guo. “An encryption algorithm for user’s
sensitive information resources in network database.” Journal of In-
terdisciplinary Mathematics 21, no. 5 (2018): 1255-1260.
[21] Wang, Xiao-Xia, Xi-Yuan Liu, and Zhan-Qiang Li. “A social collab-
orative urban distribution integration platform.” Journal of Interdisci-
plinary Mathematics 21, no. 5 (2018): 1109-1113.
[22] Malik, Vinita, and Sukhdip Singh. “Security risk management in IoT
environment.” Journal of Discrete Mathematical Sciences and Cryptogra-
phy 22, no. 4 (2019): 697-709.
[23] Saad, George W. Helmy, and Magdy A. Ahmed. “Power saving by
incorporating mobile agents and clustering approach in wireless sen-
sor networks.” Journal of Discrete Mathematical Sciences and Cryptogra-
phy 15, no. 2-3 (2012): 135-147.
[24] Kumar, Devender, Harsh Kumar Singh, and Chhahat Ahlawat. “A
secure three-factor authentication scheme for wireless sensor net-
works using ECC.” Journal of Discrete Mathematical Sciences and Cryp-
tography (2019): 1-22.

You might also like