+ All Categories
Home > Documents > The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania,...

The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania,...

Date post: 01-Apr-2015
Category:
Upload: abril-cunningham
View: 212 times
Download: 0 times
Share this document with a friend
Popular Tags:
31
The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation was completed as a graduate student at the University of California- Berkeley
Transcript
Page 1: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

The Design and Implementation of Declarative Networks

Boon Thau LooUniversity of Pennsylvania, University of California-Berkeley*

*This dissertation was completed as a graduate student at the University of California- Berkeley

Page 2: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Declarative Networking

A declarative framework for networks: Network protocols are declaratively specified

using a database query language Distributed query engine executes

specifications to implement network protocols

Success of database research: 70’s – today: Database research has

revolutionized data management Today: Similar opportunity to revolutionize the

Internet architecture

Page 3: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Motivation

Internet faces many challenges today: Unwanted, harmful traffic Complexity/fragility in Internet routing Proliferation of new applications and

services

Efforts at improving the Internet: Evolutionary: App-level “Overlay” networks Revolutionary: Clean-slate designs

NSF GENI initiative, FIND programOpportunity: Software tools that can

significantly accelerate network innovation

Opportunity: Software tools that can significantly accelerate network

innovation

Page 4: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

A Declarative Network

Distributed recursive query

Traditional Networks Declarative NetworksNetwork State Distributed

databaseNetwork protocol Recursive Query Execution

Network messages Distributed Dataflow

DataflowDataflow

messages

Dataflow

Dataflow

Dataflow

Dataflow messagesmessages

Page 5: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

The Case for Declarative Networking

Ease of programming: Compact and high-level representation of protocols Orders of magnitude reduction in code size

Declarative Chord DHT is 48 lines instead of 10,000. Easy customization

Safety: Queries are “sandboxed” within query processor Potential for static analysis of safety

What about efficiency? No fundamental overhead when executing standard

routing protocols Application of well-studied query optimizations Note: Same question was asked of relational databases in

the 70’s.

Page 6: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Main Contributions of Dissertation

Declarative Routing [SIGCOMM ’05]: Extensible Routers: balance of flexibility,

efficiency and safety

Declarative Overlays [SOSP ’05]: Rapid prototyping of new overlay networks

Database Fundamentals [SIGMOD ‘06]: Network specific query language and semantics Distributed recursive query execution strategies Query optimizations, classical and new

Page 7: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

A Breadth of Use Cases

Example implementations to date: Textbook routing protocols Chord DHT Narada mesh for end-system multicast Distributed Gnutella/Web crawlers Pastry DHT Replication protocols Lamport/Chandy snapshots Paxos distributed consensus Overlays for host mobility Sensor network protocols

P2 declarative networking system http://p2.cs.berkeley.edu

Page 8: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Outline

BackgroundThe Connection: Routing as a Query Execution Model Path-Vector Protocol Example

Query specification protocol implementation

Query ProcessingBeyond routing: Declarative Overlays Ongoing work @ Penn

Page 9: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Traditional Router

Neighbor Table Forwarding TableRouting

Infrastructure

Packets

Packets

Traditional Router

Control PlaneForwarding Plane

Routing Protocol

Neighbor Table

updates

Forwarding Table

updates

Page 10: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Declarative RouterTraditional Router

Declarative Router

Neighbor Table Forwarding Table

Input Tables

Declarative Queries

Control PlaneForwarding Plane

Output Tables

Routing Infrastructure

Packets

Packets

Query EngineRouting Protocol

Neighbor Table

updates

Forwarding Table

updates

Page 11: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

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, 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: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

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

Page 13: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Towards Network Datalog

Specify tuple placement Value-based partitioning of tables

Tuples to be combined are co-located Rule rewrite ensures body is always single-site

All communication is among neighbors No multihop routing during basic rule

execution Link-restricted rules: Enforced via simple

syntactic restrictions

Page 14: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

All-Pairs Reachability

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

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

Network Datalog

Query: reachable(@M,N)

@S

D

@a

b

@a

c

@a

d

reachableOutput

table:

Input table:

Query: reachable(@a,N)

@S

D

@c b

@c d

link@

SD

@b

c

@b

a

link@

SD

@a

b

link @

SD

@d

c

link

b dca

@S

D

@b

a

@b

c

@b

d

reachable @

SD

@c a

@c b

@c d

reachable @

SD

@d

a

@d

b

@d

c

reachable

Location Specifier “@S”

Query: reachable(@a,N)

Page 15: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Path Vector in Network Datalog

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=SP2. path(@Z,D,P2),

Query: path(@S,D,P)

Add S to front of P2

Page 16: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

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

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

@S

D P @S

D P

@c d [c,d]

Query Execution

@S

D P @S

D P

Query: path(@a,d,P)

Neighbor table:

@S

D

@c b

@c d

link@S D

@b c

@b a

link@

SD

@a

b

link @S D

@d c

link

b dca

path path path

Forwarding table:

Page 17: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

@S

D P @S

D P @S

D P

@c d [c,d]

Query Execution

Forwarding table:

@S

D P

@b

d [b,c,d]

b dca

path(@b,d,[b,c,d])

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

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

Query: path(@a,d,P)

Neighbor table:

@S

D

@c b

@c d

link@S D

