Professional Documents
Culture Documents
Unit 3
Unit 3
Unit 3
Computer Engineering
Chapter 3
Protocols for IoT
(Message Subscribed
to the
Queuing topic
Telemetry Publisher:
Publishes data
MQTT broker
Subscriber 2
Transport) Subscribed
to the
topic
Subscriber 3
• This approach is best understood by the example of
television and radio broadcast scenario. Television and
MQTT radio stations do the broadcast and viewers and listeners
(Message tune in to their favorite shows and channels.
Queuing • Once the message reach the clients, the message gets
removed from the broker.
Telemetry • The life of message is limited and if there are no takers or
Transport) subscribers for a particular topic, it automatically gets
deleted.
MQTT
(Message
Queuing
Telemetry
Transport)
MQTT
(Message
Queuing
Telemetry
Transport)
MQTT Scheme: Client and Broker
MQTT
(Message
Queuing
Telemetry
Transport)
MQTT Client:
a) Collects information from sensors (telemetry
devices).
b) Connects it to messaging server (broker).
MQTT c) Topic is used to publish this message to let other
client understand.
(Message
d) Can also be a subscriber.
Queuing
Telemetry MQTT Broker:
Transport) a) Protocol is implemented in this case.
b) Mediates and facilitates the data based on interest
of the subscriber.
c) Ensure security by cross-checking the authorization
of publishers and subscribers
MQTT
Packet
Format
• The MQTT protocol payload can carry any type of data
such as binary, ascii text etc. The receiver need to
interpret and decode as per format used by the
transmitter. Hence MQTT is packet agnostic.
• It uses packet of low size and hence can be used for low
Advantages bandwidth applications.
to MQTT • It is reliable protocol as it uses QoS options to provide
guaranteed delivery.
• Due to its publish/subscribe model, It is scalable.
• It offers de-coupled design as it is easy to decouple the
device and server.
Disadvantages • High power consumption due to the TCP-based
of MQTT connection
• Lack of encryption
protocol
Difference
between
MQTT and
HTTP
protocols
MQTT COAP
Underlying Protocol TCP(Connection UDP(Connectionless)
oriented)
Communication Many to Many One to One
CoAP VS Power Higher than CoAP. Lesser Lowest. Consumes less
AMQP • This version has the following three additives, which might link into
processing chains in the server to create the favored capability.
Message Queue: Stores messages until they may thoroughly process via the
eating client software.
Binding: States the connection between the message queue and the change.
AMQP
Transport Protocols
• BLE(Bluetooth Low Energy)-inevitable
• Li-Fi(Light Fidelity)
• BLE is an open low-energy short-range radio
communication technology. It is also called Bluetooth
Smart.
• BLE is a relatively new Bluetooth standard defined by the
Bluetooth Special Interest Group (SIG) with a focus on
low energy.
Bluetooth • It is wireless person area network(PAN) similar to
Low Bluetooth with some advancement.
Energy(BLE)
1. Healthcare
BLE- 2. Entertainment
Application 3. Fitness(eg. Smart Watches)
Domains 4. Proximity related applications(e.g. car lock, children
tracking in the mall etc)
1. The lowest power consumption
• To reduce power consumption, a BLE device is
kept in sleep mode most of the time. When an
event occurs, the device wakes and a short
message is transferred to a gateway, PC, or
Features of smartphone.
BLE 2. Cost efficient and compatible
3. The range offered by BLE is much higher and better
than the previous versions.
4. The size of BLE chips are small as well and hence shall
not occupy much space on board.
5. There is no restriction with respect to manufactures.
BLE
Component
of BLE
Application Host Controller
BLE
architecture
1. Controller:
a) Host Controller Interface(HCI):
• It is used to enable interoperability between hosts
and controllers assembled by different manufactures
b) Link Layer:
BLE
• It is responsible for advertising, scanning, and
architecture creating/maintaining connections.
• The role of BLE devices changes in peer to peer (i.e.
Unicast) or broadcast modes.
• The common roles are Advertiser/Scanner
(Initiator), Slave/Master or Broadcaster/Observer.
BLE
architecture BLE Link Layer States
c) Physical Layer:
• It is responsible for modulation/demodulation and
analog-to-digital conversion.
2. Host:
a) Generic Access Profile (GAP):
• It takes care of the device discovery, connection
establishment, connection management and initiation
of security features.
• This layer is mandatory for all BLE devices.
BLE b) Generic Attribute Profile (GATT):
architecture • It oversees the data exchange process.
• Whenever there is a need to push data and to read
or write data, the generic guidelines with respect to
the process are governed by GATT.
c) Attribute Protocol (ATT):
• It is protocol for accessing data.
2. Host:
d) Logical Link Control and Adaption Protocol
(L2CAP):
• This layer provides data encapsulation services to the
BLE upper layers, allowing for logical end-to-end
communication of data
architecture • Fragmentation and de-fragmentation
• Multiplexing and de-multiplexing
e) Security Manager:
• It handles pairing, authentication, and encryption.
3. Application:
BLE • Topmost layer in BLE.
architecture • This layer is responsible for user interface, logic and
data handling.
• A Bluetooth Low Energy device can communicate with
the outside world in two ways:
broadcasting or connections.
• Broadcasting and Observing:
BLE • Sending out a message to more than one recipient.
Topology • This mechanism essentially allows to send data out one-
way to anyone or anything that is capable of picking up
the transmitted data.
• Similar to Radio Broadcast
BLE
Topology
• Broadcasting defines two separate roles:
• Broadcaster
• Sends non-connectable advertising packets
periodically to anyone willing to receive them.
• Observer
BLE • Repeatedly scans the preset frequencies to receive
any non-connectable advertising packets currently
Topology being broadcasted.
• Broadcasting is fast and easy to use, and it’s a good
choice if you want to push only a small amount of data
on a fixed schedule or to multiple devices.
• A major limitation of broadcasting, there are no security
or privacy provisions at all
• Connections:
• If you need to transmit data in both directions, or if you
have more data than connections topology is used.
• A connection is a permanent, periodical data exchange
of packets between two devices.
• Ideal for power saving.
BLE
• Connections involve two separate roles:
Topology • Central (master)
• Repeatedly scans the preset frequencies for connectable
advertising packets and, when suitable, initiates a
connection.
• Once the connection is established, the central manages
the timing and initiates the periodical data exchanges.
• Connections:
• Peripheral (slave)
• A device that sends connectable advertising packets
periodically and accepts incoming connections.
• Once in an active connection, the peripheral follows the
central’s timing and exchanges data regularly with it.
BLE
Topology
Specification Classic Bluetooth BLE
Range 100m >100m
Data rate 1-3Mbps 1Mbps
Classic Throughput 0.7-2.1 Mbps 0.27 Mbps
Frequency 2.4 GHz 2.4 GHz
Bluetooth VS Robustness Adaptive fast frequency 24 bit CRC, 32 bit
Light
Fidelity(Li-Fi)
Light
Fidelity(Li-Fi)
Light
Fidelity(Li-Fi)
• Li-Fi (light fidelity) is a bidirectional wireless system that
transmits data via LED or infrared light.
• Features of Li-Fi
1. It has high speed and is bi-directional.
Light 2. It is used for communication of data.
Fidelity(Li-Fi) 3. Light is the source, data transfer happens through light.
4. Light is generated through light bulbs, which makes the
use of Li-Fi inexpensive.
5. Unlike all the challenges in Wi-Fi with respect to
security, bandwidth can be avoided using Li-Fi.
How does Li-
Fi work?
1. Light can not penetrate through walls, it is extremely
safe and no data hijacking will happen
2. Efficient
Advantages 3. Li-Fi is the fastest
of Li-Fi 4. It is effective alternate of RF.
5. More reliable, No interference, More bandwidth and
More accessible
1. Short range due to the presence of walls, which could
be a real interruption and range limiter.
Disadvantages 2. The infrastructure setup could take more time
of Li-Fi 3. There is no clarity on how the receiving device will
transmit data back to the transmitter.
• An IP address is a unique identification for a node
connected to a network.
• Network using TCP/IP protocol route messages are
based on this address only.
• An IP address typically looks like 10.10.127.220. This is
IPV4 called Internet Protocol version 4(IPV4), although these
days IP Version 6(IPV6) is also globally prevalent.
• IP addresses are 4-bytes or 32-bits long.
• They can be represented in binary or decimal format.
• An IP address comprises of two halves - network ID
and host ID.
IPV4
• Classful addressing is a network addressing the
Internet's architecture from 1981 till Classless Inter-
Domain Routing was introduced in 1993.
• This addressing method divides the IP address into five
Classes of IP separate classes based on four address bits.
• Here, classes A, B, C offers addresses for networks of
three distinct network sizes.
• Class D is only used for multicast, and class E reserved
exclusively for experimental purposes.
Classes of IP
Classes of IP
• Class A(1 to 126):
• This IP address class is used when there are a large
number of hosts.
• In a Class A type of network, the first 8 bits (also called
the first octet) identify the network, and the remaining
have 24 bits for the host into that network.
Classes of IP • First octet can be from 1 to 126.
• [(2^24)-2] IP addresses available.(around 17 million)
Here (-2) is done as 1st and 255th addresses meant for
network ID and broadcast ID.
• 127.0.0.0 is loop back address, used for ping,
troubleshooting and network testing. 127.255.255.255
cannot be used and is reserved for diagnostic functions.
• Class B(128-191):
• Medium size networks
• 2 octets = network ID and 2 octets = host ID
• First two bits of the first octet are fixed to 1 0.
• [(2^14)-2], 16,384 networks possible
Classes of IP • Class C(192-223):
• Small size networks
• First 3 octets = network ID and last octet= host ID
• First three bits of first octet are fixed as 1 1 0.
• [(2^8)-2]=254 hosts per network
• Class D(224-239):
• Used for Multicasting
• First four bits of the first octet are fixed to 1 1 1 0.
Classes of IP • Class E(240-255):
• Used for experimental purposes only.
• First 3 octets = network ID and last octet= host ID
• First five bits of first octet are fixed as 1 1 1 1 0.
IPV4 Protocol
Format
• IP Version Number(4 bits):
• Indicates the version of IP being utilized.
• To ensure compatibility between the versions of IP
• Internet Header Length(IHL-4bits):
• Length of entire IP header.
IPV4 Protocol • The minimum value for a correct header is 5(0101).
Format • Type of Service(8 bits):
• Indicates Quality of Service(QoS)
• Type of Service(8 bits):
a) Precedence:
000 Routine
IPV4 Protocol 001 Priority
010 Immediate
Format 011 Flash
100 Flash Override
101 Critical
110 Internetwork
Control
111 Network Control
• Type of Service(8 bits):
b) Delay: 0 indicates normal delay and 1 indicates a
lower delay
c) Throughput: 0 indicates normal and 1 indicates high
throughput.
IPV4 Protocol d) Reliability: 0 indicates normal and 1 indicates high
Format reliability.
• Total Length(16 bits):
• Length of entire IP Packet (including IP header and
IP Payload).(minimum 20 bytes and maximum
2^16= 65,535 bytes.)
• Identification(16 bits):
• If IP packet is fragmented during the transmission,
all the fragments contain same identification number
to identify original IP packet they belong to.
• Flags(3 bits):
IPV4 Protocol • The first bit is always 0 and it is kept unused.
Format • The second bit is called Don’t Fragment(DF) Flag.
If DF is set to 0, IP datagram can be fragmented and
if it is set to 1, it cannot be fragmented.
• The last bit is called More fragments(MF) which if
set will indicate that more fragments are on the way.
• Fragment offset(13 bits):
• It indicates the position of a fragmented datagram in
the original unfragmented IP datagram.
• The first fragmented datagram has a fragment offset
of zero.
• Time to Live(8 bits):
IPV4 Protocol • Indicates the time that IP datagram will survive.
• The main purpose of TTL is to prevent the IP
Format datagrams from looping around forever in a routing
loop.
• Protocol(8 bits):
• It tells the next level protocol to the network layer at
the destination side.
• Protocol number of ICMP is 1, IGMP is 2, TCP is 6
and UDP is 17.
• Header Checksum(16 bits):
• This field is used to keep checksum value of entire
header which is then used to check if the packet is
received error-free.
• Source Address(32 bits):
• IP address of the source or originator.
IPV4 Protocol • Destination Address(32 bits):
Format • IP address of the destination which receive the data.
• Options:
• Optional header setting available for the
debugging/testing and security purposes.
• Also contain padding which provide additional 0 bits
so that the total header length is an exact multiple of
32 bits.
• Due to the extensive growth in number of computers and
internet devices, the addresses got exhausted so there was
a need for more addresses for utilization.
IPV6 Protocol • It also works in Layer 3.
• 2^32 unique IP addresses was not sufficient.
• IPv6 provides support for 2^128
IPV6 Protocol
1. Larger Address Space
2. Simplified Header
3. End-to-end Connectivity
4. Auto-configuration
Features of 5. Faster Forwarding/Routing
IPV6 Protocol 6. IPSec
7. No Broadcast
8. Mobility
9. Improve QoS
10. Smooth Transition
IPV6 Protocol
Header
Format
• Version (4-bits): It represents the version of Internet
Protocol, i.e. 0110.
• Traffic Class (8-bits):
• These 8 bits are divided into two parts. The most
significant 6 bits are used for Type of Service to let the
IPV6 Protocol Router Known what services should be provided to
this packet.
Header • The least significant 2 bits are used for Explicit
Format Congestion Notification (ECN).
• Flow Label (20-bits): This label is used to maintain the
sequential flow of the packets belonging to a
communication.
• This field helps avoid re-ordering of data packets. It is
designed for streaming/real-time media.
• Payload Length (16-bits): This field is used to tell the
routers how much information a particular packet
contains in its payload.
• Payload is composed of Extension Headers and
Upper Layer data.
IPV6 Protocol • With 16 bits, up to 65535 bytes can be indicated; but
Header if the Extension Headers contain Hop-by-Hop
Extension Header, then the payload may exceed
Format 65535 bytes and this field is set to 0.
• Next Header (8-bits): This field is used to indicate either
the type of Extension Header, or if the Extension Header
is not present then it indicates the Upper Layer
PDU(Protocol Data Unit).
• Hop Limit (8-bits): This field is used to stop packet to
loop in the network infinitely.
• This is same as TTL in IPv4. The value of Hop Limit
IPV6 Protocol field is decremented by 1 as it passes a link
(router/hop). When the field reaches 0 the packet is
Header discarded.
Format • Source Address (128-bits): This field indicates the
address of originator of the packet.
• Destination Address (128-bits): This field provides the
address of intended recipient of the packet.
• Extension Headers:
IPV6 Protocol
Header
Format
• A URI (Uniform Resource Identifier) is a sequence of
characters that identifies a logical or physical resource
either by using location, name or both.
• Specified in the Internet Engineering Task Force (IETF)
Uniform • URI has URN(Universal Resource
Name)/URL(Universal Resource Locator) in it.
Resource
Identifier
(URI)
• URL (Uniform Resource Locator):
• It is a very commonly used way to locate resources on
the web.
• It provides a way to retrieve the presentation of the
Uniform physical location by describing its network location or
Resource primary access mechanism.
Identifier • The protocol is described within the URL which is
employed to retrieve the resource and resource name.
(URI) • The URL contains http/https at the start if the resource
may be a web type resource.
• Similarly, it begins with ftp if the resource may be a file
and mailto if the resource is an email address.
• URN (Uniform Resource Name):
• It simply labels the resource with a persistent, location-
independent unique identifier.
Uniform • A URN will identify the resource throughout its lifecycle
and will never change.
Resource • Each URN has three components: the label “urn,” a
Identifier colon and a character string that serves as a unique
(URI) identifier.
• It does not indicate how to spot/locate it on the Internet.
• There is a prefix URN for all the URNs.
• Urn:vehiclenumber:041578122
Uniform • URN (Uniform Resource Name):
• It gives the name of a resource and its identification.
Resource • It does not indicate how to spot/locate it on the Internet.
Identifier • There is a prefix URN for all the URNs.
(URI) • Urn:vehiclenumber:041578122
• Identify if the following links are URL or URN or
neither.
Uniform
Resource • ftp://ftp.is.co.za/rfc/rfc1808.txt
Identifier • http://www.ietf.org/rfc/rfc2396.txt
• ldap://[2001:db8::7]/c=GB?objectClass?one
(URI) • mailto:John.Doe@example.comtelnet://192.0.2.16:80/
• urn:oasis:names:specification:docbook:dtd:xml:4.1.2
https://www.nabto.com/guide-iot-protocols-standards/
https://developer.ibm.com/articles/iot-lp101-connectivity-network-
protocols/
https://www.emnify.com/en/resources/udp
https://www.postscapes.com/internet-of-things-protocols/
References https://www.hcltech.com/blogs/unleashing-power-html5-websocket-
internet-things-iot
THANK YOU