KEMBAR78
HTENG413Lecture 1 | PDF | Transmission Control Protocol | Internet Of Things
0% found this document useful (0 votes)
5 views18 pages

HTENG413Lecture 1

Uploaded by

Faustino Bhareni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views18 pages

HTENG413Lecture 1

Uploaded by

Faustino Bhareni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

HTENG413: IoT and Cloud Systems Engineering April 2022 - July 2022

Lecture 1: Introduction to IoT and Cloud Computing


Lecturer: Harry Mafukidze Lab: 62

Disclaimer: These notes have not been subjected to the usual scrutiny reserved for formal publications. They may
be distributed outside this class only with the permission of the Instructor.

Contents

1.1Introduction of IoT. 1-2


1.1.1 Application areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.1.2 Physical design of IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
1.1.2.1 IoT Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.1.3 Logical design of Iot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
1.1.3.1 loT Functional Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
1.1.3.2 loT Communication Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13

1.2loT Communication APIs 1-15

1.3IoT Enabling Technologies 1-18

List of Figures

1.1 inferring information and knowledge from data. . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3


1.2 Applications of IoT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.3 Generic block diagram of an IoT device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
1.4 IoT protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.5 Request-response communication model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
1.6 Publish-subscribe communication model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
1.7 Push-Pull communication model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
1.8 Exclusive-pair communication model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14
1.9 Communication with REST APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15
1.10 Request-response model used by REST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16

1-1
1-2 Lecture 1: Introduction to IoT and Cloud Computing

1.1 Introduction of IoT.

The Internet of Things (IoT) has become a common news item and marketing trend. Beyond the hype, IoT
has emerged as an important technology with applications in many fields. IoT has roots in several earlier
technologies: pervasive information systems, sensor networks, and embedded computing. The term IoT sys-
tem more accurately describes the use of this technology than does Internet of Things. Most IoT devices are
connected together to form purpose-specific systems; they are less frequently used as general-access devices
on a worldwide network.
IoT moves beyond pervasive computing and information systems, which concentrated on data. Smart refrig-
erators are one example of pervasive computing devices. Several products included built-in PCs and allowed
users to enter information about the contents of their refrigerator for menu planning. Conceptual devices
would automatically scan the refrigerator contents to take care of data entry. The use cases envisioned for
these refrigerators are not so far removed from menu planning applications for stand-alone personal com-
puters.
Sensor network research spanned a range of configurations. Many of these were designed for data collection
at very low data rates. The collected data would then be sent to servers for processing. Traditional sensor
network research did not emphasize in-network processing.
Embedded computing concentrated on either stand-alone devices or tightly coupled networks such as those
used in vehicles. Consumer electronics and cyberphysical systems were two major application domains for
embedded computing; both emphasized engineered systems with well-defined goals.
Given the wide range of advocates for IoT technology, no single, clear definition of the term has emerged.
We can identify several possibilities:

• Internet-enabled physical devices, although many devices don’t use the Internet Protocol
• Soft real-time sensor networks
• Dynamic and evolving networks of embedded computing devices

We use the term IoT Systems term to capture two characteristics. First, the system is designed for one or a
set of applications, rather than being an agglomeration of Internet-enabled devices. Second, the IoT system
takes into account the dynamics of physical systems. An IoT system may consist primarily of sensors; in
some cases it may include a significant number of actuators. In both cases, the goal is to process signals and
time-series data.
Interest in the Internet of Things has been spurred by the availability of microelectromechanical (MEMS)
sensors. Integrated accelerometers, gyroscopes, chemical sensors, and other forms of sensor are now widely
available. The low cost and power consumption of these sensors enables new applications well beyond those
of traditional laboratory or industrial measurement equipment. These sensor applications push IoT systems
toward signal processing.
IoT is also enabled by the very low cost of VLSI digital and analog electronics. As we will see, IoT nodes do
not rely on state-of-the-art VLSI manufacturing processes. In fact, they are inexpensive because they are
able to make use of older manufacturing lines; the lower device counts available in these older technologies
are more than sufficient for many IoT systems.
IoT systems must consume very little power. Power consumption is a key factor in total cost of ownership
for IoT systems. Achieving the necessary power levels requires careful attention to hardware design, software
design, and application algorithms.
Security and safety are key design and operational requirements for IoT systems. As we have argued else-
where, safety and security are no longer separable problems. The merger of computational and physical
systems requires us to merge the previously separate tasks of safe physical system design and secure com-
puter system design.
Lecture 1: Introduction to IoT and Cloud Computing 1-3

Data Information Knowledge


Knowledge is inferred from
Raw and unprocessed Information is inferred from information by organizing and
data obtained from IoT data by filtering, processing structuring information and is
devices / systems categorizing, condensing, put into action to achive specific
and contextualizing data. objectives

Figure 1.1: inferring information and knowledge from data.

Summary Internet of Things (loT) comprises things that have unique identities and are connected to the
Internet. While many existing devices, such as networked computers or 4G-enabled mobile phones, already
have some form of unique identities and are also connected to the Internet, the focus on loT is in the config-
uration, control and networking via the Internet of devices or ”things” that are traditionally not associated
with the Internet. These include devices such as thermostats. utility meters, a bluetooth-connected headset.
irrigation pumps and sensors, or control circuits for an electric car’s engine. Internet of Things is a new
revolution in the capabilities of the endpoints that are connected to the Internet, and is being driven by the
advancements in capabilities (in combination with lower acts) in sensor networks, mobile devices. wireless
communications, networking and cloud technologies. Experts forecast that by the year 2020 there will be
a total of 50 billion devices/things connected to the Internet. Therefore, the major industry players are
excited by the prospects of new markets for their products. The products include hardware and software
components for loT endpoints. hubs, or control centers of the loT universe.

The scope of IoT is not limited to just connecting things (devices, appliances, machines) to the Internet.
loT allows these things to communicate and exchange data (control &: information, that could include data
associated with users) while executing meaningful applications towards a common user or machine goal.
Data itself does not have a meaning until it is contextualized processed into useful information. Applications
on IoT networks extract and create information from lower level data by filtering, processing, categorizing,
condensing and contextualizing the data. This information obtained is then organized and structured to
infer knowledge about the system and/or its users, Its environment, and its operations and progress towards
its objectives, allowing a smarter performance, as shown in Figure 1.1. For example, consider a series of
raw sensor measurements generated by a weather monitoring station, which by themselves do not have any
meaning or context. To give meaning to the data, a context is added, which in this example can be that
each tuple in data represents the temperature and humidity measured every minute. With this context
added we know the meaning (or information) of the measured data tuples. Further information is obtained
by categorizing, condensing or processing this data. For example, the average temperature and humidity
readings for last five minutes is obtained by averaging the last five data tuples. The next step is to organize
the information and understand the relationships between pieces of information to infer knowledge which
can be put into action. For example, an alert is raised if the average temperature in last five minutes exceeds
120F, and this alert may be conditioned on the user’s geographical position as well.

Definition 1.1 The Internet of Things can be defined as: A dynamic global network infrastructure with
self-configuring capabilities based on standard and interoperable communication protocols where physical and
virtual ”things” have identities, physical attributes, and virtual personalities and use intelligent interfaces,
and are seamlessly integrated into the information network, often communicate data associated with users
and their environments.
1-4 Lecture 1: Introduction to IoT and Cloud Computing

1.1.1 Application areas

IoT systems are useful in a broad range of applications:

Health & Lifestyle - Health & fitness monitoring


- Wearable electronics

- Machine diagnosis & prognosis


Industry
- Indoor air quality monitoring

Agriculture - Smart irrigation


- Greenhouse control

- Route generation & scheduling


Logistics - Fleet tracking
- Shipment monitoring
- Remote vehicle diagnosis
IoT
- Inventory management
Retail - Smart payments
- Smart vending machines

- Smart grids
Energy
- Renewable energy system
- Prognostics

- Weather monitoring
Environment - Air pollution monitoring
- Noise pollution monitoring
- Forest fire detection

- Smart lighting
- Smart appliances
Home - Intrusion detection
- Smoke / gas detectors

Figure 1.2: Applications of IoT.


Lecture 1: Introduction to IoT and Cloud Computing 1-5

• Industrial systems use sensors to monitor both the industrial processes themselves – the quality of
the product – and the state of the equipment. An increasing number of electric motors, for example,
include sensors that collect data used to predict impending motor failures.

• Smart buildings use sensors to identify the locations of people as well as the state of the building.
That data can be used to control heating/ventilation/air conditioning systems and lighting systems to
reduce operating costs. Smart buildings and structures also use sensors to monitor structural health.

• Smart cities use sensors to monitor pedestrian and vehicular traffc and may integrate data from smart
buildings.

• Vehicles use networked sensors to monitor the state of the vehicle and provide improved dynamics,
reduced fuel consumption, and lower emissions.

• Medical systems connect a wide range of patient monitoring sensors that may be located at the home,
in emergency vehicles, the doctor’s offce, or the hospital

Use cases help us understand the requirements on an IoT system.

IoT Application Example 1: Transport/Logistics

