Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in...

57
Università di Roma “La Sapienza” Dipartimento di Informatica e Sistemistica Middleware Laboratory MIDLAB Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome Sapienza University of Rome University of Cambridge- 5/5/2009

Transcript of Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in...

Page 1: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Università di Roma “La Sapienza”Dipartimento di Informatica e SistemisticaMiddleware LaboratoryMIDLAB

Distributed Event Routing in Routing in Publish/Subscribe SystemsRoberto Baldoni

Sapienza University of RomeSapienza University of Rome

University of Cambridge- 5/5/2009

Page 2: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■ The publish/subscribe communication paradigm:

■ Publishers: produce data in the form of events.

■ Subscribers: declare interests on published data with subscriptions.

■ Each subscription is a filter on the set of published events.

■ An Event Notification Service (ENS) notifies to each subscriber every published event that matches at least one of its subscriptions.

3published event that matches at least one of its subscriptions.

Bas

ic b

uild

ing

bloc

ks

3publish

notify

unsubscribe

subscribe

Mid

dlew

are

Labo

rato

ryB

asic

bui

ldin

g bl

ocks

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 3: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Publish/subscribe was thought as a comprehensive solution for thoseproblems:

■Many-to-many communication model - Interactions take place in anenvironment where various information producers and consumers cancommunicate, all at the same time. Each piece of information can bedelivered at the same time to various consumers. Each consumer receivesinformation from various producers.

2information from various producers.

■Space decoupling - Interacting parties do not need to know each other.Message addressing is based on their content.

■Time decoupling - Interacting parties do not need to be activelyparticipating in the interaction at the same time. Information delivery ismediated through a third party.

■Synchronization decoupling - Information flow from producers toconsumers is also mediated, thus synchronization among interacting partiesis not needed.

The

pub

/sub

inte

ract

ion

mod

el

2

Mid

dlew

are

Labo

rato

ry

is not needed.

■Push/Pull interactions - both methods are allowed.

■These characteristics make pub/sub perfectly suited for distributedapplications relying on document-centric communication.

The

pub

/sub

inte

ract

ion

mod

elM

iddl

ewar

e La

bora

tory

MID

LAB

Page 4: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Events represent information structured following an event schema. The event schema is fixed, defined a-priori, and known to all the participants.

■From an abstract point of view the event schema defines an n-dimensional event space (where n is the number of 4attributes).

■Subscribers express their interests in specific events issuing subscriptions. A subscription is, generally speaking, a constraint expressed on the event schema.

■The Event Notification Service will notify an event e to a subscriber x only if the values that define the event satisfy the constraint defined by one of the subscriptions s issued

Eve

nt s

chem

a an

d su

bscr

iptio

n m

odel

s

4

Mid

dlew

are

Labo

rato

ry

the constraint defined by one of the subscriptions s issued by x. In this case we say that e matches s.

■Subscriptions can take various forms, depending on the subscription language and model employed by each specific implementation.

.

Eve

nt s

chem

a an

d su

bscr

iptio

n m

odel

sM

iddl

ewar

e La

bora

tory

MID

LAB

Page 5: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Topic-based selection: data published in the system ismostly unstructured, but each event is “tagged” with theidentifier of a topic it is published in. Subscribers issuesubscriptions containing the topics they are interested in.

■A topic can be thus represented as a “virtual channel” 9■

connecting producers to consumers. For this reason theproblem of data distribution in topic-based publish/subscribesystems is considered quite close to group communications.

Eve

nt s

chem

a an

d su

bscr

iptio

n m

odel

s

9

Mid

dlew

are

Labo

rato

ryE

vent

sch

ema

and

subs

crip

tion

mod

els

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 6: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Content-based selection: all the data published in thesystem is mostly structured. Each subscription can beexpressed as a conjunction of constrains expressed onattributes. The Event Notification Service filters out uselessevents before notifying a subscriber. 1

1

Eve

nt s

chem

a an

d su

bscr

iptio

n m

odel

s

1event1:name= Acme cablesvalue=23$

e1 e1

Mid

dlew

are

Labo

rato

ryE

vent

sch

ema

and

subs

crip

tion

mod

els

e2

event2:name= Acme REvalue=18$

