Presentation is loading. Please wait.

Presentation is loading. Please wait.

FTP & E LECTRONIC MAIL د. عـــادل يوسف أبو القاسم.

Similar presentations


Presentation on theme: "FTP & E LECTRONIC MAIL د. عـــادل يوسف أبو القاسم."— Presentation transcript:

1 FTP & E LECTRONIC MAIL د. عـــادل يوسف أبو القاسم

2 FTP (F ILE T RANSFER P ROTOCOL ) FTP is a protocol for transferring a file to/ from one host to another host. FTP is a client/server model.

3 FTP IS A CLIENT / SERVER MODEL client: side that initiates transfer (either to/from remote) server: remote host ftp server : port 21

4 FTP: SEPARATE CONTROL DATA CONNECTIONS FTP client contacts FTP server at port 21, TCP is transport protocol. client authorized over control connection client browses remote directory by sending commands over control connection. when server receives file transfer command, server opens second TCP connection (for file) to client

5 FTP: SEPARATE CONTROL DATA CONNECTIONS C ONT. The port 21 is used for the control connection and the port 20 for the data connection.

6 FTP COMMANDS RESPONSES Sample commands: sent as ASCII text over control channel USER username PASS password LIST return list of file in current directory RETR filename retrieves (gets) file STOR filename stores (puts) file onto remote host

7 S AMPLE RETURN CODES status code and phrase (as in HTTP) 331 Username OK, password required 125 data connection already open; transfer starting 425 Can’t open data connection 452 Error writing file

8 8 The following shows an actual FTP session that parallels Example 21.1. The colored lines show the responses from the server control connection; the black lines show the commands sent by the client. The lines in white with black background show data transfer. Example (1)

9 We show an example of anonymous FTP. We assume that some public data are available at internic.net. Example (2)

10 Electronic Mail

11  Just like ordinary mail, email is asynchronous people send and read messages when it is convenient for them, without having to coordinate with other peoples' schedules.  Three major components: 1.user agents 2.mail servers 3.simple mail transfer protocol: SMTP Electronic Mail:

12 Electronic Mail Cont.

13 Alice's mail server transfers Alice's message to Bob's mail server.

14 User Agents (UA)  User agents allow users to read, reply to, forward, save, and compose messages.  When Alice is finished composing her message, her user agent sends the message to her mail server, where the message is placed in the mail server's outgoing message queue.  When Bob wants to read a message, his user agent obtains the message from his mailbox in his mail server.

15  GUI (graphical user interface) user agents became popular, allowing users to view and compose multimedia messages.  Currently, Eudora, Microsoft's Outlook Express, and Netscape's Messenger are among the popular GUI user agents for email. GUI user agents

16  Mail servers form the core of the e-mail infrastructure.  Each recipient, such as Bob, has a mailbox located in one of the mail servers.  Bob's mailbox manages and maintains the messages that have been sent to him.  A typical message starts its journey in the sender's user agent, travels to the sender's mail server, and then travels to the recipient's mail server, where it is deposited in the recipient's mailbox. Mail Servers

17  When Bob wants to access the messages in his mailbox, the mail server containing the mailbox authenticates Bob (with user names and passwords).  Alice's mail server must also deal with failures in Bob's mail server.  If Alice's server cannot deliver mail to Bob's server, Alice's server holds the message in a message queue and attempts to transfer the message later.  Reattempts are often done every 30 minutes or so; if there is no success after several days, the server removes the message and notifies the sender (Alice) with an email message. Mail Servers Cont.

18  SMTP uses the reliable data transfer service of TCP to transfer mail from the sender's mail server to the recipient's mail server on port 25.  SMTP has two sides: client side والذي يتم تنفيذه في ال server المرسل. و server side والذي يتم تنفيذه في ال server المستلم. كل من ال server side و ال client side من برتكول SMTP موجودة في كل mail server.  When a mail server sends mail (to other mail servers), it acts as an SMTP client.  When a mail server receives mail (from other mail servers) it acts as an SMTP server. Simple Mail Transfer Protocol (SMTP)

19  SMTP has direct transfer from sending server to receiving server  command/response interaction  commands: ASCII text  response: status code and phrase  messages must be in 7-bit ASCII  SMTP uses persistent connections SMTP Cont.

20 1. Alice تستخدم UA (User Agent) لانشاء بريد وارساله الى bob@school.edu. 2. ال UA في جهاز Alice يقوم بارسال الرسالة الى Alice’smail server والذي يضع الرسالة في ال message queue. 3.Client side من برتكول ال SMTP في Alice’smail server يقوم بفتح TCP connection مع Bob’s mail server Scenario: Alice sends message to Bob (1)

21 4. SMTP client يقوم بارسال رسالة Alice من خلال ال TCP connection. 5.Bob’s mail server يقوم بوضع الرسالة في Bob ‘s mail box. 6.Bob يقوم باستخدام user agent لقراءة الرسالة. Scenario: Alice sends message to Bob(2)

22 Scenario: Alice sends message to Bob(3)

23 كل منهما يستخدم لارسال ملفات من جهاز الى آخر. كل منهما يستخدم persistent connections Comparison with HTTP (The similarities)

