SlideShare a Scribd company logo
1 of 8
Download to read offline
1	 Mphasis
Emerging Open and Standard Protocol Stack for IoT
By Aniruddha Chakrabarti
AVP Digital Practice
2	 Mphasis
Internet of Things (IoT) has come a long way since British
entrepreneur Kevin Ashton first coined the term in 1999.
Though the advent of Industrial IoT goes a long way into
the past (remember RFID?), it did not have the form and
momentum currently present in the IoT space.
IoT is one of the key components of digital and digital
transformation along with Social, Mobile, Analytics, and
Cloud (SMAC). Some product vendors refer to IoT as
Internet of Everything or Industrial IoT. Digital uses IoT
and SMAC stack as building blocks to provide a superior
customer experience for users. Today, IoT together with
Big Data, Analytics and Cloud can help enable numerous
possibilities that were unheard of earlier and technologically
not possible otherwise. IoT takes the absolute center stage
in the roadmap of product vendors, software companies,
system integrators, and IT service companies.
According to Industry Analysts there will be nearly 26 billion
devices on the IoT by 2020. Cisco estimates that 50 billion
devices and objects will be connected to the internet by
2020. Other vendors have slightly different predictions.
Irrespective of these differences, it is very clear that the
number of devices/things connected would be in the range
of billions, not millions.
One of the biggest challenges faced by businesses,
architects, and developers while dealing with IoT projects is
selecting the technology stack and tools – this stems from
the fact that standardization in the IoT protocols is virtually
non-existent. The root of the problem is the constrained
environment of IoT characterized with low memory
availability, low power, low bandwidth requirement, and
high packet loss – combined, these do not allow TCP/IP
stack and web technologies to be used easily for IoT.
However, to solve this challenge, there are hundreds of
proprietary protocols in IoT, M2M (Machine to Machine)
and Home Automation space such as ZigBee and Z-Wave.
Though these protocols are supported by an alliance of
product vendors, they are not standardized like TCP, IP,
HTTP or SMTP.
Although the scenario is still a bit cloudy, a set of open,
standardized set of protocols have started to emerge.
Most bodies such as IEEE, IETF or W3C have standardized
protocols such as 6LoWPAN or CoAP. In the long run,
these protocols would emerge successful like the open
standardized web standards used by the web today.
The figure below shows the IoT protocols that have been
standardized for each layer of TCP/IP model including
Network, Internet, Transport and Application Layers.
Let’s take a look at the protocols bottom up the stack.
IoT Stack Web Stack
Web Applications
IoT
Applications
Binary, JSON, CBOR HTML, XML, JSON
HTTP, DHCP, DNS, TLS/SSL
TCP, UDP
IPv6, IPv4, IPSec
Ethernet (IEEE 802.3), DSL,
ISDN, Wireless LAN
(IEEE 802.11), Wi-Fi
CoAP, MQTT, XMPP, AMQP
UDP, DTLS
IPv6/IP Routing
6LoWPAN
IEEE 802.15.4 MAC
IEEE 802.15.4 PHY /
Physical Radio
TCP/IP Model
Data Format
Application Layer
Transport Layer
Internet Layer
Network/Link
Layer
Device
Management
Figure 1 – Standardized IoT Protocols
3	 Mphasis
Network / Link Layer
IEEE 802.15.4
IEEE 802.15.4 is a standard for wireless communication
that defines the Physical layer (PHY) and Media Access
Control (MAC) layers. It is standardized by the IEEE
(Institute for Electrical and Electronics Engineers) similar to
IEEE 802.3 for Ethernet, IEEE 802.11 is for wireless LANs
(WLANs) or Wi-Fi.
802.15 group of standards specifies a variety of wireless
personal area networks (WPANs) for different applications
(For instance, 802.15.1 is Bluetooth). IEEE 802.15.4
focuses on communication between devices in constrained
environment with low resources (memory, power and
bandwidth).
Internet Layer
6LoWPAN
6LoWPAN is the secret sauce that allows larger IPv6
packets to flow over 802.15.4 links that support much
smaller packet sizes. 6LoWPAN is the acronym of IPv6 over
Low Power Wireless Personal Area Networks. So 6LoWPAN
as the name implies is an adaptation layer that allows
transport of IPv6 packets over 802.15.4 links. Without
6LoWPAN IPv6, internet protocols would not work in these
Low Power Wireless Personal Area Networks that uses
IEEE 802.15.4.
6LoWPAN is an open standard defined under RFC 6282 by
the Internet Engineering Task Force (IETF), the body that
defines many of the open standards used on the internet
such as UDP, TCP and HTTP to name a few.
As mentioned previously, an IPv6 packet is too large to fit
into a single 802.15.4 frame. What 6LoWPAN does to fit an
IPv6 packet in 802.15.4 frame is -
•	 Fragmentation and Reassembly - It fragments the IPv6
packet and sends it through multiple smaller size packets
that can fit in an 802.15.4 frame. On the other end, it
reassembles the fragmented packets to re-create the
IPv6 packet
•	 Header Compression – Additionally it also compresses
the IPv6 packet header to reduce the packet size
IEEE 802.15.4 PHY /
Physical Radio
IPv6/Routing
IEEE 802.15.4 MAC
Network/Link
Layer
Internet Layer
6LoWPAN
• IPv6 packet encapsulation
• IPv6 packet fragmentation & reassembly
• IPv6 header compression
• Link layer packet forwarding
Figure 2 - IPv6 sent into 802.15.4 MAC by 6LoWPAN
Transport Layer
UDP
While TCP is used predominantly in Internet as Transport
Layer Protocol (except gaming or video streaming where
User Datagram Protocol or UDP is used), most IoT
scenarios are well suited for UDP. UDP is a much lighter
protocol compared to TCP. UDP is a connection protocol
and does not come with resiliency features of TCP, such
as guaranteed packet delivery. On the other hand, UDP is
much faster than TCP, the header size is much smaller than
TCP – making it suitable for the constrained environment of
devices and sensors.
Higher level Application Layer IoT protocols like CoAP use
UDP rather than TCP.
DTLS
DTLS or Datagram Transport Layer Security is a TLS/SSL
counterpart that runs on UDP. The way TLS/SSL takes care
of security for TCP communication, DTLS provides the
same security features on UDP or Datagrams.
Application Layer
CoAP
CoAP or Constrained Application Protocol is a specialized
Web Transfer Protocol for constrained nodes and
constrained networks on the IoT. CoAP is
an Application Layer protocol in the TCP/IP model (Web
uses HTTP as an Application Layer protocol).
The term “Constrained” is used because it is designed
specifically from the ground up to work well in constrained
environments. The devices, sensors and actuators in IoT
operate in a constrained environment with low memory,
low power, low bandwidth, and high rate of packet failure.
HTTP was not designed to work in this sort of environment,
so HTTP, which is relatively heavyweight with large header
size and text encoding struggles to work in IoT constrained
environment.
4	 Mphasis
This is where CoAP comes to play – CoAP has been
standardized by IEFT (The Internet Engineering Task Force)
Constrained RESTful Environments (CoRE) Working Group.
Think of CoAP as web protocols for devices.
CoAP can be transparently mapped to HTTP. Following are
the similarities between CoAP and HTTP –
•	 CoAP follows the same request-response pattern used
by HTTP that we all are very familiar with. The CoAP
client (a smartphone, for example) sends a request to the
CoAP server (device/things) and the server then sends a
response back
•	 Like the web, devices are addressed using IP address
and port number. Access to services exposed by the
device is via RESTful URLs
•	 CoAP uses familiar HTTP features like Methods (Get,
Post, Put, and Delete), Status Codes, URLs and
content-type
•	 CoAP supports discovery so that IoT devices/things
could be discovered
•	 CoAP provides simple proxy and caching capabilities
CoAP has a few differences as well -
•	 CoAP runs on UDP as compares to HTTP, which typically
uses TCP. UDP is lighter than TCP and has less overhead
•	 CoAP supports only Get, Put, Post and Delete methods.
CoAP uses small and reduced set of headers (header
size is limited to 4 bytes), and HTTP status codes to be
lightweight
•	 CoAP supports confirmable and non-confirmable
message types
In the example given below, to get the temperature from the
thermostat (which acts like a server), the client, which is a
smartphone sends a GET request. The URL uses RESTful
architecture - clearly indicating the device name, sensor
data it is looking for, etc. The thermostat or the server
responds back with the current temperature.
coap://myhome.in:5683/nest_bedroom/temp
72 F
coap://myhome.in:5683/nest_livingroom/temp22 F
CoAP Server 1
(Thermostat in Bedroom)
CoAP Client CoAP Server 2
(Thermostat in Living Room)
Name of the
protocol
coap://myhome.in:5683/nest_bedroom/temp
Port (5683 is
the default port
CoAP uses)
Name of
the Device
Name of the parameter
device controls
(temperature here)
4G 70%
CoAP also adds the feature of “observation”, which HTTP
lacks. This is very useful in IoT scenarios. In the above
example where the CoAP client, which is a smartphone
app, is requesting temperature from the thermostats,
it can also specify that it should notify when the
temperature changes – this functionality is called
“Observe:” When the temperature changes, the CoAP
server (in this case the thermostat), notifies the client. This
was not possible before the recent server-sent event and
WebSocket specification in HTTP.
CoAP libraries exists practically in all programming
languages like C, Java, C#, Python, JavaScript, Go, Erlang,
Ruby, etc. There are libraries for iOS and Android as well.
Coap.technology website lists many of them.
MQTT
MQTT stands for Message Queue Telemetry Transport.
MQTT is a publish-subscribe based “light weight”
messaging protocol for IoT and M2M (Machine-to-Machine
communication). To put it simply, MQTT is the AMQP or
JMS for the constrained environment of IoT. Andy Stanford-
Clark and Arlen Nipper invented MQTT back in 1999, when
their use case was to create a protocol for minimal battery
loss and minimal bandwidth connecting oil pipelines over a
satellite connection.
MQTT uses a broker-based pub-sub architecture in the
constrained IoT environment similar to other messaging
products that exist in the Web and Client Server world.
Figure 3.2 – CoAP using URLs following RESTful services
Figure 3 – COAP using GET and RESTful URLs
5	 Mphasis
So there is:
•	 MQTT Publisher - a sensor or device in IoT world that
publishes a piece of information
•	 MQTT Subscriber – anyone who is interested to
subscribe and receive a piece of information they’re
interested in. It could be a smartphone, a wearable
device or even other devices that are interested to know
about other devices around and change themselves
based on self-learning
•	 MQTT Broker – An intermediary that receives information
from publisher and forwards them to the subscribers
MQTT Publisher
(Thermostat)
Publish
MQTT
Subscriber 1
MQTT
Subscriber 2
Temp 72 F
MQTT Broker
Subscribe to TempPublish
Subscribe to Temp
Publish
4G 70%
72 F
72 F
MQTT provides subject/topic-based, content-based, and
type-based filtering. The above example uses topic-based
filtering where both the subscribers have subscribed for the
topic “temp” to the broker. When any device or publisher
publishes a message with topic “temp”, the broker sends
the message to all subscribers who have subscribed for
temp – in this case both Subscriber 1 and Subscriber 2.
MQTT is actively promoted and supported by industry
giants and it is part of many popular messaging suite
of products. There are also MQTT specific brokers like
Mosquitto and HiveMQ. MQTT libraries are available in
many programming languages – one of the very prominent
MQTT Library is Eclipse Paho. MQTT.org website lists many
of them.
Data Format
CBOR
CBOR (Concise Binary Object Representation) is a data
format designed with the goal of providing IoT with
very small message sizes. CBOR is based on the wildly
successful JSON data model. While JSON uses text
encoding, CBOR uses binary encoding that results in
compact message size.
Note: This article does not discuss IoT protocols for device
management. There are separate protocols like OMA
Lightweight M2M, which is an industry standard for device
management of IoT and M2M devices.
Conclusion
The future of IoT lies in standardizing the protocols used
across network stack. These set of open and standard
protocols like CoAP, MQTT and 6LoWPAN would eventually
become as successful as the TCP/IP stack used across
web and Internet.
Appendix 1: CoAP Details
CoAP Message Types
CoAP defines four different types of messages.
•	 CON or Confirmable Message
A confirmable message requires a response,
either a positive acknowledgement or a negative
acknowledgement. In case acknowledgement is not
received, retransmissions are made until all attempts are
exhausted.
•	 NON or Non-Confirmable Message
A non-confirmable request is used for unreliable
transmission (like a request for a sensor measurement
made periodically. Even if one value is missed, the impact
is not significant). Such a message is not generally
acknowledged.
•	 ACK or Acknowledgement
It is sent to acknowledge a confirmable (CON) message.
•	 RST or Reset
This represents a negative acknowledgement and literally
means resetting. It generally indicates some kind of
failure (example - unable to parse received data).
Figure 4 – MQTT in the world of IoT
6	 Mphasis
CoAP Status Codes
As mentioned earlier CoAP status codes are directly
influenced by HTTP status codes. CoAP uses X.YY format
for status codes. So HTTP’s “404 - Resource Not Found”
status code is “4.04 Not Found” in CoAP. The table below
shows the similarity between CoAP and HTTP status
codes.
Figure 5 – CoAP and HTTP Status Codes
7	 Mphasis
Appendix 2: Using CoAP Libraries
CoAP libraries exist in almost all programming languages like C, Java, C#, Python, JavaScript, Go, Erlang, and Ruby.
There are libraries for iOS and Android also.
For example, we would use the Node.js JavaScript CoAP library (both for the client and server). This library would seem
very familiar if you have used Node. More details about the library could be found at https://github.com/mcollina/node-
coap
Installing the Node CoAP Library
You need to have Node and npm installed on your machine as prerequisites. You can download and install them from
nodejs.org. To install Node CoAP library use “npm install coap” in the terminal/command window. Once Node CoAP
library is installed you can use it in your node code.
Connecting to a remote CoAP server
// Load coap module - similar to node http module
var coap = require(‘coap’);
// coap.me hosts CoAP servers. The default CoAP port
is 5683
var remoteServerUrl = ‘coap://coap.me:5683/large’;
var request = coap.request(remoteServerUrl);
var request = coap.request(localServerUrl);
request.on(‘response’, function(response) {
response.pipe(process.stdout);
response.on(‘end’, function() {
process.exit(0);
});
});
request.end();
Local CoAP server and client
Server:
// Load coap module - similar to node http module
var coap = require(‘coap’);
// Create a CoAP Server object - similar to creating
a Http Server object in node
// var http = require(‘http’);
// var httpServer = http.
createServer(function(req,res){ });
// The default CoAP port is 5683
var coapServer = coap.createServer(function(req,
res){
res.write(‘Hello’ + request.url.split(‘/’)[1] +
‘n’)
res.end(‘Hello from CoAP server’);
});
// Keeps the CoAP server running
coapServer.listen(function(){
console.log(‘CoAP server started!’);
});
Client:
var coap = require(‘coap’);
var localServerUrl = ‘coap://localhost:5683/world’;
var request = coap.request(localServerUrl);
request.on(‘response’, function(response) {
response.pipe(process.stdout);
response.on(‘end’, function() {
process.exit(0);
});
});
request.end();
Further Reading
https://en.wikipedia.org/wiki/Internet_of_Things
https://en.wikipedia.org/wiki/IEEE_802.15.4
https://en.wikipedia.org/wiki/6LoWPAN
http://postscapes.com/internet-of-things-protocols
http://coap.technology
http://mqtt.org
https://www.utwente.nl/ewi/dacs/colloquium/archive/2010/
slides/2010-utwente-6lowpan-rpl-coap.pdf
8	 Mphasis
VAL10/12/15USLETTERBASIL3724
For more information, contact: marketinginfo@mphasis.com
USA
460 Park Avenue South
Suite #1101
New York, NY 10016, USA
Tel.: +1 212 686 6655
Fax: +1 212 683 1690
Copyright © Mphasis Corporation. All rights reserved.
UK
88 Wood Street
London EC2V 7RS, UK
Tel.: +44 20 8528 1000
Fax: +44 20 8528 1001
INDIA
Bagmane World Technology Center
Marathahalli Ring Road
DoddanakundhiVillage,Mahadevapura
Bangalore 560 048, India
Tel.: +91 80 3352 5000
Fax: +91 80 6695 9942
About Mphasis
Mphasis is a global Technology Services and Solutions company specializing in the areas of Digital and Governance, Risk & Compliance. Our solution
focus and superior human capital propels our partnership with large enterprise customers in their Digital Transformation journeys and with global
financial institutions in the conception and execution of their Governance, Risk and Compliance Strategies. We focus on next generation technologies for
differentiated solutions delivering optimized operations for clients.
www.mphasis.com
Aniruddha Chakrabarti
AVP Digital Practice
Aniruddha has 16 years of IT experience spread across systems integration,
technology consulting, IT outsourcing, and product development. He has
extensive experience of delivery leadership, solution architecture, presales,
technology architecture, and program management of large scale
distributed systems.
As AVP, Digital Practice in Mphasis Aniruddha is responsible for Presales,
Solution, RFP/RFI and Capability Development of Digital Practice. He has
been the Lead Architect for many large scale distributed systems. His
interests include digital, cloud, mobility, IoT, distributed systems, web, open
source, .NET, Java, programming languages and NoSQL.