e1

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 7: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■The Event Notification Service is usually implemented as a:

■Centralized service: the ENS is implemented on a single server.

■Distributed service: the ENS is constituted by a set of nodes, event brokers, which cooperate to implement the service. 2

1■The latter is usually preferred for large settings where

scalability is a fundamental issue.

Gen

eral

arc

hite

ctur

e

2

Mid

dlew

are

Labo

rato

ryG

ener

al a

rchi

tect

ure

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 8: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

• Modern ENSs are implemented through a set of processes, called event brokers, forming an overlay network.

• Each client (publisher or subscriber) accesses the service through a broker that masks the system complexity. 3

13

Mid

dlew

are

Labo

rato

ry

• An event routing mechanism routes each event inside the ENS from the broker where it is published to the broker(s) where it must be notified.

Eve

nt r

outin

gMidd

lew

are

Labo

rato

ryM

IDLA

B

Page 9: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Event flooding: each event is broadcast from the publisher in thewhole system.

■The implementation is straightforward but very expensive.

■This solution has the highest message overhead with no memoryoverhead. 4

14

x>30

x=167

x<18 AND x>10

x=30 OR x>200

x=22

Mid

dlew

are

Labo

rato

ryE

vent

rou

ting

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40 Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 10: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Subscription flooding: each subscription is copied on every broker, in orderto build locally complete subscription tables. These tables are then used tolocally match events and directly notify interested subscribers. This approachsuffers from a large memory overhead, but event diffusion is optimal. It isimpractical in applications where subscriptions change frequently. 5

1x>30 IP x 5

x>30

x=167

x<18 AND x>10

x=22

x<>30 IP y

x<5 IP z

x>40 IP w

x>10 IP xyz

Mid

dlew

are

Labo

rato

ryE

vent

rou

ting

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 11: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

61Filter-based routing: subscriptions are partially diffused in the system

and used to build routing tables. These tables, are then exploited duringevent diffusion to dynamically build a multicast tree that (hopefully)connects the publisher to all, and only, the interested subscribers.

6x>30

x=167

x<18 AND x>10

x=30 OR x>200

x=22

Mid

dlew

are

Labo

rato

ryE

vent

rou

ting

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40 Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 12: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

61

ANY

a x>=30 OR (x<18 AND x>10)

5 ANY

1 -

b x>=30 OR (x<18 AND x>10)

3 ANY

Filter-based routing: subscriptions are partially diffused in the systemand used to build routing tables. These tables, are then exploited duringevent diffusion to dynamically build a multicast tree that (hopefully)connects the publisher to all, and only, the interested subscribers.

6x>30

x=167

x<18 AND x>10

x=30 OR x>200

x=22

3ANY 1 -

2 -

6 x>10

8 x<5

9 ANY

e ANY

5 x>10 OR x<5

d ANY

9 x>10 OR x<5

f -

Mid

dlew

are

Labo

rato

ryE

vent

rou

ting

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40

9 ANY

3 x>=30 OR (x<18 AND x>10)

7 x>10

5 ANY

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 13: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

61

ANY

a x>=30 OR (x<18 AND x>10)

5 ANY

1 -

b x>=30 OR (x<18 AND x>10)

3 ANY

Filter-based routing: subscriptions are partially diffused in the systemand used to build routing tables. These tables, are then exploited duringevent diffusion to dynamically build a multicast tree that (hopefully)connects the publisher to all, and only, the interested subscribers.

6x>30

x=167

x<18 AND x>10

x=30 OR x>200

x=22

3ANY 1 -

2 -

6 x>10

8 x<5

9 ANY

e ANY

5 x>10 OR x<5

d ANY

9 x>10 OR x<5

f -

Mid

dlew

are

Labo

rato

ryE

vent

rou

ting

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40

9 ANY

3 x>=30 OR (x<18 AND x>10)

7 x>10

5 ANY

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 14: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

61

ANY

a x>=30 OR (x<18 AND x>10)

5 ANY

1 -

b x>=30 OR (x<18 AND x>10)

3 ANY 6x>30

x=167

x<18 AND x>10

x=30 OR x>200

x=22

Mid

dlew

are

Labo

rato

ry

3ANY 1 -

2 -

6 x>10

