Electronic Mail outgoing message queue user mailbox user
Electronic Mail outgoing message queue user mailbox user agent Three major components: r user agents r mail servers mail server SMTP r simple mail transfer protocol: smtp User Agent r a. k. a. “mail reader” r composing, editing, reading mail messages r e. g. , Eudora, pine, elm, Netscape Messenger r outgoing, incoming messages stored on server SMTP mail server user agent SMTP user agent mail server user agent 2: Application Layer 1
Electronic Mail: mail servers user agent Mail Servers r mailbox contains incoming messages (yet ot be read) for user r message queue of outgoing (to be sent) mail messages r smtp protocol between mail server to send email messages m client: sending mail server m “server”: receiving mail server SMTP mail server user agent SMTP user agent mail server user agent 2: Application Layer 2
Electronic Mail: smtp [RFC 821] r uses tcp to reliably transfer email msg from client to server, port 25 r direct transfer: sending server to receiving server r three phases of transfer m handshaking (greeting) m transfer m closure r command/response interaction m commands: ASCI text m response: status code and phrase 2: Application Layer 3
Sample smtp interaction S: C: S: C: C: C: S: 220 hamburger. edu HELO crepes. fr 250 Hello crepes. fr, pleased to meet you MAIL FROM: <alice@crepes. fr> 250 alice@crepes. fr. . . Sender ok RCPT TO: <bob@hamburger. edu> 250 bob@hamburger. edu. . . Recipient ok DATA 354 Enter mail, end with ". " on a line by itself Do you like ketchup? How about pickles? . 250 Message accepted for delivery QUIT 221 hamburger. edu closing connection 2: Application Layer 4
smtp: final words try smtp interaction for yourself: Comparison with http r telnet servername 25 r email: push r see 220 reply from server r enter HELO, MAIL FROM, RCPT TO, DATA, QUIT commands above lets you send email without using email client (reader) r http: pull r both have ASCII command/response interaction, status codes r http: multiple objects in file sent in separate connections r smtp: multiple message parts sent in one connection 2: Application Layer 5
Mail message format smtp: protocol for exchanging email msgs RFC 822: standard for text message format: r header lines, e. g. , To: m From: m Subject: different from smtp commands! header blank line body m . r body m the “message”, ASCII characters only r line containing only `. ’ 2: Application Layer 6
Message format: multimedia extensions r MIME: multimedia mail extension, RFC 2045, 2056 r additional lines in msg header declare MIME content type MIME version method used to encode data multimedia data type, subtype, parameter declaration encoded data From: alice@crepes. fr To: bob@hamburger. edu Subject: Picture of yummy crepe. MIME-Version: 1. 0 Content-Transfer-Encoding: base 64 Content-Type: image/jpeg base 64 encoded data. . . . . base 64 encoded data. 2: Application Layer 7
MIME types Text r example subtypes: plain, html Image r example subtypes: jpeg, gif Audio r exampe subtypes: basic (8 Video r example subtypes: mpeg, quicktime Application r other data that must be processed by reader before “viewable” r example subtypes: msword, octet-stream -bit mu-law encoded), 32 kadpcm (32 kbps coding) 2: Application Layer 8
Mail access protocols user agent SMTP sender’s mail server POP 3 or IMAP user agent receiver’s mail server r SMTP: delivery/storage to receiver’s server r Mail access protocol: retrieval from server m m 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 2: Application Layer 9
POP 3 protocol authorization phase r client commands: m m user: declare username pass: password r server responses m m +OK -ERR transaction phase, client: r list: list message numbers r retr: retrieve message by number r dele: delete r quit S: C: S: +OK POP 3 server ready user alice +OK pass hungry +OK user successfully logged C: S: S: S: C: C: S: list 1 498 2 912. retr 1 <message 1 contents>. dele 1 retr 2 <message 1 contents>. dele 2 quit +OK POP 3 server signing off 2: Application Layer 10 on
DNS: Domain Name System People: many identifiers: m SSN, name, Passport # Internet hosts, routers: m m IP address (32 bit) used for addressing datagrams “name”, e. g. , hermite. cs. smith. edu used by humans Q: map between IP addresses and name ? Domain Name System: r distributed database implemented in hierarchy of many name servers r application-layer protocol host, routers, name servers to communicate to resolve names (address/name translation) m note: core Internet function implemented as application-layer protocol m complexity at network’s “edge” 2: Application Layer 11
DNS name servers Why not centralize DNS? r single point of failure r traffic volume r distant centralized database r maintenance r no server has all name-to- IP address mappings local name servers: m m each ISP, company has local (default) name server host DNS query first goes to local name server authoritative name server: doesn’t scale! m m for a host: stores that host’s IP address, name can perform name/address translation for that host’s name 2: Application Layer 12
DNS: Root name servers r contacted by local name server that can not resolve name r root name server: m contacts authoritative name server if name mapping not known m gets mapping m returns mapping to local name server r ~ dozen root name servers worldwide 2: Application Layer 13
Simple DNS example host surf. eurecom. fr wants IP address of hermite. csc. smith. edu root name server 2 5 1. Contacts its local DNS server, dns. eurecom. fr 2. dns. eurecom. fr contacts local name server root name server, if dns. eurecom. fr necessary 1 6 3. root name server contacts authoritative name server, dns. umass. edu, if necessary requesting host surf. eurecom. fr 3 4 authorititive name server dns. smith. edu hermite. csc. smith. edu 2: Application Layer 14
DNS example root name server Root name server: r may not know authoratiative name server r may know intermediate name server: who to contact to find authoritative name server 6 2 7 local name server dns. eurecom. fr 1 8 requesting host 3 intermediate name server dns. smith. edu 4 5 authoritative name server dns. csc. smith. edu surf. eurecom. fr hermite. csc. smith. edu 2: Application Layer 15
DNS: iterated queries recursive query: 2 r puts burden of name resolution on contacted name server r heavy load? iterated query: r contacted server replies with name of server to contact r “I don’t know this name, but ask this server” root name server iterated query 3 4 7 local name server dns. eurecom. fr 1 8 requesting host intermediate name server dns. smith. edu 5 6 authoritative name server dns. csc. smith. edu surf. eurecom. fr hermite. csc. smith. edu 2: Application Layer 16
DNS: caching and updating records r once (any) name server learns mapping, it caches mapping m cache entries timeout (disappear) after some time r update/notify mechanisms under design by IETF m RFC 2136 m http: //www. ietf. org/html. charters/dnsind-charter. html 2: Application Layer 17
DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type, ttl) r Type=A m name is hostname m value is IP address r Type=NS m name is domain (e. g. foo. com) m value is IP address of authoritative name server for this domain r Type=CNAME m name is an alias name for some “canonical” (the real) name m value is canonical name r Type=MX m value is hostname of mailserver associated with name 2: Application Layer 18
DNS protocol, messages DNS protocol : query and reply messages, both with same message format msg header r identification: 16 bit # for query, reply to query uses same # r flags: m query or reply m recursion desired m recursion available m reply is authoritative 2: Application Layer 19
DNS protocol, messages Name, type fields for a query RRs in reponse to query records for authoritative servers additional “helpful” info that may be used 2: Application Layer 20
- Slides: 20