More Related Content

What's hot

enet-wp002_-en-p
enet-wp002_-en-penet-wp002_-en-p
enet-wp002_-en-pShuo Zhang
 
Cisco Certified Network Associate
Cisco Certified Network AssociateCisco Certified Network Associate
Cisco Certified Network AssociateSumit K Das
 
15.) cloud (opex, capex or hybrid)
15.) cloud (opex, capex or hybrid)15.) cloud (opex, capex or hybrid)
15.) cloud (opex, capex or hybrid)Jeff Green
 
Performance Evaluation of Soft RoCE over 1 Gigabit Ethernet
Performance Evaluation of Soft RoCE over 1 Gigabit EthernetPerformance Evaluation of Soft RoCE over 1 Gigabit Ethernet
Performance Evaluation of Soft RoCE over 1 Gigabit EthernetIOSR Journals
 
Raisul Haq Rajib (063435056)
Raisul Haq Rajib  (063435056)Raisul Haq Rajib  (063435056)
Raisul Haq Rajib (063435056)mashiur
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksAtif Shahzad
 
Network Critical @ Sharkfest 2008
Network Critical @ Sharkfest 2008Network Critical @ Sharkfest 2008
Network Critical @ Sharkfest 2008Denny K
 
CCNA RS_ITN - Chapter 8
CCNA RS_ITN - Chapter 8CCNA RS_ITN - Chapter 8
CCNA RS_ITN - Chapter 8Irsandi Hasan
 
