Slide 1Web HistoryWeb HistoryWeb History (cont)Internet HostsWeb ServersWeb ContentStatic and Dynamic ContentURLsHow Clients and Servers Use URLsAnatomy of an HTTP TransactionAnatomy of an HTTP Transaction, Take 2HTTP RequestsHTTP Requests (cont)HTTP VersionsHTTP ResponsesGET Request to Apache Server From Firefox BrowserGET Response From Apache ServerTiny Web ServerTiny OperationTiny Serving Static ContentServing Dynamic ContentServing Dynamic Content (cont)Serving Dynamic Content (cont)Issues in Serving Dynamic ContentCGIThe add.com ExperienceServing Dynamic Content With GETServing Dynamic Content With GETServing Dynamic Content With GETAdditional CGI Environment VariablesEven More CGI Environment VariablesServing Dynamic Content With GETServing Dynamic Content With GETTiny Serving Dynamic ContentData Transfer MechanismsChunked Encoding ExampleProxiesWhy Proxies?For More InformationCarnegie Mellon1Web Services15-213: Introduction to Computer Systems21st Lecture, Nov. 4, 2010Instructors: Randy Bryant and Dave O’HallaronCarnegie Mellon2Web History1945: Vannevar Bush, “As we may think”, Atlantic Monthly, July, 1945.Describes the idea of a distributed hypertext system.A “memex” that mimics the “web of trails” in our minds.“Consider a future device for individual use, which is a sort of mechanized private file and library. It needs a name, and to coin one at random, "memex" will do. A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility. It is an enlarged intimate supplement to his memory.”Carnegie Mellon3Web History1989:Tim Berners-Lee (CERN) writes internal proposal to develop a distributed hypertext system.Connects “a web of notes with links.”Intended to help CERN physicists in large projects share and manage information 1990:Tim BL writes a graphical browser for Next machines.Carnegie Mellon4Web History (cont)1992NCSA server released26 WWW servers worldwide1993Marc Andreessen releases first version of NCSA Mosaic browserMosaic version released for (Windows, Mac, Unix).Web (port 80) traffic at 1% of NSFNET backbone traffic.Over 200 WWW servers worldwide.1994Andreessen and colleagues leave NCSA to form “Mosaic Communications Corp” (predecessor to Netscape).Carnegie Mellon5Internet HostsHow many of the 232 IP addresses have registered domain names?Carnegie Mellon6Web ServersWebserverHTTP requestHTTP response(content)Clients and servers communicate using the HyperText Transfer Protocol (HTTP)Client and server establish TCP connectionClient requests contentServer responds with requested contentClient and server close connection (eventually)Current version is HTTP/1.1RFC 2616, June, 1999. Webclient(browser) http://www.w3.org/Protocols/rfc2616/rfc2616.htmlIPTCPHTTPDatagramsStreamsWeb contentCarnegie Mellon7Web ContentWeb servers return content to clientscontent: a sequence of bytes with an associated MIME (Multipurpose Internet Mail Extensions) typeExample MIME typestext/html HTML documenttext/plain Unformatted textapplication/postscript Postcript documentimage/gif Binary image encoded in GIF formatimage/jpeg Binary image encoded in JPEG formatCarnegie Mellon8Static and Dynamic ContentThe content returned in HTTP responses can be either static or dynamic.Static content: content stored in files and retrieved in response to an HTTP requestExamples: HTML files, images, audio clips.Request identifies content fileDynamic content: content produced on-the-fly in response to an HTTP requestExample: content produced by a program executed by the server on behalf of the client.Request identifies file containing executable codeBottom line: All Web content is associated with a file that is managed by the server.Carnegie Mellon9URLsEach file managed by a server has a unique name called a URL (Universal Resource Locator)URLs for static content:http://www.cs.cmu.edu:80/index.htmlhttp://www.cs.cmu.edu/index.htmlhttp://www.cs.cmu.eduIdentifies a file called index.html, managed by a Web server at www.cs.cmu.edu that is listening on port 80.URLs for dynamic content:http://www.cs.cmu.edu:8000/cgi-bin/proc?15000&213Identifies an executable file called proc, managed by a Web server at www.cs.cmu.edu that is listening on port 8000, that should be called with two argument strings: 15000 and 213.Carnegie Mellon10How Clients and Servers Use URLsExample URL: http://www.cmu.edu:80/index.htmlClients use prefix (http://www.cmu.edu:80) to infer:What kind of server to contact (Web server)Where the server is (www.cmu.edu)What port it is listening on (80)Servers use suffix (/index.html) to:Determine if request is for static or dynamic content.No hard and fast rules for this.Convention: executables reside in cgi-bin directoryFind file on file system.Initial “/” in suffix denotes home directory for requested content.Minimal suffix is “/”, which all servers expand to some default home page (e.g., index.html).Carnegie Mellon11Anatomy of an HTTP Transactionunix> telnet www.cmu.edu 80 Client: open connection to serverTrying 128.2.10.162... Telnet prints 3 lines to the terminalConnected to www.cmu.edu.Escape character is '^]'.GET / HTTP/1.1 Client: request linehost: www.cmu.edu Client: required HTTP/1.1 HOST header Client: empty line terminates headers.HTTP/1.1 301 Moved Permanently Server: response lineLocation: http://www.cmu.edu/index.shtml Client should try againConnection closed by foreign host. Server: closes connectionunix> Client: closes connection and terminatesCarnegie Mellon12Anatomy of an HTTP Transaction, Take 2unix> telnet www.cmu.edu 80 Client: open connection to serverTrying 128.2.10.162... Telnet prints 3 lines to the terminalConnected to www.cmu.edu.Escape character is '^]'.GET /index.shtml HTTP/1.1 Client: request linehost: www.cmu.edu Client: required HTTP/1.1 HOST header Client: empty line terminates headers.HTTP/1.1 200 OK Server: responds with web pageDate: Fri, 29 Oct 2010 19:41:08 GMTServer: Apache/1.3.39 (Unix) mod_pubcookie/3.3.3 ...Transfer-Encoding: chunkedContent-Type: text/html ... Lots of stuffConnection closed by foreign host. Server: closes connectionunix> Client: closes
View Full Document