Declarative Routing: Extensible Routing with Declarative Queries

42
Declarative Routing: Extensible Routing with Declarative Queries Boon Thau Loo 1 Joseph M. Hellerstein 1,2 , Ion Stoica 1 , Raghu Ramakrishnan 3 , 1 University of California at Berkeley, 2 Intel Research Berkeley, 3 University of Wisconsin-Madison Smchoi 2011.04.23

description

Declarative Routing: Extensible Routing with Declarative Queries. Boon Thau Loo 1 Joseph M. Hellerstein 1,2 , Ion Stoica 1 , Raghu Ramakrishnan 3 , 1 University of California at Berkeley, 2 Intel Research Berkeley, 3 University of Wisconsin-Madison. Smchoi 2011.04.23. Motivation. - PowerPoint PPT Presentation

Transcript of Declarative Routing: Extensible Routing with Declarative Queries

Page 1: Declarative Routing:  Extensible Routing with Declarative Queries

Declarative Routing: Extensible Routing with Declarative Queries

Boon Thau Loo1

Joseph M. Hellerstein1,2, Ion Stoica1, Raghu

Ramakrishnan3, 1University of California at Berkeley, 2Intel Research Berkeley, 3University of Wisconsin-Madison

Smchoi 2011.04.23

Page 2: Declarative Routing:  Extensible Routing with Declarative Queries

Motivation

Lack of extensibility and flexibility in today’s Internet routingHard to add/improve/update routing protocols

Page 3: Declarative Routing:  Extensible Routing with Declarative Queries

Two “Extremes”:

“Hard-coded” protocols:

- Efficiency, safety

- Flexibility, evolvability

-

+

Active Networks

- Flexibility, evolvability

- Safety, efficiency-

+

Declarative Routing:

+ Flexibility, evolvability, safety

Our Goal

Restricted instantiation of Active Networks for the

control plane

Page 4: Declarative Routing:  Extensible Routing with Declarative Queries

Key Idea

Recursive query language for expressing routing protocols: Datalog: a declarative recursive query

language Well-researched in the database

community Well-suited for querying properties of

graphs

Page 5: Declarative Routing:  Extensible Routing with Declarative Queries

Advantages

Expressiveness: Compact and clean representation of protocolsSafety: Datalog has desirable safety properties on terminationEfficiency: No fundamental overhead when executing standard protocols.

Page 6: Declarative Routing:  Extensible Routing with Declarative Queries

Usage Scenarios

ISP administrators Run different protocols for different

nodes Modify existing protocols in routers

End-hosts Set up customized routes for different

quality-of-service and policy requirements of applications

Page 7: Declarative Routing:  Extensible Routing with Declarative Queries

Roadmap

Execution ModelIntroduction to DatalogPath-Vector Protocol ExampleAdvantages: Expressiveness Safety Efficiency

Evaluation

Page 8: Declarative Routing:  Extensible Routing with Declarative Queries

Centralized Execution Model

Store entire network state into a centralized databaseIssue Datalog queries on the centralized database for customized routes

Fully distributed implementation To explore the limits of our design

Page 9: Declarative Routing:  Extensible Routing with Declarative Queries

Routing Infrastructure Node

RoutingInfrastructure

Distributed Execution Model

Neighbor Table Forwarding Table

Declarative Routing

ResultTuples

DerivedTuples

Traditional Routers

Input Table

s

Output Tables

Datalog Queries

Query ProcessorRouting Protocol

Neighbor Table

updates

Forwarding Table

updates

Page 10: Declarative Routing:  Extensible Routing with Declarative Queries

Introduction to Datalog

<head> <precondition1>, <precondition2>, … , <preconditionN>.

Datalog rule syntax:

Page 11: Declarative Routing:  Extensible Routing with Declarative Queries

All-Pairs Reachability

R2: reachable(S,D) link(S,Z), reachable(Z,D)

R1: reachable(S,D) link(S,D)

Input: link(source, destination)Output: reachable(source, destination)

“For all S,D, If link(S,D) exists, generate reachable(S,D)”

“For all nodes S,D, If there is a link from S to D, then S can reach D”.

link(a,b) – “there is a link from node a to node b”

reachable(a,b) – “node a can reach node b”

Page 12: Declarative Routing:  Extensible Routing with Declarative Queries

All-Pairs Reachability

R2: reachable(S,D) link(S,Z), reachable(Z,D)

R1: reachable(S,D) link(S,D)

Input: link(source, destination)Output: reachable(source, destination)

“For all nodes S,D and Z, If there is a link from S to Z, AND Z can reach D, then S can reach D”.

“For all S, D and Z, If link(S,Z) exists AND reachable(Z,D) exists, generate reachable(S,D).”

Page 13: Declarative Routing:  Extensible Routing with Declarative Queries

All-Pairs Reachability

R2: reachable(S,D) link(S,Z), reachable(Z,D)

R1: reachable(S,D) link(S,D)

Query: reachable(M,N)

b dca

S D

a b

reachableOutput table

(Round 1): S D

b c

reachable S D

c d

reachable

Input table: S D

c d

linkS D

b c

linkS D

a b

link

E.g. R1: reachable(b,c) link(b,c)

All-Pairs

Page 14: Declarative Routing:  Extensible Routing with Declarative Queries

All-Pairs Reachability

R2: reachable(S,D) link(S,Z), reachable(Z,D)

R1: reachable(S,D) link(S,D)

Query: reachable(M,N)

b dca

S D

a b

a c

reachableOutput table

(Round 2): S D

b c

b d

reachable S D

c d

reachable

Input table: S D

c d

linkS D

b c

linkS D

a b

link

R2: reachable(b,d) link(b,c), reachable(c,d)

Page 15: Declarative Routing:  Extensible Routing with Declarative Queries

R2: reachable(S,D) link(S,Z), reachable(Z,D)

R1: reachable(S,D) link(S,D)

Query: reachable(M,N)

b dca

S D

a b

a c

a d

reachableOutput table

(Round 3):S D

b c

b d

reachable S D

c d

reachable

Input table: S D

c d

linkS D

b c

linkS D

a b

link

All-Pairs Reachability

Recursive queries are natural for querying graph topologies Recursive queries are natural

for querying graph topologies

Page 16: Declarative Routing:  Extensible Routing with Declarative Queries

Roadmap

Execution ModelIntroduction to DatalogPath-Vector Protocol Example Distributed Datalog Execution Plan

Protocol

Advantages: Expressiveness Safety Efficiency

Evaluation

Page 17: Declarative Routing:  Extensible Routing with Declarative Queries

R1: reachable(S,D) link(S,D)

R2: reachable(S,D) link(S,D), reachable(Z,D)

Distributed Datalog

Query: reachable(M,N)

b dca

S D

a b

a c

a d

reachableOutput

table:

S D

b c

b d

reachable S D

c d

reachable

Input table: S D

c d

linkS D

b c

linkS D

a b

link

Page 18: Declarative Routing:  Extensible Routing with Declarative Queries

Path Vector Protocol Example

Input: link(source, destination)Query output: path(source, destination, pathVector)

R1: path(S,D,P) link(S,D), P=(S,D).

R2: link(Z,S), path(S,D,P) P=S+P2. path(Z,D,P2),

Query: path(S,D,P)

Page 19: Declarative Routing:  Extensible Routing with Declarative Queries

Datalog Execution Plan

R1: path(S,D,P) link(S,D), P=(S,D).

R2:

link(S,D) path(S,D,P)R1

Recursion

link(Z,S), path(S,D,P) P=S+P2.

link.S=path.SR2 while

(receive<path(Z,D,P2)>)) {

for each neighbor S {

newpath = path(S,D,S+P2)

send newpath to neighbor S

}

}

path(Z,D,P2),

Send path.

S

Matching variable Z = “Join”

Pseudocode at node Z:while (receive<path(Z,D,P2)>)) { for each neighbor S { newpath = path(S,D,S+P2) send newpath to neighbor S }}

Page 20: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P) link(S,D), P=(S,D).

R2: path(S,D,P) link(Z,S), path(Z,D,P2), P=S+P2.

b dca

S D P

a b (a,b)

S D P

b c (b,c)

S D P

c d (c,d)

Forwarding table:

Query Executionlink(S,D) path(S,D,P)

Sendpath.

Slink.S=path.S

R2

R1

S D P S D P S D P

path path path

Neighbor table:

S D

c b

c d

linkS D

b c

b a

linkS D

a b

link S D

d c

link

Query: path(S,D,P,C)

Page 21: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P) link(S,D), P=(S,D).

R2: path(S,D,P) link(S,Z), path(Z,D,P2),

P=S+P2.

S D P

a b (a,b)

S D P

b c (b,c)

path path pathS D P

c d (c,d)

Query Execution

Forwarding table:

S D P

a b (a,b)

a c (a,b,c)

S D P

b c (b,c)

b d (b,c,d)

b dcap(b,d,[b,c,d])p(a,c,[a,b,c])

link(S,D) path(S,D,P)

path.S

link.S=path.S

R2

R1

Neighbor table:

S D

c b

c d

linkS D

b c

b a

linkS D

a b

link S D

d c

link

Query: path(S,D,P,C)

Page 22: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P) link(S,D), P=(S,D).

R2: path(S,D,P) link(S,Z), path(Z,D,P2),

P=S+P2.

b dca

path path pathS D P

c d (c,d)

Query Execution

Forwarding table:

p(a,d,[a,b,c,d])

S D P

a b (a,b)

a c (a,b,c)

S D P

b c (b,c)

b d (b,c,d)

S D P

a b (a,b)

a c (a,b,c)

a d (a,b,c,d)

link(S,D) path(S,D,P)

path.S

link.S=path.S

R2

R1

Neighbor table:

S D

c b

c d

linkS D

b c

b a

linkS D

a b

link S D

d c

link

Query: path(S,D,P,C)

Communication patterns are identical to those in the actual path vector

protocol

Communication patterns are identical to those in the actual path vector

protocol

Page 23: Declarative Routing:  Extensible Routing with Declarative Queries

Roadmap

Execution ModelIntroduction to DatalogPath-Vector Protocol Example Distributed Datalog Execution Plan

Protocol

Advantages: Expressiveness Safety Efficiency

Evaluation

Page 24: Declarative Routing:  Extensible Routing with Declarative Queries

Expressiveness

Best-Path Routing Distance VectorDynamic Source Routing Policy Decisions QoS-based RoutingLink-stateMulticast Overlays (Single-Source & CBT)

Minor variants give many options!

Page 25: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D, ,C) link(S,D,C) R2: path(S,D, ,C) C=C1+C2, Query: path(S,D, ,C)

All-pairs all-paths:

link(S,Z,C1), path(Z,D, ,C2),

Expressiveness

, P=(S,D).PP

P2

P=S+P2.P

Page 26: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P,C) link(S,D,C), P= (S,D). R2: path(S,D,P,C) link(S,Z,C1), path(Z,D,P2,C2), C=C1+C2, P= S+P2.

Query: bestPath(S,D,P,C)

R3: bestPathCost(S,D,min<C>) path(S,D,Z,C)R4: bestPath(S,D,Z,C) bestPathCost(S,D,C), path(S,D,P,C)

Expressiveness

Best-Path Routing:

Page 27: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P,C) link(S,D,C), P= (S,D). R2: path(S,D,P,C) link(S,Z,C1), path(Z,D,P2,C2), C=FN(C1,C2), P=S+P2.

Query: bestPath(S,D,P,C)

R3: bestPathCost(S,D,AGG<C>) path(S,D,Z,C)R4: bestPath(S,D,Z,C) bestPathCost(S,D,C), path(S,D,P,C)

Expressiveness

Best-Path Routing:

Customizing C, AGG and FN: lowest RTT, lowest loss rate, highest available bandwidth, best-k

Page 28: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D, ,C) link(S,D,C) R2: path(S,D, ,C) C=C1+C2, Query: path(S,D, ,C)

All-pairs all-paths:

link(S,Z,C1), path(Z,D, ,C2),

Expressiveness

, P=(S,D).PP

P2

P=S+P2.P

Page 29: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D, ,C) link(S,D,C) R2: path(S,D, ,C) link(S,Z,C1), path(Z,D, ,C2), C=C1+C2

Query: (S,D, ,C)

Distance Vector:

Expressiveness

DZ W

R3: shortestLength(S,D,min<C>) path(S,D,Z,C)R4: nextHop(S,D,Z,C) nextHop(S,D,Z,C), shortestLength(S,D,C)ZnextHop

Count to Infinity problem?

Page 30: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,D,C) link(S,D,C) R2: path(S,D,Z,C) link(S,Z,C1), path(Z,D,W,C2), C=C1+C2

R3: shortestLength(S,D,min<C>) path(S,D,Z,C) R4: nextHop(S,D,Z,C) nextHop(S,D,Z,C), shortestLength(S,D,C) Query: nextHop(S,D,Z,C)

Distance Vector with Split Horizon:

Expressiveness

, W!=S

Page 31: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,D,C) link(S,D,C) R2: path(S,D,Z,C) link(S,Z,C1), path(Z,D,W,C2), C=C1+C2, W!=S

R4: shortestLength(S,D,min<C>) path(S,D,Z,C) R5: nextHop(S,D,Z,C) nextHop(S,D,Z,C), shortestLength(S,D,C) Query: nextHop(S,D,Z,C)

Distance Vector with Poisoned Reverse:

Expressiveness

R3: path(S,D,Z,C) link(S,Z,C1), path(Z,D,W,C2), C=, W=S

Page 32: Declarative Routing:  Extensible Routing with Declarative Queries

R1: path(S,D,P,C) link(S,D,C), P= (S,D). R2: path(S,D,P,C) C=C1+C2, P=S+P2. Query: path(S,D,P,C)

