1 Lecture #3 Electronic Mail Protocols HAIT Summer 2005 Shimrit Tzur-David.

Slides:



Advertisements
Similar presentations
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Advertisements

1 Electronic Mail u Three major components: u user agents u mail servers u simple mail transfer protocol: SMTP u User Agent u a.k.a. “mail reader” u composing,
2: Application Layer1 ECE5650 FTP, , DNS, and P2P.
Layer Aplikasi Risanuri Hidayat. Applications and application-layer protocols Application: communicating, distributed processes –e.g., , Web, P2P.
TCP/IP Protocol Suite 1 Chapter 20 Upon completion you will be able to: Electronic Mail: SMTP, POP, and IMAP Understand four configurations of architecture.
CPSC 441: FTP & SMTP1 Application Layer: FTP & Instructor: Carey Williamson Office: ICT Class.
Chapter 2: Application layer  2.1 Web and HTTP  2.2 FTP 2-1 Lecture 5 Application Layer.
2: Application Layer1 Traceroute – roundtrip times from source to the given hop traceroute to ( ), 30 hops max, 38 byte packets.
Electronic Mail and SMTP
Ftp: File Transfer Protocol  ftp specification: RFC 959 ( file transfer FTP server FTP user interface FTP client local.
Chapter 2: Application layer  2.1 Web, HTTP and HTML (We will continue…)  2.2 FTP  2.3 SMTP 9/22/2009 Lecture 7, MAT 279, Fall
POP3 Post Office Protocol v.3. Intro The Post Office Protocol (POP) is currently the most popular TCP/IP access and retrieval protocol. It implements.
Chapter 30 Electronic Mail Representation & Transfer
Esimerkki: Sähköposti. Lappeenranta University of Technology / JP, PH, AH Electronic Mail Three major components: user agents mail servers simple mail.
Simple Mail Transfer Protocol
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Mail Server Fitri Setyorini. Content SMTP POP3 How mail server works IMAP.
Electronic Mail Three major components: SMTP user agents mail servers
Lecturer : Ms.Trần Thị Ngọc Hoa Chapter 8 File Transfer Protocol – Simple Mail Transfer Protocol.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
Electronic Mail (SMTP, POP, IMAP, MIME)
SMTP, POP3, IMAP.
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Trying out HTTP (client side) for yourself
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Mail Services.
Lecture51 Administrative Things r Grader: Yona Raekow Office hours: Wed. 1pm-3pm or Th. 11am-1pm r Homeworks.
CSE401N: Computer Networks Lecture-5 Electronic Mail S. M. Hasibul Haque Lecturer Dept. of CSE, BUET.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Communications and Networks Lecture 5 Instructor: Rina Zviel-Girshin.
Intro to Computer Networks Bob Bradley The University of Tennessee at Martin.
Review: –How do we address “a network end-point”? –What services are provided by the Internet? –What is the network logical topology observed by a network.
Application Layer Protocols Simple Mail Transfer Protocol.
1 Computer Communication & Networks Lecture 27 Application Layer: Electronic mail and FTP Waleed.
Lecturer: Maxim Podlesny Sep CSE 473 File Transfer and Electronic in Internet.
DNS,SMTP,MIME.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 7 The Application Layer.
2: Application Layer1 Reminder r Homework 1 for Wednesday: m Problems #3-5,11,16,18-20 m Half of the problems will be graded r Feel free to send me .
Sending and Receiving Mails
FTP (File Transfer Protocol) & Telnet
Simple Mail Transfer Protocol (SMTP)
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
File Transfer Protocol (FTP)
Application Layer1 Electronic Mail. Application Layer2 Electronic Mail Three major components: r user agents r mail servers r simple mail transfer protocol:
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
CSE 524: Lecture 6 Application layer protocols. Where we’re at… ● Internet architecture and history ● Internet protocols in practice ● Application layer.
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
CS440 Computer Networks 1 Neil Tang 12/01/2008.
Slides based on Carey Williamson’s: FTP & SMTP1 File Transfer Protocol (FTP) r FTP client contacts FTP server at port 21, specifying TCP as transport protocol.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
World Wide Web r Most Web pages consist of: m base HTML page, and m several referenced objects addressed by a URL r URL has two components: host name and.
COMP 431 Internet Services & Protocols
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Dr. Adil Yousif University of Alneelian – Master of CS - IT Electronic Mail.
Spring 2006 CPE : Application Layer_ 1 Special Topics in Computer Engineering Application layer: Some of these Slides are Based on Slides.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Dibyajit Computer Security Hacking dibyajit
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
Networking Applications
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
CS4470 Computer Networking Protocols
SMTP, POP3, IMAP.
Chapter 2: Application layer
Internet and Intranet Protocols and Applications
The Application Layer: SMTP, FTP
Chapter 7 Network Applications
Chapter 2 Application Layer
Part II Application Layer.
Presentation transcript:

1 Lecture #3 Electronic Mail Protocols HAIT Summer 2005 Shimrit Tzur-David

2 Message Transfer The message transfer system is concerned with relaying messages from the originator to the recipient. The simplest way to do this is to establish a transport connection from the source machine to the destination machine and then just transfer the message. After examining how this is normally done, we will examine some situations in which this does not work and what can be done about them.

3 Mail Servers mailbox contains incoming messages for user message queue of outgoing (to be sent) mail messages SMTP protocol between mail servers to send messages –client: sending mail server –“server”: receiving mail server mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

4 SMTP— The Simple Mail Transfer Protocol Uses TCP to reliably transfer message from client to server, port 25 Direct transfer: sending server to receiving server Three phases of transfer –handshaking (greeting) –transfer of messages –closure Command/response interaction –commands: ASCII text –response: status code and phrase

5 Sequence of Events After establishing the TCP connection to port 25, the sending machine, operating as the client, waits for the receiving machine, operating as the server, to talk first. The server sends a line of text giving its identity and telling whether it is prepared to receive mail. If it is not, the client releases the connection and tries again later. If the server is willing to accept , the client announces whom the is coming from and whom it is going to. If such a recipient exists at the destination, the server gives the client the go-ahead to send the message. The client sends the message and the server acknowledges it. When all the has been exchanged in both directions, the connection is released.

6 Scenario: Alice sends message to Bob 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his user agent to read message 1) Alice uses UA to compose message “to” 2) Alice’s UA sends message to her mail server; message placed in message queue 3) Client side of SMTP opens TCP connection with Bob’s mail server user agent mail server mail server user agent

