Title: Client-Server%20Interaction
1Client-Server Interaction
- Based on Chapter 28 in Computer Networks and
Internets, Comer
2Network Applications
- All of the lower layers of the network
communication protocol stack exist so that
applications on different computers can interact.
- Applications are high-level software used
directly by users. - The applications (e.g. Excel) sit on top of the
application layer which provides various
network-related services (e.g. FTP) to the
applications. - The basic paradigm for this application-to-applica
tion interaction on an internet is the
client-server model.
3Application Software
- Applications and the application layer hide all
of the details of the network from the user. - Information hiding
- In most cases the user does not have to know the
IP address (let alone the MAC address) of the
computer he or she is communicating with. - The application provides a user-friendly symbolic
name, which is then translated into the
corresponding number. - E.g. a domain name service
4Connection-Oriented
- While TCP is in part responsible for establishing
a session between two computers (the three-way
handshake), the TCP does not establish a
connection on its own volition. - The source application layer must direct its
transport layer to do so. - The destination application layer must direct its
transport layer to listen for others trying to
connect to it. - In the phone analogy, the source must dial the
number, the destination must hear the phone ring
and answer it.
5The client-server paradigm
- The approach in which the source initiates
contact with a listening destination is said to
adhere to the client-server paradigm. - The initiating source is called the client.
- Clients are active.
- The listening destination is called the server.
- Servers are passive.
6Two meanings
2
- In one sense, client-server is used to refer to
the communication model - Client Active requester
- Server Passive listener/responder
- In another sense, client-server is used to refer
to machines which are designed to act as clients
or as (dedicated) servers - In this sense, a server is a machine capable of
offering a such service to a number of clients.
7What is a Server?
- A server can refer to a program that passively
waits for communication. - A server can refer to a computer dedicated to
running server programs. - Your book uses the terminology server class
computer for the latter case. - But most of the world uses the term server in
both cases. - Servers or server-class computers are typically
powerful machines which run server software.
8Not the only paradigm in town
- Client-server is not the only model for
computer-to-computer communication. - Peer-to-peer A type of network in which each
workstation has equivalent capabilities and
responsibilities. Peer-to-peer networks are
generally simpler, but they usually do not offer
the same performance under heavy loads. - Master/slave master polls the slaves to see if
they have anything to transmit.
9Mainframe architecture
- Mainframes are an example of the master-slave
model. - Most of the data storage and computing power lies
in the mainframe (a central computer). - Users interact with the mainframe via terminals
(dumb terminals) which is little more than a
monitor and keyboard. - In the early days of PCs, they were often
disabled to work as dumb terminals in a
mainframe.
10Thin and fat clients
- There was an idea of returning to some extent to
the notion of a dumb terminal. - In client/server applications, a client designed
to be especially small so that the bulk of the
data processing occurs on the server is called a
thin client. - A client that performs the bulk of the data
processing operations is called a fat client. - Although the term usually refers to software, it
can also apply to a relative abilities of a
network computer.
11Client/Server Operating Systems
- Often the version of the operating system one
loads on a computer that mainly plays the client
role will be different from the version of the
operating system loaded on the server - E.g. Windows 2000 is different from Windows 2000
Server
12The client
- Client software
- Requests service but also performs its own
computations. - Is invoked directly by a user and executes only
for one session - as opposed to starting automatically and running
continuously - Usually runs locally on a users PC
- Initiates contact with a server.
- May access multiple services, but only
communicates with one server at a time. - Does not require special hardware (beyond
standard communications hardware) or Operating
System.
13The Server
- Server software
- Is a special-purpose, privileged program
dedicated to providing one service. - Can handle multiple remote clients at the same
time. - Is invoked automatically (typically when a system
boots) and continues to execute through many
sessions. - Waits passively for contact from arbitrary remote
clients. - Accepts contact from arbitrary clients, but
offers a single service. - Requires powerful hardware and a sophisticated
operating systems.
14Application Software
- Applications (as opposed to services provided by
the application layer) that communicate with
other applications are often written with either
the client role or server role specifically in
mind. - Thus one talks about client-side scripting and
server-side scripting.
15Scripting
- Client-side scripting is code written for the
client end of a client-server system. - For example, JavaScript scripts are client-side
because they are executed by your browser (the
client). - Server-side scripting is code written for the
server end of a client-server system. - For example, CGI scripts are server-side because
they run on the Web server. - Java applets can be either server-side or
client-side depending on which computer (the
server or the client) executes them.
16Client-Server Interaction
- Information between client-server passes in both
directions. - Clients request, servers respond.
- Sometimes the servers response is an ongoing
communication based on one initial request. - Client-server applications lead the protocol
suite to establish the session and send/receive
information. - A computer needs all stacks of the software
protocol suite to run as a client or server.
17Client-Server
18Multiple Services
- A powerful computer can run multiple clients and
servers at the same time. - You need sufficient hardware resources and an
operating system which allows multiple
application programs to execute concurrently
(such as UNIX or WIN9x)
19One connection/Many services
- A computer with multiple servers still requires
only a single physical connection for
communication. - Different services will be associated with
different ports. - Since servers are often in passive modes, having
one computer offer many services can help reduce
administrative overhead and cost without a
significant reduction in performance. - However, if many clients are expected for a
particular service it may be worthwhile having a
machine dedicated to it.
20Some Server Types
- A file server is a computer and storage device
dedicated to storing files. Any user on the
network can store files on the server. - A print server is a computer that manages one or
more printers. - A network server is a computer that manages
network traffic. - A database server is a computer system that
processes database queries.
21Multiple services
22A thread for each request
- In order to handle concurrency, that is, dealing
with many clients at once, the server-class
computer uses threads. - We mentioned certain services being associated
with well-known ports. - Actually the main thread or listener (usually a
daemon) is located at this port, but as soon as a
request is made, a new thread is spun off
(forked) for it. - This allows the main listening thread to await
the next client.
23Thread
- A thread is the information needed to serve one
individual user or a particular service request. - If multiple users are using the program or
concurrent requests from other programs occur, a
thread is created and maintained for each of
them.
24Thread
- The thread allows a program to know which client
is being served as the program alternately gets
re-entered on behalf of different users. - One way thread information is kept is by storing
it in a special data area and putting the address
of that data area in a register. - The operating system always saves the contents of
the register when the program is interrupted and
restores it when it gives the program control
again.
25Types of Transport Protocols
- The application services may be
connection-oriented or connectionless. - Connection-Oriented
- The applications must first establish the
connection and then send the data across the
connection. TCP requests the connection and once
established the communication begins. Session
must be terminated.
26Types of Transport Protocols
- Connectionless Interface
- The application sends a message to the
destination at any time. The sending application
needs to specify the destination with each
message sends. The UDP is the connectionless
support mechanism in the TCP/IP protocol. - For a client request using the connectionless
interface, servers often require the request to
be sent in a single message. The server responds
in a single message.
27Service Connections Choice
- Servers may provide a service through both
connection methods. - The choice of transport is dependent on the
client. - This choice requires the server to provide both
transport implementations. This may be
implemented by - Setting up 2 servers for the same service, one
for connectionless transport and one for
connection-oriented transport. - Setting up a single server that is able to
interact with either type of transport protocol
simultaneously.
28Client-Server Interactions
- A client application is not restricted to
accessing a single service. A single application
can become the client of several servers over
time. - A client application is not restricted to
accessing a single server for a given service. A
client might send a request to multiple servers
to improve performance. - A server is not restricted from performing
further client-server interactions . A server
for one service can become a client of another.
29Two-tier
- The term two-tier refers to client/server
architectures in which the user interface runs on
the client and the database is stored on the
server. - The actual application logic can run on either
the client or the server.
30Three tier
- A special type of client/server architecture
consisting of three well-defined and separate
processes, each running on a different platform - The user interface, which runs on the user's
computer (the client). - The functional modules (business rules) that
actually process data. This middle tier runs on a
server and is often called the application
server. - A database management system (DBMS) that stores
the data required by the middle tier. This tier
runs on a second server called the database
server.
31Three tier (Cont.)
- The three-tier design has many advantages over
traditional two-tier or single-tier designs,
mainly - The added modularity makes it easier to modify or
replace one tier without affecting the other
tiers. (Remember Layering and information
hiding.) - Separating the application functions from the
database functions makes it easier to implement
load balancing, i.e. spreading the processing out
32Network Address Translation and Electronic Mail
- Based on Chapters 26 and 32 in Computer Networks
and Internets, Comer
33Network Address Translation
- NAT (Network Address Translation) is a scheme for
a network to use one set of addresses internally
but to have the outside world see a different set
of addresses, possibly only one address. - It can be used as a security measure since it
hides internal addresses from the outside world. - It can be used to expand ones address space.
One can use non-routable addresses, and different
networks can use the same internal addresses
provided their external address is unique.
34NAT Figure 26.4
35NAT Tables
- The translator understands the local addresses
and the external address. It maintains a table
of what internal addresses (computers) are
communicating with which external addresses.
36(No Transcript)
37Dilemma
- But what if two internal addresses are
communicating with the same external address? - How would the translator know which internal
address to deliver a message to?
38Solution (NAPT)
- Recall that beyond IP addresses there is an
additional part of the addressing scheme the
ports. The translator can associate different
internal addresses with its different ports.
Then it can distinguish differ incoming messages
by which port they come in on. - This is known as Network Address and Port
Translation (NAPT).
39NAPT Table (Figure 26.4)
40Another Dilemma
- Associating internal addresses with ports is fine
for sessions initiated by the internal machines,
but what if the the outside wants to initiate? - The outside world will know the internal
computers not by IP addresses but by domain
names. Therefore this can be resolved by having
the local DNS and NAT servers coordinate.
41E-Mail
- E-mail was designed to serve as an electronic
version of the traditional office memo. - E-mail can be used to be used for one-to-one or
one-to-many communication. - It can also handle automatic response to
information requests.
42Mail box
- In order for a person to receive mail, they are
assigned a mail box which is a location
(typically a directory in storage) designated to
hold incoming messages addressed to a particular
user. - The email server is given permission to write
files in this directory. - The user to whom the mail box is assigned is
given permission to access these files.
43Mail box
- A mailbox is often associated with an account,
thus someone with multiple accounts may have
multiple boxes. - The mailbox is typically on the mail server and
not on the users computer. - While the user may have most of the permissions
in regard to his or her mail box, the amount that
can be stored there and so on is controlled by
the administrator of the mail server.
44Email Addresses
- Addresses have 2 parts, e.g. blum_at_lasalle.edu
- The first part blum_at_lasalle.edu denotes the mail
box (and in turn the person to whom it is
assigned) - It allows the local administrators to assign
mailbox identifiers independently (no central
authority). - The second part blum_at_lasalle.edu denotes the mail
server at the domain, i.e. the computer to which
the message should be sent. - It allows users on arbitrary computer systems to
exchange email messages (is assigned by central
authority).
45E-Mail Message Formats
- An email message consists of ASCII code.
- As with most information protocols we have
studied, it has two parts - A header containing information about delivery
the senders and recipients address along with
various other information. - A body containing the actual message to be
delivered. - The two parts are separated by a blank line
(carriage return character).
46Header and body
header
body
47Some header fields
48SUBJECT, CC and BCC
- Most headers include a SUBJECT field
- Typically it conveys information about the body
to the recipient. - It can be used to send commands to certain
automated processes, e.g. SUBJECT subscribe. - The CC (carbon copy) field allows the message to
be sent to users other than the primary
recipients. - BCC (Blind carbon copy) has a similar effect as
CC except that a BCC recipients address does not
appear in the message. - The primary recipient does not know that a blind
carbon copy was sent
49User and Transfer Agents
- The Email system can be broken down into two
parts - One part is a user interface for composing and
reading messages. It is then placed in a queue - (Sometimes called mail user agent)
- Another part for delivering messages to the
intended recipient on another computer (or
indicating if delivery was unsuccessful). It
takes messages from the queue and delivers them
to the recipients mail box. - (Sometimes called mail transfer agent)
50Mail Transfer
- Delivery may be
- Local Sending a message to a user on the same
computer simply requires that a copy of the
message be placed in the recipients mailbox. - Remote Sending the message to a user on a remote
computer requires that senders transfer software
become a client of the recipients transfer
program. The remote computer must append the
message to the recipients mailbox.
51SMTP
- Simple Mail Transfer Protocol is a set of rules
for transferring email messages using a TCP
connection. - SMTP allows the sender to identify itself,
specify a recipient and send an e-mail message,
once the connection has been established. - SMTP requires reliable delivery of a message
which means the sender keeps a copy of the
message in storage (nonvolatile) until the
receiver has stored the message.
52(No Transcript)
53Two Stage Delivery
- Mail is not delivered directly to the typical end
users computer - Mail might arrive at any time and the mail server
must be ready to receive it at that time (its a
TCP session), many users computers are turned
off when not in use. - Plus, each computer would have to operate the
mail server software. - The e-mail is delivered to a mail server and then
the user must retrieve it, so there is a second
stage in the delivery process.
54POP
- One choice for this second stage of delivery is
POP (Post Office Protocol). - The mail server (the computer with the mailboxes)
also runs a POP server. - The POP server allows a user to run e-mail
software from his PC to access the mailbox
remotely. - The POP server can be accessed via a dial-up
connection with the mailbox computer or via the
internet. - The POP server requires the client to
authenticate itself (username and password).
55POP
56IMAP
- Internet Message Access Protocol is another
protocol for accessing e-mail from the mail
server. - The e-mail client views just the messages header
and then decide whether or not to download it. - IMAP also allows the client to create and
manipulate folders or mailboxes on the server,
delete messages, or search for certain parts or
an entire note.
57IMAP (Cont.)
- IMAP is more sophisticated than POP.
- IMAP requires continual access to the mail server
while one is working with ones mail. - With POP3, when one reads mail, it is immediately
downloaded to the users computer and is no
longer maintained on the server. - IMAP can be thought of as a remote file server,
whereas POP can be thought of as a
"store-and-forward" service.
58Multiple Recipients
- E-mail message can be effectively multicast, that
is, there may be more than one recipient of the
same message. - The transfer programs do not send separate copies
if more than one recipients mail box is on the
same mail server.
59Multiple Recipients
- One message is sent, then copies are made by the
end mail server. This saves internet bandwidth
and is more egalitarian. - Recipients with mailboxes on the same mail server
will all receive the message about the same time. - If the internet fails, either all recipients or
none will receive a copy.
60Exploders, Lists and Forwarders
- A mail exploder, or forwarder, is a program that
can forward copies of a message. - A mailing list is a database entry which is a
list of email addresses. - If a message is sent to a list, the exploder
forwards the message to each entry in the list. - If an individual wishes to receive mail for a
group, the individuals email address must be on
the list.
61List server
- A list server (mailing list server) is a program
that handles subscription requests for a mailing
list and distributes new messages, newsletters or
other postings from the list's members to the
entire list of subscribers as they occur or are
scheduled.
62E-Mail Application Programs
- When an email message arrives at a computer, the
email software sends a copy of the message to the
specified user. If the user is an application
program, the email package sends the message to
the application instead of the mailbox. - This allows the user to make a request in an
e-mail message and the message to be sent
directly to the query system (application). - The application will extract the request, look-up
the answer and send an e-mail reply to the user.
63Extending email
- Originally email was for sending messages, so it
used a simple ASCII (text) format, and to
exchange files, one used FTP. But - Users were much more familiar with email and
wanted to extend its capabilities rather than use
an unfamiliar service. - FTP (file transfer protocol) is essentially a
pull technology while email is a push technology.
64BinHex
- E-mail attachments are the way in which one uses
the e-mail system meant to handle ACSII to
deliver non-ASCII files. - BinHex is one approach
- All files are in binary a group of four binary
numbers can be though of as a number between 0
and 15 or in hexadecimal notation a number
between 0 and F the hexadecimal numbers can be
replaced by the corresponding ASCII code for the
digit. - This replaces 4 bits with 7 or 8 (for ASCII) and
while simple is inefficient.
65uuencode
- A more efficient binary-to-ASCII algorithm is
called uuencode. - Originally, this was done as a separate step by
the user before sending the file as an e-mail
message. And the receiver had to uudecode the
file. - But now with MIME, many of these steps are done
automatically and hidden from the user.
66MIME
- Multipurpose Internet Mail Extension was invented
to coordinate and unify the encoding schemes used
for transfer. MIME does not dictate a single
standard. - The sender and receiver exchange a convenient
encoding sequence. If a message has several
parts, the encoding sequence for each part may be
different. - This allows transmission of graphics and plain
text messages. - MIME is flexible. MIME is compatible with older
e-mail systems.
67MIME (Cont.)
- In 1991, Nathan Borenstein of Bellcore proposed
to the IETF that SMTP be extended so that
Internet client and server could recognize and
handle other kinds of data than ASCII text. - As a result, new file types were added to "mail"
as a supported Internet Protocol file type.
68MIME (Cont.)
- Clients use a header to select an appropriate
"player" application for the type of data the
header indicates. - Some of these players are built into the Web
client or browser (for example, all browser come
with GIF and JPEG image players as well as the
ability to handle HTML files) other players may
need to be downloaded. - New MIME data types are registered with the
Internet Assigned Numbers Authority (IANA).
69S/MIME
- Secure Multi-Purpose Internet Mail Extensions is
a secure method of sending e-mail attachments
that uses the Rivest-Shamir-Adleman (RSA)
encryption system. - S/MIME is included in the latest versions of the
Web browsers from Microsoft and Netscape and has
also been endorsed by other vendors that make
messaging products. - An alternative to S/MIME is PGP/MIME.
70finger
- A UNIX program that takes an e-mail address as
input and returns information about the user who
owns that e-mail address. - On some systems, finger only reports whether the
user is currently logged on. Other systems return
additional information, such as the user's full
name, address, and telephone number. - Of course, the user (or system administrator)
must first enter this information into the
system. Many e-mail programs now have a finger
utility built into them.
71finger
72Finger blocked
73Other References
- http//www.whatis.com
- http//www.webopedia.com