APlication Layer

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 50

Business Data Communications

and Networking
8th Edition
Jerry Fitzgerald and Alan Dennis

John Wiley & Sons, Inc

Prof. M. Ulema
Manhattan College
Computer Information Systems
Copyright 2005 John Wiley & Sons, Inc 2-1
Chapter 2

Application Layer

Copyright 2005 John Wiley & Sons, Inc 2-2


Outline
• Application Architectures
– Host-Based, Client-Based, and Client-Server
Architectures, Choosing Architectures
• World Wide Web
– How the Web Works, Inside an HTTP Request & HTTP
Response
• Electronic Mail
– How E-Mail Works, Inside an SMTP Packet
– Listserv, Attachments in MIME
• Other Applications
– Ftp, Telnet, Instant Messaging, Videoconferencing

Copyright 2005 John Wiley & Sons, Inc 2-3


Application Layer - Introduction
Applications Application Layer
(e.g., email, web,
word processing)
Transport Layer
Network Layer
• Functions of Applications
– Data storage
– Storing of data generated by programs (e.g., files, records)
– Data access logic
– Processing required to access stored data (e.g., SQL)
– Application logic
– Business logic
– Presentation logic
– Presentation of info to user and acceptance of user commands
Copyright 2005 John Wiley & Sons, Inc 2-4
Application Architectures
• Determined by how functions of
application programs are spread among
clients and servers
– Host-based Architectures
• Server performs almost all functions
– Client-based architectures
• Client performs most functions
– Client-server architectures
• Functions shared between client and server

Copyright 2005 John Wiley & Sons, Inc 2-5


Host-Based Architectures

or a PC running a
terminal emulation
program

– captures key strokes then


sends them to the mainframe
– displays information
according to the server’s
instructions

Copyright 2005 John Wiley & Sons, Inc 2-6


Problems with Host-based Arch.
• Host becoming a bottleneck
– All processing done by the host, which can
severely limit network performance
• Upgrades typically expensive and “lumpy”
– Available upgrades require big jumps in
processing and memory  $$$
– Network demand grows more incrementally, so
this often means a poor fit (too much or too
little) between host performance and network
demand.

Copyright 2005 John Wiley & Sons, Inc 2-7


Client-Based Architectures

Example: Using a word


processing on a PC and
storing data (file) on a server

Was popular in 1980s with the widespread


use of PCs, LANs, and programs such as
spreadsheets and word processors
Copyright 2005 John Wiley & Sons, Inc 2-8
Problems with Client-Based Arch.
• Data MUST travel back and forth between
server and client
– Example: when the client program is making a
database query, the ENTIRE database must
travel to the client before the query can be
processed
– Result in poor network performance

Copyright 2005 John Wiley & Sons, Inc 2-9


Client-Server Architectures
Used by most networks today
Server
Client (PC, mini,
(PC) mainframe)

Example: Using a Web


browser to get pages from

Data Access logic


Presentation logic Data Storage
Application logic Application logic
may reside on the client, server
or be split up between the two
Copyright 2005 John Wiley & Sons, Inc 2 - 10
Client-Server Architectures
• Advantages
– More efficient because of distributed
processing
– Allow hardware and software from different
vendors to be used together
• Disadvantages
– Difficulty in getting software from different
vendors to work together smoothly
– May require Middleware, a third
category of software

Copyright 2005 John Wiley & Sons, Inc 2 - 11


Middleware
client application programs
a standard
– Manages
way of
translating message
between Middleware transfers
software – Insulates network
from changes from the
different clients ((e.g.,
vendors server application adding a new
programs server)
• Examples:
– Distributed Computing Environment (DCE)
– Common Object Request Broker Architecture (CORBA)
– Open Database Connectivity (ODBC)

Copyright 2005 John Wiley & Sons, Inc 2 - 12


Multi-tier Architectures
• Involve more than two computers in
distributing application program logic
– 2-tier architecture (architectures discussed so
far)
– 3-tier architecture
• 3 sets of computers involved
– N-tier architecture
• more than three sets of computers used

Copyright 2005 John Wiley & Sons, Inc 2 - 13


3-tier Architecture

Copyright 2005 John Wiley & Sons, Inc 2 - 14


N-tier Architecture

Copyright 2005 John Wiley & Sons, Inc 2 - 15


Multi-tier Architectures
• Advantages
– Better load balancing:
• More evenly distributed processing. (e.g., application
logic distributed between several servers.)
– More scalable:
• Only servers experiencing high demand need be
upgraded
• Disadvantages
– Heavily loaded network:
• More distributed processing  more exchanges
– Difficult to program and test due to increased
complexity
Copyright 2005 John Wiley & Sons, Inc 2 - 16
Fat vs. Thin Clients
• Depends on how much of the application logic
resides on the client
– Fat client: (a.k.a., thick client)
• All or most of the application logic
– Thin client:
• Little or no application logic
• Becoming popular because easier to manage, (only
the server application logic generally needs to be
updated)
• The best example: World Wide Web architecture
(uses a two-tier, thin client architecture)

Copyright 2005 John Wiley & Sons, Inc 2 - 17


Thin-Client Example: Web Architecture
Web Server

Client (PC, mini,


mainframe)
(PC)

Presentation logic Application Logic


Data Access logic
Data Storage

Copyright 2005 John Wiley & Sons, Inc 2 - 18


Criteria for Choosing Architecture
• Infrastructure Cost
– Cost of servers, clients, and circuits
– Mainframes: very expensive; terminals, PCs: very
inexpensive
• Development Cost
– Mainly cost of software development
– Software: expensive to develop; off-the-shelf software:
inexpensive
• Scalability
– Ability to increase (or decrease) in computing capacity
as network demand changes
– Mainframes: not scalable; PCs: highly scalable

Copyright 2005 John Wiley & Sons, Inc 2 - 19


Choosing an Architecture

Host-Based Client-Based Client-Server

Cost of
Infrastructure High Medium Low

Cost of
Development Low Medium High

Scalability Low Medium High

Copyright 2005 John Wiley & Sons, Inc 2 - 20


Applications
• World Wide Web
• E-mail
• File Transfer
• Videoconferencing
• Instant Messaging

Copyright 2005 John Wiley & Sons, Inc 2 - 21


World Wide Web
• Two central ideas:
– Hypertext
• A document containing links to other documents
– Uniform Resource Locators (URLs)
• A formal way of identifying links to other documents
• Invention of WWW (1989)
– By Tim Berners-Lee at CERN in Switzerland
• First graphical browser, Mosaic, (1993)
– By Marc Andressen at NCSA in USA; later founded
Netscape
CERN - Centre Européan pour Rechèrche Nucleaire
NCSA - National Center for Supercomputing Applications

Copyright 2005 John Wiley & Sons, Inc 2 - 22


How the Web Works
Main Web communications protocol:
HTTP - Hypertext Transfer Protocol

A request-response cycle:
include multiple steps since web
Clicking on a hyperlink or pages often contain embedded
typing a URL into a browser files, such as graphics, each
starts a request-response cycle requiring a separate response.
Copyright 2005 John Wiley & Sons, Inc 2 - 23
HTTP Request Message
Request line
(command, URL, HTTP version number) required
(If the user
types in the Request header optional
URL by (information on the browser,
themselves, date, and the referring page )
then the
referring page
is blank.)
Request body
(information sent to the server, optional
e.g., from a form)

Copyright 2005 John Wiley & Sons, Inc 2 - 24


Example of an HTTP Request
Command URL HTTP version

Request
GET http://www.kelley.indiana.edu/ardennis/home.htm HTTP/1.1 Line
Date: Mon 06 Aug 2001 17:35:46 GMT Request
User-Agent: Mozilla/6.0 Header
Referer: http://www.indiana.edu/~aisdept/faculty.htm

URL that contained Web browser


the link to the (code name for
requested URL Netscape)

Note that this HTTP Request message has no “Body” part.

GMT – Greenwich Mean Time


Copyright 2005 John Wiley & Sons, Inc 2 - 25
HTTP Response Message
Response status
(http version number, status code, reason) optional

Response header optional


(information on the server, date,
URL of the page retrieved, format used )

Response body required


(requested web page)

Copyright 2005 John Wiley & Sons, Inc 2 - 26


Example of an HTTP Response
HTTP/1.1 200 OK Response
Status
Date: Mon 06 Aug 2001 17:35:46 GMT
Server: NCSA/1.3 Response
Location: http:// www.kelley.indiana.edu/adennis/home.htm Header
Content-type: text/html

<html>
<head>
<title>Allen R. Dennis</title>
</head>
<body>
<H2> Allen R. Dennis </H2> Response
<P>Welcome to the home page of Allen R. Dennis</P> Body

</body>
</html>

Another example of response status: HTTP/1.1 404 page not found)


Copyright 2005 John Wiley & Sons, Inc 2 - 27
HTML - Hypertext Markup Language
• A protocol used to format Web pages
• Also developed at CERN (initially for text
files)
• TAGs embedded in HTML documents
– include information on how to format the file
• Extensions to HTML needed to format
multimedia files
• XML - Extensible Markup Language
– A new markup language becoming popular
Copyright 2005 John Wiley & Sons, Inc 2 - 28
Electronic Mail
• Heavily used Internet application
– Much, much faster than snail mail (regular
mail)
– Extremely inexpensive (compared to $3-$10
per paper mail cost)
• Includes preparation, paper, postage, etc,
– Can substitute for other forms of
communication, such as telephone calls
• Eliminates “telephone tag”
– E-mail users can answer at his/her convenience,
instead of time of call

