Saturday 26 September 2015

Answers to Exercises - Distributed Systems - Chapter 1

Been awhile. Thought I just start posting my answers, mostly researched throughout the internet & the book itself, of the exercises of this book "Distributed Systems - Concepts and Design 5th Edition" by Coulouris, Dollimore, Kindberg, and Blair



I have a subject in my Master's degree, IT 238 "Networking and Client/Server Computing". Since first exam is coming up, which covers chapter 1 through chapter 4 of this book, I thought it's best that I answer the Exercises found in the book. I would answer that exercises found at chapter 1 for now, and will just post my answers from other chapters in the next posts.

I'll be honest, many of my answers are from various sources I found in the internet. I will cite the sources.

 1.1 Give five types of hardware resource and five types of data or software resource that can usefully be shared. Give examples of their sharing as it occurs in practice in distributed systems. pages 2, 14

Hardware :
(1) CPU : most servers, such as filer servers, do some computatuon for their clients, hence their cpu is a shared resource.
(2) Memory: cache server (holds recently-accessed web pages in its RAM, for faster access  by other local computers.)
(3) disk  :   file server, virtual disk server, video on demand server etc
(4)  screen : Network window systems, such as X-11 , allow processes in remote computers to update the content of windows.
(5)  Printer : networked printers accept print jobs from many computers, managing them with a queuing system.
(6)  Network capacity:  packet transmission enables many simultaneous communication channels (stream Of data ) to be transmitted on the same circuits.

Data / software :
(1) Web page :  web servers enable multiple clients to share read-only page content (usually stored  in a file, but sometimes generated on-the-fly.)
(2) File : filer servers enable multiple clients to share read-write files. Conflict updates may result in Inconsistent results. Most useful for files that change infrequently, such as software Binaries.
(3)  Object:  possibilities for software objects are limitless. E.g. shared whiteboard, shared diary, room Booking system, etc.
(4)  Database : database are intended to record the definitive state of some related sets of data. They have been shared  ever since multi-user computers appeared.  They include techniques to manage concurrent  updates.
(5) Newsgroup content:   the netnews system make read-only copies of the recently-posted news items available  to clients throughout the Internet. A copy of newsgroup content is maintained at each netnews server that is an approximate replica of those  at other servers. Each server makes its data available to multiple clients.
(6) Video/audio stream: Servers can store entire videos on disk and deliver them at playback speed to multiple clients simultaneously.
(7)  Exclusive lock : a system-level object provided by a lock server, enabling several clients to coordinate their use of resource (such as printer that does not include a queuing scheme.)

=============================

1.2 How might the clocks in two computers that are linked by a local network be synchronized without reference to an external time source? What factors limit the accuracy of the procedure you have described? How could the clocks in a large number of computers connected by the Internet be synchronized? Discuss the accuracy of that procedure. page 2

    Several time synchronization protocols are described in chapter 10.  One of these is Christian's protocol. The round trip time t to send a message and a reply between computers A and B is measured by repeated tests; then computer A  sends its clock reading T to B. B sets it clock to T + t/2.  The setting can be refined by repetition. The procedure is subject to inaccuracy because of contention for the use of the local network from other computers and delays in the processing the messages in the operating systems of A and B.
    For a large number of computers, one computer should be nominated to act as the time server and it should carry out Christian's protocol  with all of them. The protocol can be initiated  by each in turn. Additional inaccuracies arise in the Internet  because messages are delayed as they pass through  switches in wide area networks.

=============================

1.3 Consider the implementation strategies for massively multiplayer online games as discussed in Section 1.2.2. In particular, what advantages do you see in adopting a single server approach for representing the state of the multiplayer game? What problems can you identify and how might they be resolved? page 5

Technically there is no significant difference in the workings of cloud and client applications on the server. Client sends request data or applications from the server, and the server will respond with running applications and send data to the client. The novelty is in the handling of the server. In the traditional client server, the server must be configured and managed, could be in the application server or the client, the client must know where the application data should be stored. While the cloud eliminates the hassles of managing servers, clients simply have to connect to the cloud via the Internet, the cloud will be managing his own where he will store applications and data, making backups, and others, the client does not need to know.

There are two types of MMO games. There are real-time games that have interaksitinggi between usernya like Ragnarok and World of Warcraft, and there are games that do not require high interaction between the user and the nature turn and wait like Farmville, MafiaWars. Two game genre requires two different architectures.
For games like Farmville standard architecture of the server is sufficient, because the gameplay is personal to each user does not need to be real-time interaction between users directly so low that bandwidth capacity is not too inedible. Games that require real-time interaction between hundreds or thousands of users need to have multiple servers because of the gameplay requires a lot of users directly involved in it, so there needs to be multiple servers to menshare bandwidth.

=============================

1.4 A user arrives at a railway station that they has never visited before, carrying a PDA that is capable of wireless networking. Suggest how the user could be provided with information about the local services and amenities at that station, without entering the station’s name or attributes. What technical challenges must be overcome? page 13

As a computer attached to the Internet, it can be assumed that the internet protocol network dealing with heterogeneity. Computer systems have different hardware - because the users have to deal with the heterogeneity of the representation of the data item in the request and reply packets of data from the client to the object.
Computers can run different operating systems, users are faced with the heterogeneity of the system to send and receive data. In the Java / C + + operating rates will generally be used that will be translated into specific operation adjusted to the operating system running on the language.
In the language C + + and Java using different representations of data structures such as strings, arrays, and records. A common standards will be established for each type of data structure that must be transmitted between the object and the client and how to translate between data structures and each language.