24 HTTP is a pull protocol – حيث يقوم شخص ما برفع معلومات على Web server ويقوم المستخدمون باستخدام برتكول HTTP لقراءة to pull هذه المعلومات من ال server. The TCP connection يتم انشاءها بواسطة الجهاز الذي يريد الحصول على الملف. في المقابل SMTP is a push protocol حيث ان ال server المرسل يقوم بارسال pushes لل server المستقبل. كما ان ال TCP connection يتم ان شاءها بواسطة الجهاز الذي يريد ارسال الملف. Comparison with HTTP (The differences)

25 Mail message format

26 While the message headers described in RFC 822 are satisfactory for sending ordinary ASCII text, they are not sufficiently rich enough for multimedia messages (e.g., messages with images, audio and video) or for carrying non-ASCII text formats (e.g., characters used by languages other than English). The MIME Extension for Non-ASCII Data

27 لارسال محتوى رسالة ايميل تحتوى على بيانات غير ال ASCII text فإن user agent للمرسل يجب ان يضيف headers جديدة في الرسالة. Two key MIME headers for supporting multimedia are the Content-Type: header and the Content-Transfer-Encoding: header. The Content-Type: header allows the receiving user agent to take an appropriate action on the message. The MIME Extension for Non-ASCII Data Cont.

28 For example, by indicating that the message body contains a JPEG image, the receiving user agent can direct the message body to a JPEG decompression routine. The MIME Extension for Non-ASCII Data Cont.

29 29 AL: M ESSAGE FORMAT : MULTIMEDIA EXTENSIONS MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg base64 encoded data....................................base64 encoded data multimedia data type, subtype, parameter declaration method used to encode data MIME version encoded data

30 في الماضي كان مستلم رسائل البريد الالكتروني يقرأ الرسائل التي تصله بالدخول (logging ) الى جهاز ال server, غالبا باستخدام Telnet, وبعد ذلك يقوم بتنفيذ برامج قراءة الرسائل في ذلك الجهاز. لكن الآن فأن المستخدم يقوم بقراءة الرسائل باستخدام user agent والتي تقوم بتنفيذ برامج قراءة الرسائل في جهاز المستلم local PC سواء كان ذلك الجهاز عبارة عن office PC, a home PC, or a portable PC Mail access protocols

31 بتشغيل ال user agent في ال local PC يمكن للمستخدم ان يتمتع بكثير من المزايا كالقدرة على عرض رسائل ال multimedia وعرض ال attachments. من اشهر ال mail user agents والتي تعمل على local PCs هي Eudora, Microsoft's Outlook Express, and Netscape's Messenger. جهاز المستلم يجب ان يكون دائما يعمل ويجب ان يكون متصلا بالانترنت حتى يتمكن من استلام الرسائل الجديدة. Mail access protocols Cont.

32 لكن هذا السيناريو يعتبر غير عملي لمعظم مستخمي الانترنت. بدلاً عن ذلك المستخدم يقوم بتشغيل ال user agent في ال local PC لكن يصل لل mailbox من خلال shared mail server يكون دائما متصلا بالانترنت ودائما يعمل ويتشارك فيه مجموعة من المستخدمين. هذا ال mail server عادة ما تتم ادارته بواسطة ال user's ISP والتي يمكن ان تكون شركة او مجمع سكني او معهد او جامعة. Mail access protocols Cont.

33 الآن بما انه لدينا user agents يعمل على local PCs ولدينا mail servers مقدم بواسطة ISPs, فإننا نحتاج الى برتكول يسمح لل user agent و ال the mail server بالاتصال. Mail access protocols Cont.

34 34 M AIL ACCESS PROTOCOLS SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server POP: Post Office Protocol [RFC 1939] authorization (agent server) and download IMAP: Internet Mail Access Protocol [RFC 1730] more features (more complex) manipulation of stored msgs on server HTTP: Hotmail, Yahoo! Mail, etc. user agent sender’s mail server user agent SMTP POP3 or IMAP receiver’s mail server

35 35 W EB BASED E - MAIL More and more users today are using browser- based email services such as Hotmail or Yahoo! Mail. With these servers, the user agent is an ordinary Web browser and the user communicates with its mailbox on its mail server via HTTP. When a recipient, such as Bob, wants to access the messages in his mailbox, the messages are sent from Bob's mail server to Bob's browser using the HTTP protocol rather than the POP3 or IMAP protocol.

36 36 W EB BASED E - MAIL C ONT. When a sender with an account on an web- based email server, wants to send a message, the message is sent from his browser to his mail server over HTTP rather than over SMTP. The mail server, however, still sends messages to, and receives messages from, other mail servers using SMTP. This solution to mail access is enormously convenient for the user on the go.

37 37 W EB BASED E - MAIL C ONT. The user need only to be able to access a browser in order to send and receive messages. The browser can be in an Internet cafe, in a friend's house, in a hotel room with a Web TV, Web-based email is so convenient however, Its principle disadvantage is that it can be slow, as the server is typically far from the client and interaction with the server is done through CGI scripts.

38 Thank You


Download ppt "FTP & E LECTRONIC MAIL د. عـــادل يوسف أبو القاسم."

Similar presentations


Ads by Google