Security (and finale)
Dan Ports, CSEP 552
Security (and finale) Dan Ports, CSEP 552 Today Security: what - - PowerPoint PPT Presentation
Security (and finale) Dan Ports, CSEP 552 Today Security: what if parts of your distributed system are malicious? BFT: state machine replication Bitcoin: peer-to-peer currency Course wrap-up Security Too broad a
Dan Ports, CSEP 552
what if parts of your distributed system are malicious?
how do we build a trusted distributed system when some of its components are untrusted?
nodes either execute the protocol correctly or just stop
send messages, try to trick other nodes, collude, …
either malicious attacks or random failures
B: Get(x) -> "foo bar" C: Get(x) -> "foo bar”
running
request
OK
might fail
2f+1 replicas?
put(X, 1)
OK
X=1 X=0 get(X) X=0 X=0 X=1
X=0
X=0
any two quorums intersect at at least one node
any two quorums intersect at a majority of nodes => any two quorums intersect at at least one good node
put(X,1) X=0 X=1 X=1 X=0
just writing to a quorum wasn’t enough
request order
(prepare / prepareOK = Paxos’s accept/acceptOK)
(this is the really hard case!)
from primary (to make sure the primary isn’t equivocating)
if no progress, they replace primary
PRE-PREPARE(seq, op) to all replicas
PREPARE(seq, op) to others
PREPARES, execute the request
e.g., heard request but not PRE-PREPARE
always the next primary?
VIEW-CHANGE to the next primary
announces view with NEW-VIEW message
number it saw + 1
executed it
=> two different ops with seq num n!
n, need to make sure that the next primary will hear about it
COMMIT message to let the others know
COMMITs
send COMMIT(seq, op) to all
execute op, reply to client
determines request order
sure primary told them same
that a quorum knows about the order
determines request order
ensure that a quorum knows about the order
replication
malicious
server, got ~3% overhead
PBFT only does replication (is this ok? fair?)
=> only measures increased latency, not cost of crypto
[J. Mickens, “The Saddest Moment”, 2013]
even though parts may be malicious!
mechanisms
like about cash
gives Bob the hamburger
else’s bitcoins?
key?
transactions spending the same bitcoin?
transaction:
hash(T7)
set of operations
happened and in what order
log, but we wanted to avoid that!
than 1/3rd of the replicas?
internet!
the honest nodes (limited only by network bandwidth, etc)
hash(previousblock), set of transactions, nonce
try to create a new block extending the previous block
are working on it => new block every 10 minutes
without a central authority or admission control
controlled by faulty replicas (actually, some attacks possible if 1/3 faulty)
blockchain … -> B6 -> B7, where B7 contains B->C
to accept chain … -> B6 -> Bx instead?
double-spend
creates a new block (10 minutes)
the rest of the network
technical problems: preventing theft, double-spending, forgery even though some participants may be malicious
protocol avoids Sybil attacks
why does it have value, legality?
But it’s easy to make a distributed system that’s less scalable and less reliable than a centralized one!
despite many copies and massive concurrency
Paxos, VR, Chain Replication, NOPaxos
replication, transactions, cache coherency
partitioning, caching, consistent hashing
GFS, Chubby, Bigtable, Megastore, Spanner
Amazon’s Dynamo, COPS
MapReduce, GraphLab, Spark
2/3)
is a major accomplishment!
RPC, state machine replication, Paxos, transactions…
GFS uses a centralized, in-memory master
availability and low latency in all cases, so use eventual consistency when this matters (Dynamo)
with RPC
serve millions of users, and are always up