=============================

1.5 Compare and contrast cloud computing with more traditional client-server computing? What is novel about cloud computing as a concept? pages 13, 14

Any request to access a protected operation must include the identity of the user who sent the request. Some of the problems that arise are:
defines the user's identity. Using identity in the list of users who are allowed to access the protected operation on a BLOB object.
ensure that the identity of the entry is derived from a legitimate user, not other users pretending to be the user.
prevent other users to replay or disrupt the delivery of a message from a legitimate / legal.
Further problems arise.
the information is returned as the result of a "protected operation" should be hidden from unauthorized users. This means that a message containing information should be encrypted when dicapture by unauthorized users.

=============================

1.6 Use the World Wide Web as an example to illustrate the concept of resource sharing, client and server. What are the advantages and disadvantages of HTML, URLs and HTTP as core technologies for information browsing? Are any of these technologies suitable as a basis for client-server computing in general? pages 14, 26

Answer:
The three main components of the software are likely to experience failure:
process on the client - likely to happen crash
process on the server - likely to happen crash
the communication process in the software - for example, the possibility of a failed message delivered
This failure is generally caused independently of each other. Examples:
if the loss of the message causes the client or server crash.
if it crashes on the client menimulkan server problems.
If the crash causes a failure in communication software to transmit data.
Both processes must be able to tolerate lost messages. Clients must tolerate the reply message is lost after it has sent a request message. Rather than making the user wait got a reply, the client can use a timeout and then informed that the user has not been able to contact the server. A simple server just waiting for a message request, execute and send the reply. This system must be truly reliable against packet loss.
Communications software should be designed to tolerate crash in the process of communicating. For example, the failure of the process should not cause a problem in communication between other processes that are running.

=============================

1.7 A server program written in one language (for example, C++) provides the implementation of a BLOB object that is intended to be accessed by clients that may be written in a different language (for example, Java). The client and server computers may have different hardware, but all of them are attached to an internet. Describe the problems due to each of the five aspects of heterogeneity that need to be solved to make it possible for a client object to invoke a method on the server object. page 16

Resource migration is done to reduce the communication delay, to balance the processing load and storage utilization between different servers. If all server receives the request, the communication load on the network increases considerably and the server must perform unnecessary work, such as filter requests for objects that do not exist on the server server.

=============================

1.8 An open distributed system allows new resource-sharing services such as the BLOB object in Exercise 1.7 to be added and accessed by a variety of client programs. Discuss in the context of this example, to what extent the needs of openness differ from those of heterogeneity. page 17

Answer:
HTTP URL consists of four components
Scheme, identifies the protocol that will be used to access resources on the Internet bida be HTTP (without SSL) or HTTPS (SSL).
Host, identify the name servers that store data or applications, for example, www.example.com.
Path, identify a folder on the server to be accessed, for example, want to access a file contoh.php by accessing folders and subfolders next htp (www.example.com/htp/next/contoh.php)
The query string. provides a series of variables that can later be accessed by an application or file server, for example, the variable x is worth 100 will be processed in a file contoh.php (www.example.com/htp/next/contoh.php?x=100)

=============================

1.9 Suppose that the operations of the BLOB object are separated into two categories – public operations that are available to all users and protected operations that are available only to certain named users. State all of the problems involved in ensuring that only the named users can use a protected operation. Supposing that access to a protected operation provides information that should not be revealed to all users, what further problems arise? page 18

=============================

1.10 The INFO service manages a potentially very large set of resources, each of which can be accessed by users throughout the Internet by means of a key (a string name). Discuss
an approach to the design of the names of the resources that achieves the minimum loss of performance as the number of resources in the service increases. Suggest how the
INFO service can be implemented so as to avoid performance bottlenecks when the number of users becomes very large. page 19

=============================

1.11 List the three main software components that may fail when a client process invokes a method in a server object, giving an example of a failure in each case. Suggest how the
components can be made to tolerate one another’s failures. page 21

=============================


1.12 A server process maintains a shared information object such as the BLOB object of Exercise 1.7. Give arguments for and against allowing the client requests to be executed
concurrently by the server. In the case that they are executed concurrently, give an example of possible ‘interference’ that can occur between the operations of different clients. Suggest how such interference may be prevented. page 22

=============================

1.13 A service is implemented by several servers. Explain why resources might be transferred between them. Would it be satisfactory for clients to multicast all requests to
the group of servers as a way of achieving mobility transparency for clients? page 23

=============================

1.14 Resources in the World Wide Web and other services are named by URLs. What do the initials URL denote? Give examples of three different sorts of web resources that can be
named by URLs. page 26

=============================

1.15 Give an example of an HTTP URL. List the main components of an HTTP URL, stating how their boundaries are denoted and illustrating each one from your example. To what
extent is an HTTP URL location-transparent? page 26

Sources:
  • https://condor.depaul.edu/ichu/ds420/ans1.doc
  • https://www.academia.edu/4851440/TUGAS_1_SISTEM_TERDISTRIBUSI_NAMA_KELOMPOK_PUSPANDA_HATTA_12_338755_PTK_08206_ 
  • http://123doc.org/document/2343931-distributed-systems-concepts-and-design.htm