25
1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

1

Hybrid Resource Control for Active Extensions

Parveen PatelJay Lepreau

University of Utah

Page 2: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

2

The Problem Resource-greedy active code Resource control of untrusted code

CPU, memory, network bandwidth

Context: Active ExtensionsCode downloaded via the control channelExamples: Application Layer Gateways,

Multicast scoping agents

Page 3: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

3

Current Solution #1: Dynamic

“Sandbox” the active code Run-time checks in the critical path Asynchronous termination

Requires checks at the “user-kernel” boundary to protect integrity of the “kernel” code

Flexible Examples: Janos, Smart Packets, RCANE,

OKE Corral

Page 4: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

4

Current Solution #2: Static Analysis Constrained programming model bounds

resource consumption

Admission control == Resource control

Examples: PLAN, SNAP, PCC

Issue: Existing work does not yet address the problem with pessimistic estimates, valid code gets rejected.

Page 5: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

5

Current Solutions - Summary

dynamic checkingdynamic checking run-time overheadrun-time overheadasynchronous termination asynchronous termination

static checking is very conservativestatic checking is very conservative

Page 6: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

6

Hybrid Resource Control #1

Static checking

Constrained programming model to bound the resources and guarantee termination

Static analysis rejects resource greedy code from the “kernel” fast-path environment

Liberal resource limits

Page 7: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

7

Hybrid resource control #2

Dynamic resource accounting

Detects misbehavior

Misbehaving code is detected and unloaded only when idle (between packets)

Limits overall resource consumption

Page 8: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

8

Poll points Extension could cause packet drops at

device input queue

Split the active extension code and poll network interfaces

Adds some runtime cost

Page 9: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

9

Merits of Hybrid Resource Control

No asynchronous termination Implies no runtime checks at the

“user-kernel” boundary

Reduced runtime overhead Runtime accounting checks are inexpensive

Flexibility via “poll points”

DoS prevention

Page 10: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

10

Outline

Prototype: resource bounded Click or RBClick

Building blocks

The big picture

Preliminary evaluation

Page 11: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

11

Cyclone Cyclone: typesafe C-like language from

Cornell and AT&TRegion-based memory managementcontrol over data-representationEasy to interface with CNamespaces

Page 12: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

12

Resource-bounded Cyclone Namespace control

Restricted programming constructs (bounded loops)

Memory management via 4 distinct dynamic regions Per-packet Packet-cache Inter-packet Global memory

Page 13: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

13

Click

Modular router toolkit from MIT Data-flow programming model Has an increasingly large base of router

extensions

FromDevice Classifier

ToDeviceARPResponder

Counter Drop

Page 14: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

14

Prototype: Architecture

An active extension is a special Click graphMix of trusted and untrusted elementsStatically analyzed

Admitted to kernel fast-path

Page 15: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

15

An Active Extension

Untrusted RBCyclone Element

D

Trusted C++ Element

C

A BE

Page 16: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

16

The big picture

D

C

A B E

Code Analysis Tool ElementResource bounds

Page 17: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

17

The big picture

D

C

A B E

Graph Analysis Tool

Overall Resource bounds

Element Resource bounds

C

A BE

D

P

Poll Element

Page 18: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

18

Loop configuration

D

C

A B E

Graph Analysis Tool

Overall Resource bounds

Element Resource bounds

C

A BE

D

L

Loop Element

Page 19: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

19

Evaluation

Flexibility of programming model

Experimental performance gains

Page 20: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

20

Classification of Click elements Categorized all 234 Click v1.2.1 elements into 7

different classes based on their resource use E1 - Constant resource consumption E2 - ~ length of the packet E3 - ~ length of some protocol header E4 - ~ length of element configuration E5 - ~ some value in the configuration of an element. E6 - ~ field in a protocol header E7 - Potentially unbounded

Page 21: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

21

Evaluation: flexibility

Results:88% resource-boundedThe rest can be easily rewritten to be bounded

Demonstrates that RBClick can reuse a rich set of Click elements

Strongly suggests that RBCyclone programming model is sufficiently expressive

Page 22: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

22

Prototype Context

Janos

Page 23: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

23

Evaluation – experiment configurations

Page 24: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

24

Evaluation: performance

0

20

40

60

80

100

120

1400

20

40

60

80

10

0

12

0

Send Rate

Rec

eive

Rat

e

Moab Fast path

RBClick

RBCyclone

Click

Page 25: 1 Hybrid Resource Control for Active Extensions Parveen Patel Jay Lepreau University of Utah

25

Conclusion Hybrid resource control

Static analysis reduces runtime overhead Dynamic accounting allows liberal admission control

RBCyclone is expressive and practical(“tastes great”)

RBClick doubles forwarding rate in Janos

(“less filling”)