CTI, DePaul University, Chicago
COGS, University of Sussex, Brighton
Joint work with Ian Wakeman, Tim Owen and Rory Graves, Sussex
The SafetyNet project.
Programming model.
Semantics.
Types.
Further work.
In reality, a router is often pretty smart.
An AN allows users to make use of the computing power in the routers:
Active multicast networks can take advantage of processing power at the relays.
For example, an active relay can perform application-specific compression for low-bandwidth links.
Makes firewall deployment lightweight.
Scalable VR.
Application-specific protocols.
Application-specific proxies.
...
Add a notable performance overhead.For example, if arbitrary C code were executed:Compromise network integrity.
Security violations from dereferencing arbitrary memory.Denial of Service attacks from flooding the network with packets or processes.
For example, each array assignment requires a bounds test and a run-time type test.
All objects are heap allocated.
Can we achieve security and safety without requiring costly run-time checks?
To develop safety and security policies for ANs.
To design a typed language for programming ANs.
To show that any type-safe program will satisfy the safety and security policies.
To provide prototype implementations and simulation tools.
At each location, there is a collection of resources and a collection of executing threads.
Threads may access existing resources, or register new resources.
Threads may spawn subthreads, and may migrate to neighbouring locations.
Threads can find out local information about the network, eg the next hop to a location, but not global information.
The language is statically typed, with a formal model of a `core' language.
class OutStream
<serializable class Packet> {
abstract method send (p : packet);
}class RemoteStream
<serializable class Packet> (
dest : location,
port : OutStream <Packet> at dest
) extends OutStream <Packet> {
field dest : ... = dest;
field port : ... = port;
method send (p : packet) {
if (at dest) {
port.send (p);
} else {
spawn at route dest {
new RemoteStream <Packet>
(dest, port).send (p);
}
}
}
class Forwarder {
static method forward
<serializable class Packet> (
dest : location,
port : OutStream <Packet> at dest,
p : packet
) {
if (at dest) {
port.send (p);
} else {
spawn at route dest {
Forwarder.forward <Packet>
(dest, port, p);
}
}
}
}
Objects are either local (no remote references) or global (can be referred to by other locations).
Local objects have type Foo, global objects have type Foo at Loc.
Only serializable data can be migrated between locations.
Objects can be stack-based (eg foo) or heap-based (eg Foo). Stack-based objects may be serialized, heap-based objects are not.
Classes are cached, shared resources. The first time a class is used at a location, it is loaded, after that the cached copy is used.
RPC is derived, not primitive!
Primitive is spawn at route Location { Thread }.
Network topology is dynamic.
Milner, Parrow and Walker's pi-calculus.Closest AN work is Gunter et al's PLAN.Boudol's blue-calculus.
Fournet, Gonthier, Lévy, Maranget and Rémy's join calculus.
Moggi's monadic meta-language.
Girard / Reynolds' 2nd order lambda-calculus.
Hennessy and Riely's / Sewell's distributed pi-calculus.
Cardelli and Gordon's ambients.
Abadi and Cardelli's object calculus
Gordon's concurrent object calculus
Odersky, Wadler et al's Generic Java
Network ::=Resources are classes, objects or unknown:
Loc [Thread] |
Loc <Id = Resource> |
Network | Network |
0 |
secret Id; Network
Resource ::=
class extends Class { ClassBody }
object Class { Fields }
unknown

Last rule requires L<x = ...> not in N.
(M | N) | OM | (N | O) M | N N | M M | 0 M secret x; N secret y; N[y / x] secret x; (M | N) (secret x; M) | N secret x; 0 0 secret x; N secret x; L<x = unknown>
The rules include a formal treatment of an object-oriented class-based language, including class loading.
L[let P = O.F; T] | L<O = object C {...field F = V;...}> L[let P = V; T] | L<O = object C {...field F = V;...}>
We can then verify:Exp : Type
Network : network
Type safety: any well-typed program satisfies the required safety and security conditions.Together, these properties mean that any well-typed program will always satisfy the safety and security conditions.Subject reduction: any well-typed program stays well-typed.
Develop and formalize `real world' safety and security policies.http://klee.cs.depaul.edu/an/Add linear types (for time-to-live counts or charging mechanisms).
Include security and digital signatures.
Include a `web of trust' model based on Hennessy and Riely.
Provide a versioning model.
Check principal typing.
Try out on real examples!