FON Unit IV - IoT
FON Unit IV - IoT
UNIT- IV Application Layer –Domain name system, SNMP, Electronic Mail; the
World WEB, HTTP, Content Delivery.
Application Layer:
The Application Layer, as discussed above, being topmost layer in OSI model,
performs several kinds of functions which are requirement in any kind of
application or communication process.
Following are list of functions which are performed by Application Layer of OSI
Model –
Data from User <=> Application layer <=> Data from Presentation Layer
Application Layer provides a facility by which users can forward several
emails and it also provides a storage facility.
This layer allows users to access, retrieve and manage files in a remote
computer.
It allows users to log on as a remote host.
This layer provides access to global information about various services.
This layer provides services which include: e-mail, transferring files,
distributing results to the user, directory services, network resources and so
on.
It provides protocols that allow software to send and receive information
and present meaningful data to users.
It handles issues such as network transparency, resource allocation and
so on.
This layer serves as a window for users and application processes to
access network services.
Application Layer is basically not a function, but it performs application
layer functions.
The application layer is actually an abstraction layer that specifies the
shared protocols and interface methods used by hosts in a communication
network.
Application Layer helps us to identify communication partners, and
synchronizing communication.
This layer allows users to interact with other software applications.
In this layer, data is in visual form, which makes users truly understand
data rather than remembering or visualize the data in the binary format (0’s
or 1’s).
This application layer basically interacts with Operating System (OS) and
thus further preserves the data in a suitable manner.
This layer also receives and preserves data from it’s previous layer,
which is Presentation Layer (which carries in itself the syntax and semantics
of the information transmitted).
The protocols which are used in this application layer depend upon what
information users wish to send or receive.
This application layer, in general, performs host initialization followed by
remote login to hosts.
Working of Application Layer in the OSI model :
In the OSI model, this application layer is narrower in scope.
The application layer in the OSI model generally acts only like the interface
which is responsible for communicating with host-based and user-facing
applications. This is in contrast with TCP/IP protocol, wherein the layers below
the application layer, which is Session Layer and Presentation layer, are
clubbed together and form a simple single layer which is responsible for
performing the functions, which includes controlling the dialogues between
computers, establishing as well as maintaining as well as ending a particular
session, providing data compression and data encryption and so on.
At first, client sends a command t server and when server receives that
command, it allocates port number to client. Thereafter, the client sends an
initiation connection request to server and when server receives request, it
gives acknowledgement (ACK) to client through client has successfully
established a connection with the server and, therefore, now client has access
to server through which it may either ask server to send any types of files or
other documents or it may upload some files or documents on server itself.
Features provided by Application Layer Protocols :
To ensure smooth communication, application layer protocols are implemented
the same on source host and destination host.
The following are some of the features which are provided by Application layer
protocols-
The Application Layer protocol defines process for both parties which are
involved in communication.
These protocols define the type of message being sent or received from
any side (either source host or destination host).
These protocols also define basic syntax of the message being forwarded
or retrieved.
These protocols define the way to send a message and the expected
response.
These protocols also define interaction with the next level.
Application Layer Protocols:
The application layer provides several protocolswhich allow any software to
easily send and receive information and present meaningful data to its users.
The following are some of the protocols which are provided by the application
layer.
TELNET: Telnet stands for Telecommunications Network. This protocol is
used for managing files over the Internet. It allows the Telnet clients to
access the resources of Telnet server. Telnet uses port number 23.
DNS: DNS stands for Domain Name System. The DNS service translates
the domain name (selected by user) into the corresponding IP address. For
example- If you choose the domain name as www.abcd.com, then DNS must
translate it as 192.36.20.8 (random IP address written just for understanding
purposes). DNS protocol uses the port number 53.
DHCP: DHCP stands for Dynamic Host Configuration Protocol. It
provides IP addresses to hosts. Whenever a host tries to register for an IP
address with the DHCP server, DHCP server provides lots of information to
the corresponding host. DHCP uses port numbers 67 and 68.
FTP: FTP stands for File Transfer Protocol. This protocol helps to transfer
different files from one device to another. FTP promotes sharing of files via
remote computer devices with reliable, efficient data transfer. FTP uses port
number 20 for data access and port number 21 for data control.
SMTP: SMTP stands for Simple Mail Transfer Protocol. It is used to
transfer electronic mail from one user to another user. SMTP is used by end
users to send emails with ease. SMTP uses port numbers 25 and 587.
HTTP: HTTP stands for Hyper Text Transfer Protocol. It is the foundation
of the World Wide Web (WWW). HTTP works on the client server model.
This protocol is used for transmitting hypermedia documents like HTML. This
protocol was designed particularly for the communications between the web
browsers and web servers, but this protocol can also be used for several
other purposes. HTTP is a stateless protocol (network protocol in which a
client sends requests to server and server responses back as per the given
state), which means the server is not responsible for maintaining the
previous client’s requests. HTTP uses port number 80.
NFS: NFS stands for Network File System. This protocol allows remote
hosts to mount files over a network and interact with those file systems as
though they are mounted locally. NFS uses the port number 2049.
SNMP: SNMP stands for Simple Network Management Protocol. This
protocol gathers data by polling the devices from the network to the
management station at fixed or random intervals, requiring them to disclose
certain information. SNMP uses port numbers 161 (TCP) and 162 (UDP).
DNS is a TCP/IP protocol used on different platforms. The domain name space is divided
into three different sections: generic domains, country domains, and inverse domain.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS
database.
o It uses three-character labels, and these labels describe the organization type.
Label Description
Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has
received a request from the client, and the server contains the files of only authorized
clients. To determine whether the client is on the authorized list or not, it sends a query
to the DNS server and ask for mapping an address to the name.
Working of DNS
o DNS is a client/server network communication protocol. DNS clients send
requests to the. server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known as a
forward DNS lookups while requests containing an IP address which is converted
into a name known as reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts
available on the internet.
o If a client like a web browser sends a request containing a hostname, then a piece
of software such as DNS resolver sends a request to the DNS server to obtain
the IP address of a hostname. If DNS server does not contain the IP address
associated with a hostname, then it forwards the request to another DNS server.
If IP address has arrived at the resolver, which in turn completes the request over
the internet protocol.
SNMP
o SNMP stands for Simple Network Management Protocol.
o SNMP is a framework used for managing devices on the internet.
o It provides a set of operations for monitoring and managing the internet.
SNMP Concept
o SNMP has two components Manager and agent.
o The manager is a host that controls and monitors a set of agents such as routers.
o It is an application layer protocol in which a few manager stations can handle a set of
agents.
o The protocol designed at the application level can monitor the devices made by different
manufacturers and installed on different physical networks.
o It is used in a heterogeneous network made of different LANs and WANs connected by
routers or gateways.
Management Components
o Management is not achieved only through the SNMP protocol but also the use of other
protocols that can cooperate with the SNMP protocol. Management is achieved through
the use of the other two protocols: SMI (Structure of management information) and
MIB(management information base).
o Management is a combination of SMI, MIB, and SNMP. All these three protocols such as
abstract syntax notation 1 (ASN.1) and basic encoding rules (BER).
SMI
The SMI (Structure of management information) is a component used in network
management. Its main function is to define the type of data that can be stored in an
object and to show how to encode the data for the transmission over a network.
MIB
o The MIB (Management information base) is a second component for the network
management.
o Each agent has its own MIB, which is a collection of all the objects that the manager can
manage. MIB is categorized into eight groups: system, interface, address translation, ip,
icmp, tcp, udp, and egp. These groups are under the mib object.
SNMP
SNMP defines five types of messages: GetRequest, GetNextRequest, SetRequest,
GetResponse, and Trap.
GetRequest: The GetRequest message is sent from a manager (client) to the agent
(server) to retrieve the value of a variable.
SetRequest: The SetRequest message is sent from a manager to the agent to set a
value in a variable.
Trap: The Trap message is sent from an agent to the manager to report an event. For
example, if the agent is rebooted, then it informs the manager as well as sends the time
of rebooting.
Electronic Mail:
User Agent (UA): The User-Agent is a simple software that sends and
receives mail. It is also known as a mail reader. It supports a wide range
of instructions for sending, receiving, and replying to messages, as well
as manipulating mailboxes.
Some of the services supplied by the User-Agent are listed below:
Reading a Message
Sending a reply to a Message
Message Composition
Forwarding a Message
Handling the Message
Message Access Agent: Simple Mail Transfer Protocol is used for the
first and second stages of e-mail delivery.
The pull protocol is mainly required at the third stage of e-mail delivery,
and the message access agent is used at this point.
POP and IMAP4 are the two protocols used to access messages.
Architecture of E-mail
Source: Researchgate.net
First Scenario:
In the first scenario, two user agents are required. The sender and
recipient of the e-mail share the same machine directly connected to the
server.
For example, let us consider two user agents, Tom and Zen. When Tom
sends an e-mail to Zen, the user agent (UA) programme is used to
prepare the message. Following that, this e-mail gets saved in Zens
inbox.
Second Scenario:
The sender and recipient of an e-mail, in this case, are essentially users
on two different machines over the internet. User-Agents and Message
Transfer Agents(MTA) are required in this scenario.
Take, for example, two user agents (John and Micheal), as illustrated in
the diagram. When John sends an e-mail to Micheal, the user agent (UA)
and message transfer agents (MTAs) programmes prepare the e-mail for
transmission over the internet. Following that, this e-mail gets stored in
Micheal's inbox.
Third Scenario:
The sender is connected to the system by a point-to-point WAN, which
can be a dial-up modem or a cable modem in this case. On the other
hand, the receiver is directly attached to the system, as it was in the
second scenario.
The sender also needs a User agent (UA) to prepare the message in this
situation. After preparing the statement, the sender delivers it over LAN
or WAN via a pair of MTAs.
Fourth Scenario:
The recipient is linked to the mail server via WAN or LAN in this
scenario. When the message arrives, the recipient must retrieve it, which
needs additional client/server agents. This scenario requires two user
agents (UAs), two pairs of message transfer agents (MTAs), and a
couple of message access agents (MAAs).
1. Structural Components
2. Semantic Components
Architecture of WWW
The WWW is mainly a distributed client/server service where a client using the browser
can access the service using a server. The Service that is provided is distributed over
many different locations commonly known as sites/websites.
Each website holds one or more documents that are generally referred to as web
pages.
Where each web page contains a link to other pages on the same site or at other
sites.
These pages can be retrieved and viewed by using browsers.
In the above case, the client sends some information that belongs to site A. It generally
sends a request through its browser (It is a program that is used to fetch the documents
on the web).
and also the request generally contains other information like the address of the site,
web page(URL).
The server at site A finds the document then sends it to the client. after that when the
user or say the client finds the reference to another document that includes the web
page at site B.
The reference generally contains the URL of site B. And the client is interested to take a
look at this document too. Then after the client sends the request to the new site and
then the new page is retrieved.
Now we will cover the components of WWW in detail.
1. Client/Browser
The Client/Web browser is basically a program that is used to communicate with the
webserver on the Internet.
Controller
Interpreter
Client Protocols
The Controller mainly receives the input from the input device, after that it uses the
client programs in order to access the documents.
After accessing the document, the controller makes use of an interpreter in order to
display the document on the screen.
An interpreter can be Java, HTML, javascript mainly depending upon the type of the
document.
The Client protocol can be FTP, HTTP, TELNET.
2. Server
The Computer that is mainly available for the network resources and in order to provide
services to the other computer upon request is generally known as the server.
3. URL
It is basically a standard used for specifying any kind of information on the Internet.
In order to access any page the client generally needs an address.
To facilitate the access of the documents throughout the world HTTP generally
makes use of Locators.
Port The URL can optionally contain the port number of the server. If the port
number is included then it is generally inserted in between the host and path and
is generally separated from the host by the colon.
Path It indicates the pathn ame of the file where the information is located.
5. XML
Features of WWW
Given below are some of the features provided by the World Wide Web:
Advantages of WWW
There are some drawbacks of the WWW and these are as follows;
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates
a request and waits for a response from the server. When the server receives the
request, the server processes the request and sends back the response to the
HTTP client after which the client disconnects the connection. The connection
between client and server exist only during the current request and response
time only.
o Media independent: HTTP protocol is a media independent as data can be sent
as long as both the client and server know how to handle the data content. It is
required for both the client and server to specify the content type in MIME-type
header.
o Stateless: HTTP is a stateless protocol as both the client and server know each
other only during the current request. Due to this nature of the protocol, both
the client and server do not retain the information between various requests of
the web pages.
HTTP Transactions
The above figure shows the HTTP transaction between client and server. The client initiates a
transaction by sending a request message to the server. The server replies to the request message
by sending a response message.
Messages
HTTP messages are of two types: request and response. Both the message types follow the same
message format.
Request Message: The request message is sent by the client that consists of a request line,
headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that consists of a
status line, headers, and sometimes a body.
Uniform Resource Locator (URL)
o A client that wants to access the document in an internet needs an address and
to facilitate the access of documents, the HTTP uses the concept of Uniform
Resource Locator (URL).
o The Uniform Resource Locator (URL) is a standard way of specifying any kind of
information on the internet.
o The URL defines four parts: method, host computer, port, and path.
o Method: The method is the protocol used to retrieve the document from a server.
For example, HTTP.
o Host: The host is the computer where the information is stored, and the
computer is given an alias name. Web pages are mainly stored in the computers
and the computers are given an alias name that begins with the characters
"www". This field is not mandatory.
o Port: The URL can also contain the port number of the server, but it's an optional
field. If the port number is included, then it must come between the host and
path and it should be separated from the host by a colon.
o Path: Path is the pathname of the file where the information is stored. The path
itself contain slashes that separate the directories from the subdirectories and
files
Over the last few years there has been a huge increase in the number of Internet
users. YouTube alone has 2 Billion users worldwide, while Netflix has over 160
million users. Streaming content to such a wide demographic of users is no easy
task. One can think that a straightforward approach to this can be building a large
data center, storing all the content in the servers, and provide it to the users
worldwide. But there are issues that arise when this approach is followed-
1. Firstly if the data center is in the USA and the user is in India there will be
slower delivery of content.
2. Secondly, a single data center represents a single point of failure.
3. Thirdly, if some content is being accessed frequently from a remote area
then it is likely to follow the same links, and this, in turn, results in wastage of
bandwidth.
CDN – Content Distribution Network or Content Delivery Network is a
solution that provides faster delivery of content to the users distributed worldwide.
What is a CDN?
A CDN is essentially a group of servers that are strategically placed across the
globe with the purpose of accelerating the delivery of web content. A CDN-
1. Manages servers that are geographically distributed over different locations.
2. Stores the web content in its servers.
3. Attempts to direct each user to a server that is part of the CDN so as to
deliver content quickly.
How does CDN work?
To minimize the distance between the visitors and your website’s server, a CDN
stores a cached version of original content in multiple geographical locations
(a.k.a., points of presence/ PoPs). Each PoP contains a number of caching servers
known as edge servers that are responsible for content delivery to visitors within
its proximity. CDN caches content in many places at once, ensuring quick
delivery of content.
Let’s consider an example:
Suppose you are hosting a website, wherein your origin server(server containing
the primary source of your website’s data, where website files are hosted) is
located in Australia and a company XYZ provides you the CDN service.
When a user in India clicks on a video on your website, the request goes to the
user’s local DNS server(See DNS), which relays the request to the authoritative
DNS server of your website.
The authoritative DNS server then identifies that the user is situated far away and
therefore relays the request to its XYZ’s DNS server. Now the DNS query enters
XYZ’s network which provides the address of the edge server that is closest to
the user to the Local DNS server. The video is delivered by this edge server.
From this point onwards the local DNS server knows the address of the edge
server. So whenever users within its network send a request for content from your
website, the local DNS server shall relay the request to the edge server.
CDN thus minimizes the number of hops required to deliver the data to a user’s
browser due to the POPs that are located near the user.
Following image depicts the same:
Following Image depicts the difference between how a request is handled with
and without a CDN respectively:
WITH CDN(2 SECONDS)