@b c

@b a

link@

SD

@a

b

link @S D

@d c

link

path path path@S

D P

@a

d [a,b,c,d]

path(@a,d,[a,b,c,d])

Communication patterns are identical to those in the actual path vector

protocol

Communication patterns are identical to those in the actual path vector

protocol

Matching variable Z = “Join”

Page 18: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Other Routing Examples

Best-Path RoutingDistance VectorDynamic Source Routing (Wireless)Policy DecisionsQoS-based RoutingLink-stateMulticast Overlays (Single-Source & CBT)

Page 19: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Outline

BackgroundThe Connection: Routing as a QueryQuery ProcessingBeyond routing: Declarative Overlays Sampling of ongoing work

Page 20: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Recursive Query Evaluation

Semi-naïve evaluation: Iterations (rounds) of synchronous computation Results from iteration ith used in (i+1)th

Path Table

87

3-hop

109

21

1-hop3

65 2-hop4

Link Table Network

510

021

3

4

6

8

7

Problem: Unpredictable delays and failures

9

Page 21: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Pipelined Semi-naïve (PSN)Fully-asynchronous evaluation:

Computed tuples in any iteration pipelined to next iteration

Natural for network protocols

Path Table

41

7

Link Table Network

25836910

510

021

3

4

6

8

79

Relaxation of semi-naïve

Relaxation of semi-naïve

Page 22: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Pipelined Evaluation

Challenges: Does PSN produce the correct answer? Is PSN bandwidth efficient?

I.e. does it make the minimum number of inferences?

Proofs for

Basic technique: local timestamps

p(x,z) :- p1(x,y), p2(y,z), …, pn(y,z), q(z,w)

recursive w.r.t. p

Page 23: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

lookup

lookup

Dem

ux

link

Local Tables

path ...

UD

P

Tx

Round

Robin

Queue

CC

T

x

Queue

UD

P

Rx

CC

R

x

Execution Plan Strands

Messages

Network In

Messages

Network Out

Single NodeNodes in execution plan (“operators”):

Network operators (send/recv, cc, retry, rate limitation) Relational operators (selects, projects, joins, aggregates) Flow operators (mux, demux, queues)

Page 24: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Localization RewriteRules may have body predicates at different locations:

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

R2b: path(@S,D,P) linkD(S,@Z), path(@Z,D,P2), P=SP2.

R2a: linkD(S,@D) link(@S,D)

Matching variable Z = “Join”

Rewritten rules:

Matching variable Z = “Join”

Page 25: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Localized Rule Compilation

Execution Plan

path Joinpath.Z = linkD.Z

linkD

Projectpath(S,D,P) Send to

path.S

R2b: path(@S,D,P) linkD(S,@Z), path(@Z,D,P2), P=SP2.

Netw

ork

In

Netw

ork

Ou

t

linkD

JoinlinkD.Z =

path.Z

path

Projectpath(S,D,P) Send to

path.S

Page 26: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Optimizations

Traditional: evaluate in the NW context Aggregate Selections Magic Sets rewrite Predicate Reordering

New: motivated by NW context Multi-query optimizations:

Query Results caching Opportunistic message sharing

Cost-based optimizations Neighborhood density function Hybrid rewrites

PV/DV (Wired) DSR (Wireless)

Hybridized protocols: Zone

Routing Protocol

Page 27: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Beyond Routing: Declarative Overlays

Language extensions to support events and soft-state predicatesChord Routing, including:

Multiple successors Stabilization Optimized finger

maintenance Failure detection

48 rules11 table definitionsMIT-Chord: x100 more codeAnother example:

Narada mesh in 22 rules 10 pt font

Page 28: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Outline

BackgroundThe Connection: Routing as a QueryQuery ProcessingBeyond routing: Declarative Overlays Ongoing work @ Penn

Page 29: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Ongoing Work @ PennDeclarative secure networking

Difficult to design/implement/reason about secure networks Network Datalog + logic-based security languages [NetDB ’07] Authenticated path vector protocol, DNSSEC, secure DHTs,… Moving forward:

Exploit fine-grained control over networks and security policies

Data-centric querying and routing in heterogeneous networks

Internet: Wired infrastructure with wireless clouds at the edges

Flexible network support for mobility [ACM MobiArch ’07] Declarative queries for addressing and naming mobile hosts Session-aware customizable QoS routing

Moving forward: Declarative wireless ad-hoc networks Cost-based query optimizations to adapt protocols

Page 30: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

SummaryDeclarative networking: Declarative Routing:

Extensible routing infrastructure Declarative Overlays

Rapid prototyping overlay networks Database fundamentals

Query language New distributed query execution strategies and

optimizations Semantics in dynamic networks

P2 declarative networking system (http://p2.cs.berkeley.edu)

Page 31: The Design and Implementation of Declarative Networks Boon Thau Loo University of Pennsylvania, University of California-Berkeley * *This dissertation.

Many Thanks…

Advisors: Joseph M. Hellerstein, Ion StoicaCollaborators:

UC Berkeley: Tyson Condie, Ryan Huebsch Intel Research: David Gay, Petros Maniatis, Timothy

Roscoe Yahoo! Research: Minos Garofalakis, Raghu

Ramakrishnan Rice University: Atul Singh Many others…


Recommended