Da3210751081
Da3210751081Da3210751081
Da3210751081IJMER
 
80211ac 5th gen_wi-fi
80211ac 5th gen_wi-fi80211ac 5th gen_wi-fi
80211ac 5th gen_wi-filaser9107
 
Module 15 (hacking wireless networks)
Module 15 (hacking wireless networks)Module 15 (hacking wireless networks)
Module 15 (hacking wireless networks)Wail Hassan
 
CCNAv5 - S1: Chapter 10 Application Layer
CCNAv5 - S1: Chapter 10 Application LayerCCNAv5 - S1: Chapter 10 Application Layer
CCNAv5 - S1: Chapter 10 Application LayerVuz Dở Hơi
 
CCNA v6.0 ITN - Chapter 11
CCNA v6.0 ITN - Chapter 11CCNA v6.0 ITN - Chapter 11
CCNA v6.0 ITN - Chapter 11Irsandi Hasan
 
Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10Hamza Malik
 
CCNA v6.0 ITN - Chapter 03
CCNA v6.0 ITN - Chapter 03CCNA v6.0 ITN - Chapter 03
CCNA v6.0 ITN - Chapter 03Irsandi Hasan
 
CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5Irsandi Hasan
 

What's hot (20)

enet-wp002_-en-p
enet-wp002_-en-penet-wp002_-en-p
enet-wp002_-en-p
 
Cisco Certified Network Associate
Cisco Certified Network AssociateCisco Certified Network Associate
Cisco Certified Network Associate
 
15.) cloud (opex, capex or hybrid)
15.) cloud (opex, capex or hybrid)15.) cloud (opex, capex or hybrid)
15.) cloud (opex, capex or hybrid)
 
Performance Evaluation of Soft RoCE over 1 Gigabit Ethernet
Performance Evaluation of Soft RoCE over 1 Gigabit EthernetPerformance Evaluation of Soft RoCE over 1 Gigabit Ethernet
Performance Evaluation of Soft RoCE over 1 Gigabit Ethernet
 
Raisul Haq Rajib (063435056)
Raisul Haq Rajib  (063435056)Raisul Haq Rajib  (063435056)
Raisul Haq Rajib (063435056)
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networks
 
What is Network Address Translation (NAT)
What is Network Address Translation (NAT)What is Network Address Translation (NAT)
What is Network Address Translation (NAT)
 
Network Critical @ Sharkfest 2008
Network Critical @ Sharkfest 2008Network Critical @ Sharkfest 2008
Network Critical @ Sharkfest 2008
 
802 15-4 tutorial
802 15-4 tutorial802 15-4 tutorial
802 15-4 tutorial
 
CCNA RS_ITN - Chapter 8
CCNA RS_ITN - Chapter 8CCNA RS_ITN - Chapter 8
CCNA RS_ITN - Chapter 8
 
Da3210751081
Da3210751081Da3210751081
Da3210751081
 
Ipv6
Ipv6Ipv6
Ipv6
 
Ccna introduction
Ccna introductionCcna introduction
Ccna introduction
 
80211ac 5th gen_wi-fi
80211ac 5th gen_wi-fi80211ac 5th gen_wi-fi
80211ac 5th gen_wi-fi
 
Module 15 (hacking wireless networks)
Module 15 (hacking wireless networks)Module 15 (hacking wireless networks)
Module 15 (hacking wireless networks)
 
CCNAv5 - S1: Chapter 10 Application Layer
CCNAv5 - S1: Chapter 10 Application LayerCCNAv5 - S1: Chapter 10 Application Layer
CCNAv5 - S1: Chapter 10 Application Layer
 
CCNA v6.0 ITN - Chapter 11
CCNA v6.0 ITN - Chapter 11CCNA v6.0 ITN - Chapter 11
CCNA v6.0 ITN - Chapter 11
 
Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10Ccna v5-S1-Chapter 10
Ccna v5-S1-Chapter 10
 
CCNA v6.0 ITN - Chapter 03
CCNA v6.0 ITN - Chapter 03CCNA v6.0 ITN - Chapter 03
CCNA v6.0 ITN - Chapter 03
 
CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5CCNA RS_NB - Chapter 5
CCNA RS_NB - Chapter 5
 

Viewers also liked

2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)
2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)
2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)Keysuke Mizuno
 
Genre: Crime (Heist)
Genre: Crime (Heist) Genre: Crime (Heist)
Genre: Crime (Heist) jackfitz1998
 
Genre: Crime (Heist)
Genre: Crime (Heist) Genre: Crime (Heist)
Genre: Crime (Heist) jackfitz1998
 
Ata 3a reca 2016 minuta.doc
Ata 3a reca 2016 minuta.docAta 3a reca 2016 minuta.doc
Ata 3a reca 2016 minuta.docJose Carlos
 
How to Light a Woodfire
How to Light a WoodfireHow to Light a Woodfire
How to Light a WoodfireGeoffrey Vogan
 
Ama-biZ 実績中間まとめ 201508
Ama-biZ 実績中間まとめ 201508Ama-biZ 実績中間まとめ 201508
Ama-biZ 実績中間まとめ 201508Takashi Uchiyama
 
Apresentação Banco-de-Horas
Apresentação Banco-de-HorasApresentação Banco-de-Horas
Apresentação Banco-de-HorasJose Carlos
 
Act 2016-2017 - Proposta dos Correios - Condições de Trabalho
Act 2016-2017 - Proposta dos Correios - Condições de TrabalhoAct 2016-2017 - Proposta dos Correios - Condições de Trabalho
Act 2016-2017 - Proposta dos Correios - Condições de TrabalhoJose Carlos
 
Getting Started with dynamic product ads
Getting Started with dynamic product adsGetting Started with dynamic product ads
Getting Started with dynamic product adsDaniel Kędzierski
 
References Dpa98
References Dpa98References Dpa98
References Dpa98wulfruna77
 
Internet of Things: Comparison of Protocols & Standards
Internet of Things: Comparison of Protocols & StandardsInternet of Things: Comparison of Protocols & Standards
Internet of Things: Comparison of Protocols & StandardsAshu Joshi
 
Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?
 Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?   Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?
Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy? Mobile Trends
 
Reklama na Facebooku: Piksel konwersji – tutorial
Reklama na Facebooku: Piksel konwersji – tutorialReklama na Facebooku: Piksel konwersji – tutorial
Reklama na Facebooku: Piksel konwersji – tutorialSzymon Lisowski
 
3GPP Standards for the Internet-of-Things
3GPP Standards for the Internet-of-Things3GPP Standards for the Internet-of-Things
3GPP Standards for the Internet-of-ThingsEiko Seidel
 

Viewers also liked (18)

2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)
2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)
2016/11/16セキビズ ビジネスブログ講座(ポエジー・オカビズ水野)
 
Genre: Crime (Heist)
Genre: Crime (Heist) Genre: Crime (Heist)
Genre: Crime (Heist)
 
Personeria 20001
Personeria 20001Personeria 20001
Personeria 20001
 
Genre: Crime (Heist)
Genre: Crime (Heist) Genre: Crime (Heist)
Genre: Crime (Heist)
 
Ata 3a reca 2016 minuta.doc
Ata 3a reca 2016 minuta.docAta 3a reca 2016 minuta.doc
Ata 3a reca 2016 minuta.doc
 
Australia_Mining 2011
Australia_Mining 2011Australia_Mining 2011
Australia_Mining 2011
 
How to Light a Woodfire
How to Light a WoodfireHow to Light a Woodfire
How to Light a Woodfire
 
Ngk evangeliseren dicht bij jezelf
Ngk   evangeliseren dicht bij jezelfNgk   evangeliseren dicht bij jezelf
Ngk evangeliseren dicht bij jezelf
 
Ama-biZ 実績中間まとめ 201508
Ama-biZ 実績中間まとめ 201508Ama-biZ 実績中間まとめ 201508
Ama-biZ 実績中間まとめ 201508
 
Apresentação Banco-de-Horas
Apresentação Banco-de-HorasApresentação Banco-de-Horas
Apresentação Banco-de-Horas
 
Act 2016-2017 - Proposta dos Correios - Condições de Trabalho
Act 2016-2017 - Proposta dos Correios - Condições de TrabalhoAct 2016-2017 - Proposta dos Correios - Condições de Trabalho
Act 2016-2017 - Proposta dos Correios - Condições de Trabalho
 
Informe climatico no. 230
Informe climatico no. 230Informe climatico no. 230
Informe climatico no. 230
 
Getting Started with dynamic product ads
Getting Started with dynamic product adsGetting Started with dynamic product ads
Getting Started with dynamic product ads
 
References Dpa98
References Dpa98References Dpa98
References Dpa98
 
Internet of Things: Comparison of Protocols & Standards
Internet of Things: Comparison of Protocols & StandardsInternet of Things: Comparison of Protocols & Standards
Internet of Things: Comparison of Protocols & Standards
 
Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?
 Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?   Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?
Anna Gruszka, Norbert Mazur: Ile tapnięć potrzeba do zamówienia pizzy?
 
Reklama na Facebooku: Piksel konwersji – tutorial
Reklama na Facebooku: Piksel konwersji – tutorialReklama na Facebooku: Piksel konwersji – tutorial
Reklama na Facebooku: Piksel konwersji – tutorial
 
3GPP Standards for the Internet-of-Things
3GPP Standards for the Internet-of-Things3GPP Standards for the Internet-of-Things
3GPP Standards for the Internet-of-Things
 

Similar to Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT

Implementation_and_Analysis_of_the_6LoWPAN.pdf
Implementation_and_Analysis_of_the_6LoWPAN.pdfImplementation_and_Analysis_of_the_6LoWPAN.pdf
Implementation_and_Analysis_of_the_6LoWPAN.pdfIUA
 
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJINTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ150ROHITCHANDRASHEKH
 
IPv6 and IoT
IPv6 and IoTIPv6 and IoT
IPv6 and IoTAPNIC
 
Io t standard_bis_arpanpal
Io t standard_bis_arpanpalIo t standard_bis_arpanpal
Io t standard_bis_arpanpalArpan Pal
 
Web Services for the Internet of Things
Web Services for the Internet of ThingsWeb Services for the Internet of Things
Web Services for the Internet of ThingsMarkku Laine
 
Adhoc mobile wireless network enhancement based on cisco devices
Adhoc mobile wireless network enhancement based on cisco devicesAdhoc mobile wireless network enhancement based on cisco devices
Adhoc mobile wireless network enhancement based on cisco devicesIJCNCJournal
 
Efficient End-to-End Secure Key Management Protocol for Internet of Things
Efficient End-to-End Secure Key Management Protocol for Internet of Things Efficient End-to-End Secure Key Management Protocol for Internet of Things
Efficient End-to-End Secure Key Management Protocol for Internet of Things IJECEIAES
 
Network And Network Address Translation
Network And Network Address TranslationNetwork And Network Address Translation
Network And Network Address TranslationErin Moore
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoTMichael Koster
 
Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network usman sarwar
 
IoT Day 2013 - Madrid
IoT Day 2013 - MadridIoT Day 2013 - Madrid
IoT Day 2013 - Madridwaltercolitti
 
Seminar on Intelligent Personal Assistant based on Internet of Things approach
Seminar on Intelligent Personal Assistant based on Internet of Things approachSeminar on Intelligent Personal Assistant based on Internet of Things approach
Seminar on Intelligent Personal Assistant based on Internet of Things approachKarthic C M
 

Similar to Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT (20)

IOT - Unit 3.pptx
IOT - Unit 3.pptxIOT - Unit 3.pptx
IOT - Unit 3.pptx
 
Swry013
Swry013Swry013
Swry013
 
Implementation_and_Analysis_of_the_6LoWPAN.pdf
Implementation_and_Analysis_of_the_6LoWPAN.pdfImplementation_and_Analysis_of_the_6LoWPAN.pdf
Implementation_and_Analysis_of_the_6LoWPAN.pdf
 
Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
6 lowpan
6 lowpan6 lowpan
6 lowpan
 
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJINTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ
INTERNWT OF THINGS KHiuahjqilkjhJU HAUI JHJKQB HJAGE IUH OLJQHNORJ BQJ
 
IPv6 and IoT
IPv6 and IoTIPv6 and IoT
IPv6 and IoT
 
Rpl2016
Rpl2016Rpl2016
Rpl2016
 
Io t standard_bis_arpanpal
Io t standard_bis_arpanpalIo t standard_bis_arpanpal
Io t standard_bis_arpanpal
 
Web Services for the Internet of Things
Web Services for the Internet of ThingsWeb Services for the Internet of Things
Web Services for the Internet of Things
 
Chapter 1 pdf
Chapter 1 pdfChapter 1 pdf
Chapter 1 pdf
 
Adhoc mobile wireless network enhancement based on cisco devices
Adhoc mobile wireless network enhancement based on cisco devicesAdhoc mobile wireless network enhancement based on cisco devices
Adhoc mobile wireless network enhancement based on cisco devices
 
Efficient End-to-End Secure Key Management Protocol for Internet of Things
Efficient End-to-End Secure Key Management Protocol for Internet of Things Efficient End-to-End Secure Key Management Protocol for Internet of Things
Efficient End-to-End Secure Key Management Protocol for Internet of Things
 
CoAP - Web Protocol for IoT
CoAP - Web Protocol for IoTCoAP - Web Protocol for IoT
CoAP - Web Protocol for IoT
 
Network And Network Address Translation
Network And Network Address TranslationNetwork And Network Address Translation
Network And Network Address Translation
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network Intel IPSO/6LoWPAN solution for general wireless sensor network
Intel IPSO/6LoWPAN solution for general wireless sensor network
 
