Untitled Document
Untitled Document
JSON
JSON is often used when data is sent from a server to a web page
JSON Example
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
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
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI
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
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
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.
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI
Disadvantages of SMTP
● SMTP’s common port can be blocked by several firewalls.
● 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 −
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
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
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
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST
INTERNET OF THINGS TOOLS FOR IOT UNIT -VI
1 $ sudo vi etc/default/puppetserver
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
•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.
ROHINI VARANASI
Assistant professor ELECTRONICS AND COMMUNICATION ENGINEERING ,NBKRIST