Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Grad School of Lib & Info Sci., Univ.

of Illinois
http://www.lis.uiuc.edu/

Networking: The Client/Server


Architecture
LIS 451 * Fall 2005
Introduction to Networked Systems
http://www.isrl.uiuc.edu/˜mwolske/lis451/fall05

Martin Wolske
mwolske@uiuc.edu
1/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Review
• What is a client?

• What is a server?

• What does it mean to be running a server?

• How do the two interact?

2/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
NOTE: the following example sends anonymous email, something that if
used improperly is illegal at the federal level. Do NOT do this at home!
telnet express-smtp.cites.uiuc.edu 25
HELO uiuc.edu
MAIL From: unsworth@uiuc.edu
RCPT To: mwolske@alexia.lis.uiuc.edu
DATA
Date: Tue, 1 Nov 2005 12:45:05 -0600
From: John Unsworth <unsworth@uiuc.edu>
To: Martin Wolske <mwolske@alexia.lis.uiuc.edu>
Subject: Performance Evaluation

I have some reservations about your upcoming performance evaluation.


Please see the attached and respond.
.
QUIT
3/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
The Daemon Factor
• Server software manages resources by listening for requests and then working to
fulfill the requests by accessing resources.

• Remember from earlier lectures that requests are sent to particular ports to
reach the correct software server (e.g., HTTP, or web, requests are sent to port
80; SMTP, or outgoing mail, requests are sent to port 25).

• Daemons are the portion of the server software that hangs out and listens on the
port for requests (e.g., httpd).

4/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
Sockets
• In order for a monitor to turn on, you first need to plug it’s electrical cord into
an electrical socket. Once plugged in, electrons are free to flow between the
electrical source in a well defined and controlled manner so that the monitor can
be turned on.

• Software sockets are used to interconnect clients with their daemons in a similar
manner, opening a channel whereby packets can flow between the two in a well
defined and controlled manner.

• There are many ways to open sockets with a daemon, including writing programs
(that is, writing a client) to do so.

• While telnet is a text-based program that by default opens a socket with a telnet
daemon to allow users to emulate a text login on a computer, it can also be
instructed to open a text-based socket with many other daemons as well.

5/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
“...well defined and controlled...”
• Daemons and sockets explain how telnet was able to make a connection that
allowed me to send the ‘anonymous’ spam.

• But sockets only work if the flow between the two parts are done in a well defined
and controlled manner.

• Protocols are used to provide the definition of how transfers between two inter-
acting entities should occur.

• For open standard client/server protocols, these definitions are published as


RFC’s, or Request For Comments.

• While originally RFC’s were meant to be places for open discussion and devel-
opment of protocols, in practice this occurs via other channels, with the RFC
being a place to publish the details of the protocols.

6/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
RFC #’s for Major Client/Server Protocols
• Simple Mail Transport Protocol (SMTP): 821

• Telnet: 854

• File Transfer Protocol (FTP): 959

• Network News Transport Protocol (NNTP): 977

• Internet Relay Chat (IRC): 1459

• Post Office Protocol (POP): 1725

• Internet Mail Access Protocol (IMAP): 2060

• HyperText Transport Protocol (HTTP): 2068 (v1.1)

7/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
Reviewing the RFC for Email
• RFC’s typically provide an introduction, a description of the model, and speci-
fications of the protocol.

• One place to go to find a listing of all RFC’s that have been published is at
HyperRFC: http://www.csl.sony.co.jp/rfc/

• Reviewing the RFC for email:


– Note model for email delivery and compare to example header
– Note description of commands
– Note description of relaying — what happens if the socket is made to
mail.prairienet.org instead of mail.lis.uiuc.edu?

8/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Client/Server Demonstration
Another Demonstration of Sending Email
telnet mail.prairienet.org 25
HELO uiuc.edu
MAIL From: unsworth@uiuc.edu
RCPT To: mwolske@alexia.lis.uiuc.edu
DATA
Date: Tue, 1 Nov 2005 12:45:05 -0600
From: John Unsworth <unsworth@uiuc.edu>
To: Martin Wolske <mwolske@alexia.lis.uiuc.edu>
Subject: Performance Evaluation

I have some reservations about your upcoming performance evaluation.


Please see the attached and respond.
.
QUIT

9/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Reading Email
• The above successful demonstration only delivers email to a destination mailbox,
typically a user’s INBOX.

• No indication in RFC 821 is made regarding how the email is to be retrieved


from the destination mailbox.

