Untitled

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which of the following is a limitation of Christian's Algorithm regarding its applicability in different network environments?

  • It requires synchronization with external systems, which is not always possible in wide area networks.
  • It is vulnerable to interference, especially in networks with unreliable connectivity.
  • It relies on a master server for synchronization, making it unsuitable for distributed networks.
  • It assumes equal durations for the two parts of the round trip time (RTT), making it less effective outside of LANs where RTT can vary greatly. (correct)

How does the Berkeley Algorithm address the central point of failure issue present in Christian's Algorithm?

  • By synchronizing directly with UTC time, eliminating the need for a central server.
  • By relying on high-precision timekeeping devices such as atomic clocks at each node.
  • By employing a master server that can be re-elected if it fails, using a master election algorithm. (correct)
  • By using a hierarchical model of time servers to distribute the synchronization load.

What is a key difference between the Berkeley Algorithm and Christian's Algorithm in terms of their synchronization approach?

  • The Berkeley Algorithm is suitable for Internet-based synchronization, while Christian's Algorithm is limited to LAN networks.
  • The Berkeley Algorithm protects against interference, while Christian's Algorithm is vulnerable to disruptions.
  • The Berkeley Algorithm uses a master server to poll nodes and average their times, while Christian's Algorithm relies on a clock server synchronized to UTC. (correct)
  • The Berkeley Algorithm synchronizes directly with UTC time, while Christian's Algorithm synchronizes relative to a master server.

Which of the following is a major limitation that the Berkeley Algorithm and Christian's Algorithm share?

<p>Suitability primarily for LAN networks. (B)</p> Signup and view all the answers

What is the primary goal of the Network Time Protocol (NTP) in relation to the previously discussed algorithms?

<p>To improve upon existing algorithms for synchronization over the Internet, provide reliable service during connectivity losses, and protect against interference. (D)</p> Signup and view all the answers

In the NTP hierarchical model, what distinguishes Stratum 0 devices from Stratum 1 devices?

<p>Stratum 0 devices are high-precision timekeeping devices like atomic clocks, while Stratum 1 devices are computers synchronized with them. (C)</p> Signup and view all the answers

Within the context of NTP, which stratum level directly interfaces with high-precision timekeeping devices such as atomic clocks?

<p>Stratum 0, serving as reference clocks. (C)</p> Signup and view all the answers

What is the primary function of Stratum 1 servers within the NTP hierarchy?

<p>To act as primary time servers synchronized with Stratum 0 devices, providing time to lower strata. (C)</p> Signup and view all the answers

In a centralized resource allocation system, which of the following is NOT a general requirement for mutual exclusion?

<p>Impartiality: Guaranteeing all processes have equal access to the resource. (A)</p> Signup and view all the answers

What action does a process take in a distributed scheme when it receives a resource request and is neither using nor requesting the resource itself?

<p>It immediately responds to the requesting process. (B)</p> Signup and view all the answers

In a distributed resource allocation scheme, what determines the order in which queued requests for a resource are processed when the process finishes using the resource?

<p>The timestamp associated with each request. (D)</p> Signup and view all the answers

In a token ring resource allocation system, what is the worst-case scenario a process might face when trying to access a resource?

<p>The process has to wait for every other process in the ring to utilize the resource. (A)</p> Signup and view all the answers

How does a process in a token ring structure determine if it should utilize a resource when it receives the token?

<p>It checks to see if it wants the resource. (C)</p> Signup and view all the answers

What is the primary role of timestamps in a distributed resource allocation scheme?

<p>To ensure fairness by ordering requests based on when they were generated. (A)</p> Signup and view all the answers

In a distributed scheme for resource allocation, what action does a process take if it wants to use a resource and receives a request with a higher timestamp?

<p>It places the request in a queue. (B)</p> Signup and view all the answers

What is a key difference between centralized and distributed resource allocation?

<p>Centralized systems rely on a single point of control, while distributed systems involve multiple processes coordinating. (D)</p> Signup and view all the answers

In Lamport timestamps, what happens at process $p_i$ before each event?

<p>The counter $L_i$ is incremented by 1 such that $L_i = L_i + 1$. (A)</p> Signup and view all the answers

When process $p_i$ sends a message $m$ to process $p_j$, what value is assigned to $t$?

<p>$t = L_i$ (A)</p> Signup and view all the answers

In the Lamport timestamp algorithm, what does process $p_j$ do upon receiving a message with timestamp $t$ from process $p_i$?

<p>$L_j = max(L_j, t)$ and then $L_j$ is incremented by 1. (C)</p> Signup and view all the answers

If event 'a' could have influenced event 'b', according to Lamport timestamps:

<p>L(a) must always be less than L(b). (D)</p> Signup and view all the answers

Which statement is correct regarding Lamport timestamps and strong clock consistency?

<p>Lamport timestamps violate strong clock consistency; if L(a) &lt; L(b), we cannot definitively say a -&gt; b. (A)</p> Signup and view all the answers

In a distributed system using vector clocks, what does $V_i[j] = k$ signify?

<p>Process $P_i$ knows about <em>k</em> events that have occurred at process $P_j$. (C)</p> Signup and view all the answers

Why do Lamport timestamps only create a partial ordering of events?

<p>They do not guarantee a unique timestamp for every event across all processes without additional mechanisms. (B)</p> Signup and view all the answers

Given two vector timestamps V and V', what condition must be met for V to be considered strictly less than V' (V < V')?

<p>V[j] &lt;= V'[j] for all j and V != V' (A)</p> Signup and view all the answers

How can Lamport timestamps be extended to create a total ordering of events?

<p>By incorporating an arbitrary mechanism to break ties, such as process IDs. (B)</p> Signup and view all the answers

If event e happened before event e', what is the relationship between their vector timestamps V(e) and V(e')?

<p>V(e) &lt; V(e') (A)</p> Signup and view all the answers

Given two extended Lamport timestamps (Lᵢ(e), i) and (Lⱼ(e), j), under what condition is (Lᵢ(e), i) < (Lⱼ(e), j)?

<p>If Lᵢ(e) &lt; Lⱼ(e) or (Lᵢ(e) = Lⱼ(e) and i &lt; j). (D)</p> Signup and view all the answers

What condition defines two concurrent events e and e' in terms of their vector timestamps V(e) and V(e')?

<p>Neither V(e) &lt;= V(e') nor V(e') &lt;= V(e) (B)</p> Signup and view all the answers

In a distributed system employing a centralized resource allocation algorithm, what is a significant potential problem?

<p>A single coordinator crash causing system-wide failure. (D)</p> Signup and view all the answers

According to the vector clock algorithm, when can a process $P_j$ deliver a message it received from $P_i$?

<p>When $V_i[i] == V_j[i] + 1$ and $V_j[k] &gt;= V_i[k]$ for all k, $k != i$ (C)</p> Signup and view all the answers

What is the primary disadvantage of a distributed resource allocation algorithm compared to a centralized one?

<p>Higher message complexity and increased delay. (C)</p> Signup and view all the answers

Timestamps can be utilized for creating a snapshot of a distributed system. Besides the state of processes, what other information is essential for this snapshot?

<p>Messages in transit (D)</p> Signup and view all the answers

In a token ring resource allocation system, what is the range of possible message counts per resource allocation?

<p>A range from 1 to the Number of processes in the system. (D)</p> Signup and view all the answers

Which of the following issues can timestamps help resolve when saving a snapshot of a distributed system?

<p>Garbage Collection (D)</p> Signup and view all the answers

Why is automatic garbage collection particularly important in distributed systems compared to single-system environments?

<p>Manual memory management is significantly more complex across multiple systems. (B)</p> Signup and view all the answers

What initiates the election process in distributed systems when a centralized leader fails?

<p>The failure of the current coordinator. (D)</p> Signup and view all the answers

In the Bully Algorithm, what action does a process take when it notices the coordinator has stopped responding?

<p>It sends an election message to all processes with higher weight values. (D)</p> Signup and view all the answers

In the context of a distributed messaging system, what role do timestamps play in garbage collection?

<p>They determine whether messages should be included in a snapshot or discarded. (A)</p> Signup and view all the answers

According to the Bully Algorithm, what determines whether a process wins an election and becomes the new coordinator?

<p>Receiving no replies to its election messages within a specific timeframe. (C)</p> Signup and view all the answers

Why can deadlocks be problematic in distributed systems?

<p>They cause processes to wait indefinitely for each other, halting progress. (D)</p> Signup and view all the answers

What action does a process take in the Bully Algorithm upon receiving an election message from another process?

<p>It replies to the election message and initiates its own election if it hasn't already. (A)</p> Signup and view all the answers

In the Bully Algorithm, what is the action of a recovering process?

<p>It launches a new election to potentially become the coordinator. (A)</p> Signup and view all the answers

What is the primary factor that reduces the clock accuracy of an NTP node as its stratum number increases?

<p>The accumulation of round trip time (RTT). (A)</p> Signup and view all the answers

What is the theoretical resolution of NTP timestamps, given that it uses a 64-bit timestamp with 32 bits for seconds and 32 bits for fractional seconds?

<p>233 picoseconds (B)</p> Signup and view all the answers

The NTP client uses the values of time offset 𝜃 and round trip delay 𝛿 to adjust its clock. Given the formulas for ( \theta ) and ( \delta ), which statement accurately describes the relationship between these values and the client's clock adjustment?

<p>( \theta ) estimates the clock offset between the client and server, while ( \delta ) measures the network delay. (A)</p> Signup and view all the answers

What method does the NTP algorithm use to mitigate the effects of network delays and ensure more accurate time synchronization?

<p>Applying a statistical filter to eliminate outliers and using the best remaining candidates. (C)</p> Signup and view all the answers

Which synchronization requirement ensures that if one member of a replicated system sees event A before event B, all other members also observe event A before event B?

<p>Groups/replicated (D)</p> Signup and view all the answers

In the context of 'Happened-Before' relations, what does it mean if events 'a' and 'b' are concurrent (a || b)?

<p>Neither 'a' happens before 'b' nor 'b' happens before 'a'. (B)</p> Signup and view all the answers

According to Lamport Timestamps, what action should a process take immediately before processing an event?

<p>Increment its counter. (A)</p> Signup and view all the answers

A process using Lamport Timestamps has a counter value of 5. It then receives a message with a timestamp of 7. What will be the new value of the process's counter?

<p>7 (C)</p> Signup and view all the answers

Assuming a client A sends a message to server B. In the context of the 'Happened-Before' relationship, which statement is correct?

<p>The event of <code>A</code> sending the message happened before <code>B</code> receiving the message. (A)</p> Signup and view all the answers

Consider two events: event X with a Lamport timestamp of 10 occurring in process A, and event Y with a Lamport timestamp of 12 occurring in process B. If there is no message passing between A and B related to these events, what can be inferred about the order of these events from the timestamps alone?

<p>Events X and Y are concurrent, meaning there is no causal relationship determinable from the timestamps alone. (B)</p> Signup and view all the answers

Flashcards

Christian's Algorithm: Limitations

Assumes equal round trip parts, unsuitable outside LANs, clock server is a central failure point.

Berkeley Algorithm

A time synchronization algorithm that doesn't require synchronization to UTC; uses a master server to adjust node clocks.

How Berkeley Algorithm Works

Master polls nodes, estimates clock, averages values, instructs clock changes; failsafe: Master Election Algorithm.

Berkeley Algorithm: Problems

Only appropriate for LAN, not synchronized with external systems, like Christian's algorithm

Signup and view all the flashcards

NTP Goals

To synchronize clients via the Internet; provide reliable service during losses of connectivity; protect against interference.

Signup and view all the flashcards

NTP: Hierarchical Model

Uses a hierarchical model with stratum assigned different levels of accuracy.

Signup and view all the flashcards

Stratum 0

High precision timekeeping devices, such as atomic clocks, GPS or other radio clocks

Signup and view all the flashcards

Stratum 1

Computers synchronized within microseconds of Stratum 0 devices; they are the primary time servers.

Signup and view all the flashcards

Stratum 2 NTP Servers

Nodes connected to primary time servers (Stratum 1). Can connect to multiple.

Signup and view all the flashcards

NTP Stratum

A level in the NTP hierarchy, maxing out at 15. Higher stratum = less accurate.

Signup and view all the flashcards

NTP Timestamp

64 bits, divided into 32 bits for seconds and 32 bits for fractional seconds.

Signup and view all the flashcards

NTP Algorithm

Client polls servers, calculates time offset (𝜃) and round trip delay (𝛿).

Signup and view all the flashcards

NTP Time Offset (θ)

Time offset calculated as 𝜃= ((𝑡1 − 𝑡0 )+(𝑡2 − 𝑡3 ))/2

Signup and view all the flashcards

NTP Round Trip Delay (𝛿)

Round trip delay calculated as 𝛿 = 𝑡3 − 𝑡0 − (𝑡2 − 𝑡1 )

Signup and view all the flashcards

NTP Statistical Filter

Eliminate outliers, estimates offset from best candidates. Clock adjusted gradually.

Signup and view all the flashcards

Causality (Synchronization)

Order of events is the same, no matter where you are.

Signup and view all the flashcards

Happened-Before Relation

If 'a' happens before 'b' in the same process, a -> b

Signup and view all the flashcards

Lamport Timestamps

Increment counter before event; include counter in sent messages; recipient updates counter.

Signup and view all the flashcards

Mutual Exclusion (Safety)

Ensures only one process can access a resource at any time.

Signup and view all the flashcards

Mutual Exclusion (Liveness)

Guarantees that all resource requests will eventually be granted.

Signup and view all the flashcards

Mutual Exclusion (Fairness)

Ensures resource requests are granted in the order they were made.

Signup and view all the flashcards

Distributed Resource Allocation

Each process multicasts a request and waits for responses before using a resource.

Signup and view all the flashcards

Responding to Resource Request

If process doesn't need resource, it immediately responds to the request.

Signup and view all the flashcards

Queuing Resource Requests

If a process wants the resource and its timestamp is earlier it queues the request.

Signup and view all the flashcards

Token Ring Allocation

A logical ring where a token is passed from process to process.

Signup and view all the flashcards

Token Usage

Process with the token checks if it needs the resource, uses it, then passes the token.

Signup and view all the flashcards

Vector Clocks

A mechanism that extends Lamport Timestamps to detect causality violations in distributed systems.

Signup and view all the flashcards

Vector Clock Element Vi[i]

Each process maintains a vector where the i-th element represents the number of events occurred at process Pi.

Signup and view all the flashcards

Vector Clock Element Vi[j]

If Vi[j] = k, process Pi knows about k events that occurred at process Pj.

Signup and view all the flashcards

V = V’

Every vector timestamp must be the same. Only one process can change at one time; other processes must wait.

Signup and view all the flashcards

V ≤ V’

Each event in V must be smaller than or equal to the related timestamp event V’.

Signup and view all the flashcards

V < V’

Each event in V must be strictly smaller than its respective timestamp event V’.

Signup and view all the flashcards

e -> e’

If one event happened before another.

Signup and view all the flashcards

e || e’

Events e and e’ are parallel if neither V(e) ≤ V(e’) nor V(e’) ≤ V(e).

Signup and view all the flashcards

Deadlock

Occurs when two processes are waiting for each other to release a resource, resulting in neither being able to proceed.

Signup and view all the flashcards

Garbage Collection

An automatic memory management technique that reclaims memory occupied by objects that are no longer in use.

Signup and view all the flashcards

Lamport Process Definition

A process, denoted as 𝑝𝑖, performs events (e), managed by a counter 𝐿𝑖, assigning timestamps 𝐿𝑖(𝑒) to each event.

Signup and view all the flashcards

Lamport Increment Rule

Before an event at process 𝑝𝑖, the local counter 𝐿𝑖 is incremented: 𝐿𝑖 = 𝐿𝑖 + 1.

Signup and view all the flashcards

Message Sending/Receiving

When 𝑝𝑖 sends message m to 𝑝𝑗, 𝑝𝑖 increments 𝐿𝑖, sets t= 𝐿𝑖, and sends (m,t). 𝑝𝑗 updates 𝐿𝑗 = max(𝐿𝑗 , t), then increments 𝐿𝑗.

Signup and view all the flashcards

Event Influence Rule

If event 'a' could influence 'b', a->b, then L(a) < L(b).

Signup and view all the flashcards

Lamport's Limitation

L(a) < L(b) doesn't guarantee a->b because Lamport timestamps provide only a partial ordering and can't ensure strong clock consistency.

Signup and view all the flashcards

Partial Ordering

Lamport timestamps create a partial ordering of events, but can't assert causality from timestamp order alone.

Signup and view all the flashcards

Total Ordered Timestamp

Achieved by expanding the timestamp to (𝐿𝑖 𝑒 , 𝑖), comparing timestamps then process IDs: (𝐿𝑖 𝑒 , 𝑖) < (𝐿𝑗 𝑒 , 𝑗) if 𝐿𝑖 𝑒 < 𝐿𝑗 𝑒 or (𝐿𝑖 𝑒 = 𝐿𝑗 𝑒 and i < j).

Signup and view all the flashcards

Total Order Multicasting

All receivers see all messages in the same order. This order it not necessarily the original sending order.

Signup and view all the flashcards

Centralized Resource Allocation

A resource allocation method where a central coordinator manages resource distribution.

Signup and view all the flashcards

Leader Process

Process chosen to manage and coordinate activities within a distributed system.

Signup and view all the flashcards

Election Algorithms

Algorithms used to select a new leader if the current leader process fails in a distributed system.

Signup and view all the flashcards

Bully Algorithm

An election algorithm where the process with the highest weight wins the election.

Signup and view all the flashcards

Bully Algorithm - Election Messages

In the bully algorithm processes with higher weight receive election messages.

Signup and view all the flashcards

Bully Algorithm - Coordinator Declaration

If a process in the bully algorithm doesn't receive replies, it declares itself the coordinator.

Signup and view all the flashcards

Study Notes

  • Synchronization involves coordinating events across different nodes in a network.
  • Events at different nodes in a network use different clocks for recording.
  • The timing of events in a distributed system determines the order of writes and data staleness.
  • Determining if it is possible to sell stock that does not exist is a synchronization issue.

Clock Synchronization

  • Clock synchronization is difficult to achieve in practice.
  • Synchronizing clocks on every node in the network is a simple solution, however.

Hardware Clocks

  • Crystal oscillators connected to oscillation counter circuitry are hardware clocks in computers.
  • This counter is then scaled to provide a physical time approximation.

Problems with Hardware Clocks

  • Hardware clocks are not all the same.
  • Clock rate is affected by physical differences in the crystal.
  • Clock rate is affected by temperature differences.
  • Voltage and humidity affect the clock rate.
  • Skew is a disagreement in the reading of two clocks.
  • Drift is the difference in the rate at which two clocks count time..
  • Clock Drift Rate is the difference in precision between a hardware clock and a reference clock.
  • Normal clocks have a clock drift rate of approximately 10-6 sec/sec.
  • High precision clocks have a clock drift rate up to 10-7 - 10-8 sec/sec.
  • Assuming a normal clock drift rate of 10-6 sec/sec, a drift of 1ms occurs in approximately 17 minutes.
  • Assuming a normal clock drift rate of 10-6 sec/sec, a drift of 1s occurs in approximately 12 days.

Synchronizing Clocks

  • External Synchronization involves using an external authoritative clock to update the clock of nodes in the network.
  • With External Synchronization, skew is limited to the delay between the authoritative clock server and the node.
  • In Internal Synchronization, Nodes in the network collaborate to limit the skew to a delay bound but has larger delay.
  • Software-Based Clock Synchronization methods include Christian's Algorithm, Berkley Algorithm, and Network Time Protocol (Internet).

Christian's Algorithm

  • This algorithm assumes LAN networks have a sufficiently small round trip time.
  • It requires a clock server synchronized to UTC time.
  • A node in the network sends a request to the clock server and records the Round Trip Time (RTT).
  • The clock server measures its current time (T) and sends this to the node.
  • A node updates its time t to be t = T + RTT/2.

Christian's Algorithm Problems

  • The duration of the two parts of the round trip are assumed to be equal.
  • It is unsuitable outside a LAN because RTT increases dramatically.
  • The clock server being a central point of failure is a problem.

Berkeley Algorithm

  • A master server is used to alter the clocks and not a synchronized server.
  • A master server periodically polls all nodes in the network.
  • It records RTT to estimate a node's clock like in the Christian's algorithm.
  • Berkeley Algorithm averages the values obtained from all nodes.
  • Instructions are given for nodes to alter clocks and synchronize times.
  • A master election algorithm is used if the master fails.

Berkeley Algorithm Problems

  • It is only suitable for LAN networks.
  • Nodes are synchronized with each other instead of with external systems like with Christian's algorithm.

Network Time Protocol (NTP)

  • This protocol improves upon previously discussed algorithms.
  • Clients can synchronize via the Internet.
  • Reliable service is available in the event of lengthy losses of connectivity.
  • There is protection against interference.
  • NTP uses a hierarchical model with varying levels of accuracy, assigning different stratum.
  • Stratum 0: High precision timekeeping devices like atomic clocks, GPS, or radio clocks which act as reference clocks.
  • Stratum 1: Computers synchronized within microseconds of a Stratum 0 device, which act as primary time servers.
  • Stratum 2: Nodes connected to primary time servers, connecting to multiple primary time servers is possible.
  • There are up to 15 stratum that are possible in NTP.
  • With NTP, the higher the stratum number decreases the accuracy of the node's clock due to the increased RTT.
  • Timestamps use 64 bits, comprising 32 bits for seconds and 32 bits for fractional seconds
  • The theoretical resolution of NTP timestamps is 233 picoseconds.
  • There is a timescale that rolls over every 136 years and the first rollover will occur on February 7th 2036.

NTP Algorithm

  • NTP client will regularly poll one or more servers.
  • Time offset θ is derived from (t1 - t0)+(t2-t3) / 2.
  • Round trip delay δ is derived from (t3 - t0) - (t2 - t1).
  • After this data is returned to the client, the client must eliminate outliers using a statistical filter.
  • Offset is estimated from the best three remaining candidates favoring higher stratum messages.
  • Adjusts the client's clock gradually reduces the offset.

Synchronization Requirements

  • Causality: Real-time order is similar to timestamp order.
  • Groups/replicated: Same order of member visibility for group events.
  • Multiple-copy-updates: Consistency conflicts and order of updates.
  • Serializability of transactions: Common order of transaction order.

Happened-Before Relations (a->b)

  • a and b are defined as events in the same process.
  • If a occurs before b then a happens before b (a->b).
  • If a is a message being sent and b is a message being received, then a->b.
  • a || b occurs if is neither a->b and b->a (a and b are concurrent).
  • If a->b and b->c then a->c.

Lamport Timestamps

  • All timestamps include: the process increments its counter before each event.

  • A process includes its counter when it sends a message.

  • Upon receiving a message: The recipient's counter updates to the greater of its current value or the timestamp.

  • The event counter is then incremented to show the message has been received.

  • Where p is the process, e the event, L is the counter and t is the timestamp:

  • Where pi is the process, before each event L₁ = Li + 1.

  • Whenever a process sends a message 'm' to pj:

  • pi: Li = Li + 1; t = Li; message = (m,t).

  • pj: Lj = max(Lj, t); Lj = Lj + 1.

  • Lj receives the event as Lj.

Lamport Timestamps Problems

  • The Lamport timestamp of event a is less than the Lamport timestamp of event b if there is any way that event a could have influenced event b.
  • If two Lamport timestamps exist where L(a) < L(b), a->b cannot explicitly be stated because these timestamps do not fulfill the strong clock consistency condition.
  • Lamport timestamps only accomplish partial event ordering.
  • They can provide a 'total event ordering' by incorporating a mechanism to resolves ties (however causality cannot be implied).

Total Ordered Lamport Timestamps

  • Timestamps can be expanded to (Li(e), i).
  • (Li(e), i) < (Lj(e), j).
  • If Li(e) < Lj (e) or (Li(e) = Lj (e) and i < j).

Vector Clocks

  • These expand on Lamport Timestamps through the incorporation of causality violation detection data.
  • Each Process Pi maintains a vector Vi
  • Vi[i] represents the events that have occurred at Pi.
  • If Vi[j] = k, then Pi knows about the k events that have occurred at Pj.

Vector clock ordering

  • V = V' iff V[j] = V' [j].
  • V ≤ V' iff V[j] ≤ V' [j].
  • V.
  • e -> e' => V(e) V(e').
  • If not V(e)≤ V(e') and not V(e') ≤ V(e), then e || e'.

Vector Clocks algorithm is as follows

  • Pi multicasts Vi[i] = Vi[i] + 1.
  • Each message includes Vi.
  • For each Pj, which is receiving a message.
  • The message can be delivered when Vi[i] = Vj [i] + 1 (Every message from i has arrived).
  • When Vj [k] >= Vi[k] for all k, k≠i (j must have read every message that i has read when the sent message was sent).
  • Upon delivery of message: Vj [i] = Vj [i] + 1.

Global State

  • Timestamps can be used to save a snapshot of a distributed system for many purposes.
  • States of Processes and Messages in Transfer are needed to create a snapshot.
  • Snapshot validity can be affected by Garbage Collection, Deadlock, and Termination problems.

Garbage Collection

  • An automatic form of memory management.
  • Distributed systems benefit because of difficulties in multiple systems manual memory management.
  • It is important in a distributed messaging system.
  • Messages must be kept until they can be processed and then discarded by a garbage collector.
  • In a snapshot, messages are examined to determine whether they are discarded.

Deadlock

  • Results when two processes wait for each other to take an action associated with a resource through releasing a lock.
  • P₁ has a lock on resource R₁, and p₂ has a lock on resource R₂ creating an example of deadlock.
  • P1 must obtain R2 before R1 is released in order to resolve lock, P2 must do the opposite.
  • Both P₁ and P₂ will remain in deadlock with the locks not being obtained unless intervened.
  • Solving deadlocks and preventing them are useful for consistent progress in distributed systems.

Global Snapshot

  • A particular algorithm can achieve a global snapshot .
  • At each node i: Record the current time (Ti) using a local clock; record a state (Si) through containing {event, timestamp} tuples.
  • S, the system state, is described through individual node states. (Si).
  • T indicates up to which information on the node is contained in a snapshot
  • Snapshots can be consistent or inconsistent.

Consistent Snapshot

  • Occurs if all events taking place before the snapshot time T are tracked .
  • xį describes local values during threshold value changes.
  • Send is given to another processor following a threshold being exceeded.
  • Increment vector after 'changes' to make S record changes.

Chandy-Lamport Algorithm

  • Provides consistent global distributed systems states, with its use.
  • The algorithm requires two assumptions: There are no network failures and all communications arrive intact; and the integrity of the standard activities processes must be retained during snapshots.
  • This may be modified with tcp/ip to remove no network failures assumptions.
  • A process (initiating the snapshot) saves its state and dispatches a snapshot request to processes using a snapshot token.
  • Upon receipt , the snapshot then receives its saved state.
  • A snapshot token is then attached to all messages, or the token the process uses to save its state.
  • If a non token message is received on receipt that it has the token it forward it .

Resource Reservation

  • Useful in resource management.
  • Can be either centralized or distributed and the decision affects potential fault tolerances.
  • Typically can be implemented easily, and are harder to debug.
  • Fault tolerant properties are increased at the cost of greater debugging and design requirements.
  • Mutual Exclusion is another name used for this.

Centralized Resource Allocation

  • First, the process asks a resource coordinator for use.
  • Then, the coordinator checks for a queue, or issues use.
  • If there are any other competing processes, insert contact into a queue and do not respond.
  • Tell the coordinator when finished.

Centralized Resource Allocation Requirements

  • There are many exclusion requirements that can be given.
  • A single process must be allowed to use resource is a safety requirement.
  • Liveness is necessary with requested processes . Deadlock is not assured fully otherwise and timeout prevention may be best.
  • Honor a timely request before newer request following some delay is a fairness requirement.

Distributed Resource Allocation

  • Alternative schemes can be given, when asking to multi contact a all process request while waiting for a reply.
  • Responses are given to immediate processes which do not want the resource.
  • If there are requests with later receipts or greater use push the processes.
  • Then provide resource use when resource gets abandoned .

Token Ring Resource Allocation

  • A logical ring token structure can be done where the process '0' starts with a token when algorithm starts.
  • Then, passes ring to neighbor processes in adjacent tokens.
  • If the resource is desired after reception, utilize such resource and return after completion in the token.
  • The token is then used by every resource.

Resource Allocation Algorithm Comparison

Algorithm Messages per Resource Allocation Delay before Resource Allocation (in message times) Potential Problems
Centralized 3 2 Coordinator Crash (Central Point of Failure)
Distributed 2(n-1) 2(n-1) Crash of any process
Token Ring 1 - ∞ 0-(n-1) Lost token, Process Crash

Election Algorithms

  • Algorithm in the event of failure of a leader or more particularly Burk algorithm is the best selection for a leader.
  • Both Bully and Ring are Election Algorithm processes.

Bully Algorithm

  • Process receive a unique weight.
  • Requests for more processes with higher process stops a controller (sending election to the other processes).
  • All elections must answer.
  • If a process still hasn't had a response, it indicates completion and the election will begin.

Ring Algorithm

  • The process gets a ring structure for what it has.
  • The message sent and given to the new logical processes is 'Ring Algorithm'.
  • Receive the same message a lot until acknowledgement . The addition ring provides processes.
  • Lastly, when a message that needs attention receives that message in a ring and this provides the coordinator.
  • Reduces head weight.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

Untitled
110 questions

Untitled

ComfortingAquamarine avatar
ComfortingAquamarine
Untitled
48 questions

Untitled

HilariousElegy8069 avatar
HilariousElegy8069
Untitled
49 questions

Untitled

MesmerizedJupiter avatar
MesmerizedJupiter
Untitled
121 questions

Untitled

NicerLongBeach3605 avatar
NicerLongBeach3605
Use Quizgecko on...
Browser
Browser