You are on page 1of 4

2018 – Semester 1

SE3020 – Distributed Systems

Programming Assignment 1

Marks allocated – 20

Imagine that you have been asked to develop a fire alarm monitoring system for a high-rise building.
You will be using fire alarms that contain sensors that can measure the temperature (celcius), battery
level of the sensor (percentage value) and the smoke level (out of a scale of 0-10) and the CO2 level
(parts per million. Average is around 300 in normal atmosphere). The sensors fixed to the fire alarms do
these measurements at five minute intervals. The fire alarm sensors do have JVMs with TCP/IP network
ports but they can only perform basic socket communication to send data to a central server. The
central server is at the control room and the server is part of the Local area network in the building. A
server machine is available with higher memory and processing speed to deploy the server. Each fire
alarm sensor is uniquely identified by an ID of the following form, 23-13, where the first number is the
floor number and the second number is the number of the sensor in that particular floor.

The administrative staff can connect to the server and monitor the fire alarm system in the building
remotely. At a given time, several clients may be connected to the server to monitor the status of the
fire alarm system. These clients are called ‘monitors’ by the administrative staff.

The fire alarm sensors should send periodic updates (every 1 hour) of the above readings to a remote
server. If the temperature exceeds 50 degrees Celsius or the smoke level is above 7 (out of the 0-10
scale), alerts should be sent to all monitoring clients by the server. Each monitoring client should be able
to view the IDs of the sensors connected, along with their latest readings. If required, the monitoring
stations should be able to query for the current readings of each fire alarm sensor. The system should be
scalable so that additional weather sensors and/or monitoring stations can be added as required. If a
particular sensor doesn’t send the 1 hour update, all monitoring clients should be alerted.

Each monitoring client should be able to view the number of sensors and monitoring stations (clients)
connected to the server at any given time. (Note: These two numbers should be thread safe, meaning
that when one server thread is updating these values, these valued should be locked and other threads
will not be able to update these values).
Basic security/authentication mechanisms should be there to authenticate each sensor and that data
that is sent by the sensors to the server. Also, some basic authentication method can be there to
authenticate the monitors when they connect and communicate with the server.

1. Based on the given requirements, implement a client-server system to gather and monitor
weather data at the remote base-stations. Note: You may use regular Java programs to emulate
the behavior of the IOT sensors. The emulator may randomly change the readings to emulate
the changes of readings coming from the sensor. Thus, your implementation will contain a
sensor (emulator), server and the monitor (client).

2. You may use Java Socket programming to communicate between the server and the sensors
and Java RMI to manage the communication between the server and the monitors (clients).

3. Write a report explaining the system. The report should include:

- The High level Software architecture diagram along with the software components
- System architecture
- Class/Sequence diagrams
- How the system implements the communication between the sensors and the server
- How the system implements the communication between the monitors and the server
- Assumptions made in the implementation

You may use code snippets in the report to explain the above.

The report must have an appendix with all the code that you have written (excluding the auto-
generated code). Do not paste screenshots of the code in the appendix and copy the code as
text.

The report should be no less than 8 pages (excluding the appendix) of length. The report is the
main component that should be marked. However, the code should be there to validate the
implementation.

4. Write a readme.txt file explaining how to test the given system.

Note: You should only use the Eclipse IDE to do the development and upload the source files in a Eclipse
project. Do not use a database and simply use text file/files and/or XML file/files to store/retrieve any
data that you want to run and demonstrate the application.
Note: All reports will be uploaded to Turnitin for plagiarism checking. If the turnitin similarity is above
30%, 10% of the marks will be reduced. For 50% similarity, 50% of the marks will be reduced. For reports
with 80% similarity, no marks will be given.

Note: If your submission size is larger than 10 MB, you may upload the submission to OneDrive and
share the OneDrive link (use OneDrive only). Make sure to test that the link is accessible publicly (to test
this, logout from your Office 365 account, close the browsers and open a browser and try to access the
link. Basically, you should be able to access the link even if you can’t login to your email account. If the
download link is not accessible, I can give you another attempt to upload your submission but I will have
to cap the mark at 45%, as it is effectively a resubmission and otherwise it would be unfair for those
uploaded the assignment on time. If you are uploading the OneDrive link, make sure to include that in a
text file (readme file) and indicate your name, registration number, contact number and contact email in
the same text file.

Submission: The Eclipse project with the source files, readme.txt file and the report should be uploaded
in a single zip archive. The zip file name should be your SLIIT registration number.

Note: Your submission must have each of the following components. If any one of them is missing,
you will have to resubmit. But then your mark will be capped at 45%.

1. The code and the readme.txt file


2. The report
3. Appendix in the report with the complete code (not as screenshots)
4. Working OneDrive link with the contact details (only if the submission is over 10MB)

Marking Rubric

Following rubric will be used in evaluating the assignment.

Criteria Good (10-8) Average (4-7) Poor (0-3) Weight


Application of 100%
Distributed Computing
principles in the
architecture and the
design
Socket communication 100%
implementation
RMI communication 100%
implementation
Asynchronous 100%
Communication
Thread safety 50%
Quality and the 100%
readability of the code,
with meaningful and
detailed comments.
Adoption of 50%
appropriate
security/authentication
mechanisms
Quality of the writing 100%
and formatting in the
report

You might also like