scuola superiore sant’anna project assignments operating systems

8
Scuola Superiore Sant’Anna Project Assignments Operating Systems

Post on 21-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Scuola Superiore Sant’Anna

Project Assignments

Operating Systems

Page 2: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 1

• A multi-threaded server– the goal is to provide a file repository– similar to ftp– the server should be able to accept requests for

• showing the list of files in the repository

• getting one or more files

• putting one or more files

– Access should be regulated through a configuration file• the file contains the username and password and permissions of the users

• all registered users can read all the files

• “special” users can also put files in the server

– Communication through TCP sockets

Page 3: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 2

• A variation of project 1• Two servers on two computers

– the two computers contain exactly the same files– when a client requests a file

• the first half of the file is obtained by server 1

• the second half of the file is obtained by server 2

• the two halves are transferred in parallel

– E.g. BitTorrent

• Hint– Both the client and the server must be multi-threaded programs– In particular, the client should be able to receive two streams in

parallel (with two threads)

Page 4: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 3

• A distributed environment– The goal is to automatically distribute the load across a server farm– N computers, each one running a server– One of these runs a special server S– Clients send requests of running a program “dummy” to S– S forwards the request to one of the N computers– The program standard output is forwarded back to the client

Server 1 Server 2

Server

Client A

Client B

stdout

stdout

Page 5: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 3 – cont

• Structure of the dummy– The dummy program simply sends some output back on the std

output– Does not open files or it does not access any other local resource– For example, it could be a program that periodically sends out a

random number on stdout– However, such output should be sent back to the client!

• Structure of server S– The server should be able to “balance” the load between the N

computers– It should send the request to the free server first, and then to the one

with less serving requests

Page 6: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 4

• Distributed memory– Simulate a distributed memory in the following way:– N computers– Each computer stores M blocks of memory, each one of 4 Kb– A client can access a block of memory with the following functions:

• lock(int block);

• read(int block, void* pointer);

• write(int block, void *pointer);

• unlock(int block);

– This is translated to a request to the corresponding server– Different clients on different computers can access the same block

Page 7: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 5

• A simple Peer to Peer with notifications– Each client has a list of files to share– One special client contains the list of all clients that are

on-line

• A client can:– search for a specific file (with wildcards)– transfer files (optional)– add files to its repository (to share with others)– get notifications when a file is added

Page 8: Scuola Superiore Sant’Anna Project Assignments Operating Systems

Project 5: notifications

• The client can “register” its requests, so that it will be notified later– for example, the client could ask: “notify me when the

following file is made available by some other client”– the notification mechanism is up to you! (it must be a

remote notification, using sockets)– the notification will expire after some time (for example, a

few hours or days)– the registration can be centralized or distributed