Application Layer1 Electronic Mail. Application Layer2 Electronic Mail Three major components: r user agents r mail servers r simple mail transfer protocol:

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.
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
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.
1 Lecture #3 Electronic Mail Protocols HAIT Summer 2005 Shimrit Tzur-David.
Electronic Mail Three major components: SMTP user agents mail servers
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)
Internet Engineering Course
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
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.
Electronic Mail. Most heavily used application on any network Uses client-server architecture –Electronic mail client accepts mail from user and delivers.
Chapter 7: Internet-Based Applications Business Data Communications, 6e.
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.
Electronic Mail Originally –Memo sent from one user to another Now –Memo sent to one or more mailboxes Mailbox –Destination point for messages.
1 Applications Electronic Mail. 2 Electronic Mail Many user applications use client-server architecture. Electronic mail client accepts mail.
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
Simple Mail Transfer Protocol (SMTP)
TCOM 509 – Internet Protocols (TCP/IP) Lecture 06_c Application Protocols: HTTP, FTP, SMTP Instructor: Dr. Li-Chuan Chen Date: 10/06/2003 Based in part.
File Transfer Protocol (FTP)
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.
Lecture 6: Sun: 8/5/1435 Distributed Applications Lecturer/ Kawther Abas CS- 492 : Distributed system & Parallel Processing.
Computer Networks with Internet Technology William Stallings Chapter 03 Traditional Applications.
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.
Chapter 16: Distributed Applications Business Data Communications, 4e.
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
26.1 Electronic Mail Sending/Receiving Mail Addresses User Agent MIME Mail Transfer Agent Mail Access 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.
SMTP - Simple Mail Transfer Protocol POP - Post Office Protocol
Networking Applications
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
SMTP, POP3, IMAP.
CS- 492 : Distributed system & Parallel Processing
Chapter 2: Application layer
Internet and Intranet Protocols and Applications
William Stallings Data and Computer Communications
The Application Layer: SMTP, FTP
Chapter 2 Application Layer
Presentation transcript:

Application Layer1 Electronic Mail

Application Layer2 Electronic Mail Three major components: r user agents r mail servers r simple mail transfer protocol: SMTP User Agent r a.k.a. “mail reader” r composing, editing, reading mail messages r e.g., Eudora, Outlook, elm, Netscape Messenger r outgoing, incoming messages stored on server user mailbox outgoing message queue mail server user agent user agent user agent mail server user agent user agent mail server user agent SMTP

Application Layer3 Electronic Mail: mail servers Mail Servers r mailbox contains incoming messages for user r message queue of outgoing (to be sent) mail messages r 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

Application Layer4 The Entire System

Application Layer5 Electronic Mail: SMTP [RFC 2821] r uses TCP to reliably transfer message from client to server, port 25  SMTP uses persistent connections r direct transfer: sending server to receiving server r three phases of transfer  handshaking (greeting)  transfer of messages  closure r command/response interaction  commands: ASCII text  response: status code and phrase r SMTP uses info written on envelope of mail  Message header r Does not look at contents  Message body r messages must be in 7-bit ASCII r Other functions:  address lookup  address verification

Application Layer6 Scenario: Alice sends message to Bob 1) Alice uses UA to compose message and “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 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 user agent mail server mail server user agent

Application Layer7 Sample SMTP interaction S: 220 hamburger.edu 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

Application Layer8 Try SMTP interaction for yourself:  telnet servername 25 r see 220 reply from server r enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send without using client (reader)

Application Layer9 [codd:~] [4:18pm] -> telnet 25 Trying Connected to vonneumann.cs.uakron.edu. Escape character is '^]'. 220 vonneumann.cs.uakron.edu ESMTP Sendmail 8.9.3/8.9.3; Mon, 12 Nov :18: (EST) HELO cs.uakron.edu 250 vonneumann.cs.uakron.edu Hello codd.cs.uakron.edu [ ], pleased to meet you MAIL FROM: 250 Sender ok RCPT TO: 250 Recipient ok DATA 354 Enter mail, end with "." on a line by itself This is a test mail message to myself!!!. 250 Message accepted for delivery QUIT 221 vonneumann.cs.uakron.edu closing connection Connection closed by foreign host.

Application Layer10 Mail Message Contents r Each queued message has:  Message text RFC 822 header with message envelope and list of recipients Message body, composed by user  A list of mail destinations Derived by user agent from header May be listed in header May require expansion of mailing lists May need replacement of mnemonic names with mailbox names

Application Layer11 Possible Errors r Host unreachable r Host out of operation r TCP connection fail during transfer r Sender can re-queue mail  Give up after a period r Faulty destination address  User error  Target user changed address  Redirect if possible  Inform user if not

Application Layer12 SMTP System Overview r Commands and responses between sender and receiver r Initiative with sender  Establishes TCP connection r Sender sends commands to receiver r e.g. HELO r Each command generates exactly one reply r e.g. 250 requested mail action ok; completed

Application Layer13 SMTP Replies r Leading digit indicates category  Positive completion reply (2xx)  Positive intermediate reply (3xx)  Transient negative completion reply (4xx)  Permanent negative completion reply (5xx)

Application Layer14 Operation Phases r Connection setup r Exchange of command-response pairs r Connection termination

Application Layer15 Connection Setup r Sender opens TCP connection with receiver r Once connected, receiver identifies itself  220 service ready r Sender identifies itself  HELO r Receiver accepts sender’s identification  250 OK r If mail service not available, step 2 above becomes:  421 service not available

Application Layer16 Mail Transfer r Sender may send one or more messages to receiver r MAIL command identifies originator  Gives reverse path to used for error reporting  Receiver returns 250 OK or appropriate fail/error message r One or more RCPT commands identifies recipients for the message  Separate reply for each recipient r DATA command transfers message text  End of message indicated by line containing just period (.)

Application Layer17 Closing Connection r Two steps r Sender sends QUIT and waits for reply r Then initiate TCP close operation r Receiver initiates TCP close after sending reply to QUIT

Application Layer18 Electronic Mailboxes and Addresses r users have an electronic mailbox into which mail is deposited r Usually associated with computer account; one user may have different electronic mailboxes r User accesses mail with a mail reader program r Electronic mailbox is identified by an e- mail address

Application Layer19 Internet Mail Addressing r User portion or mailbox portion is site specific  Dang  XuanHien_T_Dang  r Host portion or computer portion is domain name r Source mail client  Resolves destination name using DNS (MX, if available)  Contacts mail delivery server at destination  Copies mail to server r Destination mail server  Interprets user name according to local mailbox addresses  Places mail in appropriate mailbox

Application Layer20 message format r Simple two-part format  Header includes delivery information  Body carries text of message r Header and body separated by blank line

Application Layer21 Mail message format SMTP: protocol for exchanging msgs RFC 822: standard for text message format: r header lines, e.g.,  To:  From:  Subject: different from SMTP commands! r body  the “message”, ASCII characters only header body blank line

Application Layer22 Headers r Lines of text in format keyword: information r keyword identifies information; information can appear in any order r Essential information:  To: list of recipients  From: sender  Cc: list of copy recipients r Useful information  Reply-to: different address than From:  Received-by: for debugging r Frivolous information:  Favorite drink: lemonade  Phase-of-the-moon: gibbous

Application Layer23 Data in r Original Internet mail carried only 7-bit ASCII data r Couldn’t contain arbitrary binary values; e.g., executable program r Techniques for encoding binary data allowed transport of binary data r Uuencode: three 8-bit binary values as four ASCII characters (6 bits each)  Also carries file name and protection information  Incurs 33% overhead  Requires manual intervention

Application Layer24 Multipurpose Internet Mail Extension (MIME) r Extension to RFC822 r SMTP cannot transmit executables  Uuencode and other schemes are available Not standardized r Can not transmit text including international characters (e.g. â, å, ä, è, é, ê, ë)  Need 8 bit ASCII r Servers may reject mail over certain size r Translation between ASCII and EBCDIC not standard r SMTP gateways to X.400 can not handle none text data in X.400 messages r Some SMTP implementations do not adhere to standard  CRLF, truncate or wrap long lines, removal of white space, etc.

Application Layer25 MIME r Multipart Internet Mail Extensions - Extends and automates encoding mechanisms r Allows inclusion of separate components – programs, pictures, audio clips – in a single mail message r Sending program identifies the components so receiving program can automatically extract and inform mail recipient  Header includes MIME-Version: 1.0 Content-Type: Multipart/Mixed; Boundary=Mime_separator  Separator line gives information about specific encoding Content-Type: text/plain

Application Layer26 MIME (cont.) r MIME is extensible – sender and receiver agree on encoding scheme r MIME is compatible with existing mail systems  Everything encoded as ASCII  Headers and separators ignored by non-MIME mail systems r MIME encapsulates binary data in ASCII mail envelope

Application Layer27 MIME

Application Layer28 Overview of MIME r Five new message header fields  MIME version  Content type  Content transfer encoding  Content Id  Content Description r Number of content formats defines r Transfer encoding defined

Application Layer29 Content Types r Text body r Multipart  Mixed, Parallel, Alternative, Digest r Message  RFC 822, Partial, External-body r Image  jpeg, gif r Video  mpeg r Audio  Basic r Application  Postscript  octet stream

Application Layer30 MIME Transfer Encodings r Reliable delivery across wide largest range of environments r Content transfer encoding field  Six values  Three (7bit, 8bit, binary) no encoding done Provide info about nature of data r Quoted-printable  Data largely printable ASCII characters  Non-printing characters represented by hex code r Base64  Maps arbitrary binary input onto printable output r X-token  Named nonstandard encoding

Application Layer31 Message format: multimedia extensions r MIME: multimedia mail extension, RFC 2045, 2056 r 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

