Chemical Networking Protocols Thomas Meyer and Christian Tschudin - - PowerPoint PPT Presentation
Chemical Networking Protocols Thomas Meyer and Christian Tschudin - - PowerPoint PPT Presentation
Chemical Networking Protocols Thomas Meyer and Christian Tschudin University of Basel, Switzerland 8 th ACM Workshop on Hot Topics in Networks (HotNets-VIII) New York, October 22 nd , 2009 Observation There are many protocols that make use
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Observation
- There are many protocols that make use of the same underlying principle:
- Examples:
- Classical: TCP “bases on the conservation of packets principle to bring a
connection to equilibrium” [Jacobson, 1988]
- Social-network → Gossip protocols
- Animal behavior → AntNet routing protocol
2
Bring the system to equilibrium at the point of optimal operation
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Contributions
- Feasibility result:
- Protocol implementations can recover from loss of code in the same way
as they can recover from packet loss.
- Provable dynamics result:
- A new way of proving the dynamics of a protocol (e.g. convergence).
- Execution model:
- All this is enabled by a new programming model, metaphorically called
Chemical Networking Protocols.
- Paradigmatic change:
- Think in terms of flows, not finite state-machines.
- Representation-free instead of symbolic information encoding.
3
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Overview
- Distributed chemical reaction networks
- Example: Disperser - a gossip-style protocol
- Formal convergence analysis
- An implementation in Fraglets
- Code homeostasis: Self-regulation of code with Quines
- A first self-healing protocol
- Discussion
- Flows vs. FSM
- Symbolic vs. representation-free encoding of information
- Application fields
4
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Each network node contains a multiset of “molecules”.
- Each node executes “reactions”.
- Example reaction: Pick a (random) molecule and send it to a neighbor node.
- We start with an arbitrary distribution of molecules...
Distributed Chemical Reaction Networks: A Molecule Disperser Example
5
Node n1 Node n2 Node n3 Node n4
molecule reaction
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- ...and want to obtain a uniform distribution.
- The system shall calculate the average number of molecules.
- What is needed such that this distributed system converges?
Distributed Chemical Reaction Networks: A Molecule Disperser Example
6
Node n1 Node n2 Node n3 Node n4
molecule reaction
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Traditional packet scheduler: Drain queues as fast as possible.
In the chemical context: Each reaction vessel executes reactions back-to-back.
- Result: Molecules drift to nodes with high degree:
- The result depends on the network topology and the nodes’ performance!
!"#$%&'( %)*#+$,%-.%/ 0-1$%2 3 4 23 24 53 3 533 633 733 833 2333 !"#$%&'( %)*#+$,%-.%/ 0-1$%5 3 4 23 24 53 3 533 633 733 833 2333 !"#$%&'( %)*#+$,%-.%/ 0-1$%9 3 4 23 24 53 3 533 633 733 833 2333 !"#$%&'( %)*#+$,%-.%/ 0-1$%6 3 4 23 24 53 3 533 633 733 833 2333
Traditional Packet Scheduling
7
Node n1 Node n2 Node n3 Node n4
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Network graph:
Elements of a Chemical Networking Theory
8
Node n1 Node n2 Node n3 Node n4
G = (V, E)
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Network graph:
- Node: Multiset of molecules:
Elements of a Chemical Networking Theory
9
Node n1 Node n2 Node n3 Node n4
G = (V, E)
Node n2
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Network graph:
- Node: Multiset of molecules:
Elements of a Chemical Networking Theory
- Set of molecules:
10
Node n1 Node n2 Node n3 Node n4
G = (V, E) S = {Xi, Cij} ∀i ∈ V, (i, j) ∈ E
Node n2
X2 C21 C23 C24
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Network graph:
- Node: Multiset of molecules:
Elements of a Chemical Networking Theory
- Set of molecules:
- Set of reactions:
11
Node n1 Node n2 Node n3 Node n4
G = (V, E) S = {Xi, Cij} ∀i ∈ V, (i, j) ∈ E rij : Cij + Xi − → Cij + Xj R = {rij | (i, j) ∈ E}
Node n2
X2 C21 C23 C24 r23 r21 r24
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Set of molecules:
- Set of reactions:
- Law of mass action scheduler:
The reaction rate of all reactions is equal to the product of the reactant concentrations.
- Network graph:
- Node: Multiset of molecules:
Elements of a Chemical Networking Theory
12
Node n1 Node n2 Node n3 Node n4
G = (V, E) S = {Xi, Cij} ∀i ∈ V, (i, j) ∈ E vij = cijxi cij = 1 : vij = xi rij : Cij + Xi − → Cij + Xj R = {rij | (i, j) ∈ E}
Node n2
v21 = c21x2 v21 = c23x2 v
2 4
= c
2 4
x
2
X2 C21 C23 C24
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- LoMA Scheduler: Each node sleeps for a well-defined (but inherently
stochastic) time between two reactions:
- Result: Our Disperser protocol computes a useful result: average function.
!"#$%&'( $)$#$*!' +,-$%. / ./ .0 1/ / 1// 2// 3// 4// ./// !"#$%&'( $)$#$*!' +,-$%1 / ./ .0 1/ / 1// 2// 3// 4// ./// !"#$%&'( $)$#$*!' +,-$%5 / ./ .0 1/ / 1// 2// 3// 4// ./// !"#$%&'( $)$#$*!' +,-$%2 / ./ .0 1/ / 1// 2// 3// 4// .///
Law of Mass Action Scheduler
13
Node n1 Node n2 Node n3 Node n4
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Node n2
X2 x
2
x1 x
3
x4 x2 x2
- Convergence proof of Disperser using a classical perturbation analysis:
- 1. Write down the system’s differential equations:
Disperser: Formal Flow Analysis
14
˙ x2 = x1 + x3 + x4
- inflow
−3x2
- utflow
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Node n2
X2 x
2
x1 x
3
x4 x2 x2
- Convergence proof of Disperser using a classical perturbation analysis:
- 1. Write down the system’s differential equations:
- 2. Find the fixpoint:
Concentrations do not change anymore at equilibrium: set all time derivatives to zero:
Disperser: Formal Flow Analysis
15
x∗
2 = (x∗ 1 + x∗ 3 + x∗ 4)/3
= average number of X-molecules x∗
i =
- j x∗
j
|V | ˙ x2 = x1 + x3 + x4
- inflow
−3x2
- utflow
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Node n2
X2 x
2
x1 x
3
x4 x2 x2
- Convergence proof of Disperser using a classical perturbation analysis:
- 1. Write down the system’s differential equations:
- 2. Find the fixpoint:
Concentrations do not change anymore at equilibrium: set all time derivatives to zero:
- 3. Show that the fixpoint is asymptotically stable:
Linearize the system around the fixpoint (Jacobian) and show that the real part of all eigenvalues are negative.
Disperser: Formal Flow Analysis
16
x∗
2 = (x∗ 1 + x∗ 3 + x∗ 4)/3
= average number of X-molecules x∗
i =
- j x∗
j
|V | ˙ x2 = x1 + x3 + x4
- inflow
−3x2
- utflow
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- Fraglets - a programming language to express distributed chemical reactions:
- Molecules=strings of symbols; symbols=executable “assembler instructions”
- (Partial) List of the Fraglets instruction set:
- The Disperser protocol,
programmed in Fraglets:
Chemical Networking Protocol Implementation
17
[match x tail1] + [x tail2] [tail1 tail2] [matchp x tail1] + [x tail2] [matchp x tail1] + [tail1 tail2] [nop tail] [tail] [fork a b tail] [a tail] + [b tail] [send j tail]i [tail]j
Node n1 matchp X send n2 X X send n2 X X Node n2
X1 C12 X2
C12 + X1 − → C12 + X2
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Overview
18
- Distributed chemical reaction networks
- Example: Disperser - a gossip-style protocol
- Formal convergence analysis
- An implementation in Fraglets
- Code homeostasis: Self-regulation of code with Quines
- A first self-healing protocol
- Discussion
- Flows vs. FSM
- Symbolic vs. representation-free encoding of information
- Application fields
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Finite Reactor
- We limit the capacity (number of molecules) of the reaction vessel...
Due to limited resources, we cannot let the number of molecules grow infinitely.
- ...by randomly overwriting molecules when this vessel capacity is exceeded.
- Consequence: We risk to lose part
- f the program logic (code).
- Possible strategy:
Continuous regeneration of “code” molecules.
19
Reaction Vessel
- verflow
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
20
[match x fork fork fork match nop x] [x fork fork fork match nop x]
We start with two slightly different molecules
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
21
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x]
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
The first reaction step combines the two molecules; they are consumed.
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
22
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x]
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
The molecules splits into two
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
23
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x] 2
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
The two molecules are identical
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
24
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x] 2 [nop x fork fork fork match nop x]
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
Each molecule instance splits into two different molecules
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
25
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x] 2 [nop x fork fork fork match nop x]
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
The no-operation instruction closes the cycle
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Autocatalytic Reaction Networks
26
[match x fork fork fork match nop x] [x fork fork fork match nop x] [fork fork fork match nop x fork fork fork match nop x] [fork match nop x fork fork fork match nop x] 2 [nop x fork fork fork match nop x]
- To handle code loss we have to continuously regenerate it.
- Well-known Quines, now in Fraglets:
A quine is a program that generates its own source code as output.
The Quine replicated by generating an identical copy of itself
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- If we destroy 80% of the [matchp x ...] or the [x ...] molecules...
...the system recovers very quickly:
- The “dilution flow” eliminates superfluous and defective particles.
- The system finds back to equilibrium (code homeostasis)
!"#$%&'( )*#+$,%-.%#-/$0*/$'
1 2 3 4 5 6 1 31 51 71 81 211 231 251
Quine Replicas Recover From Code Deletion Attacks
27 !"#$%&'( )*#+$,%-.%#-/$0*/$'
1 1231 1234 1235 1236 127 1271 3 13 43 53 63 733 713
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
A Load-Balancing Protocol Resilient to Code Knock-Outs
- Goal: Balance a packet stream from node src to node dest over two links.
- Node src uses two competing Quines to send data packets to node dest.
- The Quines only replicate when receiving an acknowledgment.
- If path p2 drops packets, the replication rate of Quine 2 decreases:
- The relative concentration of Quine 1 increases; it forwards more packets.
28
pkt pkt Quine 1 Quine 2 Quine 3 2 2 input stream: rate r
- utput
stream data packets 2 Path p1 (bw: ) Path p2 (bw: B) Node src Node dest acknowledgments
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
A Load-Balancing Protocol Resilient to Code Knock-Outs (continued)
- At t=50s we destroyed 80%
- f all molecules in node src.
- This destroys large parts of
the forwarding Quines’ code.
- Observations:
- The packet forwarding
rate is not affected!
- Quine concentrations
recover, the program code finds back to equilibrium.
29
pkt pkt Quine 1 Quine 2 Quine 3 2 2 input stream: rate r
- utput
stream data packets 2 Path p1 (bw: ) Path p2 (bw: B) Node src Node dest acknowledgments
picture: omnet++ sim
!"#$%&'(&$
)$* )$+ )$, )$-
./%0123("%/4 .*%0123("%*4 5'#"&2#" 6"78!2&83'( 9889&:%0-);4
835"%<7= !98"%<>:87?7=
@) +) A) ,) B)
- )
) A) /)) /A)
!/%0C98D%>/4 !*%0C98D%>*4
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Discussion (1) Representation-free vs. Symbolic Information
- Traditional protocols:
- Symbolic encoding of protocol states.
stored as integers, flags, etc.
- Symbolic information exchange
among distant nodes.
- Chemical protocols:
- Protocol states are reflected by the multiplicity of molecules.
- Information is exchanged by the packet rate.
- The law of mass action scheduler
maps concentrations to rates and vice-versa.
- Higher message complexity
+ Better robustness to packet and code loss.
30
state: multiplicity exchange: rate state: integer exchange: integer 15 4 7.5 2
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Discussion (2) Flows vs. FSM
- Classical FSM model and
queuing theory:
- Queues (and scheduling
algorithms) are in a different sphere than protocol logic.
- Only traffic is modeled (Markov).
- Integrated, chemical view:
Message passing and code execution at the same level and in the same environment.
- The reaction network is
modeled by a timed Petri-Net with law of mass action governed transitions
- We focus on the flow dynamics of tokens
which is outside of the Petri-Net model and which can be approximated by differential equations
31 Sched Alg 2 Sched Alg 3 Sched Alg 1 FSM FSM
t=1/|P1| P1 P3 P4 P5 t=1/|P1||P2| P2 t=1/|P4||P5| T1 T2 T3 molecule type molecule instance reaction
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Discussion (3): Application Fields
- Generally: Continuously running distributed services “with an equilibrium”:
- “Pure” chemical protocol: Representation-free information only.
- Gossip-style protocols:
Calculation is presented in the equilibrium of the distributed reaction network.
- Routing protocols:
E.g. ant colony routing, where ants and pheromones are represented by molecule instances.
- Hybrid protocols: User information is stored symbolically, but protocol states
are representation-free; the protocol dynamics is governed by the law of mass action.
- Flow control protocols:
E.g. multipath load balancing by optimal path reinforcement.
- Topological self-organization of sensor/actor networks, and reactive
systems in general
E.g. generate spatial patterns caused by reaction/diffusion to identify the role of network nodes.
32
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Conclusions
- Our chemical networking theory provides a common basis to design, model
and analyze new protocol types:
- Abstract distributed chemical reaction network.
- Convergence proofs using differential equations.
- In-depth stochastic analysis using timed Petri-Nets.
- The Fraglets language and execution model allows for fast development of
protocol prototypes (sort of active networking).
- No distinction between code and data → code homeostasis, i.e. recovery
from code loss.
33
Questions?
Thank You
match WHOM match WHAT exch nop WHOM You match WHAT exch nop You WHAT Thank nop Thank You exch nop You Thank
Backup Slides
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
- PushSum is a comparable gossip-style protocol (average computation).
PushSum isochronously sends half of its values to a random neighbor node [Kempe et al, 2003].
- Both protocols asymptotically converge to the solution.
!"#$%&'( )*+,$
- ./$%0
1 2 3 4 5 6 1 211 311 411 011 511 !"#$%&'( )*+,$
- ./$%4
1 2 3 4 5 6 1 211 311 411 011 511 !"#$%&'( )*+,$
- ./$%3
1 2 3 4 5 6 1 211 311 411 011 511 !"#$%&'( )*+,$
- ./$%2
1 2 3 4 5 6 1 211 311 411 011 511
7"'8$9'$9 :,';<,#
Comparison to Another Gossip Protocol
36
Node n1 Node n2 Node n3 Node n4
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Law of Mass Action Scheduler
- Statistical Mechanics: Prevalent molecules ⇒ more frequent collisions.
In a reaction vessel of constant volume, the collision frequency increases with a higher mol. density.
- Stochastic scheduling algorithm:
- For each reaction A + B → C, calculate the reaction interval
number of A, B molecules; randomness due to Brownian motion.
- Sort the next reaction time of all reactions into a priority queue.
- Wait for the next reaction time.
- Execute that reaction and calculate its next reaction interval.
37
τ ∼ Exp
- 1
xAxB
- xA, xB :
[Gibson&Bruck, 2000]
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Stochastic Scheduling and Deterministic Prediction
- Reactions are NOT executed as fast as possible.
- Reactions are rather scheduled for a later time according to the Law of Mass
Action:
reaction rate = product of the reactant concentrations
Differential Equation Approximation:
time [s] number of x molecules 1 2 3 4 5 6 7 8 1 1/2 1/3 ...
Exponential Growth of x w.r.t. Simulation Time: Reaction Network:
matchp x fork x x x 2
38
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Robustness of Quines to Deletion (qualitatively)
data injection rate x vessel capacity N destruction rate
- req. CPU power
robustness, yield,
- req. CPU power
robustness, yield robustness
39
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Robustness of Quines to Deletion (quantitatively)
x t1 2 2 data flow input
- utput
t2 2 2 t3 2 2 t4 2 2 t5 2 2 t6 2 2 y 2 2 Q1 Q2 Q3 Q4 Q5 Q6 Q7
40
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Robustness of Quines to Deletion (quantitatively)
41
- Th. Meyer & Ch. Tschudin: Chemical Networking Protocols
Robustness of Quines to Mutation
!"#$%& '()*+)"+#,!"#$%&
- *.+(
/0 1/0 2/0 3/0 4/0 5/0 6/0 7/0 8/0 9/0 1//0
>95% valid results >50% valid results <50% valid results <5% valid results no result molecules inert infinite closure
42