INST 346
Technologies Infrastructure and Applications
Spring 2018
Assignment H9


Task: Implement the client and the simulation server for the following protocol in Python 3 (or another language that we can reasonably grade -- please ask us in advance if you prefer not to use Python 3). For full credit, your code must run correctly. Partial credit may be awarded for correctly running code that implements only some of the required functions or for code that does not run but is clearly on the right track. For aspects of the system’s behavior that are not specified, you may make any reasonable design decisions. Turn in your code as python source files (with a .py extension) using ELMS before class on the date shown in the schedule. If you wish, you may also submit a written document on ELMS with additional comments, but that is not required.

Protocol title: Thermostat Application Protocol (TAP)

Goal: TAP is an application-layer Internet protocol that is designed to allow a remote user to check the temperature of the house as measured by the thermostat, and to set the desired temperature of the thermostat. TAP uses a client-server architecture in which the thermostat functions as the server. In the simulation, the server always sends the same value when asked for the temperature (72), and the server prints the new desired temperature when asked to set the desired temperature.

Narrative description: To check the temperature, a TAP client first establishes a TCP connection with the TAP server. Upon receiving the READY message from the server, the client then sends a CHECK message. The server responds with a TEMP message containing the current measured temperature (in the simulation, the server always responds with the value 72). Upon receiving the TEMP message, the client then displays the temperature to the user and closes the TCP connection. To set the temperature, the TAP client first establishes a TCP connection with the TAP server. Upon receiving the READY message from the server the client then sends a SET message containing the new desired temperature. The server responds with a SETPOINT message that contains the new desired temperature after it has been set. Upon receiving the SETPOINT message, the client then informs the user that the temperature has been set and closes the TCP connection.

Messages that can be sent by the Client:

TAP 1.0 CHECK \r\n
TAP 1.0 SET {temp} \r\n

Messages that can be sent by the Server:

TAP 1.0 READY \r\n
TAP 1.0 TEMP {temp} \r\n
TAP 1.0 SETPOINT {temp} \r\n

In the SET, TEMP and SETPOINT messages, {temp} must be an two-digit ASCII sequence representing an integer between 35 and 99 that is to be interpreted as a temperature on the Fahrenheit scale.




Doug Oard
Last modified: Wed Mar 28 20:47:27 2018