Ask Computer Network & Security Expert

The task is to create a webserver.

The files are attaches with the mail. The files contain a server.c file which is a working file we have to modify netSrvDemo.c and use telnet to test it.

Assignment Topics

Recall that in assignment 0, you learned :-
- The use of the Git repository.
- The use of a makefile.
- C command line arguments.
- Using pointers in C
- Calling functions in C
- Writing functions in C
- Encapsulation in C.
- Configuration
- Logging
- Error handling
In Assignment 1, you will build on everything you learned in assignment 0. In addition to the above, you will learn :-
- Accepting TCP connections.
- Reading from TCP connections.
- Writing to TCP connections.
- Parsing HTTP text.
- Sending HTTP text.
- Opening and reading from file.
- Write a TCP server.
About this assignment
CscNetLib
You will use CscNetLib networking library, beginning with the demonstrations in the Samples directory. You need to obtain the latest version of CscNetLib (i.e. version 1.9.0). The version number of the library exists in the file "std.h". Build it and install it, before attempting the assignment.

Network Framework Documentation
The documentation for CscNetLib routines exists in the network framework header files, and you will need to read these carefully in order to complete the work in this assignment.

For example, if you want to know just what a given netCli_???() routine does, and what the return value is, you will find the documentation for the routine immediately before the prototype for that routine in the file "netCli.h" in the place where you installed it.
If you get stuck
If you are stuck at any stage which is likely then seek help on the forums. Hopefully someone has already had the same problems as yourself, and you can read the solution in the forums. If not, then you need to ask.
Develop a bit at a time.
It is good practice, and in this course your marks depend on it. You need to plan your delta (small improvement) so that your increment can be tested. Get the delta working and test that before moving on.
You MUST check your work in with Git
You need to check your code into the Git repository provided for this course (NOT GitHub), and push it to the server regularly. This is good practice normally, and in this course your marks depend on it. There are marks associated with your report, but failure to check in your code regularly will incur the loss of the marks associated with the code. Code with no development history is worth zero marks.
Checked into the correct place
You may need to make a new directory in your Git repository called "Ass1", and it will have subdirectories within that directory as needed.
Quality code
The student is expected to produce quality code. The code should be:-
- Consistently formatted throughout using Horstmann, Allman or K&R indent style , with Allman being preferred.
- Block commented.
- Not use many global variables.
- Use modules (functions).
Testable on Linux
Your marker will inspect, compile and run your code on the Linux operating system as provided for this course. If it does not work on the linux test machine then the marker will say that it does not work.
It builds using make

The marker will go to the directory associated with the question and inspect the code. He or she will type the command "make" in order to compile the program.
No errors or warnings

Errors mean that it does not work, but compiler warnings will cost marks. Compiler warnings are usually an indication of something not being done correctly. If you cannot ascertain the cause of a compiler error or warning, then seek help in the tutorials or the course forums.
Submit the report
Your work will not be assessed until you submit the report via the USQ submission. The submission date of your assignment is deemed to be the date of the USQ assignment submission.
Your own work please
Be warned, the issue of plagiarism is taken seriously, and the penalties are harsh. USQ policies on plagiarism may be found here.

Part 1
(Goes in the report)

HTTP
- Explain in your own words the purpose of each of the "words" or "fields" of a request line.
- Explain how the parameters of a CGI GET request are bundled into the request-URI.
- Explain percent encoding.
- Explain in your own words the purpose of each of the "words" or "fields" of a response line.
- What is the purpose of the "host" header of a request, and why it is mandatory.
- Explain the Content-Type header. What is the difference between "text/html" and "application/html".
Observing HTTP in action
- Use telnet to download the file "index.html" from http://example.com. Show the command and the output in report.
- Use telnet to attempt to download the file "wontBeThere.html" from http://bology.com.au. This one times out pretty fast, so you will have to be ready to paste your HTTP request into your telnet conversation. Show the command and the output in report.
netSrvDemo
- Build and test netSrvDemo. You will need to use two command line windows to do this. In one command line window, invoke netSrvDemo. In the other command line window, invoke the telnet command with the host "localhost" and the port number 9991 as arguments. Type some text, and press enter. Take screenshots of your two command line windows and paste them into your report.
- Copy the function main() from netSrvDemo.c into your report, and comment every line of code.

Part 2

Your task
You will implement a very basic HTTP 1.0 web server, with error handling, that can deliver files. You can test your server using telnet while you are developing it, but when completed, you should be able to point a standard web browser at it.
You may well be able to re-use nearly all the code from assignment 0.
Pseudocode

* Initialise logging.
* Read configuration.
* Initialise server object.
* Loop:-
* Get a connection
* Read only the first line (which should be a request line).
* Split the line into words
* if there are the wrong number of words.
* Send appropriate HTTP rejection. (status code 400)
* else if the request is not "GET"
* Send appropriate HTTP rejection. (status code 501)
* else if the file is not a decent absolute path
* Send appropriate HTTP rejection. (status code 404)
* else if the file does not exist in the configuration directory
* Send appropriate HTTP rejection. (status code 404)
* else
* Send appropriate HTTP acceptance. (status code 200)
* close the connection and free resources.

Attachment:- Assignment.zip

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M93078990
  • Price:- $170

Guranteed 48 Hours Delivery, In Price:- $170

Have any Question?


Related Questions in Computer Network & Security

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Advanced network design assessment - human factors in

Advanced Network Design Assessment - Human factors in network analysis and design Purpose of the assessment - This assignment is designed to assess students' knowledge and skills related to the following learning outcome ...

Advanced network design assessment - human factors in

Advanced Network Design Assessment - Human factors in network analysis and design Purpose of the assessment - This assignment is designed to assess students' knowledge and skills related to the following learning outcome ...

Assignment descriptionproject scope a typical network

Assignment Description Project Scope: A typical network layout diagram of a firm is given below for illustrative purposes only. The service requirements are enclosed. Figure. Network layout of a firm Service requirements ...

Assignment descriptionproject scope a typical network

Assignment Description Project Scope: A typical network layout diagram of a firm is given below for illustrative purposes only. The service requirements are enclosed. Figure. Network layout of a firm Service requirements ...

After reading this weeks materials please respond to two 2

After reading this week's materials, please respond to TWO (2) of the following questions. AND PROVIDE CITATION IN APA 1. Describe the differences between bus, ring, star and mesh topologies. 2. Explain the TCP/IP Model ...

The abstract should not be more than 250 words describe

The abstract should not be more than 250 words. Describe your project, focusing on research questions and research method for next stage of the project. 1. Introduction [The introduction should describe what the project ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As