IoT Day 2013 - Madrid
IoT Day 2013 - MadridIoT Day 2013 - Madrid
IoT Day 2013 - Madrid
 
Seminar on Intelligent Personal Assistant based on Internet of Things approach
Seminar on Intelligent Personal Assistant based on Internet of Things approachSeminar on Intelligent Personal Assistant based on Internet of Things approach
Seminar on Intelligent Personal Assistant based on Internet of Things approach
 
UNIT III- 1.RPL.pptx
UNIT III- 1.RPL.pptxUNIT III- 1.RPL.pptx
UNIT III- 1.RPL.pptx
 

More from Aniruddha Chakrabarti

Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Aniruddha Chakrabarti
 
NLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryNLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryAniruddha Chakrabarti
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Amazon alexa - building custom skills
Amazon alexa - building custom skillsAmazon alexa - building custom skills
Amazon alexa - building custom skillsAniruddha Chakrabarti
 
Using Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsUsing Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsAniruddha Chakrabarti
 
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Aniruddha Chakrabarti
 
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Aniruddha Chakrabarti
 
Future of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsFuture of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsAniruddha Chakrabarti
 

More from Aniruddha Chakrabarti (20)

Pinecone Vector Database.pdf
Pinecone Vector Database.pdfPinecone Vector Database.pdf
Pinecone Vector Database.pdf
 
Mphasis-Annual-Report-2018.pdf
Mphasis-Annual-Report-2018.pdfMphasis-Annual-Report-2018.pdf
Mphasis-Annual-Report-2018.pdf
 
Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...Thomas Cook and Accenture expand relationship with 10 year technology consult...
Thomas Cook and Accenture expand relationship with 10 year technology consult...
 
NLP using JavaScript Natural Library
NLP using JavaScript Natural LibraryNLP using JavaScript Natural Library
NLP using JavaScript Natural Library
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
 
Third era of computing
Third era of computingThird era of computing
Third era of computing
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Amazon alexa - building custom skills
Amazon alexa - building custom skillsAmazon alexa - building custom skills
Amazon alexa - building custom skills
 
Using Node-RED for building IoT workflows
Using Node-RED for building IoT workflowsUsing Node-RED for building IoT workflows
Using Node-RED for building IoT workflows
 
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
 
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
Using Swift for all Apple platforms (iOS, watchOS, tvOS and OS X)
 
Future of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows PlatformsFuture of .NET - .NET on Non Windows Platforms
Future of .NET - .NET on Non Windows Platforms
 
Groovy Programming Language
Groovy Programming LanguageGroovy Programming Language
Groovy Programming Language
 
Level DB - Quick Cheat Sheet
Level DB - Quick Cheat SheetLevel DB - Quick Cheat Sheet
Level DB - Quick Cheat Sheet
 
Lisp
LispLisp
Lisp
 
Overview of CoffeeScript
Overview of CoffeeScriptOverview of CoffeeScript
Overview of CoffeeScript
 
memcached Distributed Cache
memcached Distributed Cachememcached Distributed Cache
memcached Distributed Cache
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
 