Copyright 2005 John Wiley & Sons, Inc 2 - 29


E-mail Standards
• SMTP - Simple Mail Transfer Protocol
– Main e-mail standard for
• Originating user agent and the mail transfer agent
• Between mail transfer agents
– Originally written to handle only text files
– Usually used in two-tier client-server architectures
• Post Office Protocol (POP) and Internet Mail
Access Protocol (IMAP)
– Main protocols used between the receiver user agent
and mail transfer agent
– Main difference: with IMAP, messages can be left at the
server after downloading them to the client
• Other competing standards
– Common Messaging Calls (CMC), X.400
Copyright 2005 John Wiley & Sons, Inc 2 - 30
Two-Tier E-mail Architecture
• User agents (also called e-mail clients)
– Run on client computers
– Send e-mail to e-mail servers
– Download e-mail from mailboxes on those servers
– Examples: Eudora, Outlook, Netscape Messenger
• Mail transfer agents (also called mail server)
– Used by e-mail servers
– Send e-mail between e-mail servers
– Maintain individual mailboxes.

Copyright 2005 John Wiley & Sons, Inc 2 - 31


How SMTP Works
Server computer
with e-mail server
software
SMTP packet (“message
Client computer
transfer agent”)
with e-mail LAN
client
software SMTP reads the packet’s
(“user agent”) packet destination address and
sends it over the Internet
an e-mail message is to the receiver’s mail
sent as an SMTP server.
packet to the local
mail server
Internet

SMTP
packet Server computer
IMAP or with e-mail server
Client computer POP packet software
contacts the LAN
mail server stores the
which then message in the
downloads SMTP receiver’s mail
the message packet box
Copyright 2005 John Wiley & Sons, Inc 2 - 32
Host Based e-mail Architectures
• An old method used on UNIX based hosts
• Similar to client-server architecture, except
– Client PC replaced by a terminal (or emulator)
• Sends all keystrokes to the server
• Display characters received from the server
– All software reside on server
• Takes client keystrokes and understand user’s
commands
• Creates SMTP packets and sends them to next mail
server

Copyright 2005 John Wiley & Sons, Inc 2 - 33


Three-Tier Client-Server Arch.
Best known example: Web based email (e.g., Hotmail)
Client computer Server computer with Web Server computer with
with Web Browser server software email server software

sends HTTP • sends HTTP performs the


requests to the responses to same functions
Web server the Web client as the mail
• translates the server in the
client’s HTTP two-tier example
requests into
No need for an SMTP packets
email user agent then send them
to the Mail
server
Copyright 2005 John Wiley & Sons, Inc 2 - 34
Web-based e-mail
Server computer with
HTTP Web server
request software
Client computer
with Web LAN SMTP packet
Server computer
browser
with email server
software
HTTP
response SMTP
packet
Internet

SMTP packet Server computer


HTTP with e-mail server
Client computer request software
with Web
browser LAN IMAP or
POP packet
HTTP IMAP Server computer
response packet with Web server
software
Copyright 2005 John Wiley & Sons, Inc 2 - 35
SMTP Message
Header
(source and destination addresses, date, subject,
and other information about the e-mail message)

Body
(message itself)

Attachments
(additional files included
along with the e-mail message)

Copyright 2005 John Wiley & Sons, Inc 2 - 36


Sample SMTP Message
Text in “ “ are ignored

From: “Alan Dennis;”<adennis@indiana.edu>


TO: “Pat Someone” <someone@somewhere.com> Header
Date: Mon 06 Aug 2001 19:03:02 GMT
Subject: Sample Note
Message-Id: <4.1.20000623164823.009f5e80@IMAP.IU.EDU>
DATA: Body
This is an example of an e-mail message

Unique ID used to keep


track of messages.

Note that this SMTP message has no attachments.


Copyright 2005 John Wiley & Sons, Inc 2 - 37
MIME
• Multipurpose Internet Mail Extension
– A graphics capable mail transfer agent protocol (to send
graphical information in addition to text)
• SMPT designed for text transfer only
– Included as part of an e-mail client
– Translates graphical information into text allowing the
graphic to be sent as part of an SMTP message (as a
special attachment)
– Receiver’s e-mail client then translates the MIME
attachment from text back into graphical format
• Other Graphics capable mail agent protocols
– uuencode and binhex

Copyright 2005 John Wiley & Sons, Inc 2 - 38


