Compile and run your code on the linux operating system

Assignment Help Computer Networking
Reference no: EM132091519

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 https://example.com. Show the command and the output in report.
- Use telnet to attempt to download the file "wontBeThere.html" from https://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

Reference no: EM132091519

Questions Cloud

Validate the email address and return true if valid : Create a new document called l5p3 html. It should have a form with a text input box for an email address and a Submit button.
What is the average density of the mixture : How van I find the average density of the mixture; then 40 cm3 of gasoline are mixed with 50 cm3 of water. What is the average density of the mixture?
Would you be against leaving the product on the shelf : Would you be for leaving the product on the shelf because you feel your duty as a corporate manager is to maximize shareholder profits
Explain economic principles and their applications : A brief provides a snapshot, or short, written summary, of a situation or event that has occurred.
Compile and run your code on the linux operating system : CSC8415 Computer Network Programming - compile and run your code on the Linux operating system - you will build on everything you learned in assignment 0
What obligation do commercial banks with foreign exchange : What obligation do commercial banks with foreign exchange exposure have in building consumer confidence.
Why does the emission spectrum of hydrogen : Why does the emission spectrum of hydrogen or unknown source have a distinct line spectrum instead of a continuous one?
Would you offer your scientific insights : Would you offer your scientific insights that might threaten establishment views?
Newton laws of motion : Do the three of these objects react the same way to Newton's Laws of Motion? Please share your thoughts.

Reviews

len2091519

8/21/2018 3:59:22 AM

Use telnet to demonstrate what happens when the request involves:- 1. The wrong number of words in the request line. 2. The request is not "GET" 3. The file requested is not a decent absolute path 4. The file does not exist in the configuration directory 5. Successful deliver of the requested file Marks for Part 2 Marks for Part 1 is given in Part 1. • (4 marks) Configuration and logging. • (3 marks) The server accepts connections. • (3 marks) The server reads the request line and splits it into words. • (10 marks) The server gives the correct status code and reason phrase. • (5 marks) The server logs each of the circumstances. • (5 marks) The server delivers the requested file on success. • (5 marks) The server delivers explanatory text on failure. • (5 marks) Testing • Marks removed for bad indentation or code not block commented. • Marks removed for sloppy report.

len2091519

8/21/2018 3:58:48 AM

The subject is Computer Network Programming. 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. The questions are inside the doc file. Please extract the rar file attached. I need it before that as i need to push the code into the git and also need show prof the code development.

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