7 Sample SMTP interaction S: 220 hamburger.edu SMTP service ready C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: S: 250 Sender ok C: RCPT TO: S: 250 Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself C: Do you like ketchup? C: How about pickles? C:. S: 250 Message accepted for delivery C: QUIT S: 221 hamburger.edu closing connection

8 Try SMTP Interaction for Yourself telnet servername 25 see 220 reply from server enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands The commands above let you send without using client (reader)

9 Mail Message Format SMTP: protocol for exchanging msgs Format: header lines, e.g., –To: –From: –Subject: different from SMTP commands! body –the “message”, ASCII characters only header body blank line

10 Message Format: Multimedia Extensions MIME: multimedia mail extension. Additional lines in msg header declare MIME content type From: To: 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

11 Weak Spots of SMTP Even though the SMTP protocol is completely well defined, a few problems can still arise. –Message length - some older implementations cannot handle messages exceeding 64 KB. –Timeouts - if the client and server have different timeouts, one of them may give up while the other is still busy, unexpectedly terminating the connection.

12 ESMTP To get around some of these problems, extended SMTP (ESMTP) has been defined. Clients wanting to use it should send an EHLO message instead of HELO initially. If this is rejected, then the server is a regular SMTP server, and the client should proceed in the usual way. If the EHLO is accepted, then new commands and parameters are allowed.

13 Mail access protocols SMTP: delivery/storage to receiver’s server Mail access protocol: retrieval from server –POP: Post Office Protocol, port TCP/110 authorization (agent server) and download –IMAP: Internet Mail Access Protocol, port 150 more features (more complex) manipulation of stored messages on server –HTTP: Hotmail, Yahoo! Mail, etc. user agent sender’s mail server user agent SMTP access protocol receiver’s mail server

14 POP3 Situation where both sender and receiver having a permanent connection to the Internet Situation where the sender is on-line but the receiver is not

15 POP3 Protocol POP3 begins when the user starts the mail reader. The mail reader calls up the ISP and establishes a TCP connection with the message transfer agent at port 110. Once the connection has been established, the POP3 protocol goes through three states in sequence: –Authorization - deals with having the user log in. –Transactions - deals with the user collecting the s and, for example, marking them for deletion. –Update - causes the s to be deleted.

16 POP3 Protocol – Cont. authorization phase client commands: –user: declare username –pass: password server responses –+OK –-ERR transaction phase, client: list: list message numbers retr: retrieve message by number dele: delete quit C: list S: S: S:. C: retr 1 S: S:. C: dele 1 C: retr 2 S: S:. C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on

17 Gentle Point POP3 protocol supports the ability to download a specific message or set of messages and leave them on the server. Most programs just download everything and empty the mailbox. This behavior means that in practice, the only copy is on the user's hard disk. If that crashes, all may be lost permanently.

18 Sequence of Events 1.Alice creates a message for Bob using some program (i.e., user agent) and clicks on an icon to send it. 2.The program hands the message over to the message transfer agent on Alice's host. 3.The message transfer agent sees that it is directed to so it uses DNS to look up the MX record for xyz.com. This query returns the DNS name of xyz.com's mail server. 4.The message transfer agent now looks up for the IP address of this machine using DNS again. 5.It then establishes a TCP connection to the SMTP server on port 25 of this machine. Using an SMTP command sequence analogous, it transfers the message to Bob's mailbox and breaks the TCP connection.

19 Sequence of Events – Cont. 6.Bob boots up his PC, connects to his ISP, and starts his program. 7.The program establishes a TCP connection to the POP3 server at port 110 of the ISP's mail server machine. 8.Bob's program runs the POP3 protocol to fetch the contents of the mailbox to his hard disk. 9.Once all the has been transferred, the TCP connection is released. Why?

20 IMAP – Internet Message Access Protocol What happens if a user opens his mailbox in more than one place? Many people have a single account at work or school and want to access it from work, from their home PC, from their laptop when on business trips, etc. While POP3 allows this, since it normally downloads all stored messages at each contact, the result is that the user's quickly gets spread over multiple machines, more or less at random, some of them not even the user's.

21 IMAP Policy IMAP assumes that all the will remain on the server indefinitely in multiple mailboxes. IMAP provides extensive mechanisms for reading messages or even parts of messages, a feature useful when using a slow modem to read the text part of a multipart message with large audio and video attachments. Since the working assumption is that messages will not be transferred to the user's computer for permanent storage, IMAP provides mechanisms for creating, destroying, and manipulating multiple mailboxes on the server. In this way a user can maintain a mailbox for each correspondent and move messages there from the inbox after they have been read.

22 A comparison of POP3 and IMAP FeaturePOP3IMAP Where is s stored? Where is s read? Connect time required Use of server resources Multiple mailboxes User control over downloading Partial message downloads Are disk quotas a problem? Simple to implement Keeps user state User’s PCServer Off-line On-line LittleMuch MinimalExtensive NoYes LittleGreat NoYes NoCould be YesNo YesNo

23 More about POP3 Previous example uses “download and delete” mode. Bob cannot re-read if he changes client. “Download-and-keep”: copies of messages on different clients

24 Delivery Features Many systems provide additional features for processing of incoming . For example: the ability to set up filters. –These are rules that are checked when comes in or when the user agent is started. Each rule specifies a condition and an action. –Rule examples - any message received from the boss goes to mailbox number 1, any message from a select group of friends goes to mailbox number 2, and any message containing certain objectionable words in the Subject line is discarded without comment.

25 Delivery Features – Cont. Filter - automatically categorizes incoming as either important or spam (junk ) and stores each message in the corresponding mailbox. Such filters typically work by first checking to see if the source is a known spammer. They usually examine the subject line. If hundreds of users have just received a message with the same subject line, it is probably spam. Other techniques are also used for spam detection. Forward incoming to a different address. Installation of a vacation daemon.

26 Web-Mail Some Web sites, for example, Hotmail and Yahoo, provide e- mail service. They have normal message transfer agents listening to port 25 for incoming SMTP connections. To contact, say, Hotmail, you need to establish a TCP connection over which SMTP commands can be sent in the usual way. When the user goes to the Web page, a form is presented in which the user is asked for a login name and password. When the user clicks on Sign In, the login name and password are sent to the server, which then validates them. The server finds the user's mailbox and builds a listing page, only formatted as a Web page in HTML. The Web page is then sent to the browser for display.