Network代写 | 18-441/741: Computer Networks

本次计算机网络代写主要是HTTP协议流传输相关

1. HTTP Server

18-441/741: Computer Networks Project 3: HTTP Pseudo Streaming

Deadline: 11:59pm EDT, Apr. 25, 2021 Questions? Ask on Piazza!

An HTTP server, often known as a web server, provides content needed by web browsers. The content could be an HTML file, a plain text file, an image, an audio file, a video, or just a binary file. In a nutshell, our HTTP server will act as a simple file server. It will take a resource identifier (URI) and locate the content for the URI in a directory relative to a content root. Then, it will generate a HTTP response message which contains information about the content (headers), and the content itself (body).

2. HTTP Protocol

The Hypertext Transfer Protocol is used to facilitate transfer of hypermedia documents (text, contents, links). The current protocol is based on RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616.html). Please familiarize yourself with the following sections. In the documentation, the server you are implementing in this project is referred to as the “origin server.”

o 200 OK (10.2.1)
o 206 Partial Content (10.2.7)
o 404 Not Found (10.4.5)
o 500 Internal Server Error (10.5.1)

o Connection (14.10)
o Content-Length (14.13) o Content-Range (14.16) o Content-Type (14.17)
o Date (14.18)
o Last-Modified (14.29)
o Range (14.35)

1 Computer Networks| 18-441/741

3. Server Requirements

Your server should be able to understand and properly generate the status codes/methods/headers listed in the previous section. Specifically, your server should:

– Successfully handle HTTP/1.1 and HTTP/1.0 GET method

o Generate “404 Not Found” response when the content could not be found o Generate“200OK”whentheservercanlocateandservetheentirerequest o Generate “206 Partial content” when the request includes Range header

(14.35), or if the requested content cannot be served in a single response

week; month; 4-digit year) For example: Sun, 06 Nov 1994 08:49:13 GMT

(Cache-Control, Age, If-*, X-Content-Duration) However, they are not required.

o text/plain (.txt)
o text/css (.css)
o text/html (.htm, .html)
o image/gif (.gif)
o image/jpeg (.jpg, .jpeg)
o image/png (.png)
o application/javascript (.js)
o video/webm (.mp4, .webm, .ogg)
o application/octet-stream (anything else)

2 Computer Networks| 18-441/741

4. Content Location

By default, the root directory of all content (often known as the content root) is located in the directory “content” relative to the directory from which the server executable file was invoked. For example, if your server is executed from the project directory as followed:

/…/project3 $> vodserver #port
Then the URL http://<server-ip-address>:<server-port>/video/video.webm should

correspond to,

/…/project3/content/video/video.webm 5. Browser Communication

Although implementing a client is not part of this project, you will need to understand the client’s behavior in order to successfully implement the server which will allow actual HTML 5 video playback on your favorite browser.

Browser Test: We will use the Firefox 78.8.0esr browser (browser version on ECE cluster machines) to grade the correctness of your server. The process of delivering a file is roughly as follows:

6. Discussions

I’m confused, where do I start?

First, relax. The first impression of a project is always a bit overwhelming. Make sure you start early. If you are not familiar with network programming, please consult the materials from the lecture and the RFCs. Once you have thought about your server design, you can start by implementing a core server (the echo

3 Computer Networks| 18-441/741

server is a good start) then implement a message parser module which can parse simple request method (just a simple GET request, ignoring other headers). After you have a basic communication server, you can begin implementing a simple file server that always responds with the entire file. Then, make sure that your server can serve simple files such as html or image files. Once you have verified that your file server works for simple files, you can implement the server range request to handle file streaming. Now, you should be able to test streaming large files (such as an MP4 video of your favorite music video).

How do I measure my server performance?

After you are finished with the functionality, you could focus on the performance part. Since your server is standard-compliant, you could use existing tools such as Apache benchmark; ab (http://httpd.apache.org/docs/2.0/programs/ab.html) to test the scalability of your server. Note that since ab only simulates a HTTP/1.0 client, you should include Connection: Keep-Alive in the response header to prevent it from hanging. Try to see how many concurrent requests (for a 10KB content) you can have, while still allowing 95% of them to be served within 500ms.

Help! I accidentally delete my working code.

Make a lot of backups! If you do not have the source when the deadline comes, you do not have the project. You may also want to use version control tools to manage your source. The ECE undergraduate cluster machines are equipped with both git and subversion tools (although learning to use them is not within the scope of this course). Make sure you have a working branch/revision available for final submission before start tuning for performance or adding features. You can always submit an early working version to Canvas.

7. Hand-in Procedure

You will submit your project to Canvas and we will test your code using the browser stated in Section 5. Please create a file named README in the primary submission directory so we know that it is the primary directory that we need to grade (we will ignore the others).

8. Deliverable Items

The deliverables are enumerated as follows,

…/project3$ make …/project3$ ant

4 Computer Networks| 18-441/741

$ ./vodserver 18441
$ java VodServer 18441

If you must use a .jar file, please make sure that we can run the following after running ant:

$ java -jar VodServer.jar 18441

submission directory (1-2 pages). Tell us about the following:

6. Grading

Partial credit will be available according to the following grading scheme,

Items Logistics

Server Performance

Required for 18-741 only (bonus for 18-441) – Handle 5000 concurrent clients!

Points (100 – 441 + 110 – 741) 10

10 10 20 10 10

5 Computer Networks| 18-441/741