All-pairs all-paths:

link(S,Z,C1), path(Z,D,P2,C2),

Expressiveness

Page 33: Declarative Routing:  Extensible Routing with Declarative Queries

Expressiveness

Switching Right-recursion to Left-recursion execution => Path vector protocol to DSR.

Dynamic Source Routing (DSR): R1: path(S,D,P,C) link(S,D,C), P= (S,D). R2: path(S,D,P,C) C=C1+C2, P= P1+D. Query: path(S,D,P,C)

path(S,Z,P1,C1), link(Z,D,C2),

Page 34: Declarative Routing:  Extensible Routing with Declarative Queries

Expressiveness

Best-Path routing Distance VectorDynamic Source Routing Policy-based routingQoS-based routingLink-stateMulticast Overlays (Single-Source & CBT)

Page 35: Declarative Routing:  Extensible Routing with Declarative Queries

SafetyQueries are sand-boxed within query engine Queries use input tables to produce output tables No side-effects on existing input tables

Pure Datalog guarantees termination: Natural bound on resource consumption of queries

Static termination checks for our extended Datalog: Identify recursive definitions and check for

termination E.g., monotonically increasing/decreasing cost

fields whose values are upper/lower boundedOrthogonal security issues: Denial-of-service attacks, compromised routers

Page 36: Declarative Routing:  Extensible Routing with Declarative Queries

Efficiency

Explore well-known database techniques Aggregate selections: avoid sending

unnecessary paths to neighbors Limit computation to portion of network

Few sources and destinations Magic sets + left-right recursion rewrite

Multi-query sharing: Identify “similar” queries, share their

computations Reuse previously computed paths

Page 37: Declarative Routing:  Extensible Routing with Declarative Queries

Queries under Churn

Long-running continuous queriesMaintain all intermediate derived tuples for query durationIncremental updates: Link failures are treated as link

updates with cost=infinity. Paths invalidated (cost=infinity), and

new paths are incrementally recomputed.

Page 38: Declarative Routing:  Extensible Routing with Declarative Queries

Evaluation Setup

PIER: Distributed relational query processor Each node runs the query engine of PIER Initialized neighbor table directly accessible by

PIER.

Simulation: Bandwidth and latency bottlenecks Transit-stub topologies

PlanetLab 72 PIER nodes Random, location-aware topologies Long-running queries

Page 39: Declarative Routing:  Extensible Routing with Declarative Queries

Summary of Results

Simulations: When all nodes issue the same query,

Scalability properties show similar trends as traditional DV/PV protocols

When few nodes issue the same query, Overhead is reduced using standard query

optimizations

PlanetLab experiments: Long-running all-pairs shortest RTT paths query Ability to handle link RTT changes Induced failures (up to 20% of nodes)

Recovery time: <1s (median), <3.6s (average)

Page 40: Declarative Routing:  Extensible Routing with Declarative Queries

ConclusionDeclarative routing:

Express routing protocols using a recursive query language

Better balance between routing extensibility and safety

Future work: Expressing policies as declarative rules Run-time query optimizations:

Cost-based decisions on query rewrites Multi-query sharing

Static checker for routing protocols Run-time monitoring of routing protocols

Declarative Networks Research agenda: Specify and construct networks

declaratively P2: “Implementing Declarative Overlays” (SOSP 2005)

Page 41: Declarative Routing:  Extensible Routing with Declarative Queries

Current Customizable Routing with Declarative Queries. (2004)Declarative Routing: Extensible Routing with Declarative Queries. (2005)Implementing Declarative Overlays. (2005)Declarative Networking: Language, Execution and Optimization. (2006)The Design and Implementation of Declarative Networks. (2006)Towards a Declarative Language and System for Secure Networking. (2007)A Declarative Perspective on Adaptive MANET Routing. (2008)MOSAIC: Unified Declarative Platform for Dynamic Overlay Composition. (2008)Declarative Network Verification. (2009)Declarative Reconfigurable Trust Management. (2009)Unified Declarative Platform for Secure Networked Information Systems. (2009)Declarative Toolkit for Rapid Network Protocol Simulation and Experimentation. (2009)A Theorem Proving Approach towards Declarative Networking. (2009)RapidMesh: Declarative Toolkit for Rapid Experimentation of Wireless Mesh Networks. (2009)Declarative Policy-based Adaptive MANET Routing. (2009)Declarative Networking. (2009)An Open-source and Declarative Approach Towards Teaching Large-scale Networked Systems Programming. (2011)NetTrails: A Declarative Platform for Provenance Maintenance and Querying in Distributed Systems. (2011)

Page 42: Declarative Routing:  Extensible Routing with Declarative Queries

Thank You