In transport logistics, IoT improves not only material flow systems but also the global positioning
and automatic identification of freight. It also increases energy efficiency and thus decreases energy
consumption.
In conclusion, IoT is expected to bring profound changes to the global supply chain via intelligent
cargo movement. This will be achieved by means of continuous synchronisation of supply chain
information and seamless realtime tracking and tracing of objects. It will make the supply chain
transparent, visible and controllable, enabling intelligent communication between people and cargo/-
goods.

IoT Application Example 2: The Smart Home

Future smart homes will be conscious about what happens inside a building, mainly impacting three
aspects: resource usage (water conservation and energy consumption), security and comfort. The
goal is to achieve better levels of comfort while cutting overall expenditure.
Moreover, smart homes also address security issues by means of complex security systems for de-
tecting theft, fire or unauthorized entry. The stakeholders involved in this scenario constitute a very
heterogeneous group. Different actors will cooperate in the user’s home, such as Internet companies,
device manufacturers, telecommunications operators, media service providers, security companies,
electricity utility companies, etc.
1-6 Lecture 1: Introduction to IoT and Cloud Computing

IoT Application Example 3: Smart Cities

While the term smart city is still a fuzzy concept, there is general agreement that it is an urban area
which creates sustainable development and high quality of life. Giffinger et al.’s model elucidates
the characteristics of a smart city, encompassing economy, people, governance, mobility, environment
and living. Outperforming in these key areas can be achieved through strong human or social cap-
ital and/or ICT infrastructure. For the latter, an initial business analysis concludes that several
sectors/industries will benefit from more digitalised and intelligent cities (examples for a city of one
million people):

1. Smart metering, 600,000 m, $120 million opportunity


2. Infrastructure for charging electric vehicles, 45,000 electric vehicles, $225 million opportunity
3. Remote patient monitoring (diabetes), 70,000 people, $14 million opportunity
4. Smart retail, 4,000 stores, $200 million opportunity

5. Smart bank branches, 3,200 PTMs, $160 million opportunity

IoT Application Example 4: Smart Factory

In a global supply chain, companies will be able to track all of their products by means of radio fre-
quency identification (RFID) tags. As a consequence, companies will reduce their operating expenses
(OPEX) and improve their productivity due to tighter integration with enterprise resource planning
(ERP) and other systems. Also, maintenance of machinery will be facilitated by connected sensors,
allowing for real-time monitoring of the health and performance of the factory equipment.
Generally, IoT will provide automatic procedures that imply a drastic reduction in the number of
employees needed. Workers will be replaced by bar code scanners, readers, sensors and actuators,
and in the end by complex robots as efficient as a human being.
Without any doubt, these technologies will bring opportunities for whitecollar workers and a large
number of technicians will be required to program and repair these machines. This is synonymous
to a transfer to maintenance jobs, but it also constitutes a new challenge for providing all blue-collar
workers with an opportunity to move toward these types of jobs and to avoid unemployment.

IoT Application Example 5: Retail

IoT realises both customer needs and business needs: price comparison of a product; looking for other
products of the same quality at lower prices; with shop promotions, giving information not only to
customers but also to shops and businesses. Having this information in real time helps enterprises to
improve their business and to satisfy customer needs.
Obviously, big retail chains will take advantage of their dominant position to enforce the future IoT
retail market, as was the case with RFID adoption, which was enforced by Walmart in 2004. In
particular, companies with controlling positions, such as Walmart, etc. will be able to push the
adoption of IoT technology due to their sizable market shares.
Lecture 1: Introduction to IoT and Cloud Computing 1-7

IoT Application Example 6: E-Health

Control and prevention are two of the main goals of future health care. Already today, people have
the option of being tracked and monitored by specialists even if the patient and specialist are not in
the same place. Tracing peoples’ health history is another aspect that makes IoT-assisted e-health
very versatile. Business applications could offer the possibility of medical services not only to patients
but also to specialists, who need information to proceed in their medical evaluation. In this domain,
IoT makes human interaction much more efficient because it permits not only localization, but also
tracking and monitoring of patients. Providing information about the state of a patient makes
the whole process more efficient, and also makes people much more satisfied. The most important
stakeholders in this scenario will be public and private hospitals and institutes.

IoT Application Example 7: Smart Energy/Smart Grid

This field has many overlaps with other scenarios, such as smart home and smart city. The key issue
in these scenarios is to detect ways to save energy. We are basically referring to what is known as a
smart grid. In this application area, initiatives that imply a more distributed energy production must
be highlighted, as many houses today have a solar panel, for example. As a vital constituent, smart
metering is considered a prerequisite for enabling intelligent monitoring, control and communication
in grid applications. The use of IoT platforms in smart metering will provide the following benefits:

