0% found this document useful (0 votes)
6 views62 pages

Understanding the Application Layer

The document provides an overview of the Application Layer in the TCP/IP protocol suite, detailing its role in facilitating communication between users and services. It discusses various application layer protocols such as HTTP, FTP, SMTP, and POP, explaining their functionalities and characteristics. Additionally, it covers paradigms like Client-Server and Peer-to-Peer, as well as the importance of DNS in mapping domain names to IP addresses.

Uploaded by

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

Understanding the Application Layer

The document provides an overview of the Application Layer in the TCP/IP protocol suite, detailing its role in facilitating communication between users and services. It discusses various application layer protocols such as HTTP, FTP, SMTP, and POP, explaining their functionalities and characteristics. Additionally, it covers paradigms like Client-Server and Peer-to-Peer, as well as the importance of DNS in mapping domain names to IP addresses.

Uploaded by

23se02cs079
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 7

Application Layer
By:
Maulika
Patel
Application Layer
• The whole Internet, hardware and software,
was designed and developed to provide
services at the application layer.
• The fifth layer of the TCP/IP protocol suite is
where these services are provided for
Internet users.
• The other four layers are there to make these
services possible.
Application Layer
• The application layer provides services to the user.
• Communication is provided using a logical connection,
which means that the two application layers assume
that there is an imaginary direct connection through
which they can send and receive messages.
Example:
• Scientist working in a research company, Sky Research,
needs to order a book related to her research from an
online bookseller, Scientific Books. Logical connection
takes place between the application layer of a computer
at Sky Research and the application layer of a server at
Scientific Books.
Application Layer
• Two important concepts:
– Application Layer:
– The First step for getting data on to the network.
– Application Software:
– The programs used to communicate over the
network.
• For example:
– When displaying a web page:
– The Application Layer uses the HTTP Protocol.
– The Application Software is your browser.
Application-Layer Paradigms
• Traditional Paradigm: Client-Server
Client/Server Model
• Several traditional services uses this
paradigm
• World Wide Web (WWW) and its vehicle
HyperText Transfer Protocol (HTTP), file
transfer protocol (FTP), secure shell (SSH), e-
mail, and so on.
• New Paradigm: Peer-to-Peer
• There are some new applications, such as
BitTorrent, Skype, IPTV, and Internet
telephony, that use this paradigm.
Mixed Paradigm
• An application may choose to use a mixture
of the two paradigms by combining the
advantages of both.
• For example, a light-load client-server
communication can be used to find the
address of the peer that can offer a service.
• When the address of the peer is found, the
actual service can be received from the peer
by using the peer-to peer paradigm.
CLIENT-SERVER PROGRAMMING

• Socket Programming using TCP and UDP.


