You are on page 1of 35

Application Layer

Prepared by

Hussein Saeed Ali Hashem

Supervised by

Dr. Mohammed Najm

October 2019
Application Layer

•The application layer enables the user, whether


human or software, to access the network.

•It provides user interfaces and support for services


such as electronic mail, file access and transfer,
access to system resources, surfing the world wide
web, and network management.

The application layer is responsible for providing


services to the user.
• Application Layer: Provides the interface between
the applications on either end of the network.
The application layer, Layer 7, is the top layer of
.both the OSI and TCP/IP models
TCP/IP Application Layer Protocols
■ Domain Name System (DNS) is used to translate a domain
name into an IP address
Hypertext Transfer Protocol (HTTP) is used to transfer files ■
.that make up the web pages of the World Wide Web
Simple Mail Transfer Protocol (SMTP) is used for the transfer of ■

.mail message and attachments


Telnet, a terminal emulation protocol, is used to provide remote ■
.access to servers and networking devices
File Transfer Protocol (FTP) : allows the download/upload of ■
.files between a client/server
Dynamic Host Configuration Protocol (DHCP) : assigns IP ■
.addresses, subnet masks, default gateways, DNS servers
Application Layer Protocols
Domain Name System (DNS): TCP/UDP port 53 ■
HTTP: TCP port 80 ■
Simple Mail Transfer Protocol (SMTP): TCP port 25 ■
Post Office Protocol (POP): UDP port 110 ■
Telnet: TCP port 23 ■
DHCP: UDP port 67 ■
FTP: TCP ports 20 and 21 ■
DNS Services and Protocol
DNS : Matches domain names with IP addresses
Domain Name System (DNS)

•The names must be unique because the addresses are unique


(name space).
•A name space that maps each address to a unique name can
be organized in two ways: flat or hierarchical.
•In a flat name space, a name is assigned to an address. A name
in this space is a sequence of characters without structure.
•In a hierarchical name space, each name is made of several
parts.
DNS Hierarchy
DOMAIN NAME SPACE

To have a hierarchical name space, a domain name space was


designed. In this design the names are defined in an inverted-
tree structure with the root at the top. The tree can have only
128 levels: level 0 (root) to level 127 .
Label

Each node in the tree has a label, which is a string with a maximum
of 63 characters.The root label is a null string (empty string). DNS
requires that children of a node (nodes that branch from the same
node) have different labels, which guarantees the uniqueness of
the domain names.

Domain Name

Each node in the tree has a domain name. A full domain name is a
sequence of labels separated by dots (.). The domain names are
always read from the node up to the root.The last label is the label
of the root (null). This means that a full domain name always ends
in a null label, which means the last character is a dot because the
null string is nothing.
Domain names and labels
•If a label is terminated by a null string, it is called a
fully qualified domain name
(FQDN).
•If a label is not terminated by a null string, it is
called a partially qualified domain name (PQDN).
?What are primary and secondary DNS servers
A server administrator has a choice of whether to designate a
DNS server as a primary or a secondary server (also known as a
slave). In some cases, a server can be primary for one zone and also
secondary for another zone.
A primary server hosts the controlling zone file, which contains all
the authoritative information for a domain (This means that it is
trusted source for important information, such as the IP address of
the domain).Primary servers get this information directly from local
files.
 A Secondary servers contain read-only copies of the zone file,
and they get their info from a primary server in a communication
known as a zone transfer. Each zone can only have one primary DNS
server, but it can have any number of secondary DNS servers.
Changes to a zone’s DNS records cannot be made on a secondary
server, but in some cases a secondary server can pass along change
requests to a primary server.
Iterative Resolution

If the client does not ask for a recursive answer, the mapping can
be done iteratively. If the server is an authority for the name, it
sends the answer. If it is not, it returns (to the client) the IP address
of the server that it thinks can resolve the query. The client is
responsible for repeating the query to this second server. If the
newly addressed server can resolve the problem, it answers the
query with the IP address; otherwise, it returns the IP address of a
new server to the client. Now the client must repeat the query to the
third server. This process is called iterative resolution because the
client repeats the same query to multiple servers.
In next figure the client queries four servers before it gets an
answer from the ques10.com server.
WWW Service and HTTP

•The WWW today is a distributed client-server service, in


