Distributed Systems ETH 2020

Distributed Systems Lecture ETH 2020

Distributed Systems Lecture ETH 2020


Kartei Details

Karten 129
Sprache English
Kategorie Elektrotechnik
Stufe Universität
Erstellt / Aktualisiert 15.01.2021 / 20.01.2024
Weblink
https://card2brain.ch/box/20210115_distributed_systems_eth_2020
Einbinden
<iframe src="https://card2brain.ch/box/20210115_distributed_systems_eth_2020/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

What is PTP?

The precision time protocol is a clock synchronization protocol similar to NTP but uses medium access control layer timestamps. (Removes unknown delay from passing through software stack.)

What is a system clock?

The system clock in a computer is an oscillator used to synchronize all components on the motherboard.

Must have low jitter.

What is the GPS?

The global positioning system satellites continuously transmit their position and time code.
The satellites use a unique pseudo-random noise (PRN) sequence for their signal transmissions.

What is GPS acquisition?

Acquisition is the process in a GPS receiver that finds the visible satellite signals and detects the delays of the PRN sequences and the Doppler shifts of the signals.

What is an A-GPS?

An assisted GPS receiver fetches the satellite orbit parameters and other navigation data from the internet. -> reduces data transmission time (TTFF).

What is collective detection?

Collective detection (CD) is a maximum likelihood snapshot receiver localization method, which does not de- termine an arrival time for each satellite, but rather combine all the available information and take a decision only at the end of the computation.

Define local and global clock skew.

In a network of nodes the local clock skew is the skew between neighboring nodes while the global clock skew is the maximum skew between any two nodes. It is \(\Omega(D)\) where D is the diameter of the network.

Define (minimal, majority) quorum.

V set of nodes, a quorum is a subset of these nodes. A quorum system is a set of quorums such that every two quorums intersect.

It's called minimal if no quorum is a subset of another.

In a majority quorum system every quorum has \(\lfloor {n \over 2} \rfloor + 1\) nodes, its asymptotic failure probability is 0.

Define access strategy.

An access strategy Z defines the probability PZ(Q) of accessing a quorum \(Q \in S\) s.t. \(\sum_{Q \in S} P_Z(Q) = 1\).

Define load.

  • the load of an access strategy Z on a node vis \(L_Z(v_i)=\sum_{Q \in S; v_i \in Q} P_Z(Q) \)
  • the load induced by access strategy Z on a quorum system S is the maximal load induced by Z on any node\(L_z(s)=max_{v_i \in S}L_z(v_i)\)
  • the load of a quorum system S is \(L(S) = min_ZL_Z(S)\)

 

Define work.

  • work of a quorum Q iis the number of nodes W(Q) = |Q|
  • the work induced by access strategy Z on a quorum system S is the expected number of nodes accessed \(W_z(S)= \sum_{Q \in S}P_Z(Q) \cdot W(Q)\)
  • the work of a quorum system S is \(W(S) = min_zW_z(S)\)

What does a grid quorum system look like, what is its work and its resilience (uniform access strategy)?

square matrix with side length \(\sqrt{n}\),  consisting of \(\sqrt{n}\) quorums.
work is 2\(\sqrt{n}\) -1 and the load of every node is in \(\Theta(1/\sqrt{n})\)

Its resilience is \(\sqrt{n}\) -1

Its asymptotic failure probability is 1.

What does the sequential locking strategy for a quorum Q look like?

1: Attempt to lock the nodes one by one, ordered by their identifiers

2: Should a node be already locked, release all locks and start over

What does the concurrent locking strategy for a quorum Q look like?

Define resilience in the context of quorums.

If any f nodes from a quorum system S can fail such that there is still a quorum without failed nodes, then S is f-resilient The largest such f is the resilience R(S).

What does a B-Grid quorum system look like?

Consider n = dhr nodes, arranged in a rectangular grid with h · r rows and d columns. Each group of r rows is a band, and r elements in a column restricted to a band are called a mini-column. A quorum consists of one mini-column in every band and one element from each mini-column of one band; thus every quorum has d + hr − 1 elements. The B-Grid quorum system consists of all such quorums.

Compare work, load, resilience and failure probability of the singleton, majority, grid and B-grid

Define f-disseminating.

A quorum system is f-disseminating if 

1. the intersection of two different quorums always contains f+1 nodes, and 

2. for any set of f byzantine nodes there is at least one quorum without byzantine nodes.
need more than 3f nodes

Define f-masking.

A quorum system is f-masking if 1. the intersection of two different quorums always contains 2f+1 nodes and 2. for any set of f byzantine nodes there is at least one quorum without byzantine nodes.

need more than 4f nodes

L(S) >=\(\sqrt{(2f+1)/n}\)

What does an f-masking grid quorum system look like?

An f-masking grid quorum system is constructed as the grid quorum system but each quorum contains one full column and f+1 rows of nodes with \(2f +1\leq \sqrt{n}\).