Application Layer32 Programs as mail recipients r Can arrange for box to be associated with a program rather than a user’s mail reader r Incoming mail automatically processed as input to program r Example – mailing list subscription administration r Can be used to implement client-server processing  Client request in incoming mail message  Server response in returned mail reply

Application Layer33 Mailing Lists and Forwarders r addresses can be attached to programs as well as electronic mailboxes r Mail exploder or mail forwarder resends copies of message to addresses in mailing list  UNIX mail program sendmail provides mail aliases  Mailing list processor, e.g. listserv, can also interpret subscription management commands

Application Layer34 Mail Gateways r Mailing list processing may take significant resources in large organizations r May be segregated to a dedicated server computer: mail gateway  Provides single mail destination point for all incoming mail  Can use MX records in DNS to cause all mail to be delivered to gateway

Application Layer35 Mail gateways and forwarding r Users within an organization may want to read mail on local or departmental computer r Can arrange to have mail forwarded from mail gateway r Message now makes multiple hops for delivery r Hops may be recorded in header r Forwarded mail may use proprietary (non- SMTP) mail system

Application Layer36 Mail Gateways and Addresses r Organization may want to use uniform naming for external mail r Internally, may be delivered to many different systems with different naming conventions r Mail gateways can translate addresses

Application Layer37 Mailbox Access r Where should mailbox be located? r Users want to access mail from most commonly used computer r Cannot always use desktop computer as mail server  Not always running  Requires multitasking OS  Requires local disk storage r Can TELNET to remote computer with mail server

Application Layer38 Mail Access Protocols r Typically users do NOT run a server on their local PC r User agent accesses a mailbox from a shared mail server r Mail access protocol transfers mail from server to local PC r 2 popular protocols:  POP3 (Post Office Protocol v3)  IMAP (Internet Mail Access Protocol) r Can’t use SMTP because getting messages is a pull operation & SMTP is a push protocol.

Application Layer39 Mail Access Protocol r Instead of TELNET, use protocol that accesses mail on remote computer directly r TCP/IP suite includes Post Office Protocol (POP) for remote mailbox access  Computer with mailboxes runs POP server  User runs POP client on local computer  POP client can access and retrieve messages from mailbox  Requires authentication (password)  Local computer uses SMTP for outgoing mail

Application Layer40 Protocols

Application Layer41 POP3 and SMTP

Application Layer42 POP3 r Three phases  Authorization  Transaction  Update r During a POP3 session, the server maintains state information r POP3 downloads mail messages to the local machine – not good for “nomadic user”

Application Layer43 POP3 protocol authorization phase r client commands:  user: declare username  pass: password r server responses  +OK  -ERR transaction phase, client:  list: list message numbers  retr: retrieve message by number  dele: delete r 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

Application Layer44 Dialup Access and POP r POP useful for dialup connection  User’s computer not always connected  Can download all mail at once and read off-line  Can compose mail off-line and mail in one connection

Application Layer45 IMAP r Internet Mail Access Protocol r Allows users to manipulate remote mailboxes r Must maintain info about user (e.g., folder hierarchy) even after the user quits r IMAP server is always in 1 of 4 states:  Nonauthenticated  Authenticated  Selected  Logout

Application Layer46 POP3 and IMAP More about POP3 r Previous example uses “download and delete” mode. r Bob cannot re-read e- mail if he changes client r “Download-and-keep”: copies of messages on different clients r POP3 is stateless across sessions IMAP r Keep all messages in one place: the server r Allows user to organize messages in folders r IMAP keeps user state across sessions:  names of folders and mappings between message IDs and folder name

Application Layer47 Mail access protocols r SMTP: delivery/storage to receiver’s server r 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 access protocol receiver’s mail server

Application Layer48 Web-based s r Problem: Suppose Alice, with a web-based account (such as Hotmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application- layer protocols that are used to move the message between the two hosts. r Solution: Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.

Application Layer49 SMTP, FTP and HTTP r Connections: – All use TCP – SMTP uses persistent connections – FTP persistent control channel, non-persistent data channel per file. – HTTP uses both persistent and non-persistent channels r Data Flow – FTP and HTTP: pull (user requests files) – SMTP: push ( sent to receiver without request, result can be spam!) r All have ASCII command/response interaction, status codes r HTTP: each object encapsulated in its own response msg r FTP: one data channel per file r SMTP: multiple objects sent in multipart msg

Application Layer50 Summary for r Electronic mail allows quick, asynchronous communication across entire Internet. r Simple Mail Transfer Protocol (SMTP) is Internet standard for mail delivery r Can attach addresses to programs for processing  Mailing lists  Other client-server applications r Mail gateways  Provide uniform user addressing outside organizations  Translate from Internet mail (e.g. SMTP) to proprietary systems r Post Office Protocol (POP) and Internet Mail Access Protocol (IMAP) allow remote access to electronic mailboxes.