• Originally email was retrieved by logging into the destination system and viewing
the mailbox file or files.

• While this remains a common way for retrieving email, several RFC’s now de-
scribe two protocols for retrieving email using a remote client:
– POP — Post Office Protocol
– IMAP — Internat Mail Access Protocl

10/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Reading Email
POP
• POP uses an offline processing strategy to retrieve email from a remote server.

• With offline processing, a client first retrieves email from a remote mailbox and
then closes connection to server. Manipulation of mail is performed on local
system.

• Advantages:
– Minimum use of connect time
– Minimum use of server resources

• Disadvantage:
– Processed mail is only accessible from local workstation

11/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Reading Email
IMAP
• IMAP primarily uses online processing to manage the user’s INBOX and archival
folders on the remote server, although it can also use offline mode to move mes-
sages from the server to the local drive.

• Major email clients now also allow a disconnected mode of IMAP, in which email
is temporarily downloaded and cached, then sync’ed with the server later.

• Advantages:
– Location-independent access
– Concurrent access to shared mailbox
– Access using data-less client

• Disadvangates:
– Extended connect time
– Extended disk usage

12/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Diagramming Email

13/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Mailing Lists
Mailing Lists do not use a separate protocol, but instead use the email protocol with
software that distributes email to multiple recipients

14/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Network News Transport Protocol (NNTP)
• Protocol used to post, retrieve, and distribute network news messages

• While email sends individual messages to private mailboxes, news servers ex-
change groups of messages using a store and forward strategy with shared spools

15/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Spanning Tree Model of Communication
• NNTP uses a spanning tree model of communication, where each server is a
central node for the other servers it sees.

• E.g., 1 is a central node for 2, 3, and 8

16/21 É Ê Ë Ì Î Í Ñ ? i Ï P
HyperText Transfer Protocol (HTTP)
• Hypertext Transfer Protocol, or HTTP, is the RFC-defined protocol to transfer
hypertext.
– HTTP 1.0 is a stateless protocol, with each command is executed indepen-
dently
– HTTP 1.1 supports persistent connections, allowing for multiple commands
to be executed during a single connection

• Browsers are optimized to display hypertext. However, hypertext is not limited


to ”web pages”

• Therefore, browsers have been designed from the beginning to work with multiple
information retrieval and browsing services

• Compare how a browser handles http://leep.lis.uiuc.edu vs. ftp://leep.lis.uiuc.edu.


How would this be handled with a telnet socket?

17/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Web Browser Diagram

18/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Web Servers as Application Servers
• In the example above, when the URL ftp://www.lis.uiuc.edu was accessed, the
web server acted as a direct intermidiary between the web browser and the FTP
server on Alexia.

• In other cases, the web server will run an application that processes information
accessed through backend servers and passes that processed information on to
the client.

• For instance:
– https://express.cites.uiuc.edu is a webmail application that uses SMTP and
IMAP to send and receive email via express.cites.uiuc.edu
– http://leep.lis.uiuc.edu/perl/bbdnews/listmsgs.pl?class=4U2maI938H1I4c&semes
is a Bulletin Board application that uses NNTP to send and read postings on
leep.lis.uiuc.edu in the news group gslis.classes.spring04.lis315a.b4class
– http://leep.lis.uiuc.edu/perl/classes/spring05/live4.pl?classname=LIS000&java=f
is a Java application that uses IRC to send and read messages with an IRC
server on leep.lis.uiuc.edu
19/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Just For the Fun of It!
• Compare:

telnet www.prairienet.org 80
GET / HTTP/1.0
HOST: uiuc.edu
<enter>

• With:

telnet www.prairienet.org 80
GET / HTTP/1.1
HOST: uiuc.edu
<enter>
GET /~mwolske/ HTTP/1.1
HOST: uiuc.edu
<enter>

• What’s one difference between HTTP version 1.0 and 1.1?

20/21 É Ê Ë Ì Î Í Ñ ? i Ï P
Review
• How do clients differ from servers?

• What is a daemon?

• What is the importance of the RFC process?

• What protocols are used for email communications? Describe how they work
together.

• Describe how telnet can be used to test a server.

• What is a spanning tree communications model?

• How do news servers communicate together?

• Describe the http protocol.

• What is unique about web browser clients? What protocol do they use?

• Using the anonymous email demonstration and RFC discussions above, use telnet
to retrieve a web page from an http server.

21/21 É Ê Ë Ì Î Í Ñ ? i Ï P

You might also like