• An efficient network of smart meters allows for faster outage detection and restoration of service.
Such capabilities abound to the benefit of customers.
• Customers will have greater control over their energy or water consumption, providing them
with more choices for managing their bills.

• IoT deployment of smart meters is expected to reduce the need for building power plants.
Building power plants that are necessary only for occasional peak demand is very expensive: a
more economical approach is to enable customers to reduce their demand through time-based
rates or other incentive programs, or to use automatic recording of consumption to temporarily
turn off devices which are not in use.

Finally, by combining the analysis of supply and demand, energy enterprises will able to supply more
efficient demand shaping. They will not just give incentives to consumers, but will actually turn off
devices that are not needed (e.g. turn off the freezer for 20 min). Furthermore, these actions must
take place automatically. Here, we again face a heterogeneous scenario involving diverse stakeholders.
The main actors are of course energy utility companies, but public entities will also be important
players.
1-8 Lecture 1: Introduction to IoT and Cloud Computing

IoT Application Example 6: E-Health

Control and prevention are two of the main goals of future health care. Already today, people have
the option of being tracked and monitored by specialists even if the patient and specialist are not in
the same place. Tracing peoples’ health history is another aspect that makes IoT-assisted e-health
very versatile. Business applications could offer the possibility of medical services not only to patients
but also to specialists, who need information to proceed in their medical evaluation. In this domain,
IoT makes human interaction much more efficient because it permits not only localization, but also
tracking and monitoring of patients. Providing information about the state of a patient makes the
whole process more efficient, and also makes people much more satisfied.

1.1.2 Physical design of IoT

Physical Design of IoT refers to IoT Devices and IoT Protocols. IoT Protocols helps to establish communi-
cation between things and cloud based servers over the Internet.
Basically Things refers to IoT Devices which have unique identities and can perform remote sensing, actuat-
ing and monitoring capabilities. Things are a main part of an IoT Application. IoT Devices can be various
type; Sensing Devices, Smart Watches, Smart Electronics appliances, Wearable Sensors, Automobiles, and
industrial machines. These devices generate data in some forms or the other which when processed by data
analytics systems leads to useful information to guide further actions locally or remotely.

Figure 1.3: Generic block diagram of an IoT device.

Figure 1.3 shows a block diagram of a typical IoT device. An IoT device may consist several interfaces for
connections to other devices, both wired and wireless. These include I/0 interfaces for sensors, (ii) interfaces
(or Internet connectivity, (iii) memory and storage interfaces and (iv) audio/video interfaces. An IoT device
can collect various types of data from the on-board or attached sensors, such as temperature, humidity, light
intensity. Sensed data can be communicated either to other devices or cloud based servers/storage. Devices
Lecture 1: Introduction to IoT and Cloud Computing 1-9

can be connected to actuators that allow them to interact with other physical entities including non-IoT
devices and systems) in the vicinity of the device. For example, a relay switch connected to an IoT device
can tum an appliance on/off based on the commands from the loT device over the Internet. IoT devices
can also be of varied types, for instance, wearable sensors, smart watches. LED lights, automobiles and
industrial machines. Almost all IoT devices generate data some form or the other which when processed
by data analytics systems leads to useful information to guide further actions locally or remotely. For
instance, sensor data generated by a soil moisture monitoring device in a garden, when processed can help
in determining the optimum watering schedules.

1.1.2.1 IoT Protocols

IoT protocols help to establish communication between an IoT Device (Node Device) and the cloud based
server over the Internet. It helps to transmit commands to and from the IoT device over the Internet. Figure
1.4 shows different types of loT devices.

Figure 1.4: IoT protocols

Link layer
Link layer protocols determine how the data is physically sent over the network’s physical layer or medium
(e.g., copper wire, coaxial cable, or a radio wave). The scope of the link layer is the local network connection
to which host is attached. Hosts on the same link exchange data packets over the link layer using link layer
protocols. Link layer determines how the packets are coded and signaled by the hardware device over the
medium to which the host is attached (such as a coaxial cable). Let us now look at some link layer protocols
winch are relevant in the context of loT.
1-10 Lecture 1: Introduction to IoT and Cloud Computing

