Network Technologies essentials Week 9: Applications: DNS and HTTP Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall, University of Washington ISBN-10: © 2014 For the book A. Tanenbaum and D. Wetherall: Computer Networks, 5 th ed, Prentice-Hall, 2011A. Tanenbaum and D. Wetherall: Computer Networks, 5 th ed, Prentice-Hall, 2011 Note that videos are numbered 8-*
Names and Addresses Names are higher-level identifiers for resources Addresses are lower-level locators for resources – Multiple levels, e.g. full name IP address Ethernet address Resolution (or lookup) is mapping a name to an address Computer Networks2 Directory Name, e.g. “Andy Tanenbaum,” or “flits.cs.vu.nl” Address, e.g. “Vrije Universiteit, Amsterdam” or IPv4 “ ” Lookup 8-2.3
DNS Zones A zone is a contiguous portion of the namespace Computer Networks3 A zone Delegation 8-2.8
Computer Networks4 DNS Resource Records (2) IP addresses of computers Name server Mail gateways
CSE 461 University of Washington5 DNS Protocol Query and response messages – Built on UDP messages, port 53 – ARQ for reliability; server is stateless! – Messages linked by a 16-bit ID field Query Response Time ClientServer ID=0x
DNS Resolution (2) flits.cs.vu.nl resolves robot.cs.washington.edu CSE 461 University of Washington
CSE 461 University of Washington7 Iterative vs. Recursive Queries Recursive query – Nameserver completes resolution and returns the final answer – E.g., flits local nameserver Iterative query – Nameserver returns the answer or who to contact next for the answer – E.g., local nameserver all others 8-3.6
Caching (2) flits.cs.vu.nl now resolves eng.washington.edu – And previous resolutions cut out most of the process CSE 461 University of Washington8 1: query 2: query UW nameserver (for washington.edu) 3: eng.washington.edu4: eng.washington.edu Local nameserver (for cs.vu.nl) I know the server for washington.edu! Cache 8-3.9
Computer Networks9 Fetching a Web page with HTTP Start with the page URL: Steps: – Resolve the server to IP address (DNS) – Set up TCP connection to the server – Send HTTP request for the page – (Await HTTP response for the page) – Execute / fetch embedded resources / render – Clean up any idle TCP connections Protocol Page on server Server ** 8-4.6
Computer Networks10 HTTP Protocol (2) Commands used in the request MethodDescription GETRead a Web page HEADRead a Web page's header POSTAppend to a Web page PUTStore a Web page DELETERemove the Web page TRACEEcho the incoming request CONNECTConnect through a proxy OPTIONSQuery options for a page Fetch page Upload data
HTTP Protocol (3) Codes returned with the response Computer Networks11 CodeMeaningExamples 1xxInformation100 = server agrees to handle client's request 2xxSuccess200 = request succeeded; 204 = no content present 3xxRedirection301 = page moved; 304 = cached page still valid 4xxClient error403 = forbidden page; 404 = page not found 5xxServer error500 = internal server error; 503 = try again later Yes!
Computer Networks12 Early Performance (3) Many reasons why PLT is larger than necessary – Sequential request/responses, even when to different servers – Multiple TCP connection setups to the same server – Multiple TCP slow-start phases Network is not used effectively – Worse with many small resources / page 8-5.6
Computer Networks13 Persistent Connections Parallel connections compete with each other for network resources – 1 parallel client ≈ 8 sequential clients? – Exacerbates network bursts, and loss Persistent connection alternative – Make 1 TCP connection to 1 server – Use it for multiple HTTP requests 8-5.9
Persistent Connections (3) Computer Networks14 One request per connection Sequential requests per connection Pipelined requests per connection
END © 2013 D. Wetherall Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, © Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey Computer Networks15