8 x<5

9 ANY

e ANY

5 x>10 OR x<5

d ANY

9 x>10 OR x<5

f -

Eve

nt r

outin

g

x=30 OR x>200

x=30

x<>30

x<5

x>10

x>40 Mid

dlew

are

Labo

rato

ryM

IDLA

B

9 ANY

3 x>=30 OR (x<18 AND x>10)

7 x>10

5 ANY

Page 15: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Rendez-Vous routing: it is based on two functions, namely SN andEN, used to associate respectively subscriptions and events to brokersin the system.

■Given a subscription s, SN(s) returns a set of nodes which areresponsible for storing s and forwarding received events matching s toall those subscribers that subscribed it. 7

1■Given an event e, EN(e) returns a set of nodes which must receive e tomatch it against the subscriptions they store.

■Event routing is a two-phases process: first an event e is sent to allbrokers returned by EN(e), then those brokers match it against thesubscriptions they store and notify the corresponding subscribers.

■This approach works only if for each subscription s and event e, suchthat e matches s, the intersection between EN(e) and SN(s) is not empty

7

Mid

dlew

are

Labo

rato

ry

that e matches s, the intersection between EN(e) and SN(s) is not empty(mapping intersection rule).

Eve

nt r

outin

gMidd

lew

are

Labo

rato

ryM

IDLA

B

Page 16: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Rendez-Vous routing: example.

■Phase 1: two nodes issue the same subscription S.

818

Mid

dlew

are

Labo

rato

ry

■SN(S) = {4,a}

Eve

nt r

outin

gMidd

lew

are

Labo

rato

ryM

IDLA

B

Page 17: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Rendez-Vous routing: example.

■Phase 1I: an event e matching S is routed toward the rendez-vousnode where it is matched against S.

919

Mid

dlew

are

Labo

rato

ry

■EN(e) = {5,6,a}

■Broker a is the rendez-vous point between event e and subscription S.

Eve

nt r

outin

gMidd

lew

are

Labo

rato

ryM

IDLA

B

Page 18: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■A generic architecture of a publish/subscribe system:

020

Mid

dlew

are

Labo

rato

ryE

vent

rou

tingMi

ddle

war

e La

bora

tory

MID

LAB

From “Distributed Event Routing in Publish/Subscribe Communication Systems: a survey” R.Baldoni, L. Querzoni, S. Takoma, A. Virgillito midlab tech.rep. 2007, to appear (springer)

Page 19: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Which pub-sub for a given environment

Type of dynamics of subscriptions

Mid

dlew

are

Labo

rato

ry

Type of dynamics of nodes(churn)

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Type of dynamics of mobility

Page 20: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Which pub-sub for a given environment

Pub-sub with broker overlaymanaged environment

Type of dynamics of nodes (churn)

Mid

dlew

are

Labo

rato

ry

• managed environment• longlife peers• no churn

Pub-sub with structured overlay• unmanaged/managed environment• shortlife peers

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Pub-sub with unstructured overlay• unmanaged environment• shortlife peers• High churn

• low churn

Page 21: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Future scenarios for pub/sub: The CoMiFin Project

■ Global Financial Ecosystem

■ "webification" of critical financial services, such as home banking, online trading, remote payments;

■ Cross-domain interactions, spanning different organization

Mid

dlew

are

Labo

rato

ry

boundaries are in place in financial contexts;

■ Financial Vulnerabilities

■ A payment card fraud (2008)

■ Distributed Denial Of Service Attack (2007, Northern Europe)

■ Need of a global monitoring systems� Both previous attacks cannot be detected quickly through information

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Both previous attacks cannot be detected quickly through information

available at the IT infrastructure of a single financial player

� Need of a cooperative approach

� Exchange non-sensitive status information

� Set up of agreements

� Advantages of a global monitoring system: Damage mitigation, Quick

reaction

Page 22: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Future scenarios for pub/sub: The CoMiFin Project

� Early detection of attacks

� Millions of events per seconds to be diffused,

analyzed and correlated.

� The monitoring system has to include

Mid

dlew

are

Labo

rato

ry

� The monitoring system has to include

different actors including financial ones and

ISPs

� Post processing analysis

� Collection of huge mass of historical data

� Information sharing among the institutions

Mid

dlew

are

Labo

rato

ryM

IDLA

B

� Information sharing among the institutions

� Conclusion: impossible a centralized monitoring

solution both in space and time

Page 23: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

The Intelligence Cloud Vision

France Telecom

Dshields Shadowserver

InternetIntelligence

Cloud

LLYODS

Unicredit

Telecom

AT&T

SWIFT

EDF

SWIFT

eventswarnings

Page 24: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

The Intelligence Cloud Vision

DshieldsIntelligence

Cloud

Pro

piet

ary

Net

wor

ks

LLYODS

Unicredit

EDF

Shadowserver

Intelligence

Internet

Pro

piet

ary

Unicredit

France Telecom

AT&T

SWIFT

Page 25: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Future scenarios for pub/sub

SR4

SR5SR7

SR6

Mid

dlew

are

Labo

rato

ry

CoMiFin System

SR2 SR3SR1

CoMiFin Semantic Room

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 26: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Smart Houses (The SM4ALL Project):

Future scenarios for pub/sub

Brain-Computer

Interface

Traditional

InterfaceUser Layer

Mid

dlew

are

Labo

rato

ry

Services

(embedded on device)

Orchestration engine

(embedded on device)

Ad hoc communications

Composition

EngineComposite domotic

service specification

Goal(s) / desiderata

service(s) templates

User Profiler &

Context Managerdeployment

Interface

Composition Layer

Data Distribuition Bus

(P2P)

Repository

Local Repository

(embedded on device)

Mid

dlew

are

Labo

rato

ryM

IDLA

B

device/sensor/appliance

Middleware

(embedded on device)

Pervasive Layer

Page 27: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■ 12

■ 1

Mid

dlew

are

Labo

rato

ryS

IEN

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 28: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■R. Baldoni, R. Beraldi, V. Quema, L. Querzoni, S. Tucci Piergiovanni “TERA: Topic-based Event Routing for Peer-to-Peer Architectures” International Conferenceon Distributed Event-Based Systems (DEBS), 2007.

444

Mid

dlew

are

Labo

rato

ryS

CR

IBE

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 29: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■ Confine the diffusion of each event only in the set of matched subscribers without affecting the whole network (traffic confinement)

■Traffic confinement can be realized solving three problems: 55

■ Interest clusteringSubscribers sharing similar interests should be arranged in a same cluster; ideally, given an event, all and only the subscribers interested in that event should be grouped in a single cluster.

■Outer-cluster routingEvents can be published anywhere in the system. We need a mechanism able to bring each event from the node where it is

5

Mid

dlew

are

Labo

rato

ry

mechanism able to bring each event from the node where it is published, to at least one interested subscriber.

■ Inner-cluster diffusionOnce a subscriber receives an event it can simply broadcast it in the cluster it is part of.

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 30: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Scribe [Castro et al., IEEE Journal on Selected Areas in Communications n.8 v.20, 2002]

■Topic-based publish/subscribe implemented on top of DHTs.

■For each topic a single node is responsible to act as a rendez-vouspoint between published events and issued subscriptions.

65

and issued subscriptions.

■Problems: ■ hot spots;

■ partial traffic confinement.

6

Mid

dlew

are

Labo

rato

ryPublisherSubscriberPure forwarder

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Pure forwarderRendez-vous node

Inner-cluster diffusion

Page 31: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■ A two-layer infrastructure:■All clients are connected by a single overlay network at the lower layer

(general overlay).

■Various overlay network instances at the upper layer connect clients subscribed to same topics (topic overlays).

Mid

dlew

are

Labo

rato

ry

■ Event diffusion:■The event is routed in the

general overlay toward one of the nodes subscribed to the target topic.

■This node acts as an access point for the event that is then diffused in the correct topic overlay.

inner-cluster diffusion

Mid

dlew

are

Labo

rato

ryM

IDLA

B

in the correct topic overlay.

First Open Workshop Budapest 21-3-2007

Page 32: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Event routing in the general overlay is realized through a random walk.

■The walk stops at the first broker that knows an access point for the target topic. 1

6topic AP

1

Mid

dlew

are

Labo

rato

ry

topic AP

x B1

a B5