• 802.3 - Ethernet : IEEE 802.3 is a collection of wired Ethernet standards for the link layer. For
example, 802.3 is the standard for l0BASE5 Ethernet that uses coaxial cable as a shared medium,
802.3.i is the standard for l0BASE-T Ethernet over copper twisted-pair connections, 802.3.j is the
standard for I0BASE-F Ethernet over fiber optic connections, 802.3ae is the standard for I0 Gbit/s
Ethernet over fiber, and so on. These standards provide data rates from 10 Mb/s to 40 Gb/s and
higher. The shared medium in Ethernet can be a coaxial cable, twisted-pair wire or an optical fiber.
The shared medium (i.e., broadcast medium) carries the communication for all the devices on the
network, thus data sent by one device can received by all devices subject 10 propagation conditions
and transceiver capabilities. The specifications of the 802.3 standards are available on the IEEE 802.3
working group website.
• 802.11 - WIFI : IEEE 802.11 is a collection of wireless local area network (WLAN) communication
standards, including extensive description of the link layer. For example, 802.11a operates in the 5 GHz
band, 802.11b and 802.11g operate in the 2.4 GHz band, 802.11n operates in the 2.4/5 GHz bands,
802.11ac operates in the 5GHz band and 802.11ad operates in the 60 GHz band. These standards
provide data rates from 1 Mb/s to upto 6.75 Gb/s. The specifications of the 802.11 standards are
available on the IEEE 802.11 working group website.
• 802.16 - WiMax : IEEE 802.16 is a collection of wireless broadband standards, including extensive
descriptions for the link layer (also called WiMax). WiMax standards provide data rates from 1.5
Mb/s to 1 Gb/s. The recent update (802.16m) provides da1a rates of 100 Mbit/s for mobile stations
and l Gbit/s for fixed stations. The specifications of the 802.11 standards are readily available on the
IEEE 802.16 working group website.
• 802.15.4 - LR-WPAN : IEEE 802.15.4 is a collection of standards for low-rate wireless personal area
networks (LR-WPANs). These standards form the basis of specifications for high level communication
protocols such as ZigBee. LR-WPAN standards provide data rates from 40 Kb/s 250 Kb/s. These stan-
dards provide low-cost and low-speed communication for power constrained devices. The specifications
of the 802.15.4 standards are available on the IF-FP 802.15 working group website.
• 2G/ 3G/ 4G - Mobile Communication : There are different generations of mobile communication stan-
dards including second generation (2G including GSM and CDMA), third generation (3G - including
UMTS and CDMA2000) and fourth generation (4G - including LTE). IoT devices based on these stan-
dards can communicate over cellular networks. Data rates for these standards range from 9.6 Kb/s
(for 2G) to upto 100 Mb/s (for 4G) and are available from the 3GPP websites.

Network/Internet Layer
The network layers are responsible for sending of IP datagrams from the source network to the destination
network. This layer performs the host addressing and packet routing. The datagrams contain the source and
destination addresses which are used to route them from the source to destination across multiple networks.
Host identification is done using hierarchical IP addressing schemes such as IPv4 or IPv6.

• IPv4 : Internet Protocol version 4 (IPv4) is the most deployed Internet protocol that is used to
identify the devices on a network using a hierarchical addressing scheme. IPv4 uses a 32-bit address
scheme that allows total of 23 2 or 4,294,967,296 addresses. As more and more devices got connected
to the Internet, these addresses got exhausted in the year 2011. IPv4 has been succeeded by IPv6.
The IP protocols establish connections on packet networks, but do not guarantee delivery of packets.
Guaranteed delivery and data integrity are handled by the upper layer protocols (such as TCP). IPv4
is formally described in RFC 791 16).
• IPv6 : Internet Protocol version 6 (IPv6) is the newest version of Internet protocol and successor to
IPv4. IPv6 uses I28-bit address scheme that allows total of 2128 or 3.4 x I e addresses. IPv4 is formally
described in RFC 2460.
Lecture 1: Introduction to IoT and Cloud Computing 1-11

• 6LoWPAN : 6LoWPAN (IPv6 over Low power Wireless Personal Area Networks) brings IP protocol
to the low-power devices which have limited processing capability. 6LoWPAN operates in the 2.4 GHz
frequency range and provides data transfer rates of 250 Kb/s. 6LoWPAN works with the 802.15.4
link layer protocol and defines compression mechanisms for IPv6 datagrams over IEEE 802.15.4-based
networks.

Transport Layer
The transport layer protocols provide end-to-end message transfer capability independent of the underlying
network. The message transfer capability can be set up on connections, either using handshakes (as in TCP)
or without handshakes/acknowledgments (as in UDP). The transport layer provides functions such as error
control, segmentation, flow control and congestion control.