two quorums overlap in at least 2f+2 nodes.

What does an M-Grid quorum system look like?

The M-grid quorum system is constructed as the grid quorum as well but each quorum contains \(\sqrt{f+1}\) rows and

 

\(\sqrt{f+1}\) columns of nodes with \(f \leq \sqrt{n-1/}2\)

Define f-opaque quorum system.

A quorum system is f-opaque if the following two properties hold for any set of f byzantine nodes F and any two different quorums Q_1, Q_2:

\(|(Q_1 \cap Q_2) \setminus F| > |(Q_2 \cap F)\cup (Q_2 \setminus Q_1)|\)

\((F \cap Q) = \emptyset \) for some Q

 

needs n > 5f nodes

L(S) >= 1/2

solves the problem of out-of-date nodes.

Define consistency, availability, partition tolerance and the CAP theorem.

  • Consistency: all nodes in the system agree on the current state of the system
  • availability: the system is operational and instantly processing incoming requests
  • partition tolerance: the ability to continue operating correctly even in the presence of a network partition
  • CAP theorem: it is impossible for a distributed system to provide all three at once.

Define eventual consistency.

If no new updates to the shared state are issued, then eventually the system is in a quiescent state and the shared state is consistent. (conflict resolution mechanism required)

What does a bitcoin address look like?

An address is derived from a public key. The key pair is used to uniquely identify the owner of funds of an address.

It is composed of a network identifier byte, the hash of the pk and a checksum.

Define output in the bitcoin context.

An output is a tuple consisting of an amount of bitcoins and a spending condition. Most commonly the spending condition requires a valid signature associated with the private key of an address.
Spending conditions are scripts.

They have two states: spent and unspent.

What is the shared state of bitcoin?

the set of unspent transaction outputs (UXTOs) and some additional global parameters.

Define input in the context of bitcoin.

An input is a tuple consisting of a reference to a previously created output and arguments (signature) to the spending condition, proving that the transaction creator has the permission to spend the referenced output.

Define transaction in the context of bitcoin.

data structure that describes the transfer of bitcoins from spenders to recipients.

It onsists of a number of inputs and new outputs. The inputs result in the referenced outputs spent (removed from the UTXO), and the new outputs being added to the UTXO.

Define doublespend.

A doublespend is a situation in which multiple transactions attempt to spend the same output. Only one transaction can be valid since outputs can onnly be spent once. When nodes accept different transactions in a doublespend the shared state becomes inconsistent.

What does receiving a transaction in the context of bitcoin look like?

transactions are either unconfirmed or confirmed

Define Proof-of-Work. What is the bitcoin PoW?

Proof-of-Work (PoW) is a mechanism that allows a party to prove to another party that a certain amount of computational resources has been utilized for a period of time. A function F_d(c,x) → {true,false}, where difficulty d is a positive number, while challenge c and nonce x are usually bit-strings, is called a Proof-of-Work function if it has following properties:

1. F_d(c,x) is fast to compute if d, c, and x are given.

2. For fixed parameters d and c, finding x such that Fd(c, x) = true is com- putationally difficult but feasible. The difficulty d is used to adjust the time to find such an x.

 

Bitcoin:  Fd(c, x) → SHA256(SHA256(c|x)) < 2^224/d with challenge c given.

What does a bitcoin block look like?

A block is a data structure used to communicate incremental changes to the local state of a node. A block consists of a list of transactions, a reference to a previous block and a nonce. A block lists some transactions the block creator (“miner”) has accepted to its memory pool since the previous block. A node finds and broadcasts a block when it finds a valid nonce for its PoW function.

The first transaction of a block is the reward transaction.

What exactly is the blockchain?

The longest path from the genesis block to a leaf. Only this longest path is a valid transaction history.

What does a bitcoin node need to do after appending a received block?

1. comptute UTXO for the path leading to b_max

2. clean up the memory pool: remove transactions that were confirmed in a block in the current path, removing transactions that conflict with confirmed transactions, adding transactions that were confirmed in the previous path but are no longer confirmed in the current path.

Define smart contract.

A smart contract is an agreement between two or more parties, encoded in such a way that the correct execution is guaranteed by the blockchain.

Define bitcoin timelock.

Bitcoin provides a mechanism to make trans- actions invalid until some time in the future: timelocks. A transaction may specify a locktime: the earliest time, expressed in either a Unix timestamp or a blockchain height, at which it may be included in a block and therefore be confirmed.

The node receiving it keeps the transaction in memory.
A timelocked transaction can be replaced.

Define singlesig and multisig outputs.

When an output can be claimed by providing a single signature it is called a singlesig output. In contrast the script of multisig outputs specifies a set of m public keys and requires k-of-m (with k ≤ m) valid signatures from distinct matching public keys from that set in order to be valid.

How to create a 2-of-2 multisig output 0?

t_s: setup transaction

What does a simple micropayment channel look like?

only two transactions actually going to the blockchain -> less fees