0% found this document useful (0 votes)
45 views16 pages

Untitled Document

The document discusses various tools used in internet of things including JSON, XML, SMTP, and Chef. It provides details on JSON syntax and examples, how XML is used to store and transport data, how SMTP works as a protocol to transfer emails, and Chef which is an open source tool used for infrastructure automation using recipes and cookbooks. Key aspects of each tool like JSON formatting, XML benefits, SMTP components and workflow, and Chef resources and cookbooks are explained.

Uploaded by

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

Untitled Document

The document discusses various tools used in internet of things including JSON, XML, SMTP, and Chef. It provides details on JSON syntax and examples, how XML is used to store and transport data, how SMTP works as a protocol to transfer emails, and Chef which is an open source tool used for infrastructure automation using recipes and cookbooks. Key aspects of each tool like JSON formatting, XML benefits, SMTP components and workflow, and Chef resources and cookbooks are explained.

Uploaded by

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

INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

JSON

JSON stands for JavaScript Object Notation

JSON is a lightweight format for storing and transporting data

JSON is often used when data is sent from a server to a web page

JSON is "self-describing" and easy to understand

JSON Example

This example defines an employees object: an array of 3 employee records (objects):

"employees":[

{"firstName":"John", "lastName":"Doe"},

{"firstName":"Anna", "lastName":"Smith"},

{"firstName":"Peter", "lastName":"Jones"}

JavaScript Object Notation

The JSON format is syntactically identical to the code for creating JavaScript objects.

Because of this similarity, a JavaScript program can easily convert JSON data into native
JavaScript objects.

The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text
only. Code for reading and generating JSON data can be written in any programming language.

XML

○ Xml (eXtensible Markup Language) is a markup language.

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

○ XML is designed to store and transport data.


○ It was created to provide an easy to use and store self describing data.
○ XML is not a replacement for HTML.
○ XML is designed to be self-descriptive.
○ XML is designed to carry data, not to display data.
○ XML tags are not predefined. You must define your own tags.
○ XML is platform independent and language independent.

What is mark-up language

A markup language is a modern system for highlighting or underlining a document.

Students often underline or highlight a passage to revise easily, same in the sense of
modern markup language highlighting or underlining is replaced by tags.

Why xml

Platform Independent and Language Independent: The main benefit of xml is that
you can use it to take data from a program like Microsoft SQL, convert it into XML then
share that XML with other programs and platforms. You can communicate between two
platforms which are generally very difficult.The main thing which makes XML truly
powerful is its international acceptance. Many corporations use XML interfaces for
databases, programming, office application mobile phones and more. It is due to its
platform independent feature.
<Geeks>
<Geek>
<firstName>Vivek</firstName> <lastName>Kothari</lastName>
</Geek>
<Geek>
<firstName>Suraj</firstName> <lastName>Kumar</lastName>
</Geek>
<Geek>
<firstName>John</firstName> <lastName>Smith</lastName>
</Geek>
<Geek>
<firstName>Peter</firstName> <lastName>Gregory</lastName>
</Geek>
</Geeks>
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

Simple Mail Transfer Protocol (SMTP)

Email is emerging as one of the most valuable services on the internet today. Most
internet systems use SMTP as a method to transfer mail from one user to another. SMTP
is a push protocol and is used to send the mail whereas POP (post office protocol) or
IMAP (internet message access protocol) is used to retrieve those emails at the receiver’s
side.

SMTP Fundamentals
SMTP is an application layer protocol. The client who wants to send the mail opens a
TCP connection to the SMTP server and then sends the mail across the connection. The
SMTP server is an always-on listening mode. As soon as it listens for a TCP connection
from any client, the SMTP process initiates a connection through port 25. After
successfully establishing a TCP connection the client process sends the mail instantly.

SMTP Protocol
The SMTP model is of two types:

1. End-to-end method

2. Store-and-forward method

The end-to-end model is used to communicate between different organizations whereas


the store and forward method is used within an organization. An SMTP client who wants
to send the mail will contact the destination’s host SMTP directly, in order to send the
mail to the destination. The SMTP server will keep the mail to itself until it is
successfully copied to the receiver’s SMTP.
Components of SMTP
1. Mail User Agent (MUA)

2. Mail Submission Agent (MSA)

3. Mail Transfer Agent (MTA)

4. Mail Delivery Agent (MDA)

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

1. Mail User Agent (MUA): It is a computer application that helps you in sending and
retrieving mail. It is responsible for creating email messages for transfer to the mail
transfer agent(MTA).
2. Mail Submission Agent (MSA): It is a computer program that basically receives mail
from a Mail User Agent(MUA) and interacts with the Mail Transfer Agent(MTA) for the
transfer of the mail.
3. Mail Transfer Agent(MTA): It is basically software that has the work to transfer mail
from one system to another with the help of SMTP.
4. Mail Delivery Agent(MDA): A mail Delivery agent or Local Delivery Agent is
basically a system that helps in the delivery of mail to the local system.
Working of SMTP
1. Communication between the sender and the receiver :
The sender’s user agent prepares the message and sends it to the MTA. The MTA’s
responsibility is to transfer the mail across the network to the receiver’s MTA. To send
mail, a system must have a client MTA, and to receive mail, a system must have a server
MTA.
2. Sending Emails:
Mail is sent by a series of request and response messages between the client and the
server. The message which is sent across consists of a header and a body. A null line is
used to terminate the mail header and everything after the null line is considered the body
of the message, which is a sequence of ASCII characters. The message body contains the
actual information read by the receipt.
3. Receiving Emails:
The user agent on the server-side checks the mailboxes at a particular time of intervals. If
any information is received, it informs the user about the mail. When the user tries to read
the mail it displays a list of emails with a short description of each mail in the mailbox.
By selecting any of the mail users can view its contents on the terminal.

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

Advantages of SMTP
● If necessary, the users can have a dedicated server.

● It allows for bulk mailing.

● Low cost and wide coverage area.

● Offer choices for email tracking.

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

● Reliable and prompt email delivery.

Disadvantages of SMTP
● SMTP’s common port can be blocked by several firewalls.

● SMTP security is a bigger problem.

● Its simplicity restricts how useful it can be.

● Just 7-bit ASCII characters can be used.

● If a message is longer than a certain length, SMTP servers may reject the entire
message.

Chef:
Chef is an open source technology developed by Opscode.This technology uses Ruby
encoding to develop basic building blocks like recipes and cookbooks. Chef is used in
infrastructure automation and helps in reducing manual and repetitive tasks for
infrastructure management.Chef have got its own convention for different building
blocks, which are required to manage and automate infrastructure.

Recipe
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

It can be defined as a collection of attributes which are used to manage the infrastructure.
These attributes which are present in the recipe are used to change the existing state or
setting a particular infrastructure node. They are loaded during Chef client run and
comparted with the existing attribute of the node (machine). It then gets to the status
which is defined in the node resource of the recipe. It is the main workhorse of the
cookbook.

Cookbook
A cookbook is a collection of recipes. They are the basic building blocks which get
uploaded to Chef server. When Chef run takes place, it ensures that the recipes present
inside it gets a given infrastructure to the desired state as listed in the recipe.

Resource
It is the basic component of a recipe used to manage the
infrastructure with different kind of states. There can be
multiple resources in a recipe, which will help in configuring
and managing the infrastructure. For example −

package − Manages the packages on a node


service − Manages the services on a node
user − Manages the users on the node
group − Manages groups
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

template − Manages the files with embedded Ruby template


cookbook_file − Transfers the files from the files
subdirectory in the cookbook to a location on the node
file − Manages the contents of a file on the node
directory − Manages the directories on the node
execute − Executes a command on the node
cron − Edits an existing cron file on the node

Attribute
They are basically settings. They can be thought of as a key value pair of anything which
one wants to use in the cookbook. There are several different kinds of attributes that can
be applied, with a different level of precedence over the final settings that the node
operates under.

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

Puppet

Puppet is a system management tool for centralizing and automating the configuration
management process. Puppet is also used as a software deployment tool. It is an open-
source configuration management software widely used for server configuration,
management, deployment, and orchestration of various applications and services across
the whole infrastructure of an organization.
Puppet is specially designed to manage the configuration of Linux and Windows systems.
It is written in Ruby and uses its unique Domain Specific Language (DSL) to describe
system configuration.
Puppet comes in two versions:
Open Source Puppet: It is a basic version of Puppet configuration management tool,
which is also known as Open Source Puppet

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

● Puppet Enterprise: Commercial version that offers features like compliance


reporting, orchestration, role-based access control, GUI, API, and command-line
tools for effective management of nodes.

To achieve the above scenario Puppet slave first requests for a master certificate, the
master sends its certificate and request for the slave certificate. All the information which
is communicated between master and slave nodes is encrypted using SSL certificates.
Once certificates are transferred on both ends, we need to sign the slave certificate on the
master server in order to authenticate slave as shown in the below diagram:

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

Setting up the Master server:

You can run following commands to setup Puppet master on the master server:

1 $ curl -O https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb

3 $ sudo dpkg -i puppetlabs-release-pc1-xenial.deb

5 $ sudo apt-get update

7 $ sudo apt-get install puppetserver or sudo apt-get install puppetmaster

By default, Puppet uses 2GB of RAM and can be customized as follows:

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

1 $ sudo vi etc/default/puppetserver

3 JAVA_ARGS="-Xms3g -Xmx3g -XX:MaxPermSize=256m"

5 $ sudo syatemctl restart puppetmaster.service

NETCONF:
Network Configuration Protocol (NETCONF) is a session-based network
management protocol. NETCONF allows retrieving state or configuration data and
manipulating configuration data on network devices

NETCONF works on SSH transport protocol.


• Transport layer provides end-to-end connectivity and ensures reliable delivery of
messages.
• NETCONF uses XML-encoded Remote Procedure Calls (RPCs) for framing request
and response messages.
• The RPC layer provides a mechanism for encoding of RPC calls and notifications.
•NETCONF provides various operations to retrieve and edit configuration data from
network devices.
• The Content Layer consists of configuration and state data which is XML-encoded.
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

•The scheme of the configuration and state data is defined in a data modeling language
called YANG.
• NETCONF provides a clear separation of the configuration and state data.
• The configuration data resides within a NETCONF configuration datastore on the server

YANG
YANG is a data modeling language used to model configuration and state data
manipulated by the NETCONF protocol
• YANG modules contain the definitions of the configuration data, state data, RPC calls
that can be issued and the format of the notifications.
• YANG modules define the data exchanged between the NETCONF client and server.
• A module comprises a number of 'leaf' nodes which are organized into hierarchical tree
structure.
• The 'leaf' nodes are specified using the 'leaf' or 'leaf-list' constructs.
• Leaf nodes are organized using 'container' or 'list' constructs.
• A YANG module can import definitions from other modules.
• Constraints can be defined on the data nodes, e.g. allowed values.
• YANG can model both configuration data and state data using the 'config' statement.

YANG Module Example


• This YANG module is a YANG version of the toaster MIB
• The toaster YANG module begins with the header information followed by identity
declarations which define various bread types.
• The leaf nodes (‘toasterManufacturer’ , ‘toasterModelNumber’ and oasterStatus’) are
defined in the ‘toaster’ container.
• Each leaf node definition has a type and optionally a description and default value.
• The module has two RPC definitions (‘make-toast’ and ‘cancel-toast’).

IoT Systems Management withNETCONF-YANG


• Management System
The operator uses a management system to send NETCONF messages to
configure the IOT device and receives the state information and notifications from the
device and NETCONF messages.
• Management API
Management API allows management applications to start NETCONF sessions,
read and write configuration data, read state data, retrieve configurations, and invoke
RPCs.
• Transaction Manager
Transaction manager executes all the NETCONF transactions and ensures that
ACID properties hold true for the transactions.
• Rollback Manager
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI

Rollback manager is responsible for generating the transactions necessary to


rollback the current configuration to its original state.
• Data Model Manager
The data model manager keeps track of all the YANG data models and
corresponding managed objects.The data model manager also keeps track of the
applications which provide data for each part of a data model.
• Configuration Validator
Configuration validator checks if the resulting configuration after applying a
transaction would be a valid configuration.
• Configuration Database
This configuration database consists of both configuration and operational data.
• Configuration API
Using the configuration API the applications on the IOT device can read the
configuration data from the configuration datastore and write operational data to the
operational datastore.
• Data Provider API
Applications on the IOT device can register for callbacks for various events using
the data provider API.Through data provider API, the applications can report statistics
and operational data.

ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy