Homework 3

Due Wednesday 10/12 @ 11:59pm

Problem 1: Basic Socket Programming

Write a program to send an ASCII message over the network, wait for a response, print out the response and exit. The message should consist of your student ID number, sent in a UDP datagram to csgateway.clarku.edu at port 1928. A process will be running on that host to service your incoming messages and transmit a message back to the port of origin. Submit a listing of your (hopefully) short program, the message you transmitted, and the response you received.

This warmup exercise is designed to give you some background you will need for the first programming project. The essential facts about socket programming you will need are in Sections 2.7 and 2.8 of the text, and posted on the course schedule.

Send me an email if your program gets no response from the server. I may need to restart it.
Test your program by running it on csgateway.clarku.edu itself. This will avoid any network security concerns that might reject your connection.

Problem 2: Basic Web Sever

In this assigment, you will develop a simple web server that is capable of processing a single request. Specifically, your web server will

You should start with one of the sample programs and modify it to work as above. Test your program by placing some HTML files into your subdirectory and requesting them from a web browser. You can also test your server with netcat (nc), curl, or wget.

Optional: Implement the "If-Modified-Since" option on the HTTP GET request, and the "Last-Modified" header entry on the HTTP reponse headers. See RFC2616 and search within the page for those two header strings.

Notes:

What to Submit

Submit your two programs as well as screenshots verifying that they work properly on Moodle. I may ask you to demo your programs to me.

Grading Criteria

Part 1: 30%
Part 2: 70%

Academic Honesty and Collaboration

Cooperation is recommended in understanding programming concepts and system features. But the actual solution of the assignments including all programming must be your individual work. For example, copying without attribution any part of someone else's program is plagiarism, even if you have modified the code. The University takes acts of cheating and plagiarism very seriously.