1 / 18

Chapter 9 More on HTTP and DNS

Chapter 9 More on HTTP and DNS. Professor Rick Han University of Colorado at Boulder rhan@cs.colorado.edu. Announcements. HW #4 due April 16 Programming Assignment #3 Thursday Midterm solutions on Web Lecture slides from last week on the Web Next, more on HTTP and DNS, also SMTP.

niveditha
Télécharger la présentation

Chapter 9 More on HTTP and DNS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 9More on HTTP and DNS Professor Rick Han University of Colorado at Boulder rhan@cs.colorado.edu

  2. Announcements • HW #4 due April 16 • Programming Assignment #3 Thursday • Midterm solutions on Web • Lecture slides from last week on the Web • Next, more on HTTP and DNS, also SMTP Prof. Rick Han, University of Colorado at Boulder

  3. Recap of Previous Lecture • HTTP • A Simple Stateless Request-Response Protocol • Simplicity leads to poor interaction with TCP • Persistent HTTP 1.1 multiplexes multiple HTTP requests onto a single TCP connection • Caching Proxies • Reduce client response time • Reduce wide-area network traffic • Reduce server processing • Combining Caching and Prefetching Prof. Rick Han, University of Colorado at Boulder

  4. More on HTTP • Configure the Web browser to access the Web via the HTTP proxy: • Internet Explorer: Tools  Internet Options  Connections  LAN Settings • Netscape: Edit  Preferences  Advanced  Proxies  Manual • DNS lookup by HTTP Proxy • Given URL http://www.cs.colorado.edu/index.html, then proxy must call DNS to translate www.cs.colorado.edu to 128.138.242.195 • Then, proxy establishes HTTP over TCP connection to 128.138.242.195 to retrieve URL’s page Prof. Rick Han, University of Colorado at Boulder

  5. More on HTTP (2) • Most browsers now support HTTP 1.1 • Compatibility with HTTP 1.0 is “expected” but not mandated • Eased via HTTP proxies • Load balancing via HTTP Redirect • In response to a GET request, a server can return an HTTP Redirect Response • Server selects another server that is less loaded • Client is redirected to again send GET request to less loaded server Redirect (2) HTTP Server 2 HTTP Server 1 GET (1) Client GET (3) Prof. Rick Han, University of Colorado at Boulder

  6. More on HTTP (3) • GET: • Retrieve document, No payload • One-step roundtrip process • Incorporate parameters via long URL • The server returns a response file with a MIME header identifying the type of file. • MIME was developed for email, but is reused by HTTP • POST: sent from Client to Server • typically used by HTML <form> to senddata to a back-end CGI script • Two-roundtrip process: contact form-processing server, then send data • Give information to a server, has payload • Expect a response Prof. Rick Han, University of Colorado at Boulder

  7. More on HTTP (4) • POST vs. GET • Use POST instead of GET if you want to send complex long text fields/parameters to server • PUT: sent from Client to Server • Store document at server under specified URL, • May be disabled at server to avoid modifying files • Receive a response: Created, Modified, … • POST vs. PUT • POST URL specifies the CGI process that will handle the enclosed form • PUT URL specifies the enclosed document to be created/stored Prof. Rick Han, University of Colorado at Boulder

  8. DNS Lookup Example root & edu DNS server www.cs.cmu.edu www.cs.cmu.edu NS cmu.edu cmu.edu DNS server Local DNS server NS cs.cmu.edu Client cs.cmu.edu Authoritative DNS server www=IPaddr Prof. Rick Han, University of Colorado at Boulder Courtesy: Srini Seshan

  9. More on DNS • In addition to name translation, DNS helps with • Host aliasing • DNS supports multiple host names for a single IP address, e.g. yahoo.com and www.yahoo.com • Load distribution • Instead of HTTP Redirect, use DNS! • A busy site like cnn.com will have multiple replicated Web servers, each with a different IP address • A set of IP addresses associated with cnn.com • DNS can return multiple records that match a single name • Order of replicated server addresses is rotated Prof. Rick Han, University of Colorado at Boulder

  10. DNS Message Format Identification Flags No. of Questions No. of Answer RRs 12 bytes No. of Authority RRs No. of Additional RRs Name, type fields for a query Questions (variable number of answers) Answers (variable number of resource records) RRs in response to query Authority (variable number of resource records) Records for authoritative servers Additional Info (variable number of resource records Additional “helpful info that may be used Prof. Rick Han, University of Colorado at Boulder

  11. More on DNS (2) Server Farm DNS Client • DNS helps with • Load distribution (cont.) • DNS round robin to N servers • Akamai’zing – Smarter than DNS round robin: choose the server closest to you – better response time! • Akamai serves a subset of cnn.com • Each URL in Akamai subset has a name for which the Akamai DNS server is authoritative • www.cnn.com/foo.gif  a128.g.akamai.net/foo.gif Prof. Rick Han, University of Colorado at Boulder

  12. More on DNS (3) • RFC 1794, DNS Support for Load Balancing • DNS also helps with : • Mail server aliasing • Given hotmail.com, return the specific host name • BIND is a popular name server for Unix Prof. Rick Han, University of Colorado at Boulder

  13. More on DNS (4) • Dynamic DNS: • Mapping your well-known Web name to a dynamic IP address (from DHCP) • Suppose you’ve reserved a hostname www.myweb.org to serve Web pages from your home PC • Each time your PC connects via cable/DSL, your ISP assigns your PC a different dynamic IP address via DHCP • Users won’t know your dynamic IP address but may remember your Web address. How can they reach you? • Solution: your PC includes code snippet to update DNS each time your PC gets a new IP address via DHCP • Your PC must have authorization at a DNS server to update its DNS record • Dynamic DNS services are being offered on the Web, some for free, others you pay Prof. Rick Han, University of Colorado at Boulder

  14. Load Balancing Techniques • HTTP Redirection • DNS Load Balancing • Router-based • Zany idea #1: N servers each advertise the same IP address. Let IP shortest-hop routing determine the nearest server. • Hopefully no loops. Prof. Rick Han, University of Colorado at Boulder

  15. Load Balancing Techniques (2) • Router-based • Better idea: Place an IP router in front of N servers – the router balances the load • Example: each server has different IP address, and router substitutes IP address of lightest loaded server • If a TCP connection is established to a specific server X, router must remember to route packets for this TCP connection to server X only • router can’t just choose most lightly loaded server L, because L might not be X, so server L would not be expecting server X’s TCP packets • NAT-Based (see NAT section) Prof. Rick Han, University of Colorado at Boulder

  16. Email: SMTP, POP, IMAP • SMTP – Simple Mail Transfer Protocol • Defines email header and email body • ASCII text for header and body • To:, Subject:, Date:, From:, Received: • MIME = Multipurpose Internet Mail Extensions • Supplements original email RFC 822 • Allows email to carry more than just text: images, audio, video, MS Word, … Prof. Rick Han, University of Colorado at Boulder

  17. Email: SMTP, POP, IMAP (2) • MIME = Multipurpose Internet Mail Extensions • Augments email header with fields • MIME-version:, • Content-Description:, • Content-Transfer-Encoding: • Content-Type: namely, the MIME type • text/html • application/postscript • image/gif • multipart – allows multiple types in an email, e.g. multipart/mixed; each part has its own header Prof. Rick Han, University of Colorado at Boulder

  18. Email: SMTP, POP, IMAP (3) • Mail client uses SMTP over TCP to send to mail server • Mail reader uses POP3 or IMAP4 to read email from mail server • SMTP • Sendmail is UNIX SMTP implementation • Mail may traverse several mail forwarding gateways en route to destination • Each gateway will have sendmail or an SMTP equivalent to set up a new SMTP connection • SMTP client sends a command (HELO, MAIL, RCPT, …), server responds with a code Prof. Rick Han, University of Colorado at Boulder

More Related