We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12
SMTP, DNS
Dr. Waseem Abbass
Application Layer: 2-1
E-mail outgoing message queue user mailbox user Three major components: agent user agents mail user server mail servers agent
simple mail transfer protocol: SMTP SMTP mail user
server agent SMTP User Agent a.k.a. “mail reader” SMTP user agent mail composing, editing, reading mail messages server user e.g., Outlook, iPhone mail client agent user outgoing, incoming messages stored on agent server Application Layer: 2-2 E-mail: mail servers outgoing message queue user mailbox user mail servers: agent
mailbox contains incoming mail user
server agent messages for user SMTP message queue of outgoing (to mail server user agent be sent) mail messages SMTP SMTP protocol between mail SMTP user servers to send email messages mail agent server • client: sending mail server user agent • “server”: receiving mail server user agent
Application Layer: 2-3
E-mail: the RFC (5321) uses TCP to reliably transfer email message from client (mail server initiating connection) to server, port 25 direct transfer: sending server (acting like client) to receiving server three phases of transfer • handshaking (greeting) • transfer of messages • closure command/response interaction (like HTTP) • commands: ASCII text • response: status code and phrase messages must be in 7-bit ASCI
Application Layer: 2-4
Scenario: Alice sends e-mail to Bob 1) Alice uses UA to compose e-mail 4) SMTP client sends Alice’s message message “to” [email protected] over the TCP connection 2) Alice’s UA sends message to her 5) Bob’s mail server places mail server; message placed in the message in Bob’s message queue mailbox 3) client side of SMTP opens TCP 6) Bob invokes his user connection with Bob’s mail server agent to read message
1 user mail user
mail agent agent server server 2 3 6 4 5 Alice’s mail server Bob’s mail server Application Layer: 2-5 Sample SMTP interaction S: 220 hamburger.edu C: HELO crepes.fr S: 250 Hello crepes.fr, pleased to meet you C: MAIL FROM: <[email protected]> S: 250 [email protected]... Sender ok C: RCPT TO: <[email protected]> S: 250 [email protected] ... 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 Layer: 2-6 Try SMTP interaction for yourself: telnet <servername> 25 see 220 reply from server enter HELO, MAIL FROM:, RCPT TO:, DATA, QUIT commands above lets you send email without using e-mail client (reader)
Note: this will only work if <servername> allows telnet connections to port 25 (this is becoming increasingly rare because of security concerns)
Application Layer: 2-7
SMTP: closing observations comparison with HTTP: SMTP uses persistent HTTP: pull connections SMTP: push SMTP requires message (header & body) to be in both have ASCII command/response 7-bit ASCII interaction, status codes SMTP server uses CRLF.CRLF to determine HTTP: each object encapsulated in its end of message own response message SMTP: multiple objects sent in multipart message Application Layer: 2-8 Mail message format SMTP: protocol for exchanging e-mail messages, defined in RFC 531 (like HTTP) RFC 822 defines syntax for e-mail message itself (like HTML) header lines, e.g., header • To: blank line • From: • Subject: these lines, within the body of the email body message area different from SMTP MAIL FROM:, RCPT TO: commands! Body: the “message” , ASCII characters only Application Layer: 2-9 Mail access protocols user e-mail access user SMTP SMTP protocol agent agent (e.g., IMAP, HTTP)
sender’s e-mail receiver’s e-mail
server server
SMTP: delivery/storage of e-mail messages to receiver’s server
mail access protocol: retrieval from server • IMAP: Internet Mail Access Protocol [RFC 3501]: messages stored on server, IMAP provides retrieval, deletion, folders of stored messages on server HTTP: gmail, Hotmail, Yahoo!Mail, etc. provides web-based interface on top of SMTP (to send), IMAP (or POP) to retrieve e-mail messages Application Layer: 2-10 DNS: Domain Name System people: many identifiers: Domain Name System: • SSN, name, passport # distributed database implemented in Internet hosts, routers: hierarchy of many name servers • IP address (32 bit) - used for application-layer protocol: hosts, addressing datagrams name servers communicate to resolve • “name”, e.g., cs.umass.edu - names (address/name translation) used by humans • note: core Internet function, Q: how to map between IP implemented as application-layer address and name, and vice protocol versa ? • complexity at network’s “edge”
Application Layer: 2-11
DNS: services, structure DNS services Q: Why not centralize DNS? hostname to IP address translation single point of failure traffic volume host aliasing distant centralized database • canonical, alias names maintenance mail server aliasing load distribution A: doesn‘t scale! • replicated Web servers: many IP Comcast DNS servers addresses correspond to one alone: 600B DNS queries name per day