Declarative, Secure, Convergent Edge Computation
Christopher Meiklejohn Université catholique de Louvain, Belgium
1
Declarative, Secure, Convergent Edge Computation Christopher - - PowerPoint PPT Presentation
Declarative, Secure, Convergent Edge Computation Christopher Meiklejohn Universit catholique de Louvain, Belgium 1 Internet of Things 2 Internet of Things but, more generally 2 Edge Computation Logical extremes Pushing both
Christopher Meiklejohn Université catholique de Louvain, Belgium
1
2
2
Pushing both computation and data to the logical extremes of the network
3
Pushing both computation and data to the logical extremes of the network
Support arbitrary computations regardless of location of data in the network
3
Pushing both computation and data to the logical extremes of the network
Support arbitrary computations regardless of location of data in the network
Directed diffusion, Cornell circa-1990; self-organizing systems that coordinate to complete computations
3
4
5
6
Internet
7
Internet HDFS
8
Internet HDFS Hadoop Client Client Internet
9
Internet HDFS Spark Client Client Internet
10
11
Internet HDFS Spark
12
Internet HDFS Spark
13
Internet HDFS Spark
14
Internet HDFS Spark
15
Internet HDFS Spark
16
Client Internet HDFS Spark
17
18
Internet HDFS Spark
19
Internet HDFS Spark
20
Internet HDFS Spark
21
Internet HDFS Spark
22
Internet HDFS Spark
23
Internet HDFS Spark
24
Internet HDFS Spark
25
26
Internet HDFS Spark
27
Internet HDFS Spark
28
Internet HDFS Spark
29
Internet HDFS Spark
30
Internet HDFS Spark
31
Backup communication mechanisms for critical systems; POTS backup for ISDN, etc.
32
Backup communication mechanisms for critical systems; POTS backup for ISDN, etc.
EMC’s “phone home” via POTS when disks failed in NAS devices to signal for replacement unit
32
33
Internet HDFS Spark
34
Internet HDFS Spark
35
Internet HDFS Spark
36
Internet HDFS Spark
37
Internet HDFS Spark
38
Internet HDFS Spark Client
39
40
Internet
41
Internet
42
Internet
43
Internet
44
45
Internet
46
Internet
47
Internet
48
Internet HDFS
49
Internet
HDFS
50
Internet ?
51
Internet ?
52
Perform some local computation to reduce transmitted state on the wire
53
Perform some local computation to reduce transmitted state on the wire
Make decisions based on results of local computation
53
54
55
R1 C1 C2
56
R1 C1 C2
57
R1 C1 C2 Read
58
R1 C1 C2 Read
59
R1 C1 C2
60
R1 C1 C2 CAS
61
R1 C1 C2
62
R1 C1 C2 CAS
63
64
R2 C1 C2 Value 2 Value 1 Value 2 R1 R3 Paxos
65
66
R1 R2 R3 C1 C2
67
R1 R2 R3 C1 C2
68
R1 R2 R3 C1 C2 Read
69
R1 R2 R3 C1 C2 Read
70
R1 R2 R3 C1 C2 Write
71
R1 R2 R3 C1 C2 Write
72
R1 R2 R3 C1 C2 Write C1
73
R1 R2 R3 C1 C2 Read
74
R1 R2 R3 C1 C2 Write
75
76
77
78
79
80
81
A A B C
82
A A B C D’ D’’
F F
83
A A B C D’ D’’ D’ D’’ D
F F
84
D’’ A A B C D’ D’ D’’ D
D D
Merge
F F
85
86
Distributed data structures designed for convergence [Shapiro et al., 2011]
87
Distributed data structures designed for convergence [Shapiro et al., 2011]
Make decisions based on results of local computation [Meiklejohn & Van Roy, 2015]
87
Distributed data structures designed for convergence [Shapiro et al., 2011]
Make decisions based on results of local computation [Meiklejohn & Van Roy, 2015]
Scalable, epidemic broadcast based runtime system [Meiklejohn & Van Roy, 2015/2016]
87
Sets, counters, registers, flags, maps
88
Sets, counters, registers, flags, maps
Objects that receive the same updates, regardless of order, will reach equivalent state
88
RA RB RC
RA RB RC {1} (1, {a}, {}) add(1)
RA RB RC {1} (1, {a}, {}) add(1) {1} (1, {c}, {}) add(1)
RA RB RC {1} (1, {a}, {}) add(1) {1} (1, {c}, {}) add(1) {} (1, {c}, {c}) remove(1)
RA RB RC {1} (1, {a}, {}) add(1) {1} (1, {c}, {}) add(1) {} (1, {c}, {c}) remove(1) {1} {1} {1} (1, {a, c}, {c}) (1, {a, c}, {c}) (1, {a, c}, {c})
Declarative, functional programming model
94
Declarative, functional programming model
Data abstraction is the CRDT
94
Declarative, functional programming model
Data abstraction is the CRDT
Composition preserves SEC
94
95
%% Create initial set. S1 = declare(set), %% Add elements to initial set and update. update(S1, {add, [1,2,3]}), %% Create second set. S2 = declare(set), %% Apply map operation between S1 and S2. map(S1, fun(X) -> X * 2 end, S2).
96
%% Create initial set. S1 = declare(set), %% Add elements to initial set and update. update(S1, {add, [1,2,3]}), %% Create second set. S2 = declare(set), %% Apply map operation between S1 and S2. map(S1, fun(X) -> X * 2 end, S2).
97
%% Create initial set. S1 = declare(set), %% Add elements to initial set and update. update(S1, {add, [1,2,3]}), %% Create second set. S2 = declare(set), %% Apply map operation between S1 and S2. map(S1, fun(X) -> X * 2 end, S2).
98
%% Create initial set. S1 = declare(set), %% Add elements to initial set and update. update(S1, {add, [1,2,3]}), %% Create second set. S2 = declare(set), %% Apply map operation between S1 and S2. map(S1, fun(X) -> X * 2 end, S2).
99
%% Create initial set. S1 = declare(set), %% Add elements to initial set and update. update(S1, {add, [1,2,3]}), %% Create second set. S2 = declare(set), %% Apply map operation between S1 and S2. map(S1, fun(X) -> X * 2 end, S2).
Reduces state transmission for clients
100
Reduces state transmission for clients
Objects are mutated locally; deltas buffered locally and periodically gossiped
100
Reduces state transmission for clients
Objects are mutated locally; deltas buffered locally and periodically gossiped
Clients resort to full state synchronization when they’ve been partitioned too long
100
Runtime system for application state & scope
109
Runtime system for application state & scope
Pairwise synchronization between peers without a central coordinator
109
Runtime system for application state & scope
Pairwise synchronization between peers without a central coordinator
Programming model can tolerate message reordering and duplication
109
Membership Overlay
Membership Overlay Broadcast Overlay
Membership Overlay Broadcast Overlay
Membership Overlay Broadcast Overlay Mobile Phone
Membership Overlay Broadcast Overlay Mobile Phone Distributed Hash Table
Membership Overlay Broadcast Overlay Mobile Phone Distributed Hash Table Lasp Execution
116
advertisement space Advertisements are paid according to a minimum number of impressions
117
advertisement space Advertisements are paid according to a minimum number of impressions
Clients have limited connectivity and the system still needs to make progress while clients are offline
117
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT
Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1Client Side, Single Copy at Client
118
Ads Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Riot Ads Ads Product Union
119
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Union
120
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Remove Union
121
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Contracts Ads Contracts Ads With Contracts Filter Product Read
Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2
122
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Contracts Ads With Contracts Filter Product Read
Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1
Client Side, Single Copy at Client
123
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union
Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1Client Side, Single Copy at Client
124
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Contracts Riot Ads Rovio Ads Product Read ≥ 50,000 Remove Increment Union
125
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientAds Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union
Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1Client Side, Single Copy at Client
126
Ads Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 2 Contracts Ads Contracts Ads With Contracts Riot Ads Rovio Ads Filter Product Read ≥ 50,000 Remove Increment Read Union Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Rovio Ad Counter 1 Rovio Ad Counter 2 Riot Ad Counter 1 Client Side, Single Copy at ClientDisabling advertisements and contracts are all modeled through monotonic state growth
127
Disabling advertisements and contracts are all modeled through monotonic state growth
Use of convergent data structures allows computational graph to be arbitrarily distributed
127
Disabling advertisements and contracts are all modeled through monotonic state growth
Use of convergent data structures allows computational graph to be arbitrarily distributed
Divergence is a factor of synchronization period
127
Client3
Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT
Riot Ad Counter 1
Client1 Client2
Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Riot Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 1
Ads With Contracts Ads With Contracts Ads With Contracts
Server
Ads With Contracts
Server Computation!
128
Client3
Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT
Riot Ad Counter 1
Client1 Client2
Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Riot Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 1
Ads With Contracts Ads With Contracts Ads With Contracts
Server
Ads With Contracts
Server Computation!
129
Client3
Lasp Operation User-Maintained CRDT Lasp-Maintained CRDT
Riot Ad Counter 1
Client1 Client2
Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Rovio Ad Counter 2 Rovio Ad Counter 1 Riot Ad Counter 2 Riot Ad Counter 1 Riot Ad Counter 1
Ads With Contracts Ads With Contracts Ads With Contracts
Server
Ads With Contracts
Server Computation!
130
Servers are peers to clients that perform additional computation
131
Servers are peers to clients that perform additional computation
model given enough information
131
Servers are peers to clients that perform additional computation
model given enough information
Serve as a location for performing “exactly once” side- effects
131
Servers are peers to clients that perform additional computation
model given enough information
Serve as a location for performing “exactly once” side- effects
trusted node in the system
131
132
132
133
134
Set Counter
Set Counter {1} (1, {c}, {}) 1 {(c, 1)}, {}
Set Counter {1} (1, {c}, {}) 1 {(c, 1)}, {} {} (1, {c}, {c}) {(c, 1)}, {(c, 1)}
Set Counter {1} (1, {c}, {}) 1 {(c, 1)}, {} {} (1, {c}, {c}) {(c, 1)}, {(c, 1)} {1} (1, {a, c}, {c}) {1} 1 1 {(c, 1), (a, 1}}, {(c, 1)}
139
140
141
142
143
ACM SIGPLAN PPDP 2015
Computation” IEEE W-PSDS 2015
ACM SIGPLAN Erlang Workshop ’15
PaPoC 2015
IEEE EdgeCom 2016
144
145
146
147
Christopher Meiklejohn @cmeik http://www.lasp-lang.org