Professional Documents
Culture Documents
• Internet protocols are the set of rules which are use in addressing the packets of data so that they can travel
across networks to arrive at the correct destination.
• Internet protocol facilitates the exchange of data between two different computers.
• Data to be transfer through the internet is divide up into small pieces refer to packets.
• Each packet is recognize by IP information which also helps the routers send the packets to the right place.
• Internet protocol is very useful and crucial also because the entire web service is running on these internet
protocols.
• These protocols are the medium between two different systems to connect with each other.
• Without these protocols, using the internet to transfer data between two devices is not possible.
• Before going on IPv6, there might be A question in your mind that if IPv6 in IOT is the
updated version of IPv4, then where is IPv5?
• Well, the answer to your question is that the Internet Engineering Task Force(IETF) who
build IPv4 decide to skip IPv5 as it will also eventually run out of addresses. Hence they
decided to directly jump on IPv6 where there will be nothing to worry about running out of
IP addresses again.
• IPv6 is the most latest version of the internet protocol. Devices that use the internet are
recognized by their own IP addresses so that internet communication can work. IPv6 in IOT
identifies these devices so that they can be located through the internet easily.
• IPv4
• IPv4 has 32-bit addressing which is able to support about 4.5 billion devices.
• But because of the large number of laptops, computers, smartphones, and the internet of
things devices, it was proved that more addresses are required for the devices.
• IPv6 was created in 1998 which uses 128-bit addressing. It supports approximately 350
trillion trillion devices. The addressing method of IPv6 includes eight groups of four
hexadecimal digits, while the IPv4 addresses used to have four sets of one to three digits
numbers.
• Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol (IP) and the
first version of the protocol to be widely deployed.
• IPv6 was developed by the Internet Engineering Task Force (IETF) to deal with the long-
anticipated problem of IPv4 address exhaustion.
• Internet Protocol version 6 is a new addressing protocol designed to incorporate all the
possible requirements of future Internet known to us as Internet version 2.
• This protocol as its predecessor IPv4, works on the Network Layer (Layer-3).
• Along with its offering of an enormous amount of logical address space, this protocol has
ample features which address the shortcoming of IPv4.
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
• Internet has grown exponentially and the address space allowed by IPv4 is saturating. There is a
requirement to have a protocol that can satisfy the needs of future Internet addresses that is
expected to grow in an unexpected manner.
• IPv4 on its own does not provide any security feature. Data has to be encrypted with some other
security application before being sent on the Internet.
• Data prioritization in IPv4 is not up to date. Though IPv4 has a few bits reserved for Type of
Service or Quality of Service, but they do not provide much functionality.
• IPv4 enabled clients can be configured manually or they need some address configuration
mechanism. It does not have a mechanism to configure a device to have globally unique IP
address.
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
https://www.tutorialspoint.com/ipv6/ipv6_overview.htm
IPv6
Greatly expanded More attractive for
address space future Internet applications
128
(2 ) compared to IPv4
Potential socio-economic
benefits for
Multi Access:
ubiquity of the Internet ;
Enhanced life
China’s Next Generation Internet – 2008 Olympics
mobility
Developing Countries have shown significant improvement in ICT but still lag behind in Internet access
Relatively greater availability of mobile/wireless networks in many developing and emerging economies
Internet access using mobile networks: Lower Cost, Higher speed of deployment than fixed networks
An Internet Protocol Version 6 address (IPv6 address) is a numeric label that is used to identify and locate a network
interface of a computer or a network node participating in a computer network using IPv6. IP addresses are included in
the packet header to indicate the source and the destination of each packet. The IP address of the destination is used to
make decisions about routing IP packets to other networks.
https://en.wikipedia.org/wiki/IPv6_address
If we look at the upper 64 bits in more detail we can see that it is split
into 2 blocks of 48 and 16 bits respectively the lower 16 bits are use
d for subnets on an internal networks, and are controlled by a
network administrator.
The upper 48 bits are used for the global network addresses and
are for routing over the internet.
http://www.steves-internet-guide.com/ipv6-guide/
http://www.steves-internet-guide.com/ipv6-guide/
Global Routing Prefix: The most significant 48-bits are designated as Global Routing Prefix which is assigned to
specific autonomous system. The three most significant bits of Global Routing Prefix is always set to 001.
http://www.steves-internet-guide.com/ipv6-guide/
Link-local addresses are used for communication among IPv6 hosts on a link (broadcast segment) only. These addresses
are not routable, so a Router never forwards these addresses outside the link.
http://www.steves-internet-guide.com/ipv6-guide/
Prefix is always set to 1111 110. L bit, is set to 1 if the address is locally assigned. So far, the meaning of L bit to 0 is not
defined. Therefore, Unique Local IPv6 address always starts with ‘FD’.
http://www.steves-internet-guide.com/ipv6-guide/
http://www.steves-internet-guide.com/ipv6-guide/
• As shown in the table, the address 0:0:0:0:0:0:0:0/128 does not specify anything and is said to be an unspecified
address. After simplifying, all the 0s are compacted to ::/128.
• In IPv4, the address 0.0.0.0 with netmask 0.0.0.0 represents the default route. The same concept is also applied to
IPv6, address 0:0:0:0:0:0:0:0 with netmask all 0s represents the default route. After applying IPv6 rule, this address
is compressed to ::/0.
• Loopback addresses in IPv4 are represented by 127.0.0.1 to 127.255.255.255 series. But in IPv6, only
0:0:0:0:0:0:0:1/128 represents the Loopback address. After loopback address, it can be represented as ::1/128.
http://www.steves-internet-guide.com/ipv6-guide/
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 34
Protocol Architecture of IoT
IPv6 address Types and Scope
Reserved Multicast Address for Routing Protocols
• Table shows the reserved multicast addresses
used by interior routing protocol.
• The addresses are reserved following the same
rules of IPv4.
Fixed Header
http://www.steves-internet-guide.com/ipv6-guide/
• 6LoWPAN stands for IPv6 over Low-Power Wireless Personal Area Networks.
• It is an open standard defined in RFC 6282 by the Internet engineering task force (IETF).
• The key feature of 6LoWPAN that makes it suitable for IoT communication is that though it was originally designed
to support IEEE 802.15.4 low-power wireless networks in the 2.4-GHz band, it now supports a wide range of
networking media such as sub-1 GHz low-power RF, Bluetooth smart, power line control (PLC), and low-power
Wi-Fi
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 40
Protocol Architecture of IoT
6LoWPAN
• Network Architecture of 6LoWPAN
• The architecture of 6LoWPAN mesh network is
depicted in the diagram that is given in Figure.
• The uplink to the Internet is provided by the
access point (AP), which in this case is an IPv6
router.
• Different types of devices such as PCs and
servers could be connected to the AP.
• The components of the 6LoWPAN network are
connected to the IPv6 network using a
6LoWPAN edge router.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 41
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 42
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 43
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 44
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 45
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 46
Protocol Architecture of IoT
6LoWPAN
• Protocol Stack of 6LoWPAN
Now let us compare the features of OSI
layer protocol stack to 6LoWPAN protocol
stack.
• Physical layer:
• This layer in the OSI model is
responsible for the conversion of data
bits into signal that can be transmitted
through air.
• In 6LoWPAN, IEEE 802.15.4 is used as
physical layer.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 47
Protocol Architecture of IoT
6LoWPAN
• Data link layer:
• This layer ensures that a reliable
connection or link is established between
two nodes by correcting the errors that
occur in physical layer during data
transmission.
• The media access control (MAC) layer
that provides access to the media is also
present in the data link layer.
• In 6LoWPAN, IEEE 802.15.4 is the
MAC layer.
• The adaptation layer of 6LoWPAN that
provides adaptation from IPv6 to IEEE
802.15.4 is also present in the data link
layer.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 48
Protocol Architecture of IoT
6LoWPAN
• Network layer:
• This layer is responsible for routing of
data in the network.
• This layer ensures that data or packet
from a source device is delivered to the
correct destination device.
• The devices are identified using their IP
address, which is assigned by using the
Internet protocol (IP).
• In 6LoWPAN, IPv6, or RPL, is used in
the network layer.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 49
Protocol Architecture of IoT
6LoWPAN
• Transport layer:
• The transport layer helps ensure that multiple
applications running on each device have their
own communication channel and can start
sessions between applications running on other
end devices.
• Transmission control protocol (TCP) is the
prominent transport layer protocol used in the
Internet.
• However, as TCP is a connection oriented
protocol, it incurs significant overhead and may
not be suitable for all devices especially for
devices that have low power consumption.
• In sucscenarios, user datagram protocol (UDP)
which is a connectionless protocol with a lower
overhead could be a better choice.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 50
Protocol Architecture of IoT
6LoWPAN
• Application layer:
• The main responsibility of application layer
is data formatting.
• A popular application layer that is used in
the Internet is HTTP that runs over TCP.
• HTTP uses XML that in turn is a text-based
language with a large overhead.
• Hence, it is not suitable for 6LoWPAN
systems that have low power consumption.
• As HTTP is not suitable for use in
6LoWPAN systems, several other
alternatives like COAP and MQTT are used
in 6LoWPAN systems.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 51
Protocol Architecture of IoT
6LoWPAN
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 52
Protocol Architecture of IoT
RPL-Routing Protocol
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 53
Protocol Architecture of IoT
RPL-Routing Protocol
• RPL was designed to support minimal routing needs by building a highly
robust topology over lossy networks.
• This protocol provides support for various types of traffic models:
multipoint-to-point, point-to-multipoint, and point-to-point.
• Devices in the network that use this protocol are connected to each other in
such a way that no cycles are present in the connection.
• In order to achieve this, a node called destination oriented directed acyclic
graph (DODAG), which is routed at a single destination, is built initially.
• RPL specifications refer to DODAG as DODAG root. Each node that is a
part of DODAG knows its parent node but does not have any information
about its child nodes.
• RPL maintains at least a single path from each node to the root and the
preferred parent.
• This is done in order to increase performance by pursuing a faster path.
• The DODAG topology used in RPL is depicted in Figure.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 54
Protocol Architecture of IoT
RPL-Routing Protocol
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 55
Protocol Architecture of IoT
REST (representational state transfer)
• REST (REpresentational State Transfer) is an architectural style for developing web services. REST is
popular due to its simplicity and the fact that it builds upon existing systems and features of the internet's
Hypertext Transfer Protocol (HTTP) in order to achieve its objectives, as opposed to creating new
standards, frameworks and technologies.
" REST " was coined by Roy Fielding in his Ph.D. dissertation [1] to describe a design pattern for implementing
networked systems. [http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm]
Motivation for REST The motivation for developing REST was to create a design pattern for how the Web should work,
such that it could serve as the guiding framework for the Web standards and designing Web services.
"Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a
network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state
transitions), resulting in the next page (representing the next state of the application) being transferred to the user and
rendered for their use." - Roy Fielding
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 56
Protocol Architecture of IoT
REST (representational state transfer)
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 59
Protocol Architecture of IoT
REST (representational state transfer)
• REST services can be developed and described using the web application description language (WADL).
• WADL is based on XML and describes applications based on HTTP.
• It supports the automatic description of RESTful services with machine-processable service descriptions.
• The SA-REST is an open, flexible, and standards-based approach for adding semantics to RESTful services.
• In the context of IoT, the RESTful services have many distinct advantages over arbitrary web services (i.e., SOAP) such
as less overhead, low parsing-complexity, statelessness, and tighter integration with HTTP.
• In addition, applications supporting RESTful services perform better on wireless sensor network with limited resources.
• There are a few integrated frameworks to speed up the process of building and deploying a bevy of RESTful services
across industry verticals.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 60
Protocol Architecture of IoT
REST (representational state transfer)
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 61
Protocol Architecture of IoT
REST (representational state transfer)
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 62
Protocol Architecture of IoT
REST (representational state transfer)
Disadvantages of REST are as follows:
• Architecture. Developers working with REST frequently encounter limitations due to its architecture design. These
include multiplexing multiple requests over a single TCP connection, having different resource requests for each resource
file, server request uploads, and long HTTP request headers, which cause delays in webpage loading.
• Stateless applications. Since HTTP does not store state-based information between request-response cycles, the client
must perform state management tasks. This makes it difficult for programmers to implement server updates without the
use of client-side polling or other types of webhooks that send data and executable commands from one app to another.
• Definition. Developers generally disagree over defining REST-based designs. As an architectural style, REST lacks a
clear reference implementation or a definitive standard that designates whether a specific design can be defined as
RESTful. This also leads to uncertainty over whether a given web API conforms to REST-based principles.
• Data overfetching/underfetching. RESTful services frequently return large amounts of unusable data combined with
relevant information, typically the result of multiple server queries. These inefficiencies also increase the time it takes for
a client to return all the required data.
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 63
Protocol Architecture of IoT
REST (representational state transfer)
Semantics of HTTP methods
The following table shows how HTTP methods are intended to be used in HTTP APIs, including RESTful ones.
• Note that while JSON and XML are popular data exchange formats, REST itself does not put any restrictions on what
the format should be. In fact, some RESTful web services exchange binary data for the sake of efficiency. This is
another benefit to working with REST-based web services, as the software architect is given a great deal of freedom in
terms of how best to implement a service.
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 65
Protocol Architecture of IoT
REST (representational state transfer)
https://www.techtarget.com/searchapparchitecture/definition/REST-REpresentational-State-Transfer
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 66
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-
oriented middleware.
• The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-
subscribe), reliability and security.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 67
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Advanced message queuing protocol (AMQP) was designed as an open replacement for existing proprietary
messaging middleware (http://www.amqp.org/).
• Two of the most important reasons to use AMQP are reliability and interoperability.
• As the name implies, it provides a wide range of features related to messaging, including reliable queuing, topic-
based publish-and-subscribe messaging, flexible routing, transactions, and security.
• AMQP exchanges route messages directly by topic and also based on headers.
• AMQP is a binary wire protocol, which was designed for interoperability between different vendors.
• Where other protocols have failed, AMQP adoption has been strong.
• Companies like :
• JP Morgan use it to process one billion messages a day.
• NASA uses it for Nebula cloud computing.
• Google uses it for complex event processing.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 68
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 69
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 71
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• robomq.io brings the messaging platform in a
fully managed and hosted message queue as a
service SaaS model offering reliability, scale,
and manageability required by today’s cloud,
mobile, M2M, and IoT applications. robomq.io
is an end-to-end IoT middleware platform that
can connect any device to any system,
application, or cloud through its suite of
connectors and adapters.
• It has an IoT gateway that allows devices and
device mesh networks to connect to the cloud
over cellular or wired connectivity.
• This also comes with real-time analytics engine, The robomq’s queuing solution for device interactions.
data-driven alerts, and device diagnostics and
management capabilities to help you manage Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling
your IoT ecosystem effectively. Technologies, Platforms, and Use Cases (2017, CRC Press)
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 75
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• AMQP Communications
• All the AMQP concepts—from connection, session, and link to performatives and messages—fit together to define
how the communication happens between two peers. The main steps involved are:
• Open/Close a connection (respectively after opening a network connection and before closing it) using “open” and
“close” performatives.
• Begin/End a session inside the connection thanks to “begin” and “end” performatives.
• Attach/Detach a link inside the session using “attach” and “detach” performatives.
• Send/Receive messages with flow control thanks to “transfer”, “disposition”, and “flow” performatives.
https://dzone.com/refcardz/amqp-essentials
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 76
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Communication: Open
• In order to open the communication with a peer, first
there is an AMQP/SASL handshake on the raw TCP
connection, then the AMQP “open” performative is
exchanged to define the max frame size (flow control),
maximum number of channels, and so on.
• Inside the connection, a session is started using the
“begin” performative specifying the window size
(number of frames for flow control).
• Finally, the “attach” performative is used to attach a
link.
https://dzone.com/refcardz/amqp-essentials
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 77
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Communication: Send
• After the link is attached, the receiver can send a “flow”
performative to the sender specifying the credit number
to limit number of messages it’s able to receive (flow
control).
• The producer sends data using the “transfer”
performative, which is followed by a “disposition”
performative by the receiver if and only if the required
QoS is at level one (at least once) and the messages are
not settled by the producer.
• The receiver can send only one “disposition”
performative to confirm that it has received more
“transfer” performatives.
https://dzone.com/refcardz/amqp-essentials
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 78
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Communication: Receive
• A receive communication is the opposite flow of a send.
The receiver sends the “flow” performative to set the
credit-based flow control and how many messages it can
receive before processing them.
• For one or more “transfers”, it replies with a
“disposition” if the QoS level is greater than zero and
the producer requires settlement.
https://dzone.com/refcardz/amqp-essentials
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 79
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Communication: Close
• Closing a communication means it becomes detached
from all active links using the “detach” performative.
After that, the “end” performative is used to end the
session, and the “close” performative is used to close the
connection.
• Of course, the last step is to close the underlying
network connection at the socket level.
https://dzone.com/refcardz/amqp-essentials
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 80
Protocol Architecture of IoT
AMQP (Advanced Message Queuing Protocol)
• Applications
• Connecting different systems and processes to talk to each other.
• Allowing servers to respond to immediate requests quickly and delegate(dealing) time consuming tasks for later
processing.
• Distributing a message to multiple recipients for consumption.
• Enabling offline clients to fetch data at a later time.
• Increasing reliability and uptime of application deployments(increasing speed of the applications).
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 82
Protocol Architecture of IoT
CoAP (Constrained application protocol)
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 83
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• Network layer:
• IPv6 over Low-Power Wireless Personal Area Networks
(6LoWPAN) standard defined by the IETF brings the IP
to small embedded devices (e.g., sensors) in even the
most constrained networks such as IEEE 802.15.4.
• In addition to 6LoWPAN, the IETF routing over low
power and lossy networks (ROLL) working group has
defined IPv6 routing protocol for low-power and lossy
networks (RPL) for smart object Internetworking.
• Together these networking technologies provide means
for small embedded devices to integrate into the Internet.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 84
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• Transport layer:
• HTTP typically relies on TCP, which has performance
problems over low-power and lossy networks (LLNs), is
sensitive to mobility, does not provide multicast support,
and has high overhead for short-lived transactions.
• CoAP, on the other hand, is built on top of the user
datagram protocol (UDP), which provides significantly
lower overhead and supports multicast.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 85
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• Application layer:
• CoAP provides RESTful services optimized for resource-
constrained networks and devices, and thus makes the
protocol suitable to the IoT and M2M applications.
• In addition, it provides reliability (with default timeout
and exponential back-off retransmission) mechanisms
even without the use of TCP as the transport layer.
• One of the most important design goals of CoAP has also
been to keep the message overhead as small as possible.
HTTP can also be used over 6LoWPAN. However, the
results show that the power consumption and bytes
transferred per transaction are drastically lower when
using CoAP over 6LoWPAN compared to HTTP over
6LoWPAN, and thus increasing the battery lifetime of
constrained devices.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 86
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• Payload:
• The W3C efficient XML interchange (EXI) format is a
very compact, high-performance XML representation,
which significantly reduces bandwidth requirements
without compromising the efficient use of other
resources, such as battery life, code size, processing
power, and memory.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 87
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• As said before, CoAP is an IoT protocol.
• CoAP stands for Constrained Application Protocol, and it is defined in RFC7252.
• CoAP is a simple protocol with low overhead specifically designed for constrained devices (such as
microcontrollers) and constrained networks.
• This protocol is used in M2M data exchange and is very similar to HTTP, even if there are important differences that
we will cover laters.
The main features of CoAP protocols are:
• Web protocol used in M2M with constrained requirements
• Asynchronous message exchange
• Low overhead and very simple to parse
• URI and content-type support
• Proxy and caching capabilities
As you may notice, some features are very similar to HTTP even if CoAP must not be considered a compressed HTTP protocol
because CoAP is specifically designed for IoT and in more details for M2M so it is very optimized for this task.
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 88
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• From the abstraction protocol layer, CoAP can be represented as:
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 89
Protocol Architecture of IoT
CoAP (Constrained application protocol)
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 90
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• CoAP Messages Model: Confirmable message
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 91
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• CoAP Messages Model: Confirmable message
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 92
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• CoAP Messages Model: Non-Confirmable message
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 93
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• CoAP Request/Response Model
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 94
Protocol Architecture of IoT
CoAP (Constrained application protocol)
• CoAP Request/Response Model
https://dzone.com/articles/coap-protocol-step-by-step-guide
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 95
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 96
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• Characteristics of MQTT
• The MQTT has some unique features which are hardly found in other protocols. Some of the features of an
MQTT are given below:
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 97
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
MQTT Architecture
1. Message
2. Client
3. Server or Broker
4. TOPIC
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 98
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
1. Message
• The message is the data that is carried out by
the protocol across the network for the
application.
• When the message is transmitted over the
network, then the message contains the
following parameters:
• Payload data
• Quality of Service (QoS)
• Collection of Properties
• Topic Name
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 99
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
2. Client
• In MQTT, the subscriber and publisher are the
two roles of a client. The clients subscribe to
the topics to publish and receive messages.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 100
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
3. Server
• The device or a program that allows the client
to publish the messages and subscribe to the
messages.
• A server accepts the network connection from
the client, accepts the messages from the client,
processes the subscribe and unsubscribe
requests, forwards the application messages to
the client, and closes the network connection
from the client.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 101
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
4. TOPIC
The label provided to the message is checked against the subscription known by the server is known as TOPIC.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 102
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• Now we will look at the architecture of MQTT.
• To understand it more clearly, we will look at the example.
• Suppose a device has a temperature sensor and wants to send the
rating to the server or the broker.
• If the phone or desktop application wishes to receive this
temperature value on the other side, then there will be two things
that happened.
• The publisher first defines the topic; for example, the temperature
then publishes the message, i.e., the temperature's value.
• After publishing the message, the phone or the desktop
application on the other side will subscribe to the topic, i.e.,
temperature and then receive the published message, i.e., the
value of the temperature. The server or the broker's role is to
deliver the published message to the phone or the desktop
application.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 103
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• The MQTT message format consists of 2 bytes fixed header, which is present in all the MQTT packets.
• The second field is a variable header, which is not always present.
• The third field is a payload, which is also not always present.
• The payload field basically contains the data which is being sent.
• We might think that the payload is a compulsory field, but it does not happen.
• Some commands do not use the payload field, for example, disconnect message.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 105
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• As we can observe in the above format that the fixed header contains two bytes. The first byte contains the following
fields:
• MQTT Control Packet Type: It occupies 4 bits, i.e., 7 to 4-bit positions. This 4-bit is an assigned value, and each
bit represents the MQTT control packet type.
• Flag specific to each MQTT packet type: The remaining 4-bits represent flag specific to each MQTT packet type.
• The byte 2 contains the remaining length, which is a variable-length byte integer. It represents the number of bytes
remaining in a current control packet, including data in the variable header and payload.
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 106
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• MQTT Control Packet Types
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 107
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• MQTT Control Packet Types
https://www.javatpoint.com/mqtt-protocol
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 108
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• efficient data transmission and quick to implement, due to its being a lightweight protocol;
• low network usage, due to minimized data packets;
• efficient distribution of data;
• successful implementation of remote sensing and control;
• fast, efficient message delivery;
• uses small amounts of power, which is good for the connected devices; and
• optimizes network bandwidth.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 109
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• MQTT has slower transmit cycles compared to Constrained Application Protocol (CoAP).
• MQTT's resource discovery works on flexible topic subscription, whereas CoAP uses a stable resource
discovery system.
• MQTT is unencrypted. Instead, it uses TLS/SSL (Transport Layer Security/Secure Sockets Layer) for security
encryption.
• It is difficult to create a globally scalable MQTT network.
• Other MQTT challenges relate to security, interoperability and authentication.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 110
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• As a result, MQTT is one of the most commonly used protocols in IoT and IIoT infrastructure -- for example, for
utilities industries to efficiently transmit data between their services and their customers and devices.
Pethuru Raj and Anupama C. Raman - The Internet of Things. Enabling Technologies, Platforms, and Use Cases (2017, CRC Press)
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 111
Protocol Architecture of IoT
MQTT (Message Queue Telemetry Transport )
• Smart metering. The MQTT protocol can be used to transmit data with guaranteed message delivery to provide
accurate meter readings in real-time. This helps make billing more accurate.
• Gathering ambient sensor data. Sensors used in remote environments are often low-power devices, so MQTT is
a good fit for IoT sensor buildouts with lower-priority data transmission needs.
• Machine health data. Ably, which provides a pub/sub messaging platform, gives the example of a wind turbine
requiring "guaranteed delivery of machine health data to local teams even before that information hits a data
center."
• Billing systems. MQTT helps eliminate duplicate or lost message packets in billing or invoicing.
Whether used for smart metering, fast outage response or other IoT and IIoT applications, MQTT enables resource-
constrained IoT devices to send, or publish, information about a specific topic to a server that acts as an MQTT message
broker. The broker then pushes the information out to those clients that have subscribed previously to the topic.
To a human, a topic looks like a hierarchical file path. Clients can subscribe to a specific level of a topic's hierarchy or use a
wildcard character to subscribe to multiple levels. The client could be an IoT sensor in the field or an application in a data
center that processes IoT data.
MQTT is an event-driven protocol. There is no periodic or ongoing data transmission. This keeps transmission to a
minimum. A client only publishes when there is information to be sent, and a broker only sends out information to
subscribers when new data arrives.
• Applications of MQTT
• Facebook Messenger uses MQTT for online chat.
• Amazon Web Services use Amazon IoT with MQTT.
• Microsoft Azure IoT Hub uses MQTT as its main
protocol for telemetry messages.
• The EVRYTHNG IoT platform uses MQTT as an M2M
protocol for millions of connected products.
• Adafruit launched a free MQTT cloud service for IoT
experimenters called Adafruit IO.
For communication, it uses a request-response prototype. For communication, it uses the publish-subscribe prototype.
It uses asynchronous and synchronous messaging. It uses only asynchronous mode for messaging.
It uses User Datagram Protocol (UDP). It uses the Transmission Control Protocol (TCP).
The Heather size of CAOP is 4 bytes. The Heather size of MQTT is 2 bytes.
It will give labels to the messages. It does not have any such function.
It has a secured system, and its usability is in Utility area It is very secure, and its usability is in IoT applications.
networks.
It has Low Latency and NAT issues. It has Low Latency and NAT issues.
https://www.tutorialspoint.com/difference-between-coap-and-mqtt-protocols
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 119
Protocol Architecture of IoT
Difference between COAP and MQTT protocols
Basis of COAP MQTT
Messaging Mode This uses both Asynchronous and Synchronous. This uses only Asynchronous
Transport layer protocol This mainly uses User Datagram protocol(UDP) This mainly uses Transmission Control protocol(TCP)
Header size It has 4 bytes sized header It has 2 bytes sized header
RESTful based Yes it uses REST principles No it does not uses REST principles
Persistence support It does not has such support It supports and best used for live data communication
Message Labelling It provides by adding labels to the messages. It has no such feature.
Usability/Security It is used in Utility area networks and has secured mechanism. It is used in IoT applications and is secure
https://www.geeksforgeeks.org/difference-between-coap-and-mqtt-protocols/
Department of Electronics and Telecommunication Engineering, VIIT, Pune-48 120
Protocol Architecture of IoT
Authorization and Access Control in IOT
• The different types of permissions, which are given for users, are classified as the following:
• Read only: The user has permission to only read the object. The user cannot delete or edit the object. These types of
permissions are granted to staff who are not required to perform any alteration on the data.
• Read and write: The user has permission to read and alter the object. These types of permissions are granted to
authorities who have the overall authority and discretion to validate the rights and access permissions of other users.