Recap SMTP and email The Application Layer: DNS Smith College, CSC 9 Sept 9, 0 q SMTP process (with handshaking) and message format q Role of user agent access protocols q Port Numbers (can google this) v SMTP v POP 0 v IMAP 3 v HTTP 80 v (DNS 3 over UDP) Scenario: Alice sends message to Bob Sample SMTP interaction user agent mail server 3 mail server user agent q In the following interaction with SMTP, which lines are v Handshaking v Transfer of message v Closure outgoing message queue user mailbox -3 -
Sample SMTP interaction fcapmaster:~ jcardell$ telnet smtp.smith.edu! Trying 3.9..3...! Connected to baton.smith.edu.! Escape character is '^]'.! 0 baton.smith.edu ESMTP Sendmail 8.3.8/8.3.8; Tue, Sep 0 :37:00-000!! C: HELO jbc.edu! S: 0 baton.smith.edu Hello [3.9.0.8], pleased to meet you! C: MAIL FROM: <judy@jbc.edu>! S: 0..0 <judy@jbc.edu>... Sender ok! C: RCPT TO: <jcardell@smith.edu>! S: 0.. <jcardell@smith.edu>... Recipient ok! C: DATA! S: 3 Enter mail, end with "." on a line by itself! C: to: Easter@Bunny.hop! C: from: Tooth@Fairy.fly! C: subject: How s Business?! C:! C: Hello Hoppy! C: Checking in to see how you re doing.! C:.! S: 0.0.0 s8gfb0q007 Message accepted for delivery! C: QUIT! Mail message format * Example of the actual message NOT part of the SMTP handshaking process q header lines, e.g., v To: S:.0.0 baton.smith.edu closing connection! - - v From: v Subject: different from SMTP commands! q body v the message, ASCII characters only header body blank line TODAY: Domain Name System q The directory system for the Internet v Used by other application layer protocols v via socket programming q Maps a hostname to an IP address v Host names use natural, human, language URL such as www.google.com v IP addresses are numerical locators used by computers (more detail in chapter ) 3 bits, bytes, in dot notation DNS: a distributed, hierarchical database Root DNS Servers com DNS servers org DNS servers edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers poly.edu umass.edu DNS servers DNS servers 7-8 a host, or client, wants the IP address for www.google.com ) Client (local server) queries root server to find the.com DNS server ) Client queries.com DNS server to get google.com DNS server 3) Client queries google.com DNS server to get the IP address for www.google.com
DNS: root name servers q contacted by local name server that can not resolve name q root name server: v contacts authoritative name server if name mapping not known v gets mapping v returns mapping to local name server e. NASA Mt View, CA f. Internet Software C. Palo Alto, CA (and 8 other sites) c. Cogent, Herndon, VA ( other sites) d. U Maryland College Park, MD h. ARL Aberdeen, MD j. Verisign, Dulles VA (9 other sites ) a. Verisign, Los Angeles CA ( other sites) b. USC-ISI Marina del Rey, CA l. ICANN Los Angeles, CA ( other sites) g. US DoD Columbus, OH ( other sites) k. RIPE London (7 other sites) i. Netnod, Stockholm (37 other sites) m. WIDE Tokyo ( other sites) 3 root name servers worldwide TLD & Authoritative Servers top-level domain (TLD) servers: v responsible for com, org, net, edu, aero, jobs, museums, and all top-level country domains, e.g.: uk, fr, ca, jp v Network Solutions maintains servers for.com TLD v Educause for.edu TLD authoritative DNS servers: v organization s own DNS server(s), providing authoritative hostname to IP mappings for organization s named hosts v can be maintained by organization or service provider -9-0 Local DNS name server q does not strictly belong to hierarchy q each ISP (residential ISP, company, university) has one v also called default name server q when host makes DNS query, query is sent to its local DNS server v has local cache of recent name-to-address translation pairs (but may be out of date) v acts as proxy, forwards query into hierarchy v When you connect to network, your host is given the IP address of the local DNS server - DNS name resolution example q host at www.smith.edu wants IP address for gaia.cs.umass.edu iterated query: v contacted server replies with name of server to contact v I don t know this name, but ask this server local DNS server dns.smith.edu 8 Requesting Host www.smith.edu root DNS server 3 7 TLD DNS server authoritative DNS server dns.cs.umass.edu gaia.cs.umass.edu - 3
DNS protocol, messages q query and reply messages, both with same message format bytes bytes DNS protocol, messages bytes bytes Message header v identification: bit # for query, reply to query uses same # v flags: query or reply recursion desired recursion available reply is authoritative identification flags # questions # answer RRs # authority RRs # additional RRs questions (variable # of questions) answers (variable # of RRs) authority (variable # of RRs) name, type fields for a query RRs in response to query records for authoritative servers identification flags # questions # answer RRs # authority RRs # additional RRs questions (variable # of questions) answers (variable # of RRs) authority (variable # of RRs) additional info (variable # of RRs) additional helpful info that may be used additional info (variable # of RRs) Application Layer -3 Application Layer - HTTP request message: general format Mail message format * Example of the actual message NOT part of the SMTP handshaking process q header lines, e.g., v To: v From: v Subject: different from SMTP commands! q body v the message, ASCII characters only header body blank line
Domain Name System protocol, messages Name, type fields for a query RRs in response to query records for authoritative servers additional helpful info that may be used DNS record format DNS: distributed db storing resource records (RR) q Type=A q Type=NS RR format: (name, value, type, ttl) v name is hostname v value is IP address v name is domain (e.g. smith.edu) v value is hostname of authoritative name server for this domain q Type=CNAME v name is alias name for some canonical (the real) name www.ibm.com is really servereast.backup.ibm.com v value is canonical name q Type=MX v value is name of mailserver associated with name 7 8 DNS records DNS: distributed db storing resource records (RR) DNS Records root DNS server RR format: (name, value, type, ttl) (hostname, IP address, A, ttl) (domain, hostname-dns-author-server, NS, ttl) (alias hostname, canonical name, CNAME, ttl) (alias hostname, mail server cname, MX, ttl) local DNS server dns.smith.edu 8 Requesting Host www.smith.edu 3 TLD DNS server 7 authoritative DNS server dns.cs.umass.edu + Type NS record with hostname of auth. server for the requested domain name + and Type A record for IP address of auth. server Type A record for IP address of hostname 9 gaia.cs.umass.edu -0
* Act out the DNS process * nslookup with Mac OS DNS protocol : query and reply messages, both with same message format Message header q identification: bit # for query, reply to query uses same # q flags q Number of records in the message itself 3 Summary of Application Design Elements q Message format v ASCII? Binary? v How handle multiple objects? q Number of connections v Persistent? Parallel connections? q State information? Stateless? q TCP or UDP (Transport Layer)? q Push or pull protocol? q How to find the server? client? peer? q Handshaking in the protocol? q Centralized? Decentralized?