pebble - Building apps on pebble
pebble - Building apps on pebblepebble - Building apps on pebble
pebble - Building apps on pebble
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 

Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT

  • 1. 1 Mphasis Emerging Open and Standard Protocol Stack for IoT By Aniruddha Chakrabarti AVP Digital Practice
  • 2. 2 Mphasis Internet of Things (IoT) has come a long way since British entrepreneur Kevin Ashton first coined the term in 1999. Though the advent of Industrial IoT goes a long way into the past (remember RFID?), it did not have the form and momentum currently present in the IoT space. IoT is one of the key components of digital and digital transformation along with Social, Mobile, Analytics, and Cloud (SMAC). Some product vendors refer to IoT as Internet of Everything or Industrial IoT. Digital uses IoT and SMAC stack as building blocks to provide a superior customer experience for users. Today, IoT together with Big Data, Analytics and Cloud can help enable numerous possibilities that were unheard of earlier and technologically not possible otherwise. IoT takes the absolute center stage in the roadmap of product vendors, software companies, system integrators, and IT service companies. According to Industry Analysts there will be nearly 26 billion devices on the IoT by 2020. Cisco estimates that 50 billion devices and objects will be connected to the internet by 2020. Other vendors have slightly different predictions. Irrespective of these differences, it is very clear that the number of devices/things connected would be in the range of billions, not millions. One of the biggest challenges faced by businesses, architects, and developers while dealing with IoT projects is selecting the technology stack and tools – this stems from the fact that standardization in the IoT protocols is virtually non-existent. The root of the problem is the constrained environment of IoT characterized with low memory availability, low power, low bandwidth requirement, and high packet loss – combined, these do not allow TCP/IP stack and web technologies to be used easily for IoT. However, to solve this challenge, there are hundreds of proprietary protocols in IoT, M2M (Machine to Machine) and Home Automation space such as ZigBee and Z-Wave. Though these protocols are supported by an alliance of product vendors, they are not standardized like TCP, IP, HTTP or SMTP. Although the scenario is still a bit cloudy, a set of open, standardized set of protocols have started to emerge. Most bodies such as IEEE, IETF or W3C have standardized protocols such as 6LoWPAN or CoAP. In the long run, these protocols would emerge successful like the open standardized web standards used by the web today. The figure below shows the IoT protocols that have been standardized for each layer of TCP/IP model including Network, Internet, Transport and Application Layers. Let’s take a look at the protocols bottom up the stack. IoT Stack Web Stack Web Applications IoT Applications Binary, JSON, CBOR HTML, XML, JSON HTTP, DHCP, DNS, TLS/SSL TCP, UDP IPv6, IPv4, IPSec Ethernet (IEEE 802.3), DSL, ISDN, Wireless LAN (IEEE 802.11), Wi-Fi CoAP, MQTT, XMPP, AMQP UDP, DTLS IPv6/IP Routing 6LoWPAN IEEE 802.15.4 MAC IEEE 802.15.4 PHY / Physical Radio TCP/IP Model Data Format Application Layer Transport Layer Internet Layer Network/Link Layer Device Management Figure 1 – Standardized IoT Protocols
  • 3. 3 Mphasis Network / Link Layer IEEE 802.15.4 IEEE 802.15.4 is a standard for wireless communication that defines the Physical layer (PHY) and Media Access Control (MAC) layers. It is standardized by the IEEE (Institute for Electrical and Electronics Engineers) similar to IEEE 802.3 for Ethernet, IEEE 802.11 is for wireless LANs (WLANs) or Wi-Fi. 802.15 group of standards specifies a variety of wireless personal area networks (WPANs) for different applications (For instance, 802.15.1 is Bluetooth). IEEE 802.15.4 focuses on communication between devices in constrained environment with low resources (memory, power and bandwidth). Internet Layer 6LoWPAN 6LoWPAN is the secret sauce that allows larger IPv6 packets to flow over 802.15.4 links that support much smaller packet sizes. 6LoWPAN is the acronym of IPv6 over Low Power Wireless Personal Area Networks. So 6LoWPAN as the name implies is an adaptation layer that allows transport of IPv6 packets over 802.15.4 links. Without 6LoWPAN IPv6, internet protocols would not work in these Low Power Wireless Personal Area Networks that uses IEEE 802.15.4. 6LoWPAN is an open standard defined under RFC 6282 by the Internet Engineering Task Force (IETF), the body that defines many of the open standards used on the internet such as UDP, TCP and HTTP to name a few. As mentioned previously, an IPv6 packet is too large to fit into a single 802.15.4 frame. What 6LoWPAN does to fit an IPv6 packet in 802.15.4 frame is - • Fragmentation and Reassembly - It fragments the IPv6 packet and sends it through multiple smaller size packets that can fit in an 802.15.4 frame. On the other end, it reassembles the fragmented packets to re-create the IPv6 packet • Header Compression – Additionally it also compresses the IPv6 packet header to reduce the packet size IEEE 802.15.4 PHY / Physical Radio IPv6/Routing IEEE 802.15.4 MAC Network/Link Layer Internet Layer 6LoWPAN • IPv6 packet encapsulation • IPv6 packet fragmentation & reassembly • IPv6 header compression • Link layer packet forwarding Figure 2 - IPv6 sent into 802.15.4 MAC by 6LoWPAN Transport Layer UDP While TCP is used predominantly in Internet as Transport Layer Protocol (except gaming or video streaming where User Datagram Protocol or UDP is used), most IoT scenarios are well suited for UDP. UDP is a much lighter protocol compared to TCP. UDP is a connection protocol and does not come with resiliency features of TCP, such as guaranteed packet delivery. On the other hand, UDP is much faster than TCP, the header size is much smaller than TCP – making it suitable for the constrained environment of devices and sensors. Higher level Application Layer IoT protocols like CoAP use UDP rather than TCP. DTLS DTLS or Datagram Transport Layer Security is a TLS/SSL counterpart that runs on UDP. The way TLS/SSL takes care of security for TCP communication, DTLS provides the same security features on UDP or Datagrams. Application Layer CoAP CoAP or Constrained Application Protocol is a specialized Web Transfer Protocol for constrained nodes and constrained networks on the IoT. CoAP is an Application Layer protocol in the TCP/IP model (Web uses HTTP as an Application Layer protocol). The term “Constrained” is used because it is designed specifically from the ground up to work well in constrained environments. The devices, sensors and actuators in IoT operate in a constrained environment with low memory, low power, low bandwidth, and high rate of packet failure. HTTP was not designed to work in this sort of environment, so HTTP, which is relatively heavyweight with large header size and text encoding struggles to work in IoT constrained environment.
  • 4. 4 Mphasis This is where CoAP comes to play – CoAP has been standardized by IEFT (The Internet Engineering Task Force) Constrained RESTful Environments (CoRE) Working Group. Think of CoAP as web protocols for devices. CoAP can be transparently mapped to HTTP. Following are the similarities between CoAP and HTTP – • CoAP follows the same request-response pattern used by HTTP that we all are very familiar with. The CoAP client (a smartphone, for example) sends a request to the CoAP server (device/things) and the server then sends a response back • Like the web, devices are addressed using IP address and port number. Access to services exposed by the device is via RESTful URLs • CoAP uses familiar HTTP features like Methods (Get, Post, Put, and Delete), Status Codes, URLs and content-type • CoAP supports discovery so that IoT devices/things could be discovered • CoAP provides simple proxy and caching capabilities CoAP has a few differences as well - • CoAP runs on UDP as compares to HTTP, which typically uses TCP. UDP is lighter than TCP and has less overhead • CoAP supports only Get, Put, Post and Delete methods. CoAP uses small and reduced set of headers (header size is limited to 4 bytes), and HTTP status codes to be lightweight • CoAP supports confirmable and non-confirmable message types In the example given below, to get the temperature from the thermostat (which acts like a server), the client, which is a smartphone sends a GET request. The URL uses RESTful architecture - clearly indicating the device name, sensor data it is looking for, etc. The thermostat or the server responds back with the current temperature. coap://myhome.in:5683/nest_bedroom/temp 72 F coap://myhome.in:5683/nest_livingroom/temp22 F CoAP Server 1 (Thermostat in Bedroom) CoAP Client CoAP Server 2 (Thermostat in Living Room) Name of the protocol coap://myhome.in:5683/nest_bedroom/temp Port (5683 is the default port CoAP uses) Name of the Device Name of the parameter device controls (temperature here) 4G 70% CoAP also adds the feature of “observation”, which HTTP lacks. This is very useful in IoT scenarios. In the above example where the CoAP client, which is a smartphone app, is requesting temperature from the thermostats, it can also specify that it should notify when the temperature changes – this functionality is called “Observe:” When the temperature changes, the CoAP server (in this case the thermostat), notifies the client. This was not possible before the recent server-sent event and WebSocket specification in HTTP. CoAP libraries exists practically in all programming languages like C, Java, C#, Python, JavaScript, Go, Erlang, Ruby, etc. There are libraries for iOS and Android as well. Coap.technology website lists many of them. MQTT MQTT stands for Message Queue Telemetry Transport. MQTT is a publish-subscribe based “light weight” messaging protocol for IoT and M2M (Machine-to-Machine communication). To put it simply, MQTT is the AMQP or JMS for the constrained environment of IoT. Andy Stanford- Clark and Arlen Nipper invented MQTT back in 1999, when their use case was to create a protocol for minimal battery loss and minimal bandwidth connecting oil pipelines over a satellite connection. MQTT uses a broker-based pub-sub architecture in the constrained IoT environment similar to other messaging products that exist in the Web and Client Server world. Figure 3.2 – CoAP using URLs following RESTful services Figure 3 – COAP using GET and RESTful URLs
  • 5. 5 Mphasis So there is: • MQTT Publisher - a sensor or device in IoT world that publishes a piece of information • MQTT Subscriber – anyone who is interested to subscribe and receive a piece of information they’re interested in. It could be a smartphone, a wearable device or even other devices that are interested to know about other devices around and change themselves based on self-learning • MQTT Broker – An intermediary that receives information from publisher and forwards them to the subscribers MQTT Publisher (Thermostat) Publish MQTT Subscriber 1 MQTT Subscriber 2 Temp 72 F MQTT Broker Subscribe to TempPublish Subscribe to Temp Publish 4G 70% 72 F 72 F MQTT provides subject/topic-based, content-based, and type-based filtering. The above example uses topic-based filtering where both the subscribers have subscribed for the topic “temp” to the broker. When any device or publisher publishes a message with topic “temp”, the broker sends the message to all subscribers who have subscribed for temp – in this case both Subscriber 1 and Subscriber 2. MQTT is actively promoted and supported by industry giants and it is part of many popular messaging suite of products. There are also MQTT specific brokers like Mosquitto and HiveMQ. MQTT libraries are available in many programming languages – one of the very prominent MQTT Library is Eclipse Paho. MQTT.org website lists many of them. Data Format CBOR CBOR (Concise Binary Object Representation) is a data format designed with the goal of providing IoT with very small message sizes. CBOR is based on the wildly successful JSON data model. While JSON uses text encoding, CBOR uses binary encoding that results in compact message size. Note: This article does not discuss IoT protocols for device management. There are separate protocols like OMA Lightweight M2M, which is an industry standard for device management of IoT and M2M devices. Conclusion The future of IoT lies in standardizing the protocols used across network stack. These set of open and standard protocols like CoAP, MQTT and 6LoWPAN would eventually become as successful as the TCP/IP stack used across web and Internet. Appendix 1: CoAP Details CoAP Message Types CoAP defines four different types of messages. • CON or Confirmable Message A confirmable message requires a response, either a positive acknowledgement or a negative acknowledgement. In case acknowledgement is not received, retransmissions are made until all attempts are exhausted. • NON or Non-Confirmable Message A non-confirmable request is used for unreliable transmission (like a request for a sensor measurement made periodically. Even if one value is missed, the impact is not significant). Such a message is not generally acknowledged. • ACK or Acknowledgement It is sent to acknowledge a confirmable (CON) message. • RST or Reset This represents a negative acknowledgement and literally means resetting. It generally indicates some kind of failure (example - unable to parse received data). Figure 4 – MQTT in the world of IoT
  • 6. 6 Mphasis CoAP Status Codes As mentioned earlier CoAP status codes are directly influenced by HTTP status codes. CoAP uses X.YY format for status codes. So HTTP’s “404 - Resource Not Found” status code is “4.04 Not Found” in CoAP. The table below shows the similarity between CoAP and HTTP status codes. Figure 5 – CoAP and HTTP Status Codes
  • 7. 7 Mphasis Appendix 2: Using CoAP Libraries CoAP libraries exist in almost all programming languages like C, Java, C#, Python, JavaScript, Go, Erlang, and Ruby. There are libraries for iOS and Android also. For example, we would use the Node.js JavaScript CoAP library (both for the client and server). This library would seem very familiar if you have used Node. More details about the library could be found at https://github.com/mcollina/node- coap Installing the Node CoAP Library You need to have Node and npm installed on your machine as prerequisites. You can download and install them from nodejs.org. To install Node CoAP library use “npm install coap” in the terminal/command window. Once Node CoAP library is installed you can use it in your node code. Connecting to a remote CoAP server // Load coap module - similar to node http module var coap = require(‘coap’); // coap.me hosts CoAP servers. The default CoAP port is 5683 var remoteServerUrl = ‘coap://coap.me:5683/large’; var request = coap.request(remoteServerUrl); var request = coap.request(localServerUrl); request.on(‘response’, function(response) { response.pipe(process.stdout); response.on(‘end’, function() { process.exit(0); }); }); request.end(); Local CoAP server and client Server: // Load coap module - similar to node http module var coap = require(‘coap’); // Create a CoAP Server object - similar to creating a Http Server object in node // var http = require(‘http’); // var httpServer = http. createServer(function(req,res){ }); // The default CoAP port is 5683 var coapServer = coap.createServer(function(req, res){ res.write(‘Hello’ + request.url.split(‘/’)[1] + ‘n’) res.end(‘Hello from CoAP server’); }); // Keeps the CoAP server running coapServer.listen(function(){ console.log(‘CoAP server started!’); }); Client: var coap = require(‘coap’); var localServerUrl = ‘coap://localhost:5683/world’; var request = coap.request(localServerUrl); request.on(‘response’, function(response) { response.pipe(process.stdout); response.on(‘end’, function() { process.exit(0); }); }); request.end(); Further Reading https://en.wikipedia.org/wiki/Internet_of_Things https://en.wikipedia.org/wiki/IEEE_802.15.4 https://en.wikipedia.org/wiki/6LoWPAN http://postscapes.com/internet-of-things-protocols http://coap.technology http://mqtt.org https://www.utwente.nl/ewi/dacs/colloquium/archive/2010/ slides/2010-utwente-6lowpan-rpl-coap.pdf
  • 8. 8 Mphasis VAL10/12/15USLETTERBASIL3724 For more information, contact: marketinginfo@mphasis.com USA 460 Park Avenue South Suite #1101 New York, NY 10016, USA Tel.: +1 212 686 6655 Fax: +1 212 683 1690 Copyright © Mphasis Corporation. All rights reserved. UK 88 Wood Street London EC2V 7RS, UK Tel.: +44 20 8528 1000 Fax: +44 20 8528 1001 INDIA Bagmane World Technology Center Marathahalli Ring Road DoddanakundhiVillage,Mahadevapura Bangalore 560 048, India Tel.: +91 80 3352 5000 Fax: +91 80 6695 9942 About Mphasis Mphasis is a global Technology Services and Solutions company specializing in the areas of Digital and Governance, Risk & Compliance. Our solution focus and superior human capital propels our partnership with large enterprise customers in their Digital Transformation journeys and with global financial institutions in the conception and execution of their Governance, Risk and Compliance Strategies. We focus on next generation technologies for differentiated solutions delivering optimized operations for clients. www.mphasis.com Aniruddha Chakrabarti AVP Digital Practice Aniruddha has 16 years of IT experience spread across systems integration, technology consulting, IT outsourcing, and product development. He has extensive experience of delivery leadership, solution architecture, presales, technology architecture, and program management of large scale distributed systems. As AVP, Digital Practice in Mphasis Aniruddha is responsible for Presales, Solution, RFP/RFI and Capability Development of Digital Practice. He has been the Lead Architect for many large scale distributed systems. His interests include digital, cloud, mobility, IoT, distributed systems, web, open source, .NET, Java, programming languages and NoSQL.