(Discussed in LAB session – also part of
syllabus).
Application Layer Protocols
Application Layer Protocols
• DNS – Domain Name to IP
• FTP – Create HTML web pages on local host
and move on the server
– Client will take service from web service provider
like GoDaddy, Amazon Web service etc.
• HTTP – To get the web pages
• SMTP – for email services
• POP – retrieving emails
DNS
• Easy to remember name rather than number
• Moving from one service provider(GoDaddy) to
another service provider(amazon), IP address
going to be changed.
• Converting Domain Name to IP address
• For example, suppose the FTP site at EduSoft
had an IP address of [Link], most
people would reach this site by specifying
[Link]. Therefore, the domain name is
more reliable than IP address.
Purpose of DNS
DNS
• DNS is a TCP/IP protocol used on different
platforms. The domain name space is divided
into three different sections:
– generic domains
– country domains
– inverse domain.
A portion of the Internet domain name space.
Various Types of Domains
Generic Domains
• It defines the registered hosts according to their
generic behavior.
• It uses three-character labels, and these labels
describe the organization type.
.com, .edu, .gov, .mil, .org, .net
com Commercial Organizations
edu Educational institutions
gov Government institutions
mil Military groups
org Nonprofit Organizations
net Network Support centers
• Generic Domains
• Each node in a tree defines the domain name, which
is an index to the DNS database.
• Country Domains - .in, .us, .uk
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 Domains – Given the domain name,
find the IP address(nslookup command)
• Different IP address for Google for
nslookup [Link]
• 3 copies of data on 3 servers like Gmail data
on 3 different servers.
• DNS able to do Load Balancing
• No delay for mapping
Hierarchy of name servers
Domain names and labels
Organization of Data
• DNS servers are Distributed Database
• Data stored on DNS server is known as DNS
Record
• [Link] = Domain Name + IP address +
Validity
• DNS Record are organized in tree stricture
• Fetch DNS Record?
• Root DNS Server→ .com DNS Server →
[Link]
Organization of Data
• [Link]
– [Link]
– [Link]
• 13 root servers out of the world.
• Country uses nearest DNS server. India goes to
Tokyo
• Every ISP provides local DNS cache which stores
common well known DNS entries(google, yahoo)
• No entry in local DNS then goto root DNS
• DNS overhead
– DNS resolving requires time
• Every DNS record in authorative servers has
TTL field
• If change the location of servers than need to
update the entry in server database
Resolution
• Mapping a name to an address is called
name-address resolution.
• DNS is designed as a client-server application.
A host that needs to map an address to a
name or a name to an address calls a DNS
client called a resolver.
• A resolution can be either recursive or
iterative.
• Host want to communicate
[Link]
• Two ways:
• Iterative way:
– Host contact to local DNS cache.
– If no entry in local DNS then goto root DNS
– Goto top-level DNS server .in
– Goto authorative server
Iterative resolution
Recursive resolution
Important Notes about DNS
• DNS uses UDP (port 53) at the transport
layer.
• DNS is a connection-less protocol.
• DNS is non-persistent.
• DNS is a state-less protocol.
• Mapping an IP Address onto a domain name
is referred to as Inverse domain.
WORLD WIDE WEB AND HTTP
• Web pages, are distributed all over the world
and related documents are linked together.
• The linking of web pages was achieved using a
concept called hypertext, which was introduced
many years before the advent of the Internet.
• Today, the term hypertext, coined to mean
linked text documents, has been changed to
hypermedia, to show that a web page can be a
text document, an image, an audio file, or a
video file.
Architecture
• The WWW today is a distributed client-server service, in
which a client using a browser can access a service using a
server.
• However, the service provided is distributed over many
locations called sites. Each site holds one or more web
pages.
• Each web page, however, can contain some links to other
web pages in the same or other sites. In other words, a
web page can be simple or composite.
• A simple web page has no links to other web pages; a
composite web page has one or more links to other web
pages.
• Each web page is a file with a name and address.
Web Client (Browser)
• Each browser usually consists of three parts: a
controller, client protocols, and interpreters.
Web Server
• The web page is stored at the server. Each time a
request arrives, the corresponding document is sent
to the client.
• To improve efficiency, servers normally store
requested files in a cache in memory; memory is
faster to access than a disk.
• A server can also become more efficient through
multithreading or multiprocessing.
• In this case, a server can answer more than one
request at a time. Some popular web servers include
Apache and Microsoft Internet Information Server
Uniform Resource Locator (URL)
• We need four identifiers to define the web
page:
1. Protocol. The first identifier is the
abbreviation for the client-server program
that we need in order to access the web
page. Although most of the time the
protocol is HTTP (HyperText Transfer
Protocol), we can also use other protocols
such as FTP (File Transfer Protocol).
[Link]. The host identifier can be the IP address of
the server or the unique name given to the server.
The name is normally the domain name that
uniquely defines the host, such as [Link].
[Link]. The port, a 16-bit integer, is normally
predefined for the client-server application.
[Link]. The path identifies the location and the
name of the file in the underlying operating
system.
Example
• The URL [Link]
defines the web page related to CE branch.
• The string [Link] is the name of the
computer in the PPSU campus. (the three
letters www are part of the host name and
are added to the commercial host).
• The path is soe/ce/, which defines CE’s web
page under the directory soe.
Web Documents
• The documents in the WWW can be grouped
into three broad categories: static, dynamic, and
active.
• Static documents are fixed-content documents
that are created and stored in a server.
• Static documents are prepared using one of
several languages: HyperText Markup Language
(HTML), Extensible Markup Language (XML),
Extensible Style Language (XSL), and 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.
• PHP, Java Server Pages (JSP),which uses the Java
language for scripting, or Active Server Pages
(ASP) are used to create dynamic documents.
• 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.
• One way to create an active document is to use Java
applets, a program written in Java on the server. It is
compiled and ready to be run.
• The document is in bytecode (binary) format. Another
way is to use JavaScripts but download and run the
script at the client site.
HTTP
• HTTP is used to get “web-pages”
• HTTP runs on port no. 80
• HTTP doesn’t provide reliability. HTTP uses TCP
at transport layer for reliability.
• HTTP is “in band” protocol both data and
comments go in same connection.
• HTTP is “stateless” protocol. HTTP does not
maintain information about users.
• HTTP 1.0 – Non-persistence connection
• HTTP 1.1 – persistence connection
Nonpersistent Connections
• In a nonpersistent connection, one TCP connection is made for
each request/response.
• The following lists the steps in this strategy:
1. The client opens a TCP connection and sends a request.
2. The server sends the response and closes the connection.
3. The client reads the data until it encounters an end-of-file marker;
it then closes the connection.
• In this strategy, if a file contains links to N different pictures in
different files (all located on the same server), the connection
must be opened and closed N + 1 times.
• The nonpersistent strategy imposes high overhead on the server
because the server needs N + 1 different buffers each time a
connection is opened.
Persistent Connections
• HTTP version 1.1 specifies a persistent
connection by default. In a persistent
connection,the server leaves the connection
open for more requests after sending a
response.
• The server can close the connection at the
request of a client or if a time-out has been
reached.
Methods used in HTTP
Important Notes about HTTP

