You are here

The HyperText Transfer Protocol

28 January, 2015 - 18:10
  1. What are the main methods supported by the first version of the HyperText Transfer Protocol (HTTP) defined in RFC 19451? What are the main types of replies sent by a http server 2?
  2. System administrators who are responsible for web servers often want to monitor these servers and check that they are running correctly. As a HTTP server uses TCP on port 80, the simplest solution is to open a TCP connection on port 80 and check that the TCP connection is accepted by the remote host. However, as HTTP is an ASCII-based protocol, it is also very easy to write a small script that downloads a web page on the server and compares its content with the expected one. Use telnet to verify that a web server is running on host rembrandt.info.ucl.ac.be 3.
  3. Instead of using telnet on port 80, it is also possible to use a command-line tool such as curl Use curl with the –trace-ascii tracefile option to store in tracefile all the information exchanged by curl when accessing the server.
    • what is the version of HTTP used by curl ?
    • can you explain the different headers placed by curl in the request ?
    • can you explain the different headers found in the response ?
  4. HTTP 1.1, specified in RFC 2616 forces the client to use the Host: in all its requests. HTTP 1.0 does not define the Host: header, by most implementations support it. By using telnet and curl retrieve the first page of the this site webserver by sending http requests with and without the Host: header. Explain the difference between the two 4.
  5. By using dig and curl, determine on which physical host the site 1, site 2 and site 3 are hosted
  6. Use curl with the –trace-ascii filename to retrieve Google . Explain what a browser such as firefox would do when retrieving this URL.
  7. The headers sent in a HTTP request allow the client to provide additional information to the server. One of these headers is the Language header that allows to indicate the preferred language of the client 5. For example, curl -HAccept-Language:en http://www.google.be’ will send to ‘http://www.google.be a HTTP request indicating English (en) as the preferred language. Does google provide a different page in French (fr) and Walloon (wa) ? Same question for this site (given the size of the homepage, use diff to compare the different pages retrieved from www.uclouvain.be)
  8. Compare the size of the Yahoo and Google web pages by downloading them with curl
  9. What is a http cookie ? List some advantages and drawbacks of using cookies on web servers.
  10. You are now responsible for the site. The government has built two datacenters containing 1000 servers each in Antwerp and Namur. This website contains static information and your objective is to balance the load between the different servers and ensures that the service remains up even if one of the datacenters is disconnected from the Internet due to flooding or other natural disasters. What are the techniques that you can use to achieve this goal ?