On-Line CS111, Winter 2017 --- Lab 4 Description
Project 4: Embedded Systems
PROJECT GOALS
This project will familiarize you with some simple distributed systems characteristics and tools. It will also give you some experience in working with hardware for embedded systems and provide some exposure to basic tools for securing distributed systems. The goals are:
- primary: build a simple client end of a client/server distributed system.
- primary: learn how to use standard tools to provide secure encrypted communications between a client and server
- secondary: build a program to a specified protocol interface.
- secondary: obtain experience with simple networking debugging.
ASSIGNMENT OVERVIEW
The assignment is divided into three general parts.
- Building an application that emulates the use of a sensor to gather data on an embedded device.
- Convert this application to become a client using a predefined network protocol to interact with a remote server program.
- Change the basic client application to make use of SSL/TLS to communicate securely to a remote server that requires cryptographic protection of communications.
In this assignment, you will:
- Implement and demonstrate an application that uses sockets to communicate with a shared server application on a remote machine.
- Learn how to convert socket communications to use SSL/TLS to provide cryptographic protection of communications.
Your deliverables for this assignment will include:
- A program that emulates a sensor and gathers readings from that sensor.
- A test run in which your program interacts with the remote server and performs all supported operations specified in the design for the application. This test run will store a log file on the remote server machine, which will be used in grading your assignment. You will also provide a log file from your emulator's run.
- A test run in which the SSL/TLS version of the program interacts with the secure remote server and performs all supported operations specified in the design for the application. This test run will store a log file on the remote server machine, which will be used in grading your assignment. You will also provide a log file from your emulator of the run.
PART 1 - Building a emulated embedded device
SUMMARY OF DELIVERABLES
- the source for a C program and Makefile that cleanly (no warnings) builds using gcc on a Linux system, implementing the functionality specified below.
- The contents of a log file showing the program operating for at least 60 seconds.
DETAILED INSTRUCTIONS
Write a program that emulates an embedded device that accesses a temperature sensor. The program should read the sensor once per second and output its reading (in Fahrenheit) to a log file, in the format:
Timestamp Temperature
(Use a space between the timestamp and temperature, not a tab or multiple spaces.) The timestamp should be obtained by running the time() system call on machine running the emulation, and should be converted to an HH:MIN:SEC format. The temperature should be in the format ##.#. (For example, 98.6.) Produce temperatures in a reasonable manner, such as choosing a base temperature and adding or subtracting a random amount from each reading.
PART 2 - Integrate your emulated device into a client/server system
SUMMARY OF DELIVERABLES
- the source for a C module and Makefile that cleanly (no warnings) builds using gcc on a Linux system and implements the functionality specified below.
- A log file showing the temperatures your device sent to the server and all commands received from the server.
DETAILED INSTRUCTIONS
Here is a description of the device you are to emulate.
The server will be running on r01.cs.ucla.edu, on port 19000. You should be able
to connect to the server on this port from anywhere.
PART 3 - Convert your emulated sensor client program to use SSL/TLS to protect communications
SUMMARY OF DELIVERABLES
- the source for a C module and Makefile that cleanly (no warnings) builds using gcc on a Linux system and implements the functionality specified below.
- A log file showing the temperatures your device sent to the server and all commands received from the server.
DETAILED INSTRUCTIONS
The emulated device should act precisely as in Part 2, but should connect to a server that required TLS/SSL encryption of the communications between client and server.
The TLS/SSL server will be running on r01.cs.ucla.edu, on port 19050. You should be able
to connect to the server on this port from anywhere. However, if you do not properly implement TLS/SSL in your client program, it will reject your connection.