IOT M3 - Ktunotes
IOT M3 - Ktunotes
IOT M3 - Ktunotes
IP as the IoT Network Layer, The Business Case for IP, The need for Optimization, Optimizing IP for IoT,
Profiles and Compliances, Application Protocols for IoT, The Transport Layer, IoT Application
Transport Methods.
Chapter 5
IP as the IoT Network Layer
One of the main differences between traditional information technology (IT) and operational
technology (OT) is the lifetime of the underlying technologies and products.
Followings are the key advantages of the IP suite for the Internet of Things:
1. Open and standards-based: TheInternet of Things creates a new paradigm in which
devices, applications,and users can leverage a large set of devices and functionalities
whileguaranteeing interchangeability and interoperability, security, andmanagement. This
calls for implementation, validation, and deployment ofopen, standards-based solutions.
While many standards developmentorganizations (SDOs) are working on Internet of
Things definitions,frameworks, applications, and technologies, none are questioning the
roleof the Internet Engineering Task Force (IETF) as the foundation forspecifying and
optimizing the network and transport layers.
2. Versatile: Even if physical and data link layers such as Ethernet, Wi-Fi, and cellular are
widely adopted, the history of data communications demonstrates that no given wired or
wireless technology fits all deployment criteria. Furthermore, communication
technologies evolve at a pace faster than the expected 10- to 20-year lifetime of OT
solutions. So, the layered IP architecture is well equipped to cope with any type of
physical and data link layers.
3. Ubiquitous: All recent operating system releases, from general-purpose computers and
servers to lightweight embedded systems (TinyOS, Contiki, and so on), have an
integrated dual (IPv4 and IPv6) IP stack that gets enhanced over time. In addition, IoT
Downloaded from Ktunotes.in
application protocols in many industrial OT solutions have been updated in recent years
to run over IP. While these updates have mostly consisted of IPv4 to this point, recent
standardization efforts in several areas are adding IPv6. In fact, IP is the most pervasive
protocol when you look at what is supported across the various IoT solutions and industry
verticals.
4. Scalable: Adding huge numbers of “things” to private and public infrastructures may
require optimizations and design rules specific to the new devices. However, you should
realize that this is not very different from the recent evolution of voice and video
endpoints integrated over IP. IP has proven before that scalability is one of its strengths.
5. Manageable and highly secure: Communications infrastructure requires appropriate
management and security capabilities for proper operations. Adopting IP network
management also brings an operational business application to OT. Well known network
and security management tools are easily leveraged with an IP network layer.
6. Stable and resilient:IP has a large and well-established knowledge base and, more
importantly, it has been used for years in critical infrastructures, such as financial and
defense networks. In addition, IP has been deployed for critical services, such as voice
and video, which havealready transitioned from closed environments to open IP
standards.
7. Consumers’ market adoption: When developing IoT solutions and products targeting the
consumer market, vendors know that consumers’ access to applications and devices will
occur predominantly over broadband and mobile wireless infrastructure. The main
consumer devices range from smart phones to tablets and PCs. The common protocol that
links IoT in the consumer space to these devices is IP.
8. The innovation factor: IP is the underlying protocol for applications ranging from file
transfer and e-mail to the World Wide Web, e-commerce, social networking, mobility,
and more.
How to implement IP in data center, cloud services, and operation centers hosting IoT
applications may seem obvious, but the adoption of IP in the last mile is more complicated and
often makes running IP end-to-end more difficult.
The use of numerous network layer protocols in addition to IP is often a point of contention
between computer networking experts. Typically, one of two models, adaptation or adoption, is
proposed:
1. Bidirectional versus unidirectional data flow:As defined in RFC 7228, may only
infrequently need to report a few bytes of data to an application. These sorts of devices,
particularly ones that communicate through LPWA technologies, include fire alarms
sending alerts or daily test reports, electrical switches being pushed on or off, and water
or gas meters sending weekly indexes. if there is only one-way communication to upload
data to an application, then it is not possible to download new software or firmware to the
devices. This makes integrating new features and bug and security fixes more difficult.
3. Data flow model:Any node can easily exchange data with any other node in a network,
although security, privacy, and other factors may put controls and limits on the “end-to-
end” concept. However, in many IoT solutions, a device’s data flow is limited to one or
two applications. In this case, the adaptation model can work because translation of
traffic needs to occur only between the end device and one or two application servers.
Depending on the network topology and the data flow needed, both IP adaptation and
adoption models have roles to play in last-mile connectivity.
4. Network diversity: One of the drawbacks of the adaptation model is a general
dependency on single PHY and MAC layers. Integration and coexistence of new physical
and MAC layers or new applications impact how deployment and operations have to be
planned. This is not a relevant consideration for the adoption model.
Optimizations are needed at various layers of the IP stack to handle the restrictions that are
present in IoT networks. The followings area require optimization
1. Constrained Nodes
Different classes ofdevices coexist. Depending on its functions in a network, a “thing”
architecturemay or may not offer similar characteristics compared to a generic PC or serverin an
IT environment.
Another limit is that this network protocol stack on an IoT node may be required to communicate
through an unreliable path. Even if a full IP stack is available on the node, this causes problems
such as limited or unpredictable throughput and low convergence when a topology change
occurs. Downloaded from Ktunotes.in
Finally, power consumption is a key characteristic of constrained nodes. Many IoT devices are
battery powered, with lifetime battery requirements varying from a few months to 10+ years.
This drives the selection of networking technologies since high-speed ones, such as Ethernet,
Wi-Fi, and cellular, are not (yet) capable of multi-year battery life.
2. Constrained Networks
In the early years of the Internet, network bandwidth capacity was restrained dueto technical
limitations. Connections often depended on low-speed modems fortransferring data. However,
these low-speed connections demonstrated that IPcould run over low-bandwidth networks. A
constrained network can have high latency and a high potential for packet loss.
Constrained networks are limited by low-power, low-bandwidth links (wireless and wired). They
operate between a few kbps and a few hundred kbps and may utilize a star, mesh, or combined
network topologies, ensuring proper operations.The packet delivery rate (PDR) to oscillate
between low and high percentages. Large bursts of unpredictable errors and even loss of
connectivity at times may occur.
3. IP Versions
The main driving force has been the lack of address space in IPv4 as the Internet has grown.
IPv6 has a much larger range of addresses that should not be exhausted for the foreseeable
future. Today, both traffic is still IPv4 based.
The following are some of the main factors applicable to IPv4 and IPv6 support in an IoT
solution:
1. Application Protocol:IoT devices versions of IP run over the Internet, but most
implementing Ethernet or Wi-Fi interfaces can communicate over both IPv4 and IPv6, but
the application protocol may dictate the choice of the IP version.
2. Cellular Provider and Technology: IoT devices with cellular modems are dependent on
the generation of the cellular technology as well as the data services offered by the
provider.
3. Serial Communications: Data is transferred using either proprietary or standards-based
protocols, such as DNP3, Modbus, or IEC 60870-5-101. In the past, communicating this
serial data over any sort of distance could be handled by an analog modem connection.
4. IPv6 Adaptation Layer: The most common physical and data link layers (Ethernet,
Wi-Fi, and so on) stipulate adaptation layers for both versions, newer technologies, such
as IEEE 802.15.4 (Wireless Personal Area Network), IEEE 1901.2, and ITU G.9903
(Narrowband Power Line Communications) only have an IPv6 adaptation layer specified.
The following sections introduce some of these optimizations already available from the market
or under development by the IETF. Figure 5-1 highlights the TCP/IP layers where optimization
is applied.
In the IP architecture, the transport of IP packets over any given Layer 1 (PHY) and Layer 2
(MAC) protocol must be defined and documented. The model for packaging IP into lower-layer
protocols is often referred to as an adaptation layer.
The main examples of adaptation layers optimized for constrained nodes or “things” are the ones
under the 6LoWPAN working group and its successor, the 6Lo working group. The initial focus
of the 6LoWPAN working group was to optimize the transmission of IPv6 packets over
constrained networks such as IEEE 802.15.4.
The 6LoWPAN working group published several RFCs, but RFC 4994 is Foundational because
it defines frame headers for the capabilities of header compression, fragmentation, and mesh
addressing. These headers can be stacked in the adaptation layer to keep these concepts separate
while enforcing a structured method for expressing each capability. Depending on the
implementation, all, none, or any combination of these capabilities and their corresponding
headers can be enabled. Figure 5-3 shows some examples of typical 6LoWPAN header stacks.
IPv6 header compression for 6LoWPAN was defined initially in RFC 4944 and subsequently
updated by RFC 6282. This capability shrinks the size of IPv6’s 40-byte headers and User
Datagram Protocol’s (UDP’s) 8-byte headers down as low as 6 bytes combined in some cases.
At a high level, 6LoWPAN works by taking advantage of shared information known by all nodes
from their participation in the local network. In addition, it omits some standard header fields by
assuming commonly used values. Figure 5-4 highlights an example that shows the amount of
reduction that is possible with 6LoWPAN header compression.
At the top of Figure 5-4, you see a 6LoWPAN frame without any header compression enabled:
The full 40-byte IPv6 header and 8-byte UDP header are visible. The 6LoWPAN header is only
a single byte in this case. Notice that uncompressed IPv6 and UDP headers leave only 53 bytes
of data payload out of the 127-byte maximum frame size in the case of IEEE 802.15.4.
Fragmentation
The maximum transmission unit (MTU) for an IPv6 network must be at least 1280 bytes. The
term MTU defines the size of the largest protocol data unit that can be passed. For IEEE
802.15.4, 127 bytes is the MTU. You can see that this is a problem because IPv6, with a much
larger MTU, is carried inside the 802.15.4 frame with a much smaller one. To remedy this
situation, large IPv6 packets must be fragmented across multiple 802.15.4 frames at Layer 2.
Downloaded from Ktunotes.in
The fragment header utilized by 6LoWPAN is composed of three primary fields: Datagram Size,
Datagram Tag, and Datagram Offset. The 1-byte Datagram Size field specifies the total size of
the unfragmented payload. Datagram Tag identifies the set of fragments for a payload. Finally,
the Datagram Offset field delineates how far into a payload a particular fragment occurs.
Figure 5-5 provides an overview of a 6LoWPAN fragmentation header.
In Figure 5-5, the 6LoWPAN fragmentation header field itself uses a unique bit value to identify
that the subsequent fields behind it are fragment fields as opposed to another capability, such as
header compression. Also, in the first fragment, the Datagram Offset field is not present because
it would simply be set to 0. This results in the first fragmentation header for an IPv6 payload
being only 4 bytes long. The remainder of the fragments have a 5-byte header field so that the
appropriate offset can be specified.
Mesh Addressing
The purpose of the 6LoWPAN mesh addressing function is to forward packetsover multiple
hops. Three fields are defined for this header: Hop Limit, SourceAddress, and Destination
Address. Analogous to the IPv6 hop limit field, thehop limit for mesh addressing also provides
an upper limit on how many timesthe frame can be forwarded. Each hop decrements this value
by 1 as it isforwarded. Once the value hits 0, it is dropped and no longer forwarded.
The Source Address and Destination Address fields for mesh addressing areIEEE 802.15.4
addresses indicating the endpoints of an IP hop. Figure 5-6details the 6LoWPAN mesh
addressing header fields.
6TiSCH
Many proprietary wireless technologies have been developed and deployed invarious industry
verticals over the years. However, the publication of the IEEE802.15.4 physical and data link
layer specifications, followed by IEEE 802.15.4eamendments, has opened the path to
standardized, deterministic communicationsover wireless networks.
In an RPL network, each node acts as a router and becomes part of a meshnetwork. Routing is
performed at the IP layer. Each node examines everyreceived IPv6 packet and determines the
next-hop destination based on theinformation contained in the IPv6 header. No information from
the MAC-layerheader is needed to perform next-hop determination.
To cope with the constraints of computing and memory that are common
characteristics of constrained nodes, the protocol defines two modes:
Storing mode: All nodes contain the full routing table of the RPL domain.Every node
knows how to directly reach every other node.
Non-storing mode: Only the border router(s) of the RPL domain contain(s) the full
routing table. All other nodes in the domain only maintain their list of parents and use
this as a list of default routes towardthe border router.
RPL is based on the concept of a directed acyclic graph (DAG). A DAG is adirected graph where
no cycles exist. This means that from any vertex or point inthe graph, you cannot follow an edge
or a line back to this same point. All of theedges are arranged in paths oriented toward and
terminating at one or more rootnodes. Figure 5-8 shows a basic DAG.
As illustrated in Figure 5-10, DAO andDIO messages move both up and down the DODAG,
depending on the exactmessage type.
Downloaded from Ktunotes.in
5.4 Profiles and Compliances
Leveraging the Internet Protocol suite forsmart objects involves a collection of protocols and
options that must work incoordination with lower and upper layers. Therefore, profile
definitions,certifications, and promotion by alliances can help implementers developsolutions
that guarantee interoperability and/or interchangeability of devices.
Established in 2008, the Internet Protocol for Smart Objects (IPSO) Alliance hashad its objective
evolve over years. The alliance initially focused on promotingIP as the premier solution for
smart objects communications. Today, it is morefocused on how to use IP, with the IPSO
Alliance organizing interoperabilitytests between alliance members to validate that IP for smart
objects can worktogether and properly implement industry standards. The IPSO Alliance does
not define technologies, as that is the role of the IETF and other standard
Organizations, but it documents the use of IP-based technologies for various IoTuse cases and
participates in educating the industry.
5.4.3 Thread
A group of companies involved with smart object solutions for consumerscreated the Thread
Group. This group has defined an IPv6-based wireless profilethat provides the best way to
connect more than 250 devices into a low-power,wireless mesh network. The wireless
technology used by Thread is IEEE802.15.4, which is different from Wi-SUN’s IEEE 802.15.4g.
The IoT application protocols you select should becontingent on the use cases and vertical
industries they apply to. In addition, IoTapplication protocols are dependent on the
characteristics of the lower layers themselves. For example, application protocols that are
sufficient for genericnodes and traditional networks often are not well suited for constrained
nodesand networks.
Selection of a protocol for the transport layer as supported by the TCP/IP architecture in the
context of IoT networks. With theTCP/IP protocol, two main protocols are specified for the
transport layer.
SCADA
In the world of networking technologies and protocols, IoT is relatively new. Combined with the
fact that IP is the de facto standard for computer networking in general, older protocols that
connected sensors and actuators have evolved and adapted themselves to utilize IP.
A prime example of this evolution is supervisory control and data acquisition (SCADA).
Designed decades ago, SCADA is an automation control system that was initially implemented
without IP over serial links, before being adapted to Ethernet and IPv4.
At a high level, SCADA systems collect sensor data and telemetry from remote devices, while
also providing the ability to control them. Used in today’s networks, SCADA systems allow
global, real-time, data-driven decisions to be made about how to improve business processes.
Outstations monitor and collect data from devices that indicate their state, such as whether a
circuit breaker is on or off, and take measurements, including voltage, current, temperature, and
so on. This data is then transmitted to the master when it is requested, or events and alarms can
be sent in an asynchronous manner. The master also issues control commands, such as to start a
motor or reset a circuit breaker, and logs the incoming data.
In Figure 2, the master side initiates connections by performing a TCP active open. The
outstation listens for a connection request by performing a TCP passive open. Dual endpoint is
defined as a process that can both listen for
Fig 3 Example of a High-Level IoT Protocol Stack for CoAP and MQTT
CoAP and MQTT are naturally at the top of this sample IoT stack, based on an IEEE 802.15.4
mesh network. While there are a few exceptions, you will almost always find CoAP deployed
over UDP and MQTT running over TCP. The following sections take a deeper look at CoAP and
MQTT.
CoAP
Constrained Application Protocol (CoAP) resulted from the IETF Constrained RESTful
Environments (CoRE) working group’s efforts to develop a generic framework for resource-
oriented applications targeting constrained nodes and networks. (For more information on the
IETF CoRE working group,
From a formatting perspective, a CoAP message is composed of a short fixedlength Header field
(4 bytes), a variable-length but mandatory Token field (0–8 bytes), Options fields if necessary,
and the Payload field. Figure 4 details the CoAP message format, which delivers low overhead
while decreasing parsing complexity.
The client in Figure 5 sends a GET message to get the temperature from the sensor. Notice that
the 0x47 message ID is present for this GET message and that the message is also marked with
CON. A CON, or confirmable, marking in a CoAP message means the message will be
retransmitted until the recipient sends an acknowledgement (or ACK) with the same message ID.
At the end of the 1990s, engineers from IBM and Arcom (acquired in 2006 by Eurotech) were
looking for a reliable, lightweight, and cost-effective protocol to monitor and control a large
number of sensors and their data from a central server location, as typically used by the oil and
gas industries. Their research resulted in the development and implementation of the Message
Queuing Telemetry Transport (MQTT) protocol that is now standardized by the Organization for
the Advancement of Structured Information Standards (OASIS).
Considering the harsh environments in the oil and gas industries, an extremely simple protocol
with only a few options was designed, with considerations for constrained nodes, unreliable
WAN backhaul communications, and bandwidth constraints with variable latencies. These were
some of the rationales for the selection of a client/server and publish/subscribe framework based
on the TCP/IP architecture, as shown in Figure 6.
An MQTT client can act as a publisher to send data (or resource information) to an MQTT server
acting as an MQTT message broker. In the example illustrated in Figure 6, the MQTT client on
the left side is a temperature (Temp) and relative humidity (RH) sensor that publishes its
Temp/RH data. The MQTT server (or message broker) accepts the network connection along
with application messages, such as Temp/RHfrom
Downloaded data, from the publishers. It also handles the
Ktunotes.in
subscription and unsubscription process and pushes the application data to MQTT clients acting
as subscribers.
The application on the right side of Figure 6, is an MQTT client that is a subscriber to the
Temp/RH data being generated by the publisher or sensor on the left. This model, where
subscribers express a desire to receive information from publishers, is well known. A great
example is the collaboration and social networking application Twitter.
Fig 7.
QoS 0: This is a best-effort and unacknowledged data service referred to as “at most once”
delivery. The publisher sends its message one time to a server, which transmits it once to the
subscribers. No response is sent by the receiver, and no retry is performed by the sender. The
message arrives at the receiver either once or not at all.
QoS 1: This QoS level ensures that the message delivery between the
publisher and server and then between the server and subscribers occurs at least once. In
PUBLISH and PUBACK packets, a packet identifier is included in the variable header. If the
message is not acknowledged by a PUBACK packet, it is sent again. This level guarantees “at
least once” delivery.
Table 3 provides an overview of the differences between MQTT and CoAP, along with their
strengths and weaknesses from an IoT perspective.