topic AP

t B1

y B6

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

topic AP

a B5

f B6topic AP

e B4

h B4

Page 33: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Each node maintains locally an Access Point Table (APT)

■Each entry in the APT is a couple <topic, node address>

■An entry <t,n> represents the fact that n is an access point for topic t.

topic AP

x B1

a B5 26

is an access point for topic t.

■The length of the APT is fixed.

■Goal:

■ each topic in the APT must be a uniform random sample among all the topics in the system;

■ the access point associated to a topic in an APT must be a uniform random sample among all the nodes subscribed to that topic.

2

Mid

dlew

are

Labo

rato

ry

random sample among all the nodes subscribed to that topic.

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 34: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Subscription advertisement:

■ each node periodically advertises its subscriptions to a set of nodes chosen uniformly at random among the population;

■ each advertisement is a set of couples<topic, popularity> 3

6■An advertisement <t,p> represents the fact that there are

(approximately) p nodes subscribed to topic t.

■APT update. When a node receives and advertisement <t,p> from node n:

■ if the APT contains an entry for <t,m> it simply puts m=n

3

Mid

dlew

are

Labo

rato

ry

■ otherwise it puts a new entry <t,n> in the APT with probability 1/p

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 35: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

464

Mid

dlew

are

Labo

rato

ry

■ OMPs: Newscast, Cyclon, etc.

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 36: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■We want every topic to appear with the same probability in every APT, regardless of its popularity.

565

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 37: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Experiments show how the system scales with respect to:■Number of subscriptions.

■Number of topics.

■Event publication rate.17

■Event publication rate.

■Number of nodes.

■ (reference figure is given by a simple event flooding approach)

1

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 38: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Experiments show how the system scales with respect to:■Number of subscriptions.

■Number of topics.

■Event publication rate.

Average notification cost

1,E+03

1,E+04pub diffusion

rnd walks

topic shuffle

subs advert.

cost incurred to maintain the

27

■Event publication rate.

■Number of nodes.

■ (reference figure is given by a simple event flooding approach)

1,E-03

1,E-02

1,E-01

1,E+00

1,E+01

1,E+02general shuffle

TOTAL

subscriptions: 10000

maintain the general overlay

2

Mid

dlew

are

Labo

rato

ry

1,E-04

1,E-03

1,E+01 1,E+03 1,E+05 1,E+07 1,E+09

Nodes

subscriptions: 10000

topics: 100

event rate: 1

cost incurred to diffuse events

inside topic overlays

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 39: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■“Mobile ad-hoc networks”

12

hoc networks”1

Mid

dlew

are

Labo

rato

ryS

IEN

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 40: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■R. Baldoni, R. Beraldi, G. Cugola, M. Migliavacca, L. Querzoni“Structure-less Content-Based Routing in Mobile Ad Hoc Networks”International Conference on Pervasive Services (ICPS), 2005.

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 41: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Environment:

■Mobile ad-hoc networks (MANETs).

■Mobile nodes that communicate through wireless links.

■No fixed communication infrastructure.

■Network topology is defined by node positioning and environment ■Network topology is defined by node positioning and environment physical characteristics.

■Network topology continuously modified by node movements.

■ Limited available resources both on nodes and in the network.

■Existing solutions:

■Mesh based + multicast [E. Yoneki and J. Bacon, Pervasive Computing and Communications Workshops, 2004]

Mid

dlew

are

Labo

rato

ry

Workshops, 2004]

■Spatial scoping [R. Meier and V. Cahill. International Workshop on Distributed Event-Based Systems,

2002] [H. Zhou and S. Singh, MobiHoc, 2000]

■Contribution: routing structures are difficult to maintain in a dynamic network. Exploit probabilistic event filtering.

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 42: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Potential Advantages of Pub/Sub for Mobile Wireless

■ Decoupling of publishers and subscribers aids ■ Decoupling of publishers and subscribers aids mobility

■ Decoupling of publishers and subscribers aids disconnected operation

Mid

dlew

are

Labo

rato

ry

■ Multicast delivery can exploit intrinsic broadcast properties of wireless

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 43: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mobile ad-hoc network: issues■Costantly changing topology