• HTTP uses TCP at the transport layer.


• HTTP uses port number 80.
• HTTP 1.0 is non-persistent and HTTP 1.1 is
persistent.
• HTTP is an in-band protocol.
• HTTP is a stateless protocol.
FTP
• File Transfer Protocol
• Tectia, Filezilla
• To use your friend’s connection
• File Client + File Server
• File Client will provide IP address and port number.
• Control Connection – persistence – port 21
• Data Connection – non-persistence – port 20
• “Out of Band” – data and comments go in different
connection
• Doesn’t provide reliability. Use TCP for reliability
• FTP is “stateful”
FTP
FTP
• Emails can’t be sent using FTP.
– FTP requires the connection establishment
between the client and server before transferring
the [Link], both have to be online at the same
time.
• FTP can transfer one file at a time.
• FTP is a stateful protocol.
– The client establishes control connection for the
duration of an FTP [Link] typically spans
multiple data transfers.
SMTP and POP
• Simple Mail Transfer Protocol
• Why not to use FTP?
• While transferring file using FTP, both client
and server should be online.
• Transferring using SMTP, both should not be
online.
Model of SMTP system
SMTP
• SMTP is a push protocol and is used to send the mail
whereas POP (post office protocol) are used to
retrieve those mails at the receiver’s side.
• 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 always on listening mode. As soon
as it listens for a TCP connection from any client, the
SMTP process initiates a connection on that port (25).
After successfully establishing the TCP connection the
client process sends the mail instantly.
SMTP
• A 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.
• The client SMTP is the one which initiates the session
let us call it as the client- SMTP and the server SMTP
is the one which responds to the session request and
let us call it as receiver-SMTP. The client- SMTP will
start the session and the receiver-SMTP will respond
to the request.
Characteristics of SMTP
• SMTP is a push protocol.
• SMTP uses TCP at the transport layer.
• SMTP uses port number 25.
• SMTP uses persistent TCP connections, so it
can send multiple emails at once.
• SMTP is a connection oriented protocol.
• SMTP is an in-band protocol.
• SMTP is a stateless protocol.
Important Points
• SMTP is a pure text based protocol.
• MIME(Multipurpose Internet Email
Extension) extends the limited capabilities of
email by enabling the users to send and
receive graphics, audio files, video files etc in
the message.
• SMTP is a stateless protocol.
• We can not use SMTP at the receiver’s side.
Important Points
• Sender and receiver can not run SMTP
between their machines.
POP
• POP is short for Post Office Protocol.
• It is an application layer protocol.
• It is a message access protocol.
• It enables the clients to receive or download
the emails from their remote mail server.
• POP version 3 (POP3) is the most popularly
used version.
Characteristics of POP
• POP is a pull protocol.
• POP uses TCP at the transport layer.
• POP uses port number 110.
• POP uses persistent TCP connections.
• POP is a connection oriented protocol.
• POP is an in-band protocol.
• POP is a stateful protocol until the mail is
downloaded as well as stateless across sessions.
SMTP vs. POP
Comparison of Application Layer Protocols
THANK YOU

You might also like