Distributed Systems : Workshops

Workshop Thu 3.10 due to popular demand in computer class B221

  • Bash tutoring
    • File redirection, signals, ports
    • Netcat, especially the 5th exercise of the last exercise session
    • Look the exercises found on http://wiki.helsinki.fi/display/linuxfun. We can go through them in the workshop, if there is something that is interesting/useful
  • Discussion about
    • Clock synchronization
    • Logical scalar and vector clocks
    • Mutual exclusion

 

Workshop Mon 30.9

-Cat and Mouse debriefing

-Miscellaneous

 

Tasks for Workshop Thu 19.9.

Task 1. Explaining concepts in writing.

The goal of this session is to get a check and a bit of practice on writing skills for both the homework assignments that are returned by email, and for exam answers later on.

Form groups of 2-4. First write down your answer, then compare the results in the group by reading each other's answers either in pairs or in a "chain" where A reads B's answer, B reads C's etc. For each task, answer the following questions:

i) What did you learn from the answer, was there something unclear?
ii) Would you have something to add or other ideas for improvement?

Afterwards if you choose to, you can pick a specific answer that you want lecturer feedback on. (Again, remember that the point here is to train and get an idea of how well you can communicate conceptual things concisely in writing, so explain things in your own words - do not copy them from memory or screen.)

Note: An exam, homework, seminar papers and also your thesis should be written in a form that can be understood by other students not specializing on your specific topic.

Apply the above instructions to the following tasks:

1) Explain* the concepts of persistence (/transience) and synchronicity (/asynchronity) in communication.

2) Explain* the basic idea of RPC.

3) Explain* the different possible RPC delivery semantics and what kinds of mechanisms must be applied to provide such guarantees.

*Explain means "explain to another student taking this course".
 
Task 2: Introduction to messaging with netcat

First, get yourself familiarized with netcat by the command 'man netcat'.

Recall earlier warmup exercises on connecting to Ukko cluster nodes. Set up an ssh connection to two different ukko nodes (in two different terminal windows).

Pick an arbitrary network port number, for example between 30000 and 40000. Replace this number to <yourport> in the following commands.

On one node, start netcat ('man nc') in server (listening) mode:

nc -l <yourport>

From the other node, connect to this server:

nc <hostname> <yourport>

Learn how to communicate with netcat and how to use the echo command to send messages and how to assign the content of the message on the receiving end to a variable.

 

 

Tasks for Workshops (Thu 5.9. and Mon 9.9.)

1. Your first shell script.

Create a new text file (say, helloworld.sh) and input the following content into it:

#!/bin/sh

x=5

echo Hello world!

Then save the file, make it executable ('chmod u+x helloworld.sh') and run it (./helloworld.sh).

Now open the file again, and find out how to make a 'for' loop (to echo 'hello world' x times) and an 'if' clause in it (to echo 'hello world' only if the variable x equals 4). Alternatively, you can do this part in Python or whatever scripting language you are familiar with.

If you find you have problems with this exercise, you should join the C Programming course as soon as possible to ensure you have the necessary skills to do the programming exercises on the course. The language used does not matter so much as the basic coding skills. If you want to deepend your skills, the course Linux Fundamentals may be of interest.

 

2. SSH key management.

For the upcoming exercises involving the computational cluster, you will need to set up a key pair for ssh.

Take a look at the manual pages ('man ssh-keygen') and generate a private and public key pair for yourself. To use the key pair, the public key must be accessible in the Ukko cluster node you will use. Remember to protect your private key with a passphrase that is at least as strong as your department login's password, because this key is equivalent to your login and password. (You can use the same password as is your department login, IT support is ok with this; why?) The key passphrase is not actually stored on the key. Just do not mix your department password into any access to your home computer or other systems.

Install your generated key to your department (fs) home directory according to the instructions linked below.

Reading material as background and further instructions: OpenSSH key management, part 1: http://www.ibm.com/developerworks/library/l-keyc/index.html

Things to learn: How ssh keys work. The keys are needed to interact meaningfully with multiple nodes in the department network, such as in any exercises done on the cluster computer. While in normal department existence you can get along without this login aid, this is setup to save your time in later exercises.

 

3.  A first glance at the Ukko cluster.

Read the instructions on how to use the department high performance cluster Ukko.  http://www.cs.helsinki.fi/en/compfac/high-performance-cluster-ukko

Test your ssh key by connecting to an Ukko cluster node. First examine the report at http://www.cs.helsinki.fi/ukko/hpc-report.txt to find a node that is live and not in use by a research project.

Then use ssh-add to activate your key identity unless you already have done so.

Log on to the chosen Ukko cluster node, make sure your password was not asked, and take a look around before logging off:

'ls' - (directory listing) notice that you have access to your home directory here too. It's just like another interactive server setup!

'who' - are other interactive users logged in on the same node? For contrast, you can try this command on the actual department interactive servers.

'uptime' - how long has the node been up and running? Do they boot these nodes every week?

'top' - you can look for resource-intensive jobs running on the node, 'man top' for documentation. 'q' to quit.

Reading material as background and further instructions: OpenSSH key management, part 1: http://www.ibm.com/developerworks/library/l-keyc/index.html