Presentation is loading. Please wait.

Presentation is loading. Please wait.

Client-Server Applications. Indirect Top Level Interaction Application.

Similar presentations


Presentation on theme: "Client-Server Applications. Indirect Top Level Interaction Application."— Presentation transcript:

1 Client-Server Applications

2 Indirect Top Level Interaction Application

3 Client asks server to connect Application Client Application Server Socket provides a STREAM based interaction Connect request

4 Server accepts Application Client Application Server Connect accepted

5 Client asks for a specific service Application Client Application Server Service Request

6 Server answers Application Client Application Server Service Response

7 Client disconnects Application Client Application Server Disconnect

8 Server acknowledges … disconnected Application Client Application Server Disconnect Acknowledged

9 Most interactions Connection request Service interaction Disconnect Give an illusion of looking like a single program when running effectively –Network/server delay is frequently obvious

10 Common CLIENT-SERVERs FTP for transferring files from one machine to another (even if no account at both machines). TELNET/SSH 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. MAIL(smtp/pop/imap) transfer agents WWW(http) (WorldWideWeb) servers/browsers

11 How do clients and servers identify each other? ClientServer Each end has 1.IP address 2.port

12 Ftp Example server at 137.155.2.10 ClientServer Each end has 1.IP address 2.port 1.137.155.2.10 2.Port 21 1.137.155.2.23 2.Port 12345 Servers run at a well-known port Client use a randomly assigned port

13 Addresses IP -> unique to machine (actually to the interface/network card) –Only gets the message to the right machine Port –Service uses a standard port for connection –Clients are randomly allocated –A port is unique to a connection. –Must identify a connection for a specific application. –Makes sure the correct application receives the data

14 FTP

15 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

16 Sample client interaction w/ftp {dgame@cambria} ftp ftp.pcs.cnu.edu Connected to ftp.pcs.cnu.edu. 220 america3 FTP server (UNIX(r) System V Release 4.0) ready. Name (ftp.pcs.cnu.edu:dgame): anonymous 331 Guest login ok, send ident as password. Password: (your id) 230 Guest login ok, access restrictions apply. ftp> cd pub/dgame/335 250 CWD command successful. ftp> binary 200 Type set to I. ftp> mget * mget AaronsFavCar.bmp? y 200 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.bmp 32768 bytes received in 0.017 seconds (1880.25 Kbytes/s) ftp> bye 221 Goodbye. {dgame@cambria} Client to Server Server to Client Connect request Service interaction Disconnect

17 USER Commands to use (not CLIENT) Not like a shell, but a few of the commands –cd –close –pwd –lcd (change on the client side!) –binary –get –put –mget –prompt

18 USER commands Client Server USER

19 Exchanges that actually go into the socket Not what the user enters This is the protocol. Table 8.3 CLIENT commands Client Server USER ftp ftp.pcs.cnu.edu (1)ftp.pcs.cnu.edu SYN (2)SYN+ACK (3) ACK (4)220 FTP server ready (5) From Fig 8.16 Session Connection

20 Figure 8.16 user enters username Client Server USER anonymous (1) USER anonymous(2)331 password required for anonymous(3) USER anonymous(2) 331 password required for anonymous(3)

21 Figure 8.16 user enters password Client Server USER dgame@pcs.cnu.edu (1) PASS dgame@pcs.cnu.edu (2) 220 user anonymous logged in(3)

22 System OS.. No user input Clients and Servers interact on their own Client Server USER SYST(1) 215 Unix System V Release 4.0 (2) Unix System V Release 4.0 (3) In the previous example this exchange is done prior to the login, not after.

23 Telnet

24 Terminal - little local intelligence Terminal NO 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

25 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

26 Telnet example telnet cambria@pcs.cnu.edu SunOS 5.6 login: dgame Password:(….) Last login: Tue Jan 25 19:07:04 from cx81733-c.nwptn1 You have new mail. {dgame@cambria:~ } pwd /home/faculty1/dgame {dgame@cambria:~ }exit {dgame@cambria:~ }logout (back on the original machine)

27 How is telnet organized? Computer to Use Telnet Server Computer now using Telnet Client Internet Keyboard Terminal Display and xmit Display Mainframe Unix Shell

28 Mail smtp/imap/pop

29 SMTP SERVER mail.pcs.cnu.edu SERVER mail.uva.edu pine Whatever client the user chooses POP or IMAP SMTP Here a local server and remote server in addition to a remote and local client. For SMTP, the servers also function as clients depending on which “server” makes the request.

30 WWW/http

31 How to Program Sockets


Download ppt "Client-Server Applications. Indirect Top Level Interaction Application."

Similar presentations


Ads by Google