Internet of Things Class5
Internet of Things Class5
Session 5
IoT Protocols:
Application Layer
Transport Layer
TCP UTP
Network Layer
Link Layer
802.3 - Ethernet 802.16 - WiMax 3G/4G/LTE - Cellular 802.11 – Wi-Fi 802.15.4 – LR-WPAN
IoT Protocols:
HTTP(Hyper Text Transfer Protocol) :
Helps in accessing data over web. Is
unidirectional where client send the request
and server send the response back.
CoAP (Constraint Application Protocol):
CoAP is a simple protocol with low overhead, specifically designed for constrained devices (such as microcontrollers)
and constrained networks and is defined in RFC 7252.
This protocol is used in machine-to-machine(M2M) applications such as smart energy and building automation.
The nodes often have 8-bit microcontroller with small amount of RAM and ROM.
The main features of CoAP protocols are:
RFC is known as a ‘Request for Comment ‘.
➢ Web protocol used in M2M with constrained requirements
Essentially, an RFC is a type of technical document
➢ Asynchronous message exchange issued by the Internet Engineering Task Force (IETF)
➢ Low overhead and very simple to parse that describes specifications, procedures, and
standards in given Internet technologies.
➢ URI (Uniform Resource Identifier) and content-type support
➢ Proxy and caching capabilities Proxy if two type 1. Forward Proxy 2. Reverse Proxy
IoT Protocols:
URI:
A Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource or both on the
Internet.
A URI has two specializations known as URL (Uniform Resource Locator) and URN (Uniform Resource Name).
IoT Protocols:
WebSocket:
WebSocket is bidirectional, a full-duplex protocol that is used in the same scenario of client-server communication.
It is a stateful protocol, which means the connection between client and server will keep alive until it is terminated by
either party (client or server). After closing the connection by either of the client and server, the connection is
terminated from both ends.
MQTT (Message Queuing Telemetry Transport):
MQTT is a machine to machine internet of things connectivity protocol. Its various factors are:
Lightweight and efficient
MQTT implementation on the IoT device requires minimal resources, so it can even be used on small microcontrollers. For
example, a minimal MQTT control message can be as little as two data bytes. MQTT message headers are also small so that you
can optimize network bandwidth.
Scalable
MQTT implementation requires a minimal amount of code that consumes very little power in operations. The protocol also has
built-in features to support communication with a large number of IoT devices. Hence, you can implement the MQTT protocol to
connect with millions of these devices.
IoT Protocols:
Reliable
Many IoT devices connect over unreliable cellular networks with low bandwidth and high latency. MQTT has
built-in features that reduce the time the IoT device takes to reconnect with the cloud. It also defines three
different quality-of-service levels to ensure reliability for IoT use cases— at most once (QoS-0), at least once
(QoS-1), and exactly once (QoS-2).
Secure
MQTT makes it easy for developers to encrypt messages and authenticate devices and users using modern authentication
protocols, such as OAuth, TLS1.3, Customer Managed Certificates, and more.
Well-supported
Several languages like Python have extensive support for MQTT protocol implementation. Hence, developers can quickly
implement it with minimal coding in any type of application.
Example:
pip install paho-mqtt #then, using Python you can import the MQTT client.
import paho.mqtt.client as paho
from paho import mqtt
client = paho.Client(client_id="", userdata=None, protocol=paho.MQTTv5)
IoT Protocols:
XMPP (Extensible Messaging and Presence Protocol):
XMPP is an excellent protocol for use within Internet of Things. It’s protocol for streaming XML elements over a network in order
to exchange messages and present information in close to real-time.
Let’s dive into each character of word XMPP:
X : It means eXtensible. XMPP is an open-source project which can be changed or extended according to the need.
M : XMPP is designed for sending messages in real time. It has very efficient push mechanism compared to other protocols.
P : It determines whether you are online/offline/busy. It indicates the state.
P : XMPP is a protocol, that is, a set of standards that allow systems to communicate with each other.
IoT Protocols:
XML file format: JSON file format:
JSON is JavaScript Object Notation.
XML is just information wrapped in tags.
{
<note> "name":"Jack",
<to>Tove</to> "age":30,
<from>Jani</from> "contactNumbers":[
{
<heading>Reminder</heading>
"type":"Home",
<body>Don't forget me this weekend!</body>
"number":"123 123-123" },
</note>
{ "type":"Office",
"number":"321 321-321"
}
],
"spouse":null,
"favoriteSports":[ "Football", "Cricket" ]
}
IoT Protocols:
DDS (Data Distribution Service):
4. A publisher sends messages to a named exchange and a consumer pulls messages from a queue or the queue pushes
them to the consumer depending on the configuration.
IoT Protocols:
TCP (Transmission Control Protocol):
• It works over UDP (User Datagram Protocol: is an unreliable protocol widely used in video streaming) and acts as an
alternative to TCP.
• It is used by the BitTorrent application, which is used to download files through P2P.
. It is also known as the uTorrent transport protocol
IoT Protocols:
IPv4 (Internet Protocol Version 4):