Upload
prudence-burns
View
215
Download
0
Embed Size (px)
Citation preview
Network Applications(typically) CLIENT-SERVER
• Examples of the Application level of the OSI model
• One typically provides a service to the other
• Servers for hardware– file
– printer
– fax
• Servers for software support – providing “terminal” access
– providing translation from
internet name addresses (pcs.cnu.edu)
to
internet numeric addresses (137.155.10.2)– A\ND LOTS OF OTHER FUNCTIONALITY!!!
Application
Common CLIENT-SERVERs
• FTP for transferring files from one machine to another WITHOUT having an account at both machines.
• TELNET for providing remote command-line (shell) access when you have an account on both machines. TELNET also will provide other functionality as we will see later.
• Info services from ARCHIE, WAIS (Wide Area Information Servers), GOPHER, etc.
• MAIL transfer agents
• WWW (WorldWideWeb) servers/browsers
Terminal - little local intelligence
TerminalNO local processing per se.Only a conduit to the Mainframe.
Keyboard
Here the PC has the program instead of the mainframe! In previously graphic, terminal is a relay.
Mainframe
Application
Keyboard
(Display and) xmit
PC
Application
Display
Display
Remote terminal
•Run program remotely•Like a long cable to a keyboard at your house•Hyperterminal on Windows 95/98•Typically requires a modem•Only run command shell, not windows apps.
•What if you want a terminal access through the internet?•Telnet is your answer
Telnet example
telnet [email protected] 5.6
login: dgamePassword:(….)Last login: Tue Jan 25 19:07:04 from cx81733-c.nwptn1You have new mail.{dgame@cambria:~ } pwd/home/faculty1/dgame{dgame@cambria:~ }exit{dgame@cambria:~ }logout(back on the original machine)
How is telnet organized?
Computer to Use
Telnet Server
Computer now using
Telnet Client Internet
Keyboard
Terminal
Display and xmit
DisplayMainframe
Unix Shell
Unix Shell
Let’s Probe a Little Deeper!
Quick Review of Ascii
• 7 bit character code
• internally or elsewhere the 8th bit is 0
• standard “char” data
• keyboard input
• PLUS communications characters
• be sure to understand HEX notation
0000000 00 NUL0000001 01 SOH…0001000 08 BS…0001010 0A LF…0001101 0D CR…0010110 16 SYN…0100000 20 SP0100001 21 !…
No 8 bit value defined! In binary 0..127 (0000000..1111111)
CommChars
DisplayChars
Computer to Use
Telnet Server
Computer now using
Telnet Client Internet
Unix Shell
Focus on the server and shell
Control Characters in telnet
• 8 bit values really transmitted
• Values greater than 127 interpreted differently
• Any character less than 128 passed directly to the shell
• Any character greater than 127 is not to be passed through but used to interpret.
Telnet server(holds 128-255)
(0-255 chars) Unix shell(0-127 chars)
Control
The basic idea (not actually fact - see the text for the real story)
mkdirr(245)(OD) Unix shell
Control
mkdir(OD)
Data intended for the receiving program is passed through.The control character (245) tells the server to delete the previous character before passing the character to the shell.
Telnet server
(245) holds r
General Interaction
Most Often:
Telnet ServerTelnet ClientInternet
Telnet:
Applor
shell
ServerClientInternet
Another View!
Telnet Client
USER Unix Shell
Telnet Server
Types ls.. gets directory
Additional layeringof application on topof standard applicationssuch as telnet, ftp, etc.
ftp
ftp Serverftp Client Internet
Commands
Files
Telnet distinguishes data from commands by code value.Ftp distinguishes data from commands by channel.
FTP
• A program for copying files from one machine to another
• Lets you do a FEW unix-type commands in the command-line version
CLIENT SERVER
connect
request login
login
request file
send file
logoff
General Exchange of Messages
FTP
Sample client interaction w/ftp{dgame@cambria} ftp ftp.pcs.cnu.eduConnected to ftp.pcs.cnu.edu.220 america3 FTP server (UNIX(r) System V Release 4.0) ready.Name (ftp.pcs.cnu.edu:dgame): anonymous331 Guest login ok, send ident as password.Password: (your id)230 Guest login ok, access restrictions apply.ftp> cd pub/dgame/335250 CWD command successful.ftp> binary200 Type set to I.ftp> mget *mget AaronsFavCar.bmp? y200 PORT command successful.150 Binary data connection for AaronsFavCar.bmp (137.155.2.17,33136) (177562 bytes).226 Binary Transfer complete.local: AaronsFavCar.bmp remote: AaronsFavCar.bmp32768 bytes received in 0.017 seconds (1880.25 Kbytes/s)ftp> bye221 Goodbye.{dgame@cambria}
Client to Server Server to Client
Commands to use
• Table 8.3
• Not like a shell, but a few of the commands– cd
– close
– pwd
– lcd (change on the client side!)
– binary
– get
– put
– mget
– prompt
Archie
• FTP provides a unix-look directory which you navigate, “ls”, and copy/send files
• If you have trouble managing your own account, how much trouble do you have locating information when the entire FTP world is your directory?
• Database server containing information on the contents of FTP sites around the world
• Being replaced with good WWW search engines which envelope ftp sites.
Other Client Servers
• SMTP (Simple Mail Transfer Protocol)– More than meets the eye
– Server can also be a client (same process)
• WWW (World-Wide Web)– (more to come)
SMTP
SERVERmail.pcs.cnu.edu
SERVERmail.uva.edu
pineWhatever client
the user chooses
POP or IMAP POP or IMAP
SMTP
Here a local server and remote server in addition to a remote and local client. For SMTP, the servers also functionas clients depending on which “server” makes the request. See Figure 8.7
General Issues atApplication Layer
• Timing of interaction (Time Sequence Diagrams)
• Types of problems encountered
• How does one approach programming one of them?
HORIZONTAL communicationbetween Client and Server
Consider the timing of the interaction
This is a TIME-SEQUENCE DIAGRAM.
TIME TIME
Send
Send
CLIENT SERVER
1Receive
1. SERVER waitsGetAnswer
2
2. SERVER works
Wait
33. CLIENT waits
ProcessAnswer
4
4. CLIENT works
Problems which can occur
• Messages are lost
• Message are altered
• Messages arrive out of order
• Client and Server are not synchronized for each other.
• Client does not have room for the answer.
• Client can not wait any longer for the answer.
• Server machine may not be turned on
• Connection between the two machines may not be functioning
How do you write programs to interact over a network?
• Although you may not actually write the code, you’ll learn how in this course.
• Different ways. (ignore the text, middle p. 483)– Ad hoc... you do all of the work
– Use libraries
» socket libraries for tcp/ip based communication
» RPC (Remote Procedure Calls) are a little more involved than using a library of procedures but that model is sufficient for now
– We will cover DOS (ad hoc) and Unix (sockets)
• In ALL cases, messages are exchanged