The HyperText Transfer Protocol
The HyperText Transfer Protocol¶
An important difference between HTTP/1.0, HTTP/1.1 and HTTP/2.0 is their utilization of the underlying transport connections. Answer the three questions below to confirm that you understand the difference between these versions of the HTTP protocol.
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/1.x 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 or ncat to verify that a web server is running on host www.computer-networking.info 1.
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.
HTTP 1.1, specified in RFC 2616, forces the client to include the Host: header in all its requests. HTTP 1.0 does not define the Host: header, but most implementations support it. By using telnet and curl retrieve the first page of the https://www.computer-networking.info web server 2 by sending http requests with and without the Host: header. Explain the difference between the two.
The headers sent in a HTTP request allow the client to provide additional information to the server. One of these headers is the Accept-Language header that allows indicating the preferred language of the client 3. 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 provides a different page in French (fr) and Walloon (wa) ? Same question for http://www.uclouvain.be (given the size of the homepage, use
diffto compare the different pages retrieved from www.uclouvain.be).
The ipvfoo extension on google chrome allows the user to visually detect whether a website is using IPv6 and IPv4, but also to see which web sites have been contacted when rendering a given web page. Some websites are distributed over several dozens of different servers. Can you find one ?
Some websites are reachable over both IPv4 and IPv6 while others are only reachable over IPv4 4. You can use the -6 (resp. -4) option to force curl to only use IPv6 (resp. IPv4). Verify that www.computer-networking.info is reachable over IPv6 and IPv4 and then check whether your university website already supports IPv6.
curl supports a huge number of options and parameters that are described in its man page Some of them allow you to force the utilization of a specific version of HTTP. These include –http0.9, –http1.0, –http1.1 and –http2. Using the latter, verify whether your favorite website supports HTTP/2.0.
As for the DNS, besides using software tools that implement the HTTP protocols, it can also be useful to analyze packet traces with wireshark . The exercises below contain simple packet traces collected with different versions of the HTTP protocol.
The minimum command sent to a HTTP server is GET / HTTP/1.0 followed by CRLF and a blank line.
This syllabus is now hosted on a web server using HTTPS (port 443) instead of HTTP (port 80).
The list of available language tags can be found at http://www.iana.org/assignments/language-subtag-registry. Versions in other formats are available at http://www.langtag.net/registries.html. Additional information about the support of multiple languages in Internet protocols may be found in rfc5646.
There are probably very few websites that only support IPv6 and not IPv4. If you find one, let us know by submitting a pull-request to change this exercise.