ftp & e lectronic mail د. عـــادل يوسف أبو القاسم

38
FTP & ELECTRONIC MAIL د م س ا ق ل و ا ب ا ف س و ب .عادل

Upload: darrell-owens

Post on 26-Dec-2015

245 views

Category:

Documents


0 download

TRANSCRIPT

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

FTP & ELECTRONIC MAIL

القاسم. د أبو يوسف عـــادل

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

FTP (FILE TRANSFER PROTOCOL)

FTP is a protocol for transferring a file to/ from one host to another host.

FTP is a client/server model.

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

FTP IS A CLIENT/SERVER MODEL

client: side that initiates transfer (either

to/from remote)server: remote host ftp server: port 21

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

FTP: SEPARATE CONTROL DATA CONNECTIONS

FTP client contacts FTP server at port 21, TCP is transport protocol.

client authorized over control connectionclient browses remote directory by sending

commands over control connection.when server receives file transfer command,

server opens second TCP connection (for file) to client

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

FTP: SEPARATE CONTROL DATA CONNECTIONS CONT.

The port 21 is used for the control connection and the port 20 for the data connection.

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

FTP COMMANDS RESPONSESSample commands:sent as ASCII text over control channel

USER usernamePASS passwordLIST

return list of file in current directory RETR filename retrieves (gets) file

STOR filename stores (puts) file onto remote host

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

SAMPLE RETURN CODESstatus code and phrase (as in HTTP)331 Username OK, password required125 data connection already open; transfer

starting425 Can’t open data connection452 Error writing file

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

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)

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

We show an example of anonymous FTP. We assume that some public data are available at internic.net.

Example (2)

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

Electronic Mail

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

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:

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

Electronic Mail Cont.

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

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

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

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.

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

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

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

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

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

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.

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

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)

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

SMTP has direct transfer from sending server to receiving servercommand/response interaction

commands: ASCII text response: status code and phrase

messages must be in 7-bit ASCIISMTP uses persistent connections

SMTP Cont.

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

.1 Alice تستخدمUA (User Agent) النشاءالى وارساله [email protected]بريد

جهاز UAال 2. بارسال Aliceفي يقومالى والذي Alice’smail serverالرسالة

ال في الرسالة .message queueيضع.3Client side ال برتكول في SMTPمن

Alice’smail server بفتح TCPيقومconnection معBob’s mail server

Scenario: Alice sends message to Bob (1)

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

.4 SMTP client رسالة بارسال يقومAlice ال خالل .TCP connectionمن

.5Bob’s mail server الرسالة بوضع يقوم .Bob ‘s mail boxفي

.6Bob باستخدام user agentيقوم. الرسالة لقراءة

Scenario: Alice sends message to Bob(2)

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

Scenario: Alice sends message to Bob(3)

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

ملفات • الرسال يستخدم منهما كلآخر . الى جهاز من

يستخدم • منهما persistentكلconnections

Comparison with HTTP (The similarities)

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

• HTTP is a pull protocol – على معلومات برفع ما شخص يقوم حيث

Web server باستخدام المستخدمون ويقومهذه to pullلقراءة HTTPبرتكول

ال من .serverالمعلومات•The TCP connection بواسطة انشاءها يتم

. الملف على الحصول يريد الذي الجهازالمقابل • حيث SMTP is a push protocolفي

ال بارسال serverان يقوم pushesالمرسلالمستقبل .serverلل

ال • ان شاءها TCP connectionكما ان يتم. الملف ارسال يريد الذي الجهاز بواسطة

Comparison with HTTP (The differences)

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

Mail message format

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

•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

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

على • تحتوى ايميل رسالة محتوى الرسالال غير user agentفإن ASCII textبيانات

يضيف ان يجب في 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.

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

• 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.

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

29

AL: MESSAGE FORMAT: MULTIMEDIA EXTENSIONS MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content type

From: [email protected] To: [email protected] Subject: Picture of yummy crepe. MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg

base64 encoded data ..... ......................... ......base64 encoded data

multimedia datatype, subtype,

parameter declaration

method usedto encode data

MIME version

encoded data

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

البريد • رسائل مستلم كان الماضي فيبالدخول تصله التي الرسائل يقرأ االلكتروني

(logging ) ال جهاز غالبا , serverالىبتنفيذ , Telnetباستخدام يقوم ذلك وبعد

. الجهاز ذلك في الرسائل قراءة برامجبقراءة • يقوم المستخدم فأن اآلن لكن

باستخدام تقوم user agentالرسائل والتيجهاز في الرسائل قراءة برامج بتنفيذ

الجهاز local PCالمستلم ذلك كان سواءعن office PC, a home PC, or aعبارة

portable PC

Mail access protocols

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

ال • ال user agentبتشغيل local PCفيالمزايا من بكثير يتمتع ان للمستخدم يمكن

ال رسائل عرض على multimediaكالقدرةال .attachmentsوعرض

ال • اشهر تعمل mail user agentsمن والتي Eudora, Microsoft'sهي local PCsعلى

Outlook Express, and Netscape's Messenger.

يعمل • دائما يكون ان يجب المستلم جهازيتمكن حتى باالنترنت متصال يكون ان ويجب

. الجديدة الرسائل استالم من

Mail access protocols Cont.

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

لمعظم • عملي غير يعتبر السيناريو هذا لكن. االنترنت مستخمي

ال • بتشغيل يقوم المستخدم ذلك عن { بدالuser agent ال لل local PCفي يصل لكن

mailbox خالل يكون shared mail serverمنويتشارك يعمل ودائما باالنترنت متصال دائما

. المستخدمين من مجموعة فيهال • ادارته mail serverهذا تتم ما عادة

ال تكون user's ISPبواسطة ان يمكن والتيجامعة . او معهد او سكني مجمع او شركة

Mail access protocols Cont.

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

لدينا • انه بما على user agentsاآلن يعملlocal PCs ولديناmail servers بواسطة مقدم

ISPs , لل يسمح برتكول الى نحتاج userفإنناagent ال باالتصال .the mail serverو

Mail access protocols Cont.

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

34

MAIL 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.

useragent

sender’s mail server

useragent

SMTP SMTP POP3 orIMAP

receiver’s mail server

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

35

WEB BASED E-MAILMore 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.

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

36

WEB BASED E-MAIL CONT.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.

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

37

WEB BASED E-MAIL CONT.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.

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

Thank You