MCS-377 Lab 1: Application Layer (Fall 2016)

Due: Monday, October 10, 2016

Objective

For project 1, you will be implementing the solutions to Assignment 1 (Web server) and Assignment 3 (mail client) from Chapter 2 of your textbook. Below is a brief description of each task. The full descriptions (as well as the skeleton Python codes) are available on Moodle.

Task 1: Web Server


In this assignment, you will develop a simple Web server that is capable of processing only one HTTP request at a time. Specifically, your Web server will: By default, your web server should display helpful information about what is up to and who has connected to it. It should display a ready message along with the port it is listening on whenever it is waiting for a new client. When a client connects, it should display the IP address and port number of the client. It should then display the name of the file requested by the client. If the file was sent, it should display the bytes sent. If the client requests a missing file, display a file not found error message.

Task 2: Automated Email

Your task is to develop a simple mail client that sends email to any recipient. Your client will need to connect to a mail server, dialogue with the mail server using the SMTP protocol, and send an email message to the mail server. Both Python and Java provide a API’s for interacting with the Internet mail system, which are called smtplib and JavaMail. However, we will not be using these API’s, because they hide the details of SMTP and socket programming. Instead, you should write either a Python or Java program that establishes a TCP connection with a mail server through the socket interface,3 and sends an email message.

When testing your mail client, please be aware Gmail is a very suspicious animal and won’t accept messages or connections from just anyone.

Reports

Please refer to the full descriptions of both tasks mentioned above as well the skeleton code on Moodle. You are to complete the skeleton codes. The places where you need to fill in code are marked. Each place may require one or more lines of code. For both tasks, you do not need to do the optional exercises provided.

For deliverables, You will submit the completed programs for both tasks along with the required screen shots as mentioned in the full project descriptions. Place all the files in a folder, compress, and upload on Moodle.