CN UNIT V
CN UNIT V
APPLICATION-LAYER PARADIGMS
• Two paradigms have been developed for Application Layer
1. Traditional Paradigm :Client-Server
2. New Paradigm : Peer-to-Peer
Client-Server Paradigm
Peer-to-Peer(P2P) Paradigm
WWW (WORLD WIDE WEB)
• WWW is a distributed client/server service, in which a client (Browsers
such as IE, Firefox, etc.) can access services at a server (Web server
such as IIS(Internet Information Services), Apache).
• The service provided is distributed over many locations called sites.
• A new protocol for the Internet and a system of document access to use
it was proposed and named as WWW.
• This system allows document search and retrieval from any part of the
Internet.
• The units of information on the web can be referred to as pages,
documents or resources.
• A document can contain text, images, sound and video, together called
Hypermedia.
• Web is a vast collection of data, information, software and protocols ,
spread across the world in web servers, which are accessed by client
machines by browsers through theInternet.
COMPONENTS OF THE WEB
Structural Components
• WebClients/Browsers
• WebServers
• WebCaches
• Internet
Semantic Components
• Hyper Text Transfer Protocol(HTTP)
• Hyper Text Markup Language(HTML)
• eXtensible Markup Language(XML)
• Uniform Resource Identifier(URI)
WEB CLIENTS (BROWSERS)
WEB DOCUMENTS
Static Documents
• Static documents are fixed-content documents that are created and stored in a
server.
• The client can get a copy of the document only.
• Static documents are prepared using one of several languages:
1. Hyper Text Markup Language(HTML)
2. Extensible Markup Language(XML)
3. Extensible Style Language(XSL)
4. Extensible Hypertext Markup Language(XHTML).
Dynamic Documents
• A dynamic document is created by a web server whenever a browser
requests the document.
• When a request arrives, the web server runs an application program or a
script that creates the dynamic document.
• The server returns the result of the program or script as a response to the
browser that requested the document.
• Dynamic documents can be retrieved using one of several scripting
languages:
1. Common Gateway Interface(CGI)
2. Java Server Pages(JSP)
3. Active Server Pages(ASP)
4. Cold Fusion
Active Documents
• For many applications, we need a program or a script to be run at the
client site. These are called active documents.
• For example, suppose we want to run a program that creates animated
graphics on the screen or a program that interacts with the user.
• The program definitely needs to be run at the client site where the
animation or interaction takes place.
• When a browser requests an active document, the server sends a copy of
the document or a script.
• The document is then run at the client (browser) site.
• Active documents can be created using one of several languages:
1. Java Applet – A program written in Java on the server. It is
compiled and ready to be run. The document is in byte code format.
2. Java Script - Download and run the script at the client site.
HTTP (HYPERTEXT TRANSFER PROTOCOL)
• The Hyper Text Transfer Protocol (HTTP) is used to define how the client-
server programs can be written to retrieve web pages from the Web.
• It is a protocol used to access the data on the World Wide Web(WWW).
• The HTTP protocol can be used to transfer the data in the form of plain
text, hypertext, audio, video, and so on.
• HTTP is a stateless request/response protocol that governs client/server
communication.
• An HTTP client sends a request; an HTTP server returns a response.
• The server uses the port number 80; the client uses a temporary port
number.
• HTTP uses the services of TCP , a connection-oriented and reliable
protocol.
• HTTP is a text-oriented protocol. It contains embedded URL known
aslinks.
Features of HTTP
• Connectionless protocol
• Media independent
• Stateless
HTTP REQUEST AND RESPONSE MESSAGES
• The HTTP protocol defines the format of the request and response
messages.
1. Request Message: The request message is sent by the client that
consists of a request line, headers, and sometimes abody.
2. 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 REQUEST MESSAGE
1. Authentication cookies
2. Tracking cookies
3. Session cookie
4. Persistent cookie
HTTP CACHING
• HTTP Caching enables the client to retrieve document faster and reduces
load on the server.
• HTTP Caching is implemented at Proxy server, ISP router and Browser.
• Server sets expiration date (Expires header) for each page, beyond which
it is not cached.
• HTTP Cache document is returned to client only if it is an updated copy
by checking against If-Modified-Since header.
• If cache document is out-of-date, then request is forwarded to the server
and response is cached along the way.
• A web page will not be cached if no-cache directive is specified.
HTTP SECURITY
• HTTP does not provide security.
• However HTTP can be run over the Secure Socket Layer(SSL).
• In this case, HTTP is referred to as HTTPS.
• HTTPS provides confidentiality, client and server authentication,
and data integrity.
FTP (FILE TRANSFER PROTOCOL)
• FTP stands for File transfer protocol.
• FTP is a standard internet protocol provided by TCP/IP used for
transmitting the files from one host to another.
• It is mainly used for transferring the web page files from their creator to
the computer that acts as a server for other computers on the internet.
• It is also used for downloading the files to computer from other servers.
• Although we can transfer files using HTTP, FTP is a better choice to
transfer large files or to transfer files using different formats.
FTP OBJECTIVES
• It provides the sharing of files.
• It is used to encourage the use of remote computers.
• It transfers the data more reliably and efficiently.
FTP MECHANISM
The FTP client has three components:
• user interface, control process, and data transfer process.
The server has two components:
• server control process and server data transfer process.
FTP CONNECTIONS
• There are two types of connections in FTP -
– Control Connection and Data Connection.
• The two connections in FTP have different lifetimes.
• The control connection remains connected during the entire interactive FTP
session.
• The data connection is opened and then closed for each file transfer
activity. When a user starts an FTP session, the control connection opens.
• FTP uses two well-known TCP ports:
– Port 21 is used for the control connection
– Port 20 is used for the data connection.
EMAIL (SMTP, MIME, IMAP, POP)
• One of the most popular Internet services is electronic mail (E-mail).
• Email is one of the oldest network applications.
• The three main components of an Email are
1. User Agent (UA)
2. Messsage Transfer Agent (MTA) – SMTP
3. Messsage Access Agent (MAA) – IMAP(Internet Message Access
Protocol) , POP3(Post Office Protocol)
• When the sender and the receiver of an e-mail are on the same system, we
need only two User Agents and no Message Transfer Agent.
• When the sender and the receiver of an e-mail are on different system, we
need two UA, two pairs of MTA (client and server), and two MAA (client
and server).
WORKING OF EMAIL
SIMPLE MAIL TRANSFER PROTOCOL (SMTP)
• SMTP is the standard protocol for transferring mail between hosts in the
TCP/IP protocol suite.
• SMTP is not concerned with the format or content of messages themselves.
– SMTP uses information written on the envelope of the mail (message
header), but does not look at the contents (message body) of the
envelope.
• SMTP clients and servers have two main components
O User Agents(UA) – Prepares the message, encloses it in an envelope.
O Mail Transfer Agent (MTA) – Transfers the mail across the internet
SMTP MAIL FLOW
SMTP COMMANDS AND RESPONSES
• The operation of SMTP consists of a series of commands and responses
exchanged between the SMTP sender and SMTP receiver.
• The initiative is with the SMTP sender, who establishes the TCP connection.
• Once the connection is established, the SMTP sender sends commands over the
connection to the receiver.
• The command is from an MTA client to an MTA server; the response is from an
MTA server to the MTA client.
SMTP OPERATIONS
Remote Logging
SSH (SECURE SHELL)
• Secure Shell (SSH) is a secure application program that can be used today for
several purposes such as remote logging and file transfer, it was originally
designed to replace TELNET.
• There are two versions of SSH: SSH-1 and SSH-2, which are totally
incompatible. The first version, SSH-1, is now deprecated because of security
flaws in it.
SSH COMPONENTS
SSH is an application-layer protocol with three components:
1.SSH Transport-Layer Protocol (SSH-TRANS)
2.SSH Authentication Protocol (SSH-AUTH)
3. SSH Connection Protocol (SSH-CONN)
SSH APPLICATIONS
• SSH for Remote Logging
• SSH for File Transfer
• Port Forwarding
WORKING OF DNS
• The following six steps shows the working of a DNS. It maps the host name to
an IP address:
• The user passes the host name to the file transfer client.
• The file transfer client passes the host name to the DNS client.
• Each computer, after being booted, knows the address of one DNS server. The
DNS client sends a message to a DNS server with a query that gives the file
transfer server name using the known IP address of the DNS server.
• The DNS server responds with the IP address of the desired file transfer server.
• The DNS server passes the IP address to the file transfer client.
• The file transfer client now uses the received IP address to access the file
transfer server.
NAME SPACE
• To be unambiguous, the names assigned to machines must be carefully
selected from a name space with complete control over the binding between
the names and IP address.
• The names must be unique because the addresses are unique.
• A name space that maps each address to a unique name can be organized in
two ways: flat (or) hierarchical.
Generic Domains
Country Domains
• The country domains section follows the same format as the generic domains
but uses two characters for country abbreviations
• E.g.; in for India, us for United States etc) in place of the three character
organizational abbreviation at the first level.
Inverse Domains
➢ Mapping an address to a name is called Inverse domain.
➢ The client can send an IP address to a server to be mapped to a domain
name and it is called PTR(Pointer) query.
➢ To answer queries of this kind, DNS uses the inverse domain
SNMP - SIMPLE NETWORK MANAGEMENT PROTOCOL
• The Simple Network Management Protocol (SNMP) is a framework for
managing devices in an internet using the TCP/IP protocol suite.
• SNMP is an application layer protocol that monitors and manages routers,
distributed over a network.
• It provides a set of operations for monitoring and managing the internet.
• SNMP uses services of UDP on two well-known ports: 161 (Agent) and 162
(manager).
• SNMP uses the concept of manager and agent.
SNMP MANAGER
• A manager is a host that runs the SNMP client program
• The manager has access to the values in the database kept by the agent.
• A manager checks the agent by requesting the information that reflects the
behavior of the agent.
• A manager also forces the agent to perform a certain function by resetting
values in the agent database.
• For example, a router can store in appropriate variables the number of packets
received and forwarded.
• The manager can fetch and compare the values of these two variables to see if
the router is congested or not.
SNMP AGENT
• The agent is a router that runs the SNMP server program.
• 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.
• 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.