Mobile Code a Long Term Perspective Christian Tschudin, University - - PDF document

mobile code a long term perspective
SMART_READER_LITE
LIVE PREVIEW

Mobile Code a Long Term Perspective Christian Tschudin, University - - PDF document

Mobile Code a Long Term Perspective Christian Tschudin, University of Basel Invited talk, Prognet 2004, Lake Windermere, UK Theme: Mobile Code Research as a broad and new challenge active networking: several systems,


slide-1
SLIDE 1

Mobile Code – a Long Term Perspective

Christian Tschudin, University of Basel Invited talk, Prognet 2004, Lake Windermere, UK Theme: Mobile Code Research as a broad and new challenge – active networking: several systems, little innovation – revisiting mobile code, communications and computations – go low level, novel models, novel architectures!

Some Observations

  • Active networking (AN) so far:

strong program, weak results

  • AN languages:

geared towards human engineers (extending what they know) instead of mobile code’s needs, potential.

  • Accept radical definition of “active networking”:

distributed self-modifying code (otherwise it’s not active)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 2/32

slide-2
SLIDE 2

Surprise Entry: Berkeley Motes

Active networking today is happening elsewhere:

  • Wireless sensor networks
  • “Smart dust” vision
  • Can’t program tiny nodes on an individual basis:

– network computing (e.g. data fusion) – “retask” the whole networks

  • Extreme constraints:

– a few kbit/s, a few kB RAM, MIPS range at most

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 3/32

Berkeley Motes and TinyOS

  • First level of programmability:

– sensors used for one task (at a time) – “decorated C” (nesC) – bundle app code with TinyOS libraries – viral (machine) code distribution as a base service (tool chain infested with Java based tools)

  • 2nd level:

– virtual machine “Mat´ e” – capsules (24 Bytes)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 4/32

slide-3
SLIDE 3

Mat´ e Programming Environment (2002)

  • Capsules executed on arrival
  • Have their own context

(stacks, PC)

  • Capsules as subroutines
  • Shared variable(s)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 5/32

Flashback: Messenger M0 (1993)

~

y ’abc’

~

x 123

...

thread queues threads shared memory messengers routing table channels

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 6/32

slide-4
SLIDE 4

Programming Example for Mat´ e

✂✁☎✄✝✆☎✞✠✟ ✡☞☛✌✁☎✄✍✆✏✎✒✑✔✓✕✎✖✑✘✗✙✎✕✎✖✔✓✛✚✘✜✖✑✘✢✣✄✖✗✘✜✙✞✥✤ ✜✛✢✦✢ ✡★✧✩✢✦✢✪✗✛✆✫✓✕✎✖✑✔✓☞✗✘✎☞✗✛✆✫✓✠✄✖✗✘✎✬✚✙✓✂✢✭✞✛✎✒✁✦✑✘✗✩✓✌✚ ✞✬✎✖✘✮ ✡✕✯✩✎✖✙✮✰✗✬✆✔✓✱✑✔✓✬✲✳✞✬✎✖✁✦✑✙✗✙✓✌✚✰✴✙✜✦✵✖✁✫✓ ✂✁☎✄✝✆☎✞✷✶ ✡ ✜✒✑✫✢ ✡★✸✘✜✹✤✫✓✻✺✔✎✛✗✦✗✙✎✥✼✭✗✛✆✙✚✙✓✦✓✷✺✾✽✖✗✿✄✷✎✌❀❁✞✛✎✒✘✮ ✂✁✘✗✘✵✂✓✌✢ ✡✰❂✂✓✌✗✕✗✛✆✫✓☞❃✂❄✂❅✾✄✱✗✙✎☞✗✬✆✔✓✫✄✹✓★✗✛✆✘✚✩✓✦✓✻✺☎✽✖✗✔✄❆✆✿✜✦✵✬✗

Comments – “persistent” counter on the stack – timer event calls this capsule – increments counter, copies the bits into LED latch

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 7/32

Mat´ e Self-Assessment

Refrishingly honest:

  • “language not usable”

(UCB technical report, 2004) But what conclusions to draw?

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 8/32

slide-5
SLIDE 5

Active Networking Timeline

1969 Decode Encode Language (RFC 5) 1982 Softnet 1993 M0 Messengers 1994 Java 1997 Morphnet 1998 NetScript, ANTS, PLAN, Safetynet All models are sequential, languages boil down to register- and stack machines (no surprise!).

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 9/32

AN Progress since then . . .

  • Infrastructure (prog. routers)

AMnet, Click, Janos, NodeOS, Promethos, Scout. . .

  • Interfaces (P15xx, ForCES)
  • Network Processors:

IXP1200, PowerNP , PayloadPlus, MMC, EZchip, Motorola C-Port

  • Few new AN languages, e.g. ESP