• TCP : Transmission Control Protocol (TCP) is the most widely used transport layer protocol, that
is used by web browsers (along with HTTP, HTTPS application layer protocols), email programs
(SMTP application layer protocol) and file transfer (FM). TCP is a connection oriented and stately!
protocol. While IP protocol deals with sending packets, TCP ensures reliable transmission of packets
in-order. TCP also provides error detection capability so that duplicate packets can be discarded and
lost packets are retransmitted. The flow control capability of TCP ensures that the rate at which the
sender sends the data is not too high for the receiver to process. The congestion control capability of
TCP helps in avoiding network congestion and congestion collapse which can lead to degradation of
network performance.
• UDP : Unlike TCP which requires carrying out an initial setup procedure. UDP is a connectionless
protocol. UDP is useful for time-sensitive applications that have very small data units to exchange and
do not want the overhead of connection setup. UDP is a transaction oriented and stateless protocol.
UDP does not provide guaranteed delivery, ordering of messages and duplicate elimination. Higher
levels of protocols can ensure reliable delivery or ensuring connections created are reliable. UDP is
described in RFC 768.

Application Layer
Application layer protocols define how the applications interface with the lower layer protocols to send
the data over the network. The application data, typically in files, is encoded by the application layer
protocol and encapsulated in the transport layer protocol which provides connection or transaction oriented
communication over the network. Port numbers are used for application addressing (for example port 80
for HTTP. port 22 for SSH, etc.). Application layer protocols enable process-to-process connections using
ports.

• HTTP : Hypertext Transfer Protocol (HTTP) is the application layer protocol that forms the foun-
dation of the World Wide Web (WWW). HTTP includes commands such as GET, PUT, POST,
DELETE, HEAD, TRACE. OPTIONS, etc. The protocol follows a request-response model where a
client sends requests to a server using the wrrp commands. HTTP is a stateless protocol and each
HTTP request is independent of the other requests. An HTTP client can be a browser or an appli-
cation running on the client (e.g., an application running on an loT device, a mobile application or
other software). MTV protocol uses Universal Resource Identifiers (IJR1s) to identify HTTP resources.
HTTP is described in RFC 2616.
• CoAP : Constrained Application Protocol (CoAP) is an application layer protocol for machine-to-
machine (M2M) applications, meant for constrained environments with constrained devices and con-
strained networks. Like HTTP, CoAP is a web transfer protocol and uses a request-response model,
however it nuts on top of UDP instead of TCP. CoAP uses a client-server architecture where clients
communicate with servers using connectionless datagrams. CoAP is designed to easily interface with
1-12 Lecture 1: Introduction to IoT and Cloud Computing

HTTP. Like HTTP, CoAP supports methods such as GET, PUT. POST, and DELETE. CoAP draft
specifications are available on LEFT Constrained environments (CoRE) Working Group website.

• WebSocket : WebSocket protocol allows full-duplex communication over a single socket connection
for sending messages between client and server. WebSocket is based on TCP and allows streams of
messages to be sent back and forth between the client and server while keeping the TCP connection
open. The client can be a browse, a mobile application or an loT device. WebSocket is described in
RFC 6455.

• MQTT : Message Queue Telemetry Transport (MQTT) is a lightweight messaging protocol based on
the publish-subscribe model. MQTT uses a client-server architecture where the client (such as an
loT device) canons to the server (also called MQTT Broker) and publishes messages to topics on the
server. The broker forwards the messages to the clients subscribed to topics. MQTT is well suited
for constrained environments where the devices have limited processing and memory resources and the
network bandwidth is low. MQTT specifications are available on IBM developerWorks.

• XMPP : Extensible Messaging and Presence Protocol (XMPP) is a protocol for real-time communica-
tion and streaming XML data between network entities. XMPP pawns a wide range of applications in-
cluding messaging, presence, data syndication. gaming, multi-party chat and voice/video calls. XMPP
allows sending small chunks of XML data from one network entity to another in near real-time. XMPP
is a decentralized protocol and uses a client-server architecture. XMPP supports both client-to-server
and server-to-server communication paths. In the context of lot XMPP allows real-time communication
between loT devices. XMPP is described in RFC 6120.

• DDS : Data Distribution Service (DDS) is a data-centric middleware standard for device-to-device or
machine-to-machine communication. DDS uses a publish-subscribe model where publishers (e.g. de-
vices that generate data) create topics to which subscribers (e.g., devices that want to consume data)
can subscribe. The publisher is an object responsible for data distribution and the subscriber is re-
sponsible for receiving published data. DDS provides quality-of-service (QoS) control and configurable
reliability. DDS is described in Object Management Group (0MG) DDS specification.

• AMQP : Advanced Message Queuing Protocol (AMQP) is an open application-layer protocol for busi-
ness messaging. AMQP supports both point-to-point and publisher/subscriber models, routing and
queuing. AMQP broken receive messages from publishers (e.g., devices or applications that generate
data) and route them over connections to consumers (applications that process data). Publishers pub-
lish the messages to exchanges which then distribute message copies to queues. Messages are either
delivered by the broker to the consumers which have subscribed to the queues or the consumers can
pull the messages from the queues.

