1 / 78

Szept 29.-ei előadás pótlása

Szept 29.-ei előadás pótlása. Szept 22.-én a 207-es teremben 16-18-ig. 1. Gyakorlat Felkészülés a web programozásra. Kecskeméti Gábor A/1 336-os szoba – fizika tanszék Konzultációs idő : Csütörtök 9-11 Előadás : XX. Előadó , Csütörtök 14-16

zalika
Download Presentation

Szept 29.-ei előadás pótlása

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Szept 29.-ei előadáspótlása • Szept 22.-én a 207-es teremben 16-18-ig.

  2. 1. GyakorlatFelkészülés a web programozásra KecskemétiGábor A/1 336-os szoba – fizikatanszék Konzultációsidő: Csütörtök 9-11 Előadás: XX. Előadó, Csütörtök 14-16 Gyakorlat: 207-es terem, Csütörtök 12-14

  3. The Universal Resource Locator (URL) Each page of information on the web has a unique address called the URL at which it can be found • http://faculty.uscupstate.edu/atzacheva/lecture1.html The document can be obtained using the Hypertext Transfer Protocol (HTTP) Host Name - The Name of Web Server Path to the Web Page File Name Denotes that the File is Written in HTML HyperText Markup Language 1 2 3 File Name Protocol Host Name

  4. Önállófeladat • Készítsünkegyprogramotamifeldolgozza a parancssoriparaméterkéntkapottURLtésdarabjairabontja • Az URL alábbirészeit minimum tudjafelolvasni a program: • 1. protokoll (séma) • 2. Domain név (hostazonosító) • 3. Port (nemprotokollnakmegfelelőportszám) • 4. Elérésiútvonal • 5. Ha Queryt is tartalmazaz URL akkor a paramétereknevei • 6. Ha Queryt is tartalmazaz URL akkor a paraméterekértékei • Ha valakielkészült a feladattalellenőrzésétésteszteléséténvégzem, jelezzemindenki ha mehetek

  5. Példák • urlparser.exehttp://www.hwsw.hu • Protokoll (séma): http • Domain név (hostazonosító): www.hwsw.hu • urlparser.exe x://y:1/a?b=c&d=e • Protokoll (séma): x • Domain név (hostazonosító): y • Port (nemprotokollbólkövetkező): 1 • Elérésiútvonal: a?b=c&d=e • Query paraméterek: b,d • Query értékek: c,e

  6. FTP protokoll KecskemétiGábor A/1 336-os szoba – fizikatanszék Konzultációsidő: Csütörtök 9-11 Előadás: XX. Előadó, Csütörtök 14-16 Gyakorlat: 207-es terem, Csütörtök 12-14

  7. Emlékeztető

  8. application: supporting network applications FTP, SMTP, HTTP transport: process-process data transfer TCP, UDP network: routing of datagrams from source to destination IP, routing protocols link: data transfer between neighboring network elements PPP, Ethernet physical: bits “on the wire” Internet protocol stack application transport network link physical

  9. Ports • Each IP address is subdivided into ports, each port assigned to a single program • You can browse the Internet using one port while receiving e-mail using another port, with a single IP address

  10. Protocols • Sets of rules or standards that let computers communicate over the Internet • Type or size or brand of computer doesn’t interfere with communication if the protocol is used

  11. Bevezetés

  12. Objectives of FTP • Promote the sharing of files • To encourage indirect or implicit use of remote computers • To shield users from variations in file storage systems • To transfer data reliably and efficiently

  13. History • First proposed file transfer mechanisms in 1971 in RFC 114 and RFC 141 • RFC 354 (1972) defined FTP between hosts on ARPANET • Several RFCs came shortly thereafter • RFC 686 (1975) entitled “Leaving Well Enough Alone” • RFC 959 defines additional commands: • CDUP, SMNT, STOU, RMD, MKD, PWD, SYST

  14. Problems of File Transfer • At first, file transfer may seem simple • Heterogeneous systems use different: • Operating Systems • Character Sets • Naming Conventions • Directory Structures • File Structures and Formats • FTP need to address and resolve these problems

  15. WHAT IS FTP? Terminology • FTP works on the client/server principle. A client program enables the user to interact with a server in order to access information and services on the server computer. • Files that can be transferred are stored on computers called FTP servers. To access these files, an FTP client program is used. This is an interface that allows the user to locate the file(s) to be transferred and initiate the transfer process.

  16. FTP • FTP begins at port 21 • Initially, client and server communicate in plain text • Server will send ‘reply codes’ along with text • client doesn’t need to interpret text • Client will send upper-case commands

  17. Protokollműködésközben

  18. * Persistent command and reply connection Non-persistent data connection Server is listening on port 21 for connection requests * Insulates users from “raw” FTP commands *Server uses port 20 for data connections * Routes “raw” FTP commands * Receives server’s replies FTP’s Connections 2 client User Interface server User Protocol Interpreter Server Protocol Interpreter Control Connection 21 User Data Transfer Function Data Connection Server Data Transfer Function 20

  19. 2 FTP’s Connections – Establishment ftp> open strauss.udel.edu Connected to strauss.udel.edu 220 strauss FTP server ready. 530 Please login with USER and PASS client 331 Password req for haggerty. Password: User Interface 230 User haggerty logged in. ftp> USER haggerty PASS mypass server User Protocol Interpreter Server Protocol Interpreter Control Connection User Data Transfer Function Server Data Transfer Function Data Connection

  20. How FTP Works Primary Command Thread Server

  21. Enter the Client Primary Command Thread Primary Command Thread Socket (21) Client Server

  22. Server Greeting 220 Welcome! Primary Command Thread Primary Command Thread Socket (21) Client Server

  23. USER Identification USER chastine Primary Command Thread Primary Command Thread Socket (21) Client Server

  24. User Verified 331 User OK… Primary Command Thread Primary Command Thread Socket (21) Client Server

  25. PASSword Sent PASS jeffrox Primary Command Thread Primary Command Thread Socket (21) Client Server

  26. User Now Verified 230 User logged in Primary Command Thread Primary Command Thread Socket (21) Client Server

  27. What we have so far… • Client/server connected by a socket • The user identified

  28. 2 FTP’s Connections Data Transfer client ls client.txt -rw-r--r-- haggerty client.txt User Interface 226 Closing Data Connection PORT 192,168,100,173,19,137 LIST client.txt 200 Port Command Sucessful 150 Data Connection will be open shortly server User Protocol Interpreter User Protocol Interpreter Server Protocol Interpreter Server Protocol Interpreter Control Connection Passive open on Port 5001 User Data Transfer Function Server Data Transfer Function Data Connection Establish Data Connection

  29. LISTing of Files Primary Command Thread Primary Command Thread Socket (21) Client Server

  30. Set TYPE to ASCII TYPE A Primary Command Thread Primary Command Thread Socket (21) Client Server

  31. Mode of transfer • There are two modes of transfer in FTP: asciiand binary. • ASCII is used only for files saved in ASCII format (this includes Postcript files) • Binary is used for files that are formatted and saved using a wordprocessing software like WordPerfect (.txt), spreadsheets (.xls), images (.jpg, .gif), and many executable programs (.exe) and videos (.avi).

  32. Server Responds 200 Type set to A Primary Command Thread Primary Command Thread Socket (21) Client Server

  33. Now the Tricky Part PASV Primary Command Thread Primary Command Thread Socket (21) Client Server • PASV • Requests server to prepare a new socket • Server listens for client on that new port

  34. Server Sets up New Socket Returns IP and port number 227 Entering Passive Mode (168,28,245,183,28,45) Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Client Server

  35. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  36. Request the LISTing LIST Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  37. Secondary Thread Is Waiting 150 Opening ASCII mode data… Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  38. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server <Data is transferred>

  39. Secondary Socket Closes Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2845 Secondary Data Thread Client Socket (2845) Server

  40. Transfer Complete 226 Transfer Complete Primary Command Thread Primary Command Thread Socket (21) Client Server

  41. What We’ve Done Now • Sent a directory listing by: • Sending the request • Establishing a new socket on a new port • Sent/Read the data • Closed the connection • Return back to the original socket • How about for files?

  42. Transfering Files(Client - Receiving) Primary Command Thread Primary Command Thread Socket (21) Client Server

  43. Set TYPE to Image (binary) TYPE I Primary Command Thread Primary Command Thread Socket (21) Client Server

  44. Server Responds 200 Type set to I Primary Command Thread Primary Command Thread Socket (21) Client Server

  45. Tricky Part PASV Primary Command Thread Primary Command Thread Socket (21) Client Server

  46. Server Sets up New Socket Returns IP and port number 227 Entering Passive Mode (168,28,245,183,28,46) Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Client Server

  47. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  48. RETRieve the File RETR Bob.txt Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  49. Secondary Thread Is Waiting 150 Opening BINARY mode data… Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server

  50. Establish the Data Socket Primary Command Thread Primary Command Thread Socket (21) Secondary Data Thread On port 2846 Secondary Data Thread Client Socket (2846) Server <Data is transferred>

More Related