UNIT 5:APPLICATION LAYER
DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
o DNS stands for Domain Name System.
o DNS is a directory service that provides a mapping between the name of a host on
the network and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of
symbols specified by dots.
o DNS is a service that translates the domain name into IP addresses. This allows the
users of networks to utilize user-friendly names when looking for other hosts
instead of remembering the IP addresses.
o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50,
most people would reach this site by specifying ftp.EduSoft.com. Therefore, the
domain name is more reliable than IP address.
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.
Country Domain
The format of country domain is same as a generic domain, but it uses two-character
country abbreviations (e.g., us for the United States) in place of three character
organizational abbreviations.
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.
Managers & Agents
o A manager is a host that runs the SNMP client program while the agent is a router that
runs the SNMP server program.
o Management of the internet is achieved through simple interaction between a manager
and agent.
o The agent is used to keep the information in a database while the manager is used to
access the values in the database. For example, a router can store the appropriate variables
such as a number of packets received and forwarded while the manager can compare
these variables to determine whether the router is congested or not.
o Agents can also contribute to the management process. A server program on the agent
checks the environment, if something goes wrong, the agent sends a warning message to
the manager.
Management with SNMP has three basic ideas:
o A manager checks the agent by requesting the information that reflects the behavior of
the agent.
o A manager also forces the agent to perform a certain function by resetting values in the
agent database.
o An agent also contributes to the management process by warning the manager regarding
an unusual condition.
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.
GetNextRequest: The GetNextRequest message is sent from the manager to agent to
retrieve the value of a variable. This type of message is used to retrieve the values of the
entries in a table. If the manager does not know the indexes of the entries, then it will not
be able to retrieve the values. In such situations, GetNextRequest message is used to
define an object.
GetResponse: The GetResponse message is sent from an agent to the manager in
response to the GetRequest and GetNextRequest message. This message contains the
value of a variable requested by the manager.
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:
It consists of two kinds of subsystems: the user agents, which allow
people to read and send email, and the message transfer agents, which move the
messages from the source to the destination. We will also refer to message transfer
agents informally as mail servers.
The message transfer agents are typically system processes. They run in the
background on mail server machines and are intended to be always available.
Their job is to automatically move email through the system from the originator to
the recipient with SMTP (Simple Mail Transfer Protocol). This is the message
transfer step.
SMTP was originally specified as RFC 821 and revised to become the current
RFC 5321.
o SMTP stands for Simple Mail Transfer Protocol.
o SMTP is a set of communication guidelines that allow software to transmit an
electronic mail over the internet is called Simple Mail Transfer Protocol.
o It is a program used for sending messages to other computer users based on e-
mail addresses.
o It provides a mail exchange between users on the same or different computers,
and it also supports:
o It can send a single message to one or more recipients.
o Sending message can include text, voice, video or graphics.
o It can also send the messages on networks outside the internet.
o The main purpose of SMTP is used to set up communication rules between servers.
The servers have a way of identifying themselves and announcing what kind of
communication they are trying to perform. They also have a way of handling the
errors such as incorrect email address. For example, if the recipient address is
wrong, then receiving server reply with an error message of some kind.
Components of SMTP
o First, we will break the SMTP client and SMTP server into two components such as
user agent (UA) and mail transfer agent (MTA). The user agent (UA) prepares the
message, creates the envelope and then puts the message in the envelope. The
mail transfer agent (MTA) transfers this mail across the internet.
o SMTP allows a more complex system by adding a relaying system. Instead of just
having one MTA at sending side and one at receiving side, more MTAs can be
added, acting either as a client or server to relay the email.
o The relaying system without TCP/IP protocol can also be used to send the emails
to users, and this is achieved by the use of the mail gateway. The mail gateway is
a relay MTA that can be used to receive an email.
Working of SMTP
1. Composition of Mail: A user sends an e-mail by composing an electronic mail
message using a Mail User Agent (MUA). Mail User Agent is a program which is
used to send and receive mail. The message contains two parts: body and header.
The body is the main part of the message while the header includes information
such as the sender and recipient address. The header also includes descriptive
information such as the subject of the message. In this case, the message body is
like a letter and header is like an envelope that contains the recipient's address.
2. Submission of Mail: After composing an email, the mail client then submits the
completed e-mail to the SMTP server by using SMTP on TCP port 25.
3. Delivery of Mail: E-mail addresses contain two parts: username of the recipient
and domain name. For example, [email protected], where "vivek" is the username
of the recipient and "gmail.com" is the domain name.
If the domain name of the recipient's email address is different from the sender's
domain name, then MSA will send the mail to the Mail Transfer Agent (MTA). To
relay the email, the MTA will find the target domain. It checks the MX record from
Domain Name System to obtain the target domain. The MX record contains the
domain name and IP address of the recipient's domain. Once the record is located,
MTA connects to the exchange server to relay the message.
4. Receipt and Processing of Mail: Once the incoming message is received, the
exchange server delivers it to the incoming server (Mail Delivery Agent) which
stores the e-mail where it waits for the user to retrieve it.
5. Access and Retrieval of Mail: The stored email in MDA can be retrieved by using
MUA (Mail User Agent). MUA can be accessed by using login and password.
SMTP MESSAGE HEADER
The Post Office Protocol (POP) is an application-layer
Internet standard protocol used by local e-mail clients to retrieve e-mail
from a remote server over a TCP/IP connection.[1] POP has been
developed through several versions, with version 3 (POP3) being the
current standard.
POP supports simple download-and-delete requirements for
access to remote mailboxes (termed mail drop in the POP RFC's).[3]
Although most POP clients have an optionto leave mail on server after
download, e-mail clients using POP generally connect, retrieve all
messages, storethem on the user's PC as new messages, delete them
from the server, andthen disconnect.
POP3 is designed to delete mail on the server as soon as the user
has downloaded it. However, some implementations allow users or an
administrator to specify that mail be saved forsome period of time. POP
can be thought of as a "store-and-forward" service.
IMAP, (Internet Message Access Protocol) provide more
complete and complex remote access to typical mailbox operations.
In the late 1990s and early 2000s, fewer Internet Service Providers
(ISPs) supported IMAP due to the storagespace that was required on
the ISP's hardware. Contemporary e-mail clients supported POP,
then over time popular mail client software added IMAP support.
IMAP stands for Internet Message Access Protocol. IMAP
shares many similar features with POP3. It, too, is a protocol that an
email client can use to download email froman email server. However,
IMAP includes many more features than POP3. The IMAP protocolis
designed to let users keep their email on the server. IMAP requires more
disk space on the serverand more CPU resources than POP3, as all
emails are stored on the server. IMAP normally uses port 143. Here is
more information about IMAP.
MIME:
Multipurpose Internet Mail Extensions (MIME) is an Internet
standard that extends theformat of email to support:
Text in character sets other than ASCII
Non-text attachments: audio, video, images, application programs etc.
Message bodies with multiple parts
Header information in non-ASCII character sets
Virtually all human-written Internet email and a fairly large
proportion of automated email is transmitted via SMTP in MIME
format.
MIME is specified in six linked RFC memoranda: RFC 2045, RFC
2046, RFC 2047, RFC 4288, RFC 4289 and RFC 2049; with the
integration with SMTP email specified in detail in RFC1521 and RFC
1522.
Although MIME was designed mainly for SMTP, the content types
defined by MIME standards are also of importance outside of email,
such as in communication protocols likeHTTP for the World Wide
Web. Servers insert the MIME header at the beginning of any Web
transmission. Clients use this content type or Internet media type header
to select an appropriate "player" application for the type of data the
header indicates. Some of these players are built into the Web client or
browser (for example, almost all browsers come with GIF and JPEG
image players as well as the ability to handle HTML files);
Multipurpose Internet Mail Extensions, a specification for
formatting non-ASCII messages so that they can be sent over the
Internet. Many e-mail clients now support MIME,which enables them
to send and receive graphics, audio, and video files via the Internet mail
system. In addition, MIME supports messages in character sets other
than ASCII.
WORLD WEB
• The browser is displaying a Web page on the client machine. Each page is fetched by
sending a request to one or more servers, which respond with the contents of thepage.
• The request-response protocol for fetching pages is a simple text-based protocol that runs
over TCP, just as was the case for SMTP. It is called HTTP(HyperText Transfer
Protocol).
• http://www.cs.washington.edu/index.html
• This URL consists of three parts: the protocol (http), the DNS name of the host
• (www.cs.washington.edu), and the path name (index.html).
steps that occur when our example
link is selected:HTTP
o The browser determines the URL (by seeing what was selected).
o 2. The browser asks DNS for the IP address of the server
o www.cs.washington.edu.
o 3. DNS replies with 128.208.3.88.
o 4. The browser makes a TCP connection to 128.208.3.88 on port 80, the
o well-known port for the HTTP protocol.
o 5. It sends over an HTTP request asking for the page /index.html
o 6.The www.cs.washington.edu server sends the page as an HTTP response,
o for example, by sending the file /index.html.
o 7. If the page includes URLs that are needed for display, the browser
o fetches the other URLs using the same process. In this case, the
o URLs include multiple embedded images also fetched from
o www.cs.washington.edu, an embedded video from youtube.com, and
o a script from google-analytics.com.
o 8. The browser displays the page /index.html as it appears in Fig. 7-18.
o 9. The TCP connections are released if there are no other requests to
o the same servers for a short period.
HTTP
o HTTP stands for HyperText Transfer Protocol.
o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that
allows us to use in a hypertext environment where there are rapid jumps from one
document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another
host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to
the server and from server to the client. SMTP messages are stored and forwarded
while HTTP messages are delivered immediately.
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.
HTTP Connections
• The usual way for a browser to contact a server is to establish a TCP connection to port
80 on the server’s machine.
• In the Web, with HTTP 1.0, after the connection was established a single
• request was sent over and a single response was sent back. Then the TCP connection was
released.
• HTTP 1.1, which supports persistent connections.
• With them, it is possible to establish a TCP connection, send a request and get a response,
and then send additional requests and get additional responses. This strategy is also called
connection reuse.
• Persistent connection and the requests are pipelined. Specifically, the second and
third requests are sent in rapid succession as soon as enough of the main page has been
retrieved to identify that the images must be fetched
HTTP METHODS
HTTP RESPONSE
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.
STREAMING AUDIO AND VIDEO