but a Java companion (C#)

  • more of the same // Will it ever become CS textbook stuff?

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 10/32

slide-6
SLIDE 6

Where should Progress come from?

  • Sensor people say: currently too low level

– go marcoprogramming, netwide DB etc

  • Prognet04 says: go sideways and upwards

– combinatorial (AN+p2p, AN+ad hoc, AN+. . . ) – mitigating (policies) Go higher level? Nth-generation language? More curbing systems? I say: – follow Feynman (“There’s plenty room at the bottom”) – get the foundation right.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 11/32

What’s wrong with AN today?

  • No good formal model for code mobility

  • calculus: basically static, simulate mobility

– Ambients: heavy weight agents

  • Still stuck with capsule style

– encoding problems – fuzzy borders between transient/persistent/shared memory

  • Or chunk-wise download: requires a network, in a first place
  • No AN network architecture yet: just an IP add-on
  • No algorithmic progress (genuin active protocols)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 12/32

slide-7
SLIDE 7

AN not really active, today

Active protocols a mere question of efficiency? Active protocols are fun for experimenting . . .

  • . . . but once we know the useful N protocols, we can

turn/burn them into a passive implementations and add a big

✂✁ ✄✆☎✞✝✠✟☛✡✌☞ statement for user choice.
  • That is, capsules as well as programmable routers:

an economy tradeoff (choice or download)

  • See Sensornets:

Mat´ e capsules better if task duration

✍ = 5 days

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 13/32

AN not really active, today

capsule

The great active protocol 1.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 14/32

slide-8
SLIDE 8

AN not really active, today

capsule

The great active protocol 2.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 15/32

AN not really active, today

  • r choice

capsule,

The great active protocol 1, 2 or whatever you choose. Applies even more to programmable routers.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 16/32

slide-9
SLIDE 9

Active Networking – if it was really active

t

The system as a whole is changed, evolves.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 17/32

An Attempt for a “activeness” Criteria (1)

A protocol is active iff removing the protocol from the system is more complex than writing a replacement protocol. Goals: – we want to exclude simple “plug-in/out” – we want to exclude a simple system reboot That is: an active protocol can have persistent effect!

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 18/32

slide-10
SLIDE 10

An Attempt for a “activeness” Criteria (2)

Note on previous definition:

  • At a different timescale we have this already
  • Our (OS, network) systems evolve this way:

– adding new functionality – almost impossible to fully replace old one – largely depends on humans in the loop

  • Mobile code promise:

– we can speed up this up – partial implementations: Windows updates – ultimately: self-modifying code at run-time.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 19/32

Packet Languages and Chemical excution models

What other models then register+stack? First pointers:

  • Post rewriting systems (1930ies)

as a basis for packet header processing

  • Gamma (Banatre and Le Metayer, 1986)
  • Growing Point Language (Coore, amorphous computing, 1999)

Introducing Fraglets and metabolic protocol implementations . . .

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 20/32

slide-11
SLIDE 11

Fraglets

Fraglet = computation fragment = “packet” = “rule” = “molecule”

fraglet store (multiset) fraglet store (multiset) fraglet exchange fraglet exchange fraglet exchange

  • Fraglet = string W of symbols:

W = [ s

: s ✁ : ... : s ✂ ]

(sequence of pkt headers)

  • Head symbol selects fraglet processing

fraglet rewriting

  • Two types of fraglet processing (shall be O(1)):

– single fraglet transformation – chemical reaction (involving two fraglets)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 21/32

A Fraglet Language – Packet Header Processing!

  • Unary operation – special symbols pop, send etc:

(V and W are words) [ discard : V ]

✄ ☎

[ pop : t : s

✆ : V ] ✄

[ t : V ] [ split : V :

✝ : W ] ✄

[ V ] and [ W ] (V has no

✝ )

[ send : n : V ]

send [ V ] to node n

  • Binary operation – two fraglets “react”:

[ match : s

✞ : V ]

[ s

✞ : W ] ✟✡✠ ☛ ✄

[ V : W ]

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 22/32

slide-12
SLIDE 12

Sample “Fraglet Program”: Change a Fraglet’s Tag

In: [ i : W ] Out: [ o : W ] Program: [ match : i : o ] Execution Trace: [ match : i : o ] [ i : W ]

✟✡✠ ☛
  • [ o : W ]

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 23/32

Sample “Fraglet Program”: Change Fraglet Tag (contd)

Persistent version of “match”: matchp In: [ i : W ] Out: [ o : W ] Program: [ matchp : i : o ] Execution Trace: [ matchp : i : o ] [ i : W ]

✟✡✠ ☛
  • [ matchp : i : o ], [ o : W ]

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 24/32

slide-13
SLIDE 13

Sample “Fraglet Process” : Producer/Consumer

a.k.a “confirmed delivery protocol” Prod: [ matchp : ack : data : Payload ] Cons: [ matchp : data : split : ack :

✝ : discard ]

Ack: [ ack ]

P C a d

Execution Trace:

[ a ] [ matchp : a : d : Payload ], [ a ]

  • [ d : Payload ]

[ matchp : d : split : a :

✁ : discard ], [ d : Payload]
  • [ split : a :
✁ : discard : Payload ]

[ split : a :

✁ : discard : Payload ]
  • [ a ], [ discard : Payload ]
  • [ a ] . . .

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 25/32

Fraglet Protocol: Flow Control with N Credits (contd)

fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk fhadks fhak hfakd fhkd fhkd fhkdas hfkdhfk hfk

credit tokens

N N/N+1/P r0/N/N+1/P r1/N/N+1/P r2/N/N+1/P r30/N+1/P r31/N+1/P r32/N+1/P r33/N+1 r34/N+1 r35/N+1 r36/N+1 r37/N+1 c0/P

  • ut/ok/P
  • ut
  • k
  • ut

r39 r38/N+1 r39/N+1 N+1 t0 t0/N t1/N send/N/N+1 t1/N+1 c1/ok/P c2/ok/P c4/ok c3/ok/P

payload next expected token step circular list consumer producer

s0/N s2/N s21/N s22/N N N/N+1 s23/N+1 s24/N+1 s25/N+1 s1/N ring/N+1 s20/N+1 s20/N ring/N ring a1/ok/P a10/ok a11/N/N+1 send/N/N+1/P a10

  • k

a0/ok/P N/N+1 a11/P in/ok/P produce N/N+1

Total system: ca 35 axioms (fraglets), 3–10 symbols long – everything is a fraglet (active packet), even credit tokens – coupled control and processing loops

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 26/32

slide-14
SLIDE 14

Fraglets and Sensornets

Extend Packet Header Processing: packet tail is a stack.

  • p1 : op2 : op3 ...

... : d3 : d2 : d1 (sequential) operators/call stack

  • perand stack

a (Fraglet) packet

Redoing the Mat´ e capsules, in Fraglets: –

✜✛✗✿✞✝✆ ✁ ✞✝✑✙✗ ✁ ✜✛✢✦✢ ✁ ✞✛✎✖✘✮ ✁ ✂✁☎✄✝✆❁✶ ✁ ✜✒✑✫✢ ✁ ✦✁✘✗✙✵✂✓✂✢ ✁ ✞✝✑✙✗ ✁ ✟✄✂

– the packet is the context (contains stack) – moving contexts easy to express

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 27/32

Fraglets and Activeness

  • Fraglet store is basically a big “soup”
  • Difficult to cleanse a running system:

– know all intermediate products – service could be used by others

  • Link to network architecture:

– packet header as “selector” (SelNet) – selector determines what processing to apply

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 28/32

slide-15
SLIDE 15

AN: Beyond Hacking Execution Supports (1)

Real CS puzzles! Researching the foundation of mobile code. E.g. Trustworthiness:

  • Can you safely execute mobile code in a hostile environment?

– compute secrets on a malicous host!

  • Preliminary results (1998, with T. Sanders):

using homomorphic encryption schemes

  • Function is encrypted (encoded) such that

– host can execute single basic instructions – but cannot extract the algorithm, nor the data!

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 29/32

AN: Beyond Hacking Execution Supports (2)

Robustness:

  • Can you write a correctly working program that works despite

removing an arbitrary instruction?

  • Preliminary resuls (2004, with L. Yamamoto):

use redundant execution paths, with Fraglets

  • Gradual difference to packet loss
  • Includes signaling which code was removed:

– code can potentially heal itself! A (unsolved puzzle): write an active packet Quine.

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 30/32

slide-16
SLIDE 16

AN: Beyond Hacking Execution Supports (3)

Robust execution of Mobile Code

  • Related area: Quantum computing
  • Problem statement:

– decay of “state” and noise in processing Qubits – need “error correcting execution” – has been demonstrated for logical gates CS question: what algorithms (beside logical gates) are encodable – directly (without relying on these gates) – dynamically (not static gate topologies)

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 31/32

Conclusions

Mobile code as a broad research area: it has just started.

  • Active networking:

Currently little to report back home, little to put into CS textbooks

  • Look beyond restricted (quasi active) mobile code
  • Towards a real and active mobile code world

– other execution models – other network architectures Go lowlevel, go theory, go active, go self-modifying!

c

Christian Tschudin, University of Basel Programmable Networks 2004, Nov 30–Dec 1, 2004, 32/32