■Communication is less “reliable” than in wired systems due ■Communication is less “reliable” than in wired systems due to disconnections (driven by mobility or volountary)

■Effects on how to design a middleware for pub/sub (e.g., toimprove performance of the event dispatching system reducing the complexity of expressiveness)

Page 44: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Architectural Model for Mobile ad-hoc networks

Routing Pub/subPS-Routing

ApplicationApplication

ApplicationPub/sub

Mid

dlew

are

Labo

rato

ry

MAC MAC MAC

[Huang et al 2002,Baldoni et al 2005,Bahemi et al 2005]

[Mottola et al 2005][Anceaume et al 2002, Picco et al 2003]

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 45: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Topological Reconfiguration

Assumption: the underlying tree is keptconnected and loop-free by some routingalgorithm

Routing

Application

CB Pub/sub

algorithm

Target: rearrange route traversed by events in response to changes in the topology of the network of brokers

Separation of concerns between connectivity

Mid

dlew

are

Labo

rato

ry

MACSeparation of concerns between connectivitylayer and event dispatching layer

Retrofitting reliability (events lost duringreconfiguration) through gossip-basedalgorithms

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 46: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Integration Approach

Assumption: the underlying tree is keptconnected and loop-free by MAODV

MAC

PS-Routing

Application

connected and loop-free by MAODV

Target: maintaining a tree-shaped overlaynetwork on top of the dynamic topology of a MANET

Integration between connectivity layerand event dispatching layer

Mid

dlew

are

Labo

rato

ry

MAC and event dispatching layer

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 47: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Broadcast-Based approach

■Usage of multicast provided by the MAC

■routing structures are difficult to ■routing structures are difficult to maintain consistent in a dynamic network.

■ Exploit probabilistic event filteringPub/sub

MAC

Application

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 48: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Using deterministic structures for event filtering (like SIENA’s routing tables) requires huge overhead for their maintenance.

■Here a different strategy:■Here a different strategy:

■ Lack of any predefined logical structure as a support to event filtering.

■Event forwarding exploits the implicit local broadcast primitive provided by the wireless communication medium.

■Each broker decides autonomously if and when a received event must be forwarded.

Mid

dlew

are

Labo

rato

ry

■The decision is taken basing on its proximity to target subscribers.

■Proximity is estimated.

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 49: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Proximity to a subscriber is estimated leveraging time-distance correlation.

■Each broker periodically broadcasts in its communication range a beacon.

■The beacon contains a summary of the subscriptions the broker stores.stores.

■Each time a broker receives a beacon it updates a proximity tableadding:■ The identifier of the broker that sent the beacon.

■ The subscriptions summary.

■A time reference that is set to 0.

■The time references is periodically increased if a beacon from the

Mid

dlew

are

Labo

rato

ry

■The time references is periodically increased if a beacon from the same broker is not received.

■When a time reference becomes greater than a predefined value T the corresponding entry is removed from the proximity table.

■Proximity to a broker Bi is defined as the ratio between the time reference recorded in the proximity table and T. (If there is no entry for Bi then the proximity value is 1) T

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 50: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

■Event routing is realized through a store, delay and cancel-or-forward approach:

■A destination list containing target subscribers is attached to each event (initially empty). A proximity value is associated to each target.

■Each time a broker receives an event:■ It checks if the event matches locally stored subscriptions,.

■ If its proximity table contains an entry for a broker listed in the destination list, with a lower value for proximity, it schedules the event for forwarding.

■ The event is forwarded with a delay that is proportional to the proximity value.

Mid

dlew

are

Labo

rato

ry

proximity value.

■ If it receives the event again with a lower value for proximity, it de-schedules the forwarding.

■A credit-based mechanism allows a limited number of event forwarding also if forwarding conditions are not met.

TE

RA

Mid

dlew

are

Labo

rato

ryM

IDLA

B

Page 51: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 52: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 53: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 54: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 55: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 56: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB

Page 57: Distributed Event Routing in Publish/Subscribe Systems€¦ · Distributed Event Routing in Publish/Subscribe Systems Roberto Baldoni Sapienza University of Rome University of Cambridge-

Mid

dlew

are

Labo

rato

ryT

ER

AM

iddl

ewar

e La

bora

tory

MID

LAB