Module 5
Module 5
Application Layer
Introduction
• Application layer is the top most layer in OSI (Layer 7) and TCP/IP
(Layer 5).
• This layer is for applications which are involved in communication
systems.
• Communication is provided using logical connection.
• The application layer and the end user can communicate with
software applications and protocols.
The application layer in the OSI model is the closest layer to
the end user which means that the application layer and end
user can interact directly with the software application.
Application
The application layer programs are based on client and
servers.
layer
This layer also serves as a window for the application services
to access the network and for displaying the received
information to the user. Ex: Application – Browsers, Skype
Messenger etc.
The peers are the computers which are not owned by the service
to-peer) Most of the peers reside in the homes, offices, schools, and
universities.
architecture The peers communicate with each other without passing the
information through a dedicated server, this architecture is known
as peer-to-peer architecture.
• 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 Model
• Client-Server model is a network architecture that describes how
servers interact with network devices.
• In this mode of interaction a program sends a request to another
program and awaits for a response.
• Requesting program is called client.
• Answering program is called server.
Client Server Model
Components of Client Server Model
• The main three components of Client-Server Model are:
• Client
• Server
• Networking devices.
Components of Client Server Model
• Client
• Computer that connects to and uses the resources of a remote computer or
server. Resources can be files, information, internet, processing power etc.
• Server
• Computer that provides services to the network.
• Networking devices
• Physical and wireless networking devices like hubs, switches, routers etc.
Working of Client-Server Model
Examples
• Mail Servers:
• Used for sending and receiving emails.
• File Servers
• Centralized location for the files (cloud)
• Web Servers
• Servers hosting different websites.
Advantages
• Centralized
• Security
• Performance
• scalability
Disadvantages
• Clients are prone to virus, can be uploaded into the server.
• Servers are prone to DoS attack.
Types of Client-Server Architecture
• There are different types of architecture in client-server model:
• 1-tier Architecture
• 2-tier Architecture
• 3-tier Architecture
• N-tier Architecture
1-tier Architecture
• All client or server configuration settings, UI environment, data logic is
on the same system.
• Ex: MS office, MP3 player
2-tier Architecture
• UI is stored in client machine and database is in server.
• Ex: Online ticket reservation system
3-tier Architecture
• Contains middleware, and request sent by client is processed by
middle layer and request is given to server.
N-Tier Architecture
• Also known as Multi Tier Architecture.
World Wide Web (WWW)
Web was first proposed by Tim Berners-Lee in 1989 at CERN.
The commercial Web started in the early 1990s.
The Web today is a repository of information in which the documents, called web
pages.
The linking of web pages was achieved using a concept called hypertext
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.
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.
A composite web page has one or more links to other web pages.
A variety of vendors offer commercial browsers that interpret and display a web page,
and all of them use nearly the same architecture.
Each browser usually consists of three parts: a controller, client protocols, and
interpreters.
The controller receives input from the keyboard or the mouse and uses the client
programs to access the document.
After the document has been accessed, the controller uses one of the interpreters to
display the document on the screen.
Web Client (Browser) cont..
The client protocol can be one of the protocols described later, such as HTTP or
FTP. The interpreter can be HTML, Java, or JavaScript, depending on the type of
document. Some commercial browsers include Internet Explorer, Netscape
Navigator, and Firefox.
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)
A web page, as a file, needs to have a unique identifier to distinguish it from other web
pages. we need four identifiers to define the web page.
Protocol: most of the time the protocol is HTTP (HyperText Transfer Protocol), we can also
use other protocols such as FTP (File Transfer Protocol).
Host: The host identifier can be the IP address of the server or the unique name given to the
server.
Port:The port, a 16-bit integer, is normally predefined for the client-server application.
Path: The path identifies the location and the name of the file in the underlying operating
system. The format of this identifier normally depends on the operating system.
HTTP
● HTTP stands for Hyper Text Transfer Protocol.
● 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.
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.
FTP (File Transfer Protocol)
File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for copying a file from
one host to another.
The client has three components: the user interface, the client control process, and the client data
transfer process.
The server has two components: the server control process and the server data transfer process.
FTP has two connections,
1. Control Connection
2. Data Connection
Control Connection:
The control Connection transfer a line of command or line of response at a time.
The control Connection is made between the control processes.
The control Connection remains connected during the entire interactive FTP session.
Data Connection:
The data connection uses very complex rules as data types may vary.
The Data connection is made between the data transfer processes.
The data connection opens when a command comes for transferring the files and
closes when the file is transferred.
E-Mail
Electronic Mail often abbreviated as E-mail, is a method of exchanging digital
messages, designed primarily for human use.
E-mail systems based on a store & forward model in which E-mail server systems
accept, forward, deliver and store messages on behalf of users, who only need to
connect to the e-mail infrastructure
To deliver mail, a mail handling system must use an addressing system with
unique addresses.
In the Internet, the address consists of two parts: a local part and a domain
name, separated by an @ sign
Protocol used in E-mail
What is SMTP ?
• Simple Mail Transfer Protocol (SMTP) is an Internet Standard for electronic mail (email)
transmission.
• SMTP is a TCP/IP protocol used in sending and receiving e-mail.
• Users typically use a program that uses SMTP for sending e-mail and either POP3 or IMAP
for receiving e-mail.
• SMTP communication between mail servers uses TCP port 25. Mail clients on the other
hand, often submit the outgoing emails to a mail server on port
587. A few Web email services, such as Gmail, use the unofficial TCP port 465 for SMTP.
• SMTP is an application layer protocol.
Protocol Overview
• SMTP is a connection-oriented, text-based protocol in which a mail sender
communicates with a mail receiver by issuing command strings and supplying necessary
data over a reliable ordered data stream channel, typically a Transmission Control
Protocol (TCP) connection.
• An SMTP session consists of commands originated by an SMTP client (sender) and
corresponding responses from the SMTP server (receiver) so that the session is opened,
and session parameters are exchanged.
• The sender’s, user agent prepare the message and send it to the MTA(Message Transfer
Agent). The MTA functioning is to transfer the mail across the network to the receiver’s
MTA.
Model of SMTP system
Sending Email
• Mail is send by a series of request and response messages between the
client and a server.
• The message which is send across consists of a header and the body.
• A null line is used to terminate the mail header. Everything which is after
the null line is considered as body of the message which is a sequence
of ASCII characters.
• The message body contains the actual information read by the receipt.
Receiving Email
• The user agent at the server side checks the mailboxes at a particular time of
intervals. If any information is received it informs the user about the mail.
• When user tries to read the mail it displays a list of mails with a short description
of each mail in the mailbox.
• By selecting any of the mail user can view its contents on the terminal.
SMTP Transaction Commands
• HELO / EHLO - It initiate a new transaction between client and server.
• RSET - to reset the SMTP connection to the initial state in which the sender
and recipient buffers are erased and the connection is ready to begin a new
mail transaction.
• NOOP - an empty ("no operation") message designed as a kind of ping to
check for responsiveness of the other end of the session
• QUIT - terminates the protocol session
SMTP Transaction Commands
• MAIL command, to establish the return address, also called return-path.
• RCPT command, to establish a recipient of the message.This command can be
issued multiple times, one for each recipient. These addresses are also part of the
envelope.
• DATA to signal the beginning of the message text; the content of the message, as
opposed to its envelope. It consists of a message header
and a message body separated by an empty line. DATA is actually a group of
commands, and the server replies twice:
1. once to the DATA command itself, to acknowledge that it is ready to receive the
text
2. second time after the end-of-data sequence, to either accept or reject the entire
message.
SMTP Connection
(Client) (Server)
Commands
SMTP Transport
Example
S: 220 smtp.example.com ESMTP •C: From: "Bob Example"
Postfix
C: HELO relay.example.com •<[email protected]>
S: 250 smtp.example.com, I am glad to
meet you
•C: To: Alice Example <ali
C: MAIL FROM:<[email protected]> [email protected]>
0500 C: Cc:
S: 250 Ok
C: RCPT TO:<[email protected]> [email protected]
C:
S: 250 Ok •C: Date: Tue, 15 January 2008
C: RCPT TO:<[email protected]> C: .
16:02:43 -
S: 250 Ok
C: DATA C: QUIT
S: 354 End data with •S:C:221
Subject:
Bye Test message
<CR><LF>.<CR><LF> {The server closes the connection}
• So, POP3 means "Post Office Protocol – Version 3". Since 1988, POP3
has been the active version.
Pop 3
POP3 is simple and l i m i t e d in functionality.
Need POP3 c li en t on user machine and POP3 server on the m a i l server machine.
It is a p u l l p r o t o c o l ; the c l i e n t must p u l l messages f r o m the server.
The direction o f the b u l k data ar e f r o m the server t o the client.
It is a message access agent.
POP 3
Disadvantages:
Don’t a l l o w user t o organize m a i l s on server.
Don’t a l l o w user t o p a r t i a l l y check the contents o f m a i l b e f o r e downloading.
How Does POP Work?
• Incoming messages are stored at a POP server until the user
logs in using an email client and downloads the messages to
their computer. After user downloads the message, it is
deleted from the server.
• Gmail
• Outlook Express
• Mozilla Thunderbird
• Netscape
• Internet Explorer
IMAP4
As its name implies, IMAP a l l o w s us t o access email messages wherever
we ar e .
Basically, email messages are s t o r e d on servers. Whenever we heck
inbox, o u r email c l i e n t contacts the server t o connect with
messages.
When we r e a d an email message using IMAP, we aren't a c t u a l l y
downloading o r storing i t on computer; instead, we ar e reading i t o f f o f
the server.
As a result, it's possible t o email f r o m s ev er al d i ff e r e n t devices
without missing a thing.
It as an intermediary between email client and email server.
When you sign into an email client l i k e M i c r o s o f t Outlook, it
contacts the email server using IMAP.
The headers o f a l l o f your email messages are then
displayed.
If you choose t o read a message, it is quickly downloaded so
that you can see it - emails are not downloaded unless you
need t o open them.
Advantages of imapv4
A user can check the email header p r i o r t o downloading
A user can search the contents o f the email f o r a specific string
o f characters p r i o r t o downloading
A user can p a r t i a l l y d o w n l o a d email ( h e l p f u l i f email contains
huge attachments and connection is s l o w )
A user can create, delete, o r rename mailboxes on the
m a i l server
A user can create a hierarchy o f mailboxes in a f o l d e r f o r email
storage
It a l l o w s us t o access email messages f r o m anywhere,
and f ro m many diff erent devices as we want.
Organize The user can not organize mails The user can organize the mails
in the mailbox of the mail server. on the server.
Folder The user can not create, delete The user can create, delete or
or rename mailboxes on a mail rename mailboxes on the mail
server. server.
Content A user can not search the content A user can search the content of
of mail for prior downloading. mail for specific string of
character before downloading.
Partial Download The user has to download the The user can partially download
mail for accessing it. the mail if bandwidth is limited.
Functions POP3 is simple and has limited IMAP is more powerful, more
functions. complex and has more features
over POP3.
TELNET
TELNET is an abbreviation for terminal network.
TELNET enables the establishment of a connection to a remote system in such a way that
the local terminal appears to be a terminal at the remote system.
In otherwords, it allows the user to log on to a remote computer. After logging on, user can
use the services available on the remote computer and transfer the results back to the
local computer.
Logging:
To access the system, user logs into the system with user-id. The system also includes
password checking to prevent an unauthorized user accessing the resources.
local logging
The user sends the keystrokes to the terminal driver where the local operating system accepts
the characters but does not interpret them.
The characters are sent to the TELNET client, which transforms the characters into a universal
character set called Network Virtual Terminal (NVT) characters (discussed below) and delivers
them to the local TCP/IP stack.
The commands or text, in NVT form, travel through the Internet and arrive at the
TCP/IP stack at the remote machine.
Here the characters are delivered to the operating system and passed to the TELNET
server, which changes the characters to the corresponding characters understandable
by the remote computer.
However, the characters cannot be passed directly to the operating system because
the remote operating system is not designed to receive characters from a TELNET
server; it is designed to receive characters from a terminal driver. The solution is to
add a piece of software called a pseudoterminal driver, which pretends that the
characters are coming from a terminal.
Network Virtual Terminal (NVT)
The client TELNET translates characters (data or commands) that come from the local terminal
into NVT form and delivers them to the network.
The server TELNET, on the other hand, translates data and commands from NVT form into the
form acceptable by the remote computer.
NVT uses two sets of characters, one for data and one for control. Both are 8-bit
bytes as shown in Figure.
For data, NVT normally uses what is called NVT ASCII. This is an 8-bit character
set in which the seven lowest order bits are the same as US ASCII and the
highest order bit is 0.
• DNS Overview:-
• Uses:-
• Domain Name:-
• Name Server:-
• Types of DNS:-
1)Generic Domain:
2)Country Domain:
3)Inverse Domain:
DNS Overview
• On the Internet, the Domain Name System (DNS) associates various sorts
of information with domain names
• Such as the list of mail exchange servers that accept email for a given
domain.
• By providing a worldwide keyword-based redirection
service, the Domain Name System is an essential component
of the modern Internet
DNS:-
• It stands for domain name system.
• The naming scheme used in the internet is called DNS.
• To identify an entity the internet uses the IP address.
• Which identifies connection of computer to internet.
• But user to use names of numeric address because to remember numeric
address are difficult compare to names.
• We need a system that can map a name to an address or an address to name.
• So, the naming scheme used in the internet is called the DNS.
• In DNS names are defined in an inverted tree structure with the root at the top.
• Fig:- DNS
root
org
net edu com uk
cs ece
cmcl
Domain name
Name Server:
• Distribute the information among computer called
DNS server.
• DNS allows domain to be divided future into smaller
domains.
• Each server can responsible for domain.
ROOT SERVER
ROOT SERVER
fhda
atc
chal Chal.atc.fhda.edu
• Country Domain:- It uses two character country abbreviation in
place of three character abbreviation
in us zw ae
co
cup
anza Anza.cup.ca.us
Inverse Domain:-
• SMI defines the general rules for naming objects, defining object types (including
range and length), and showing how to encode objects and values.
• SMI does not define the number of objects an entity should manage or name the
objects to be managed or define the association between the objects and their
values.
Role of MIB
MIB creates a collection of named objects, their types, and their
relationships to each other in an entity to be managed.