1.1.3 Logical design of Iot

Logical design of an IoT system refers to an abstract representation of the entities and processes without
going into the low-level specifics of the implementation. In this section we describe the functional blocks of
an loT system and the communication APIs that are used for the examples in this module.

1.1.3.1 loT Functional Blocks

An loT system comprises of a number of functional blocks that provide the system the capabilities for
identification, sensing, actuation, communication, and management. These functional blocks are described
as follows:
Lecture 1: Introduction to IoT and Cloud Computing 1-13

• Device : An IoT system comprises of devices that provide sensing. actuation, monitoring and control
functions.
• Communication : The communication block handles the communication for the loT system.
• Services : An loT system uses various types of loT services such as services for device monitoring,
device control services, data publishing services and services for device discovery.
• Management : Management functional block provides various functions to govern the loT system.
• Security: Security functional block secures the loT system and by providing functions such as au-
thentication, authorization, message and content integrity, and data security.
• Application : loT applications provide an interface that the users can use to control and monitor
various aspects of the loT system. Applications also allow users to view the system status and view or
analyze the processed data.

1.1.3.2 loT Communication Models

Client Server
Receives requests from client,
processes requests, looks
Sends requests Resources
up/fetches resources,
to server
prepares response and sends
response to client

Figure 1.5: Request-response communication model.

• Request-Response : Request-Response is a communication model in which the client sends requests


to the server and the server responds to the requests. When the server receives a request, it decides
how to respond, fetches the data, retrieves resource representations, prepares the response, and then
sends the response to the client. Request-Response model is a stateless communication model and each
request-response pair is independent of others. Figure 1.5 shows the client-server interactions in the
request-response model.
• Publish-Subscribe : Publish-Subscribe is a communication model that involves publishers, brokers and
consumers. Publishers are the source of data. Publishers send the data to the topics which are managed
by the broker. Publishers are not aware of the consumers. Consumers subscribe to the topics which
are managed by the broker. When the broker receives data for a topic from the publisher, it sends the
data to all the subscribed consumers.
Figure 1.6 shows the publisher-broker-consumer interactions in the publish-subscribe model.
• Push-Pull : Push-Pull is a communication model in which the data producers push the data to queues
and the consumers pull the data from the queues. Producers do not need to be aware of the consumers.
Queues help in decoupling the messaging between the producers and consumers. Queues also act as a
buffer which helps in situations when there is a mismatch between the raw at which the producers push
data and the rate at which the consumers pull data. Figure 1.7 shows the publisher-queue-consumer
interactions in the push-pull model.
1-14 Lecture 1: Introduction to IoT and Cloud Computing

Figure 1.6: Publish-subscribe communication model.

Figure 1.7: Push-Pull communication model

• Exclusive Pair : Exclusive Pair is a bi-directional, fully duplex communication model that uses a
persistent connection between the client and server. Once the connection is setup it remains open until
the client sends a request to close the connection. Client and server can send messages to each other
after connection setup. Exclusive pair is a stateful communication model and the server is aware of all
the open connections. Figure 1.8 shows the client-server interactions in the exclusive pair model.

Figure 1.8: Exclusive-pair communication model


Lecture 1: Introduction to IoT and Cloud Computing 1-15

1.2 loT Communication APIs

In the previous section you learned about various communication models. In this section you will learn about
two specific communication APIs which are used in the examples in this module. REST-based Communi-
cation APIs Representational State Transfer (REST) is a set of architectural principles by which you can
design web services and web APIs that focus on a system’s resources and how resource states are addressed
and transferred. REST APIs follow the request-response communication model described in previous sec-
tion. The REST architectural constraints apply to the components. Connectors, and data elements, within
a distributed hypermedia system. The REST architectural constraints are as follows:

Figure 1.9: Communication with REST APIs

• Client-Server: The principle behind the client-server constraint is the separation of concerns. For
example, clients should not be concerned with the storage of data which is a concern of the server.
Similarly, the server should not be concerned about the user interface, which is a concern of the client.
Separation allows client and server to be independently developed and updated.

• Stateless: Each request from client to server must contain all the information necessary to understand
the request. and cannot take advantage of any stored context on the server. The session state is kept
entirely on the client.

• Cache-able: Cache constraint requires that the data within a response to a request be implicitly or
explicitly labeled as cache-able or non-cache-able. If a response is cache-able, then a client cache is
given the right to reuse that response data for later. equivalent requests. Caching can partially or
completely eliminate some interactions and improve efficiency and scalability.
1-16 Lecture 1: Introduction to IoT and Cloud Computing

