Declarative Routing: Extensible Routing with Declarative Queries - - PowerPoint PPT Presentation

declarative routing
SMART_READER_LITE
LIVE PREVIEW

Declarative Routing: Extensible Routing with Declarative Queries - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Motivation

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

Advantages

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

slide-6
SLIDE 6

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

  • f applications
slide-7
SLIDE 7

Roadmap

Execution Model Introduction to Datalog Path-Vector Protocol Example Advantages:

Expressiveness Safety Efficiency

Evaluation

slide-8
SLIDE 8

Centralized Execution Model

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

slide-9
SLIDE 9

Routing Infrastructure Node Routing Infrastructure

Distributed Execution Model

Neighbor Table Forwarding Table

Declarative Routing

Result Tuples Derived Tuples

Traditional Routers

Input Tables Output Tables

Datalog Queries Query Processor

Routing Protocol

Neighbor Table updates Forwarding Table updates

slide-10
SLIDE 10

Introduction to Datalog

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

Datalog rule syntax:

slide-11
SLIDE 11

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”

slide-12
SLIDE 12

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).”

slide-13
SLIDE 13

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 d c a

b a D S

reachable Output table (Round 1):

c b D S

reachable

d c D S

reachable Input table:

d c D S

link

c b D S

link

b a D S

link

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

All-Pairs

slide-14
SLIDE 14

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 d c a

c a b a D S

reachable Output table (Round 2):

d b c b D S

reachable

d c D S

reachable Input table:

d c D S

link

c b D S

link

b a D S

link

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

slide-15
SLIDE 15

R2: reachable(S,D) ← link(S,Z), reachable(Z,D) R1: reachable(S,D) ← link(S,D) Query: reachable(M,N)

b d c a

d a c a b a D S

reachable Output table (Round 3):

d b c b D S

reachable

d c D S

reachable Input table:

d c D S

link

c b D S

link

b a D S

link

All-Pairs Reachability

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

slide-16
SLIDE 16

Roadmap

Execution Model Introduction to Datalog Path-Vector Protocol Example

Distributed Datalog Execution Plan Protocol

Advantages:

Expressiveness Safety Efficiency

Evaluation

slide-17
SLIDE 17

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

Distributed Datalog

Query: reachable(M,N)

b d c a

d a c a b a D S

reachable Output table:

d b c b D S

reachable

d c D S

reachable Input table:

d c D S

link

c b D S

link

b a D S

link

slide-18
SLIDE 18

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)

slide-19
SLIDE 19

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.S

R2

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 } }

slide-20
SLIDE 20

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 d c a

(a,b) P b a D S (b,c) P c b D S (c,d) P d c D S

Forwarding table:

Query Execution

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

link.S=path.S

R2 R1

P D S P D S P D S

path path path Neighbor table:

d c b D c S

link

a b c D b S

link

b D a S

link

c D d S

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

slide-21
SLIDE 21

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.

(a,b) P b a D S (b,c) P c b D S

path path path

(c,d) P d c D S

Query Execution

Forwarding table:

(a,b,c) c a (a,b) P b a D S (b,c,d) d b (b,c) P c b D S

b d c a

p(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:

d c b D c S

link

a b c D b S

link

b D a S

link

c D d S

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

slide-22
SLIDE 22

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 d c a

path path path

(c,d) P d c D S

Query Execution

Forwarding table:

p(a,d,[a,b,c,d]) (a,b,c) c a (a,b) P b a D S (b,c,d) d b (b,c) P c b D S (a,b,c,d) d a (a,b,c) c a (a,b) P b a D S link(S,D) path(S,D,P) path.S

link.S=path.S

R2 R1

Neighbor table:

d c b D c S

link

a b c D b S

link

b D a S

link

c D d S

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

slide-23
SLIDE 23

Roadmap

Execution Model Introduction to Datalog Path-Vector Protocol Example

Distributed Datalog Execution Plan Protocol

Advantages:

Expressiveness Safety Efficiency

Evaluation

slide-24
SLIDE 24

Expressiveness

Best-Path Routing Distance Vector Dynamic Source Routing Policy Decisions QoS-based Routing Link-state Multicast Overlays (Single-Source & CBT)

Minor variants give many options!

slide-25
SLIDE 25

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). P P P2 P=S+P2. P

slide-26
SLIDE 26

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:

slide-27
SLIDE 27

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

slide-28
SLIDE 28

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). P P P2 P=S+P2. P

slide-29
SLIDE 29

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

D Z 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) Z nextHop

Count to Infinity problem?

slide-30
SLIDE 30

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

slide-31
SLIDE 31

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

slide-32
SLIDE 32

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

slide-33
SLIDE 33

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),

slide-34
SLIDE 34

Expressiveness

Best-Path routing Distance Vector Dynamic Source Routing Policy-based routing QoS-based routing Link-state Multicast Overlays (Single-Source & CBT)

slide-35
SLIDE 35

Safety

Queries 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 bounded

Orthogonal security issues:

Denial-of-service attacks, compromised routers

slide-36
SLIDE 36

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

slide-37
SLIDE 37

Queries under Churn

Long-running continuous queries Maintain all intermediate derived tuples for query duration Incremental updates:

Link failures are treated as link updates

with cost=infinity.

Paths invalidated (cost=infinity), and new

paths are incrementally recomputed.

slide-38
SLIDE 38

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

slide-39
SLIDE 39

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)

slide-40
SLIDE 40

Conclusion

Declarative 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)

slide-41
SLIDE 41

Thank You