which a client using a browser can access a service using a
server.
•The service provided is distributed over many locations
called sites.
•Each site holds one or more documents, referred to as
Web pages.
•Each Web page, contain some links to other Web pages in
the same or other sites. In other words, a Web page can be
simple or composite
Assume we need to retrieve a Web page that contains the
biography of a famous character with some pictures, which
are embedded in the page itself. Since the pictures are not
stored as separate files, the whole document is a simple
Web page. It can be retrieved using one single request/
response transaction.

1 Request

Response 2
1 Request 1

Response 1 2

3 Request 2

Response 2 4

5 Request 3

Response 3 6
Now assume we need to retrieve a scientific document
that contains one reference to another text file and one
reference to a large image.
The main document and the image are stored in two
separate files in the same site (file A and file B); the
referenced text file is stored in another site (file C).
Since we are dealing with three different files, we need
three transactions if we want to see the whole
document.
The first transaction (request/response) retrieves a copy
of the main document (file A), which has a reference
(pointer) to the second and the third files.
Web Documents

The documents in the WWW can be grouped


into three broad categories: static, dynamic, and
active. The category is based on the time the
contents of the document are determined.
Uniform Resource Locator (URL)
The address of every resource or file on the internet has a Uniform
Resource Locator, including an address of a web page, audio stream or
other internet resources.
URL’s consists of protocol of the resources, domain name for the
resource and address of the file.
The first part of the address is called a protocol identifier and it
indicates what protocol to use and the second part is called a resource
name and it specifies the IP address or the domain name where the
resource is located.
HyperText Transfer Protocol (HTTP)
The HTTP is the Web’s application-layer protocol for transferring various
forms of data between server and client like plaintext, hypertext, image,
videos and sounds.

HOW HTTP WORKS?


• HTTP is implemented in two programs: a client program and a server
program, executing on different end systems, talk to each other by
exchanging HTTP messages.
• The HTTP client first initiates a TCP connection with the server. Once
the connection is established, the browser and the server processes access
TCP through their socket interfaces.
Dynamic Host Configuration Protocol (DHCP)
•A protocol that automatically provides an IP host with its IP
address and other related configuration information ( subnet
mask, default gateway, DNS etc. )
•Not permanently assigned – only leased for a specific
period of time (usually 24 hours – 7 days)
•If the host logs off or the power is lost, the IP address
they were using is returned to the pool to be re-
assigned to another host when needed.
•Runs over UDP.
Utilizing ports:
•67 – connection to server
•68 – connections to client.
•Uses client-server model.
E-mail services and SMTP/POP protocols

To explain the architecture of e-mail, we


give four scenarios. We begin with the
simplest situation and add complexity as
we proceed. The fourth scenario is the
most common in the exchange of e-mail.

The first component of an electronic mail


system is the user agent (UA).
First scenario

When the sender and the receiver of an e-mail are


on the same mail server,we need only two user
agents.

1
Second scenario

When the sender and the receiver of an e-mail are on


different mail servers,we need two UAs and a pair of
MTAs (client and server).

1 5

3 4
2
Third scenario
When the sender is connected to the mail server via a
LAN or a WAN, we need two UAs and two pairs of MTAs
(client and server).

3
7

5
4 6
Fourth scenario
When both sender and receiver are connected to the mail
server via a LAN or a WAN, we need two UAs, two pairs
of MTAs (client and server), and a pair of MAAs (client
and server). This is the most common situation today.

1 9

2
8

5
4 6
What is SMTP ?
Smtp used to transfer emails over the
internet ( Sending Emails)
SMTP SMTP

1 5
3
2 4
File Transfer Protocol
(FTP)
File Transfer Protocol (FTP) :provided by TCP/IP for
copying a file from one host to another.
FTP uses two well-known TCP ports :
1. Port 21 is used for the control connection.
2. port 20 is used for the data connection.
Telnet
• TELNET is a client/server application that allows a
user to log on to a remote machine, giving the user
access to the remote system.
•client/server application program: TELNET. TELNET is
an abbreviation for TErminaL NETwork.
•TELNET uses the network virtual terminal (NVT)
system to encode characters on the local system. On
the server machine, NVT decodes the characters to a
form acceptable to the remote machine.
• Can be run from the command prompt on a PC.
•TELNET requires a logging name and password.
Thanks for Listening

You might also like