• Layered System: Layered system constraint, constrains the behavior of components such that each
component cannot see beyond the immediate layer with which they are interacting. For example, a
client cannot tell whether it is connected directly to the end server, or to an intermediary along the
way. System scalability can be improved by allowing intermediaries to respond to requests instead of
the end server, without the client having to do anything different.
• Uniform Interface: Uniform Interface constraint requires that the method of communication between
a client and a server must be uniform. Resources are identified in the requests (by URIs in web based
systems) and are themselves separate from the representations of the resources that are returned to
the client. When a client holds a representation of a resource it has all the information required to
update or delete the resource (provided the client has required permissions). Each message includes
enough information to describe how to process the message.
• Code on demand: Servers can provide executable code or scripts for clients to execute in their
context. This constraint is the only one that is optional.

REST

Client Server

Request (GET, PUT, UPDATE or DELETE)


with payload (JSON or XML)

Response (JSON or XML)

Request (GET, PUT, UPDATE or DELETE)


with payload (JSON or XML)

Response (JSON or XML)

Figure 1.10: Request-response model used by REST.

A RESTful web service is a ”web API” implemented using HITP and REST principles. Figure 1.9 shows
the communication between client and server using REST APIs. Figure 1.10 shows the interactions in the
Lecture 1: Introduction to IoT and Cloud Computing 1-17

request-response model used by REST RESTful web service is a collection of resources which are represented
by URIs. RESTful web API has a base URI (e.g. http://example.corn/apthasks/). The clients send requests
to these URIs using the methods defined by the HTTP protocol (e.g., GET, PUT, POST, or DELETE), as
shown below.

• GET: The GET method is used to retrieve information from the given server using a given URI.
Requests using GET should only retrieve data and should have no other effect on the data.

• HEAD: Same as GET, but transfers the status line and header section only.
• POST: A POST request is used to send data to the server, for example, customer information, file
upload, etc. using HTML forms.
• PUT: Replaces all current representations of the target resource with the uploaded content.

• DELETE: Removes all current representations of the target resource given by a URI.
• CONNECT: Establishes a tunnel to the server identified by a given URI.
• OPTIONS: Describes the communication options for the target resource.
• TRACE: Performs a message loop-back test along the path to the target resource.

A RESTful web service can support various Internet media types (JSON being the most popular media type
for RESTful web services). IP for Smart Objects Alliance (IPSO Alliance) has published an Application
Framework that defines a RESTful design for use in IP smart object systems.

WebSocket-based Communication APIs


WebSocket APIs allow bi-directional, full duplex communication between clients and servers. WebSocket
APIs follow the exclusive pair communication model described in previous section. Unlike request-response
APIs such as REST, the WebSocket APIs allow full duplex communication and do not require a new con-
nection to be setup for each message to be sent. WebSocket communication begins with a connection setup
request sent by the client to the server. This request (called a WebSocket handshake) is sent over Hut
and the server interprets it as an upgrade request. If the server supports WebSocket protocol, the server
responds to the WebSocket handshake response. After the connection is setup, the client and server can send
data/messages to each other in full-duplex mode. WebSocket APIs reduce the network traffic and latency as
there is no overhead for connection setup and termination requests for each message. WebSocket is suitable
for IoT applications that have low latency or high throughput requirements.
1-18 Lecture 1: Introduction to IoT and Cloud Computing

Task 1.1 Study the following tutorials...


Title URL
The Top Five EDA/ECAD Programs for https://www.circuitbasics.com/what-is-circuit-design/
Circuit Design
Best Practices for Designing a PCB Layout https://www.circuitbasics.com/what-is-pcb-design/
Introduction to the Raspberry Pi https://www.circuitbasics.com/introduction-to-the-raspberry-pi/
Introduction to the Arduino https://www.circuitbasics.com/introduction-to-arduino/
Build a Raspberry Pi web server - Part 1 https://www.circuitbasics.com/introduction-to-web-servers/
Build a Raspberry Pi web server - Part 2 https://www.circuitbasics.com/web-server-and-raspberry-pi/
How to Write Arduino Sensor Data to https://www.circuitbasics.com/how-to-write-data-to-the-cloud-with-an-arduino/
the Cloud
How to write Raspberry Pi Sensor Data https://www.circuitbasics.com/logging-sensor-data-to-the-cloud-using-the-raspb
to the Cloud
How to Send Text Messages With a Rasp https://www.circuitbasics.com/how-to-send-a-text-message-with-ifttt/
How to optimize your Arduino Code https://www.circuitbasics.com/how-to-optimize-arduino-code/

1.3 IoT Enabling Technologies

References
[HW01] D. Coppersmith and S. Winograd,

You might also like