Application Layer Application Layer SMTP: final words Mail message format SMTP uses persistent Comparison with HTTP: SMTP: protocol for connections exchanging email msgs header HTTP: pull blank SMTP requires message RFC 822: standard for text SMTP: push line (header & body) to be in 7- message format: bit ASCII header lines, e.g., both have ASCII SMTP server uses command/response To: body CRLF.CRLF to determine interaction, status codes From: end of message Subject: HTTP: each object different from SMTP encapsulated in its own commands ! response msg body SMTP: multiple objects the “message”, ASCII sent in multipart msg characters only CSE Department CSE Department 61 62 Application Layer Application Layer Mail access protocols POP3 protocol S: +OK POP3 server ready C: user bob SMTP SMTP authorization phase access S: +OK user C: pass hungry user protocol client commands: agent agent S: +OK user successfully logged on user: declare username C: list pass: password sender’s mail receiver’s mail S: 1 498 server server server responses S: 2 912 SMTP: delivery/storage to receiver’s server S: . +OK C: retr 1 Mail access protocol: retrieval from server -ERR S: <message 1 contents> 1) POP: Post Office Protocol [RFC 1939] transaction phase, client: S: . • authorization (agent <-->server) and download C: dele 1 list: list message numbers 2) IMAP: Internet Mail Access Protocol [RFC 1730] C: retr 2 retr: retrieve message by S: <message 1 contents> • more features (more complex) number S: . • manipulation of stored msgs on server C: dele 2 dele: delete C: quit 3) HTTP: gmail, Hotmail, Yahoo! Mail, etc. quit S: +OK POP3 server signing off CSE Department CSE Department 63 64 Application Layer Application Layer POP3 (more) and IMAP Application layer: Roadmap More about POP3 IMAP Principles of network applications Previous example uses Keep all messages in Web and HTTP “ download and delete ” one place: the server mode. Allows user to FTP Bob cannot re-read e- organize messages in Electronic Mail mail if he changes folders SMTP, POP3, IMAP client IMAP keeps user state DNS “ Download-and-keep ”: across sessions: copies of messages on names of folders and P2P applications different clients mappings between message IDs and folder POP3 is stateless name across sessions CSE Department CSE Department 65 66 11
Application Layer Application Layer DNS: Domain Name System Most commonly used names People: many identifiers: Domain Name System: 张伟 1 290607 刘洋 21 199642 李霞 1 165189 2 王伟 281568 22 王勇 198720 刘敏 SSN, name, passport # distributed database 42 164133 3 王芳 268268 23 张勇 197859 43 张军 162773 implemented in hierarchy of Internet hosts, routers: 4 李伟 260980 王艳 44 李丽 162497 24 194371 many name servers 王秀英 张强 5 246737 25 李杰 191759 45 159914 IP address (32 bit) - 王平 6 李秀英 244637 张磊 46 155617 26 191065 application-layer protocol 李娜 47 王刚 154600 used for addressing 7 244223 27 王强 190266 王杰 host, routers, name servers to 48 154113 8 张秀英 236266 王军 28 189999 datagrams 49 李桂英 153218 刘伟 张杰 communicate to resolve names 9 234352 29 189117 50 刘芳 152189 30 李娟 187701 “name”, e.g., 10 张敏 233708 (address/name translation) 11 李静 232686 31 张艳 181752 ww.yahoo.com - used by 张涛 note: core Internet 12 张丽 232533 32 177993 humans 13 王静 231914 33 王涛 177978 function, implemented as 王丽 李明 14 226724 34 177898 Q: map between IP application-layer protocol 15 李强 223950 35 李艳 176676 addresses and name ? 张静 16 221483 36 王超 174891 complexity at network’s 17 李敏 213606 李勇 37 173615 “edge” 王敏 18 213603 38 王娟 171785 19 王磊 209757 刘杰 39 166929 李军 王秀兰 20 199772 40 166111 CSE Department CSE Department 67 68 Application Layer Application Layer Most Popular Names in US, 2009 DNS Why not centralize DNS? DNS services Boys Girls single point of failure hostname to IP Rank Name % +/- Rank Name % +/- 1. Jacob 0.995 (0) 1. Isabella 1.102 (+1) address translation traffic volume 2. Emma 0.885 (-1) 2. Ethan 0.938 (+1) 3. Olivia 0.861 (+1) 3. Michael 0.891 (-1) host aliasing distant centralized 4. Sophia 0.836 (+3) 4. Alexander 0.860 (+2) 5. Ava 0.786 (0) 5. William 0.844 (+3) database Canonical, alias names 6. Emily 0.759 (-3) 6. Joshua 0.831 (-2) 7. Madison 0.754 (-1) 7. Daniel 0.827 (-2) mail server aliasing maintenance 8. Abigail 0.711 (0) 8. Jayden 0.815 (+3) 9. Chloe 0.589 (+1) 9. Noah 0.814 (+6) 10. Mia 0.565 (+4) load distribution 10. Anthony 0.770 (-3) 11. Elizabeth 0.543 (-2) 11. Christopher 0.770 (-2) 12. Addison 0.528 (0) replicated Web doesn’t scale! 12. Aiden 0.756 (+4) 13. Alexis 0.491 (+2) servers: set of IP 13. Matthew 0.753 (-3) 14. Ella 0.478 (+5) 14. David 0.727 (0) 15. Samantha 0.477 (-4) addresses for one 15. Andrew 0.700 (-3) 16. Natalie 0.466 (-3) canonical name 16. Joseph 0.700 (-3) 17. Grace 0.409 (+4) 17. Logan 0.684 (+2) 18. Lily 0.400 (+6) 18. James 0.669 (-1) 19. Alyssa 0.395 (-3) 19. Ryan 0.620 (-1) 20. Ashley 0.387 (-2) CSE Department CSE Department 69 70 Application Layer Application Layer Distributed, Hierarchical Database DNS: Root name servers Root DNS Servers contacted by local name server that can not resolve name root name server: org DNS servers edu DNS servers contacts authoritative name server if name mapping not known com DNS servers gets mapping poly.edu umass.edu pbs.org returns mapping to local name server yahoo.com amazon.com DNS servers DNS servers DNS servers DNS servers DNS servers a Verisign, Dulles, VA c Cogent, Herndon, VA (also LA) Client wants IP for www.amazon.com; 1 st approx: d U Maryland College Park, MD k RIPE London (also 16 other locations) g US DoD Vienna, VA h ARL Aberdeen, MD i Autonomica, Stockholm (plus client queries a root server to find com DNS server j Verisign, ( 21 locations) 28 other locations) m WIDE Tokyo (also Seoul, e NASA Mt View, CA Paris, SF) f Internet Software C. Palo client queries com DNS server to get amazon.com Alto, CA (and 36 other locations) DNS server 13 root name servers worldwide client queries amazon.com DNS server to get IP b USC-ISI Marina del Rey, CA address for www.amazon.com l ICANN Los Angeles, CA CSE Department CSE Department 71 72 12
Application Layer Application Layer TLD and Authoritative Servers Local Name Server does not strictly belong to hierarchy Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all each ISP (residential ISP, company, top-level country domains uk, fr, ca, jp. university) has one. Network Solutions maintains servers for com TLD also called “default name server” Education for edu TLD when host makes DNS query, query is sent to its local DNS server Authoritative DNS servers: acts as proxy, forwards query into hierarchy organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers (e.g., Web, mail). can be maintained by organization or service provider CSE Department CSE Department 73 74 Application Layer Application Layer DNS name DNS name root DNS server resolution example resolution example root DNS server 2 3 recursive query: Host at cis.poly.edu 2 3 TLD DNS server puts burden of name wants IP address for 4 6 7 resolution on gaia.cs.umass.edu 5 TLD DNS server contacted name server iterated query: local DNS server heavy load? dns.poly.edu local DNS server contacted server 4 7 6 5 dns.poly.edu replies with name of 1 8 server to contact 1 8 “I don’t know this authoritative DNS server name, but ask this dns.cs.umass.edu authoritative DNS server requesting host server” dns.cs.umass.edu cis.poly.edu requesting host cis.poly.edu gaia.cs.umass.edu gaia.cs.umass.edu CSE Department CSE Department 75 76 Application Layer Application Layer DNS: caching and updating records DNS records DNS: distributed db storing resource records (RR) once (any) name server learns mapping, it caches mapping RR format: (name, value, type, ttl) cache entries timeout (disappear) after some time Type=A Type=CNAME TLD servers typically cached in local name name is hostname name is alias name for some servers value is IP address “canonical” (the real) name www.ibm.com is really • Thus root name servers not often visited Type=NS servereast.backup2.ibm.com name is domain (e.g. value is canonical name foo.com) update/notify mechanisms under design by IETF value is hostname of RFC 2136 Type=MX authoritative name http://www.ietf.org/html.charters/dnsind-charter.html value is name of mailserver server for this domain associated with name CSE Department CSE Department 77 78 13
Recommend
More recommend