Traditional Internet Applications – Email / DNS Chapter 4 Traditional Internet Applications – Email / DNS © Bobby Hoggard, Department of Computer Science, East Carolina University These slides may not be used or duplicated without permission
Email Example: direct email transfer from one device to another Email apps on each end running constantly Sender Text Editor New Email Message alert: you have mail To: userX@abc.com Receiver New Email Message connect to abc.com Transfer Application Mail Server Text Reader New Email Message send email New Email Message abc.com To: userX@abc.com Other Message A "mailbox" is just a file on the mail server Outgoing Queue userX mailbox
Email Protocols Transfer Protocols Access Protocols Used to transfer email from a sending device to a receiving device Most common: SMTP Access Protocols Allows a user to access a mailbox to view and send messages Most common: POP3, IMAP Representation Protocols Specifies the format of the message Most common: RFC2822, MIME
SMTP Simple Mail Transfer Protocol Key Points Uses stream transfer Port: 25 Simple Mail Transfer Protocol Key Points Uses stream transfer Uses text-based control messages Sends one copy of given message to server List users one at a time, then a single copy is sent to all users on the list Allows sender to check receipient names Only transfers text messages
SMTP Example Server: example.edu Client: somewhere.com client forms a control connection to the server 220 example.edu Ready HELO somewhere.com 250 OK MAIL FROM: <john@somewhere.com> Attempt to send email from: john@somewhere.com to: three users at example.edu 250 OK RCPT TO: <bill@example.edu> 250 OK RCPT TO: <jim@example.edu> 250 OK RCPT TO: <alice@example.edu> 550 No such user
<CR><LF>.<CR><LF> SMTP Example Server: example.edu Client: somewhere.com DATA 354 End data with <CR><LF>.<CR><LF> From: John Doe <john@somewhere.com><CR><LF> To: Bill Smith <bill@example.edu><CR><LF> Cc: jim@example.edu; alice@example.edu<CR><LF> Date: Tue, 15 January 2008 16:02:43 -0500<CR><LF> Subject: Test Message<CR><LF> <CR><LF> Hello There! <CR><LF> Attempt to send email from: john@somewhere.com to: three users at example.edu <CR><LF>.<CR><LF> 250 OK QUIT 221 example.edu closing connection
Access Protocols IMAP Port: 143 POP3 Port: 110 Provides access to a mailbox (a file on the mail server) Needed because most people don't leave their computers running all the time Users access email through an email client program (ex: MS Outlook) connecting to an ISP server ISP Mail Server ISP Mail Server User 1 User 2 Email Client Email Client POP/IMAP SMTP POP/IMAP
Access Protocols Some users can access email by using a web browser (web based email service) User 1 User 2 Web Server Web Server Web Browser Web Browser HTTP HTTP IMAP/POP IMAP/POP Mail Server Mail Server SMTP
Representation Standards RFC2822 (named after the standards document that defines it) Key Points Mail message is represented as a text file Consists of a header, a blank line, and a body Header lines have the form Keyword: Information Examples: From: <email@address.com> Subject: test email Header lines starting with an uppercase 'X' can be added without affecting anything. Ex: X-Cutest-Pokemon: Pikachu
Representation Standards MIME (Multi-purpose Internet Mail Extensions) Key Points Allows the transfer of non-text data in an email message Specifies how binary data is encoded into printable characters Adds additional lines in the header to specify how the message is encoded Messages can be divided into sections, and each section encoded independently MIME is backward compatable, however a system that does not understand MIME will treat the email as a single block of text
MIME Ex: An email message with a single attachment Body Attachment Header From: email@address.com To: jim@example.com Subject: Email Test Cc: alice@example.edu X-Cutest-Pokemon: Pikachu MIME-Version: 1.0 Content-Type: Multipart/Mixed; Boundary=MIME-SEPARATOR Body all printable text MIME-SEPARATOR Attachment
DNS (Domain Name System) Port: 53 Converts readable names into IP addresses: name resolution Major steps User specifies the domain name it wants to connect to A series of DNS servers are contacted until the name is found IP address is returned back to the user User then uses the IP address to contact the device it originally wanted
DNS Hierarchy IANA – organization which oversees IP addresses ICANN – organization which oversees name registrations Root Server The highest level domain name servers in existence 13 sets of them located throughout the world See: http://www.root-servers.org/ Resolves addresses to Top Level Domain servers Top Level Domain The last segment of a domain name Examples: COM, NET, ORG, EDU, GOV, etc. See: http://www.iana.com/domains/root/db/
DNS Name Segments rhoggard.cs.ecu.edu. Administered by ECU Administered by ICANN rhoggard.cs.ecu.edu. Name of ONE computer in CS network Root Server Network on ECU campus Top Level Domain Name registered with a TLD Registrar
DNS Hierarchy Root Server Top Level Domain Server Authoritative Server Answers requests for locations to top level domain servers Top Level Domain Server Answers requests for organizations registered under a particular TLD registrar When you register a domain name, your name is registered with a company operating one of these servers Authoritative Server Answers request for a specific domain name (a specific machine address) You, or your hosting provider, will set this up after you register your domain name so that this server will point clients to your website/email server/ftp server etc. The exact authoritative server could be located under a higher level DNS server in a local network
DNS Hierarchy Root Server NET EDU COM ORG ATT SPECTRUM ECU YAHOO GOOGLE MICROSOFT REDCROSS ITCS CS MAIL LOGIN WWW WWW MSDN WWW RHOGGARD COURSEELF
DNS Hierarchy Root Server Local network administrators can set up their own DNS servers to divide up their networks any way they want COM server for foobar.com FOOBAR server for candy.foobar.com CANDY SOAP PEANUT WALNUT ALMOND
DNS Hierarchy Root Server Local network administrators can set up their own DNS servers to divide up their networks any way they want COM server for foobar.com FOOBAR CANDY SOAP server for almond.candy.foobar.com PEANUT WALNUT ALMOND
Web Browser request for Example DNS Lookup I.ROOT-SERVERS.NET https://www.dotcom-tools.com/DNS-lookup-tools.aspx K.EDU-SERVERS.NET rhoggard .cs .ecu .edu . Request to: 192.36.148.17 Try: 192.52.178.30 Request to: 192.36.148.17 Try: 150.216.1.252 SUNNY.NOC.ECU.EDU Request to: 150.216.1.252 DNS Port 53 request for: rhoggard.cs.ecu.edu Resolving Nameserver (your ISP) Try: 150.216.150.36 NS2.CS.ECU.EDU Request to: 150.216.150.36 Web Browser request for rhoggard.cs.ecu.edu Go to: 150.216.55.77 Web Server at 150.216.55.77 HTTP Port 80 request for: default page
Web Browser request for DNS Caching Root Server DNS requests are cached to try to speed up the resolution process authoritative server NOT in cache authoritative server in cache Check resolving server Resolving Nameserver (your ISP) Ask authoritative server NS2.CS.ECU.EDU Web Browser request for rhoggard.cs.ecu.edu Go to: 150.216.55.77 150.216.55.77 Check local cache Have you been there before? Check local cache www.yahoo.com 72.30.35.10 disney.com 130.211.198.204 ns2.cs.ecu.edu 150.216.150.36 www.yahoo.com 72.30.35.10 maps.google.com 172.217.9.78 mail.google.com 172.217.4.197 rhoggard.cs.ecu.edu 150.216.55.77 Add to cache
Types of DNS Entries Type A Type MX Type CNAME Name/IP combination used to point a domain name to an IP address Type MX Name/Name or Name/IP combination used to point a domain name to a mail server Type CNAME Name/Name combination, also known as an alias Used to set up a second name (an alias) that points to an already existing name
DNS Entry Examples Type Name Points To Description A corporation.com 98.130.150.7 points corporation.com to 98.130.150.7 MX corporation.com 98.130.150.26 points mail requests for corporation.com to a different machine than non-mail requests MX mail.corporation.com corporation.com sets up a second name to point to the mail server CNAME www.corporation.com corporation.com sets up a second name to point to the main server CNAME ecu.corporation.com ecu.edu sets up a second name to point to ECU's server A server1.corporation.com 98.130.150.48 sets up a name to another server (Ex: FTP server) CNAME ftp.corporation.com server1.corporation.com sets up an alias for the FTP server