Listserv Discussion Groups
• Mailing lists of users who join to discuss some
special topic (e.g., cooking, typing, networking)
• Some permit any member to post messages,
some are more restricted
• Parts of listserv
– Listserv Processor
• Process commands ( subscriptions, etc,)
– Listserv Mailer
• Receive a message and resend it to everyone
• To subscribe
– Send an email to Listserv processor (address of the
processor is different than the address of mailer)

Copyright 2005 John Wiley & Sons, Inc 2 - 39


File Transfer Protocol (FTP)
• Enables sending and receiving files over the
Internet
• Requires an application program on the client
computer and a FTP server program on a server
• Commonly used today for uploading web pages
• Many packages available using FTP
– WS-FTP (a graphical FTP software)
• FTP sites
– Closed sites
• Requires account name and password
– Anonymous sites
• Account name: anonymous; pwd: your email address
Copyright 2005 John Wiley & Sons, Inc 2 - 40
Telnet
• Allows one computer to log into other computers
– Remote login enabling full control of the host
• Requires an application program on the client
computer and a Telnet server program on a
server
– Client program emulates a “dumb” terminal
• Many packages available conforming Telnet
– EWAN
• Requires account name and password
– Anonymous sites
• Account name: anonymous; pwd: your email
address

Copyright 2005 John Wiley & Sons, Inc 2 - 41


Instant Messaging (IM)
• A client-server program that allows real-time
typed messages to be exchanged
– Client needs an IM client software
– Server needs an IM server package
• Some types allow voice and video packets to be
sent
– Like a telephone
• Examples include AOL and ICQ
• Two step process:
– Telling IM server that you are online
– Chatting
Copyright 2005 John Wiley & Sons, Inc 2 - 42
How Instant Messaging Works
Client computer When you type some text, your IM
IM packet
with client sends the text in a packet to
e-mail client the IM server which relays it to your
software LAN friend.

IM packet Server
sends a request to the IM server telling it
that you are online. If a friend connects, computer with
the IM server sends a packet to your IM with IM
client and vice versa LAN server
software

Internet IM packet

Client computer If a chat session has more than


with two clients, multiple packets are
IM packet sent by the IM server. IM servers
IM client
can also relay information to other
software
IM servers.
LAN

Copyright 2005 John Wiley & Sons, Inc 2 - 43


Videoconferencing
• Provides real time transmission of video and audio
signals among two or more locations
– Allows people to meet at the same time in different locations
– Saving money and time by not having to move people
around (conference calling does the same thing)
• Typically involves 2 special purpose rooms with
cameras and displays
• Desktop videoconferencing
– Low cost application linking small video cameras and
microphones together over the Internet
– No need for special rooms
– Example: Net Meeting sw on clients communicating through
a videoconference server
Copyright 2005 John Wiley & Sons, Inc 2 - 44
Copyright 2005 John Wiley & Sons, Inc 2 - 45
Videoconferencing Standards
• Proprietary early systems
• Common standards in use today
– H.320
• Designed for room-to-room videoconferencing over
high-speed phone lines
– H.323
• Family of standards designed for desktop
videoconferencing and just simple audio
conferencing over Internet
– MPEG-2
• Designed for faster connections such as LAN or
privately owned WANs

Copyright 2005 John Wiley & Sons, Inc 2 - 46


Webcasting
• Special type of one-directional
videoconferencing
– Content is sent from the server to users
• Process
– Content created by developer
– Downloaded as needed by the user
– Played by a plug-in to a Web browser
• No standards for webcasting yet
– Defacto standards: products by RealNetworks

Copyright 2005 John Wiley & Sons, Inc 2 - 47


Copyright 2005 John Wiley & Sons, Inc 2 - 48
Implications for Management
• Network must be used to provide a worry-free
environment for applications
– Network should not change the way an organization
operates; application should!
– Network should enable wide variety of applications
• Dramatic increase in number and type of
applications
– Rapid growth in amount and type of traffic
• Different implication on network design and
management
• Increased operating cost

Copyright 2005 John Wiley & Sons, Inc 2 - 49


Copyright 2005 John Wiley & Sons, Inc.

All rights reserved. Reproduction or translation of


this work beyond that permitted in section 117 of
the 1976 United States Copyright Act without
express permission of the copyright owner is
unlawful. Request for further information should
be addressed to the Permissions Department,
John Wiley & Sons, Inc. The purchaser may make
back-up copies for his/her own use only and not
for distribution or resale. The Publisher assumes
no responsibility for errors, omissions, or
damages caused by the use of these programs or
from the use of the information herein.

Copyright 2005 John Wiley & Sons, Inc 2 - 50

You might also like