Aspects of Distributed systems Luk Stoops VUB 12142021
Aspects of Distributed systems Luk Stoops VUB 12/14/2021
Distributed Systems Organization of computing facilities 12/14/2021
Substantial Benefits u u u u Resource sharing Openness Concurrency Scalability Transparency Flexibility Reliability Performance
Resource sharing u u Fundamental characteristic Resources u Data u catalog Software u Hardware Managed by u server process (client server) u cooperating processes Object based system is most flexible u u u items
Openness u Technical Business u Interfaces are published u World Wide Web is a typical example u HTML (XML) u u Hyper. Text u Markup Language HTTP u Hyper. Text Transport Protocol
Concurrency u Higher performance u Catalog can be consulted by several clients at the same time u selective publishing u selective pricing u promotions u ordering u delivery
Scalability. . . u Replication Netscape http: //www. netscape. com u Server caching IP address ! u Works only worldwide u Statistically u DNS even distributed Load distribution u Negotiating servers u Mobile agents Netscape
Scalability u u No machine has complete information about the state of the system Machines make decisions based only on locally available information Failure of one machine does not ruin the algorithm No implicit assumption that a global clock exists
Transparency u u u Location transparent u user can not tell where resources are located Migration transparent u resources can move at will without changing their names Replication transparent u the user cannot tell how many copies exist Concurrency transparent u multiple users can share resources automatically Parallelism transparent u activities can happen in parallel without users knowing
Flexibility u u u Adding and removing servers at runtime Interoperability standards exist (CORBA) Object based system message A B response
Reliability u Boolean OR of components ? 5 servers 0. 95 chance of being up Chance all down = 0. 055 = 0. 000006 0. 999994 chance 1 ore more available u But mostly some servers are crucial for the system u u u
Reliability Aspects u Availability u no requirement simultaneous functioning u redundancy u file copies u consistency ! u Security u prevent unauthorized usage u digital u certificates instead of login procedure Fault tolerance u server crash ? u stateless u design hardware redundancy
Performance u u u Response time Troughput System utilization Amount of network capacity consumed Number of messages u small: not much protocol handling overhead u big: many activities running in parallel
Managing Distributed Systems u Central + No searching - Server down ? u Distributed + Less vulnerable - Where to search ?
Layered Architecture Applications Support Catalog Browser Compression Encryption Remote Procedure Call Multimedia Support Communication Error - & Flow Control
Non - Distributed System (single processor)
Client - Server Distribution Model
Forwarding Distribution Model User Agent asymmetric Message Transfer Agent symmetric
Distributed Systems Models u Communication (distribution visible) u File Transfer u user u is aware of the communication Distribution (distribution invisible) u File Serving (Network File System) u user is not aware of the communication
Remote Procedure Call u u u Allowing programs to call procedures located on other machines Parameter problems PROCEDURE inc (VAR x, y); VAR parameters x : = x + 1 ; y : = y + 1 u copy - restore I : = 0 ; inc ( I, I ); print ( I ) 1
Interprocess Communication. . . u Race Conditions (sharing resources) u Mutual exclusion u Critical sections u No two processes simultaneously in their critical sections No assumptions about speeds or the number of CPUs No process running outside its critical section may block other processes No process should have to wait forever to enter its critical session u u u
Interprocess Communication. . . u Semaphores u UP : atomic increment by 1 u DOWN : if 0 then sleep else atomic decrement by 1 u Monitors u only one process can be active in a monitor u In distributed systems u Semaphores too low level u Monitors not usable
Interprocess Communication. . . u Message Passing u SEND u RECEIVE u Messages can be lost No acknowledge then retransmit (TCP) Ack can be lost Each original message: sequence number Authentication by digital certificates u u
Interprocess Communication. . . u The Dining Philosophers Problem
The Dining Philosophers Problem u u u u think Take left stick Take right stick yum-yum, rice put left stick back put right stick back Suppose that all take their left stick simultaneously Deadlock
The Dining Philosophers Problem u Think Take left stick u Check to see if right fork is available u If not, put left stick back wait some time and repeat u u u u Take right stick Yum-yum, rice Put left stick back Put right stick back Suppose that all start simultaneously Starvation
The Dining Philosophers Problem u Think Take left stick u Check to see if right fork is available u If not, put left stick back wait a random time and repeat u u Take right stick Yum-yum, rice Put left stick back Put right stick back u unlikely series or random numbers? u u u
The Dining Philosophers Problem u Think DOWN on mutex Take left stick Take right stick Yum-yum, rice Put left stick back Put right stick back UP on mutex u Only one philosopher can eat u u u u
Distributed Coördination u Safety u one at the time u Ordering u first comes first served u Liveness u acceptable wait time
Distributed Coordination Centralized Approach P 1 u u u Server gives token to first asker Safety: OK Ordering: OK Liveness: u server down u client down u network fault ACK Time-out P 2 P 3 Token server
Distributed Coordination Distributed Approach P 1 u u u u Process asks token (broadcast) P 2 All other processes answer Ti (counter) different for all Pi Ti increases if token in possession P 3 Multicast: Ti Wait for (n-1) replies u If Ti < Tx then keep it , else grant Liveness problem u ACK, time-out + retry
Distributed Coordination Token Ring Distributed Approach P 1 u u u Logical token ring No Ordering Liveness P 3 u message lost u Process with token can crash u ACK lost u 2 tokens u increase token# P 2
Election Algorithms u u u Electing a coordinator Bully algorithm P sends an ELECTION message to every process with a higher number If no one responds, P wins and becomes coordinator If one of the higher-ups answers, it takes over and start a new election
Bully Algorithm Example OK 2 1 4 0 7 2 election 2 4 6 0 2 7 OK coordinator 1 5 4 5 0 6 3 7 6 7 4 7 5 0 3 2 3 1 4 6 3 1 1 5 5 election 3
Atomic Transactions u Higher level abstraction u Hiding u mutual exclusion u critical region management u deadlock prevention u crash recovery u Object Transaction Service (CORBA)
Atomic Transactions u Business transactions model inventory Computer updates u u Withdraw (amount, account 1) Deposit(amount, account 2) New inventory
Concurrence Control u Locking u shared read locks u exclusive write locks u Distributed coordination u election for the coordinator u coordinator implements lock management
- Slides: 37