Write a multi-threaded HTTP server

Assignment Help Computer Networking
Reference no: EM131684835

Objectives -

The object of this exercise is to write a multi-threaded HTTP server, showing both your understanding of the networking API and also of the programming techniques required to leverage that API effectively.

There are three small exercises which do not count for marks directly, but which are intended to help you prepare for the main element of the assignment.  You do not have to do these exercises, but you are assumed to have a full understanding of their content. 

Environment and tooling

These exercises should all be written in (preferably) C or (if you cannot program in C) Java.  They should all run, unmodified, on the school's Linux teaching systems.  If you develop on another platform, you should confirm that your code builds and runs on the school Linux machines. 

Your program should access the socket interface directly.  For C this is straightforward; for Java, you should use java.net.Socket, not one of the more abstract networking classes.

If you work in Java, your program should run from the command line using the java command; it is not sufficient to submit an Eclipse project and expect the marker to figure out how to run it.   You should include a Make file whose all target uses the javac command to compile your code.

If you work in C, there should be a Makefile whose all target builds all the required programs.

Preparatory Exercises

Write a program which accepts a single incoming connection, using listen() and accept(), and displays all received data on the screen.  You can test this program using telnet or netcat.  Once you have completed this task, swap your code with a colleague and have them test it; they should give you a one or two paragraph report on its function and the code itself.

Extend this program so that it will accept multiple connections, in parallel, and display all received traffic on the screen.  This will involve the use of pthreads, for C, or you can if you wish use fork().   For Java, you will need to use implements Runnable, extends Thread or some other threading mechanism.  Again, have a colleague (ideally a different one) evaluate your code.

Extend this program so that instead of just displaying what is sent to it, it instead parses an HTTP request and request header (you will need to read RFC 2616 for the full details) and displays the broken-out fields on the screen.  You should be able to test this with wget or curl: the client will show errors when your program closes the connection without returning any results, but your program should produce correct output on the screen.  Again, have a colleague (and, again, a different one) evaluate your code.

If requested I can set Canvas up to handle this peer feedback, but I would prefer you to actually meet and talk to people!

Main Exercise

You should write a web server which interacts correctly with a web browser, serving content from either the file system or a small database.  It should provide an index page when visited with a null URI, and then correctly handle subsequent requests arises from clicking on the items in the index.

The program should be correctly multi-threaded, and handle multiple clients connecting rapidly in parallel.

Extra marks are available for implementing any of compression, encryption with SSL or the ability to fetch byte-ranges of resources.

You should document your code at a high level (at most three pages) and provide a short diary (again, at most three pages) describing your experiences and the challenges you encountered.  You should also write briefly about what you would do differently were you to repeat the exercise.

Attachment:- Assignment file.rar

Reference no: EM131684835

Questions Cloud

Define considering physical and climatological : Why is it difficult to establish standards for acceptable levels of pollution? Explain, considering physical, climatological
Describe and demonstrate the calculations for the voc : Review the calculations demonstrated and explained regarding VOC and ES weights per gallon and per vehicle for our scenario
What are some potential ethical issues that must be consider : What are some potential ethical issues that must be considered?How might this issue impact different communities from diverse perspectives?
Economic inputs in terms of the decisions that farmers : describe 2 human/economic inputs in terms of the decisions that farmers must make in order to keep their business profitable
Write a multi-threaded HTTP server : The object of this exercise is to write a multi-threaded HTTP server, showing both your understanding of the networking API
What is one way you are currently conserving water : What is one way you are currently conserving water, What is one way that you are not conserving water
Natural pollutants of radon and biological contaminants : Explain how the natural pollutants of radon and biological contaminants could potentially be found in residence dwellings or business buildings
Discuss about the deterrence theory : How the fine line the government walks with regards to security is defined by three threat response theories.
Discuss general considerations for operation : The instrucitons are listed in the attached course syllabus under Unit II, General Considerations for Operation

Reviews

len1684835

10/20/2017 5:35:35 AM

Subject: Computer Networking. No Of Pages/Words: code. You should document your code at a high level (at most three pages) and provide a short diary (again, at most three pages) describing your experiences and the challenges you encountered. You should also write briefly about what you would do differently were you to repeat the exercise.

len1684835

10/20/2017 5:35:29 AM

You should document your code at a high level (at most three pages) and provide a short diary (again, at most three pages) describing your experiences and the challenges you encountered. You should also write briefly about what you would do differently were you to repeat the exercise. Extra marks are available for implementing any of compression, encryption with SSL or the ability to fetch byte-ranges of resources. Submission - You should submit your code as a single zip file, containing both source code and documentation.

Write a Review

Computer Networking Questions & Answers

  Networking and types of networking

This assignment explains the networking features, different kinds of networks and also how they are arranged.

  National and Global economic environment and ICICI Bank

While working in an economy, it has a separate identity but cannot operate insolently.

  Ssh or openssh server services

Write about SSH or OpenSSH server services discussion questions

  Network simulation

Network simulation on Hierarchical Network Rerouting against wormhole attacks

  Small internet works

Prepare a network simulation

  Solidify the concepts of client/server computing

One-way to solidify the concepts of client/server computing and interprocess communication is to develop the requirements for a computer game which plays "Rock, Paper, Scissors" using these techniques.

  Identify the various costs associated with the deployment

Identify the various costs associated with the deployment, operation and maintenance of a mobile-access system. Identify the benefits to the various categories of user, arising from the addition of a mobile-access facility.

  Describe how the modern view of customer service

Describe how the greater reach of telecommunication networks today affects the security of resources which an organisation provides for its employees and customers.

  Technology in improving the relationship building process

Discuss the role of Technology in improving the relationship building process Do you think that the setting of a PR department may be helpful for the ISP provider? Why?

  Remote access networks and vpns

safekeeping posture of enterprise (venture) wired and wireless LANs (WLANs), steps listed in OWASP, Securing User Services, IPV4 ip address, IPV6 address format, V4 address, VPN, Deploying Voice over IP, Remote Management of Applications and Ser..

  Dns

problems of IPV, DNS server software, TCP SYN attack, Ping of Death, Land attack, Teardrop attack, Smurf attack, Fraggle attack

  Outline the difference between an intranet and an extranet

Outline the difference between an intranet and an extranet A programmer is trying to produce an applet with the display shown in Figure 1 below such that whenever one of the checkboxes is selected the label changes to indicate correctly what has..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd