DOC PREVIEW
NU EECS 340 - Web Client And Server Project Part A

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 340 Project Part A Dinda, Winter 2003 Page 1 of 11 Web Client And Server Project Part A Overview In this part of the project, your group will build a simple web client and a succession of servers to which it can connect. In addition you, will learn how to checkout and build Minet. The goal is to slowly introduce you to Unix, Minet, and socket programming and get you to a stage where you will be able to tackle the subsequent parts of the project. The client and servers you’ll build will run both on the kernel stack and on the Minet stack. The last server that you will construct will have roughly the same structure as the TCP and IP layers of the network stack you will build. There are also extra credit servers you may build that are structured like a real high performance web server or cache, such as Inktomi’s Traffic Server, the Squid cache, Apache, or Microsoft’s IIS. HTTP and HTML The combination of HTTP, the Hypertext Transport Protocol, and HTML, the Hypertext Markup Language, forms the basis for the World Wide Web. HTTP provides a standard way for a client to request typed content from a server, and for a server to return such data to the client. “Typed content” simply means a bunch of bytes annotated with information (a MIME type) that tells us how we should interpret them. For example, the MIME type text/plain tells us that the bytes are unadorned ASCII text. You will implement a greatly simplified version of HTTP 1.0. HTML (type text/html) content provides a standard way to encode structured text that can contain pointers to other typed content. A web browser parses an HTML page, fetches all the content it refers to, and then renders the page and the additional embedded content appropriately. HTTP Example In this project, you will only implement HTTP, and only a tiny subset of HTTP 1.0 at that. HTTP was originally a very simple, but very inefficient protocol. As a result of fixing its efficiency problems, modern HTTP is considerably more complicated. It’s current specification, RFC 2616, is over a hundred pages long! Fortunately, for the purposes of this project, we can ignore most of the specification and implement a tiny subset. The HTTP protocol works on top of TCP, a reliable stream-oriented transport protocol, and is based on human-readable messages. Because of these two facts, we can use the telnet program to investigate how HTTP works. We’ll use telnet in the role of the client and www.cs.northwestern.edu in the role of the server. The typed content we’ll transfer is the CS department’s home page. This is essentially the same as fetching the home page using your favorite web browser.CS 340 Project Part A Dinda, Winter 2003 Page 2 of 11 The following shows what this looks like for the URL http://www.cs.northwestern.edu/index.html. The text in bold is what you would type, while the text in italic are the parts of the response that we’ll talk about. The first thing to notice is that we are opening a TCP connection to port 80 (telnet looks up the service “http” in the list /etc/services and discovers that it is a TCP service that runs on port 80.) Telnet does a DNS lookup on the host www.cs.northwestern.edu and finds that it is at IP address 129.105.99.240. It then does a reverse lookup on the IP address to find the canonical name of the machine (www is an alias for godzilla). It then opens the connection and lets us type. “GET /index.html HTTP/1.0” is the most basic form of an HTTP 1.0 request, and the form that you will implement. It says “please give me the file that you think of as /index.html using the 1.0 version of the HTTP protocol.” The blank line demarcates the end of the request. This is necessary because a more complex request may place further conditions (on additional lines) on what the client is willing to accept and how it is willing to accept it. $ telnet www.cs.northwestern.edu http Trying 129.105.99.240... Connected to Godzilla.cs.nwu.edu (129.105.99.240). Escape character is '^]'. GET /index.html HTTP/1.0 (blank line) HTTP/1.1 200 OK Date: Tue, 12 Sep 2000 14:55:18 GMT Server: Apache/1.2.6 Red Hat Last-Modified: Wed, 06 Sep 2000 22:57:54 GMT ETag: "194822-2ab9-39b6cbf2" Content-Length: 10937 Accept-Ranges: bytes Connection: close Content-Type: text/html <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> … </html> Connection closed by foreign host. $CS 340 Project Part A Dinda, Winter 2003 Page 3 of 11 The response always begins with a line that states the version of the protocol that the server speaks (“HTTP/1.1” in this case), an error code (“200”), and a textual description of what that error code means (“OK”). Next, the server provides a bunch of information about the content it is about the send as well as information about itself and what kinds of services it can provide. The most critical lines here are “Content-Length: 10937”, which tells us that the content will consist of 10937 bytes, and “Content-Type: text/html”, which tells us how to interpret the content we shall receive. A blank line demarcates the end of the response header and the beginning of the actual content. After the content has been sent, the server closes the connection. You can find correct implementations of the http client and servers (as binaries) that you’ll build in this project in /home/pdinda/netclass-execs, accessible on any TLAB machine. Part 0: Get, build, configure, and run your Minet Stack You will check out the Minet sources from a CVS repository. Using this mechanism, it’ll be easy for us to distribute Minet updates to you should they be required. CVS is a commonly used revision control system. There is more information available on CVS on the course web page. To get your copy of Minet, first decide where you want to place it. We recommend /home/you, which is accessible from all TLAB machines. Start by changing to the directory you select. Next, checkout minet: cvs –d /home/pdinda/CVS_MINET co minet-netclass-w03 Now you should have a subdirectory minet-netclass-w03. Congratulations! You should put this directory on your path: export PATH=$PATH:/home/you/minet-netclass-w03 Now, for this very first time you build, you need to create default dependencies. cd minet-netclass-w03 touch .dependencies Now you can make the dependencies, clean, and build Minet and your project: make clean make depend make


View Full Document

NU EECS 340 - Web Client And Server Project Part A

Download Web Client And Server Project Part A
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Web Client And Server Project Part A and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Web Client And Server Project Part A 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?