The PublishSubscribe Communication Paradigm and its Application

Document Sample
The PublishSubscribe Communication Paradigm and its Application Powered By Docstoc
					                                                     Università di Roma “La Sapienza”
                                                     Dipartimento di Informatica e Sistemistica




The Publish/Subscribe
Communication Paradigm and its
Application to Mobile Systems


    Roberto Baldoni
    Dipartimento di Informatica e Sistemistica
    Università degli Studi di Roma “La Sapienza”



                       MINEMA Summer School -                                                 1
                   Klagenfurt (Austria) July 11-15, 2005
                                                   Università di Roma “La Sapienza”
                                                   Dipartimento di Informatica e Sistemistica




  Outline

• Introduction

• Basics of pub/sub communication systems
  – Subscription models
  – Architectural models
• Event Routing

• Impact of mobility
                     MINEMA Summer School -                                                 2
                 Klagenfurt (Austria) July 11-15, 2005
                                                       Università di Roma “La Sapienza”
                                                       Dipartimento di Informatica e Sistemistica




Introduction: The Publish/Subscribe
Communication Style


  Publisher       Publish/Subscribe Middleware                                  Subscriber




                 Subscribers register subscriptions
               Publishers publish notifications with
                   Middleware determines which
               Middleware delivers notifications to
                characterizing information interests
                      interesting subscribers
              subscriptions matchinformation
                       matching which notifications




                         MINEMA Summer School -                                                 3
                     Klagenfurt (Austria) July 11-15, 2005
                                                        Università di Roma “La Sapienza”
                                                        Dipartimento di Informatica e Sistemistica




    Inroduction The Publish/Subscribe
    Paradigm
• Publish/Subscribe (pub/sub): a powerful abstraction
  for building distributed applications
   – Message-based, anonymous communication
   – Participants are decoupled
      • in space: no need to be connected or even know each other
      • in flow: no need to be synchronized
      • in time: no need to be up at the same time
• Good solution for highly dynamic, decentralized
  systems (e.g., wired environments with huge
  numbers of publishers and subscribers, MANETs,
  P2P etc)
• Many research issues, involving several research
  areas (e.g., systems, software eng., databases etc)
                          MINEMA Summer School -                                                 4
                      Klagenfurt (Austria) July 11-15, 2005
                                                        Università di Roma “La Sapienza”
                                                        Dipartimento di Informatica e Sistemistica




   Introduction
• Widely popular both in the industry and in the
  research
• Industry solutions for pub/sub are almost centralized
• Research has mainy to face the scalability aspect
• Applications
   –   Stock information delivery
   –   Auction system
   –   Air traffic control
   –   .etc…
• Many names for pub/sub systems: notification
  service, data distribution service

                          MINEMA Summer School -                                                 5
                      Klagenfurt (Austria) July 11-15, 2005
                                                              Università di Roma “La Sapienza”
                                                              Dipartimento di Informatica e Sistemistica




        Basic Interaction Model
                                                                                            subscribers
publishers
                              notification service                                           “IBM”
               IBM: -3,75                                            IBM: -3,75
                                                                                        S1
                                                                IBM: 12,51

                                   S1: IBM                                                     “ACME”
             ACME: +0,15           S2: ACME                         ACME: +0,15            S2
                                   S3: ACME
                                                                                               “ACME”

              IBM: +2,51
                                                                    ACME: +0,15           S3

                                                                                                 subscription
             event                                                            notification


                                MINEMA Summer School -                                                 6
                            Klagenfurt (Austria) July 11-15, 2005
                                                      Università di Roma “La Sapienza”
                                                      Dipartimento di Informatica e Sistemistica




Distributed Notification Service
                                                                          broker

                      notification service                                           “IBM”
   IBM: -3,75                                                IBM: -3,75
                                      S1: IBM                                   S1
                                                        IBM: 12,51

                                                                                       “ACME”
 ACME: +0,15                                                ACME: +0,15            S2
                                       S2: ACME


                                      S3: ACME                                         “ACME”

  IBM: +2,51
                                                            ACME: +0,15            S3

           Matching
               Determining the recipients for an event

           Routing
               Delivering a notification to all the recipients
                        MINEMA Summer School -                                                 7
                    Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




    Research Topics
•   System architecture
•   Efficient routing algorithm
•   Reliable messaging sending (the QoS issue)
•   Security
•   Special application issues
    –   Millions of users
    –   Mobile environment
    –   P2P
    –   Sensors networks…….


                      MINEMA Summer School -                                                 8
                  Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




    Pub/Sub Systems

•   IBM – Gryphon
•   Stanford – SIFT and more…
•   CU-Boulder – Siena
•   France – Le Subscribe
•   Technische University Darmstadt – REBECA
•   Microsoft – Herald
•   MIT
•   Others – XMLBlaster, Elvin4, TIB, Keryx, REBECA



                      MINEMA Summer School -                                                 9
                  Klagenfurt (Austria) July 11-15, 2005
                                                                            Università di Roma “La Sapienza”
                                                                            Dipartimento di Informatica e Sistemistica




           Subscription Models
                                  notification service                                       “IBM”   & v<0
               IBM: -3,75                                              IBM: -3,75
                                                                                         S1
                                                                     IBM: +2,51


                                         S1: IBM
                                             IBM,v<0                                            “ACME”
            ACME: +0,15                  S2: ACME                     ACME: +0,15          S2
                                         S3: ACME
                                                                                               “ACME”

              IBM: +2,51
                                                                      ACME: +0,15          S3



Topic-Based [Oki et al. 93]:                                     Content-Based [Carzaniga et al
- events are divided in topics                                   2001]:
- subscribers subscribe for a single                             - subscriptions are generic queries
topic                                                            SQL-like on the event schema

Type-Based [Eugster 2001]:
- notifications are objects
- type is the discriminating attribute
                                             MINEMA Summer School -                                                 10
                                         Klagenfurt (Austria) July 11-15, 2005
                                                  Università di Roma “La Sapienza”
                                                  Dipartimento di Informatica e Sistemistica




  Pub/Sub Variants: Topic-based

• Event space is divided in topics,
  corresponding to logical channels
• Participants subscribe for a topic and publish
  on a topic
• Receivers for an event are known a priori
• Channel = Group
  – Therefore often exploit network-level multicast
  – Group communication


                    MINEMA Summer School -                                                11
                Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




Content Based pub-sub: event schema
• Subscriptions and events defined over an
  n-dimensional event space (E.g. StockName =                        “ACME” and
  change < -3)


   – Subscription: conjunction of constraints

          a2                        subscription
                   event


                                                                Content-based
                                                               subscriptions can
                                                                 include range
                                                                   constraints




                                                                                      a1
                      MINEMA Summer School -                                                12
                  Klagenfurt (Austria) July 11-15, 2005
                                                          Università di Roma “La Sapienza”
                                                          Dipartimento di Informatica e Sistemistica




    Pub/Sub Variants: Content-based
• Receivers are calculated for each event being
  published
• Exploiting multicast is not straighforward
   – How are subscribers assigned to groups?




                                                                  “ACME”




    ACME, change = -2                                                “ACME”, change < -3


                            MINEMA Summer School -                                                13
                        Klagenfurt (Austria) July 11-15, 2005
                                                   Università di Roma “La Sapienza”
                                                   Dipartimento di Informatica e Sistemistica




  Topic vs. Content
• Topic-based pub/sub
  – Recipients are known a-priori
  – Many efficient implementations exist: e.g. tib
  – Limited expressiveness
• Content-based pub/sub
  –   Cannot determine recipients before publication
  –   More flexible
  –   More general
  –   Much more difficult to implement efficiently


                     MINEMA Summer School -                                                14
                 Klagenfurt (Austria) July 11-15, 2005
                                           Università di Roma “La Sapienza”
                                           Dipartimento di Informatica e Sistemistica




Architectural Model of a pub/sub


                                        •Network Multicasting

                                        •Broker layer overlay

                                        •Structured Overlay




             MINEMA Summer School -                                                15
         Klagenfurt (Austria) July 11-15, 2005
                                                   Università di Roma “La Sapienza”
                                                   Dipartimento di Informatica e Sistemistica




  Architectural Model of a pub/sub
• Network Multicasting
  – Use of multicast networking facilities (also at data link
    level)
• Broker layer overlay
  – Based on transport level connections between nodes
  – Hierarchical (Decision tree from publisher to
    subscribers)
  – Undirected Acyclic graph spanning all brokers
• Structured Overlay
  – DHT (abstracting from physical nodes)

                     MINEMA Summer School -                                                16
                 Klagenfurt (Austria) July 11-15, 2005
                                                  Università di Roma “La Sapienza”
                                                  Dipartimento di Informatica e Sistemistica




  EVENT vs SUBSCRIPTION ROUTING
• Extreme solutions
• Sol 1 (event flooding)
  – flooding of events in the notification event box
  – each subscription stored only in one place within
    the notification event box
  – Matching operations equal to the number of
    brokers
• Sol 2 (subscription flooding)
  – each subscription stored at any place within the
    notification event box
  – each event matched directly at the broker where
    the event enters the notification event box
                    MINEMA Summer School -                                                17
                Klagenfurt (Austria) July 11-15, 2005
                                                               Università di Roma “La Sapienza”
                                                               Dipartimento di Informatica e Sistemistica



 Identification of intermediate routing solutions



    Connectivity




subscribers        brokers                                                                     publishers


Handling subscriptions           MINEMA Summer School -                                                18
                             Klagenfurt (Austria) July 11-15, 2005
                                                                 Università di Roma “La Sapienza”
                                                                 Dipartimento di Informatica e Sistemistica



   Identification of intermediate routing solutions
Handling subscriptions: “subscription partitioning” i.e., “where to store s”
                                    Subscription Partitioning (s)



      Connectivity


          s




  subscribers        brokers                                                                     publishers


                                   MINEMA Summer School -                                                19
                               Klagenfurt (Austria) July 11-15, 2005
                                                                       Università di Roma “La Sapienza”
                                                                       Dipartimento di Informatica e Sistemistica



   Identification of intermediate routing solutions
Handling subscriptions: “subscription routing” i.e., “how to bring s there”
                                          Subscription Partitioning (s)
              Subscription Routing

      Connectivity


          s




  subscribers           brokers                                                                        publishers


                                         MINEMA Summer School -                                                20
                                     Klagenfurt (Austria) July 11-15, 2005
                                                                        Università di Roma “La Sapienza”
                                                                        Dipartimento di Informatica e Sistemistica



  Identification of intermediate routing solutions
Handling events
                                           Subscription Partitioning (s)
               Subscription Routing

      Connectivity




                                                                                                              e




 subscribers             brokers                                                                        publishers


                                          MINEMA Summer School -                                                21
                                      Klagenfurt (Austria) July 11-15, 2005
                                                                       Università di Roma “La Sapienza”
                                                                       Dipartimento di Informatica e Sistemistica



 Identification of intermediate routing solutions
Handling events: “Event Partitioning” i.e., “where to match e”
                                          Subscription Partitioning (s)
              Subscription Routing

     Connectivity




                                                                                                             e




subscribers             brokers           Event Partitioning (e)                                       publishers


                                         MINEMA Summer School -                                                22
                                     Klagenfurt (Austria) July 11-15, 2005
                                                                       Università di Roma “La Sapienza”
                                                                       Dipartimento di Informatica e Sistemistica



 Identification of intermediate routing solutions
Handling events: “Event Routing” i.e., “How to bring e there”
                                          Subscription Partitioning (s)
              Subscription Routing

     Connectivity




                                                                                                             e



                                                                       Event Routing
subscribers             brokers           Event Partitioning (e)                                       publishers


                                         MINEMA Summer School -                                                23
                                     Klagenfurt (Austria) July 11-15, 2005
                                                                         Università di Roma “La Sapienza”
                                                                         Dipartimento di Informatica e Sistemistica



   Identification of intermediate routing solutions
Handling events: “Event Matching” i.e., “define the set of recipients of e”
                                            Subscription Partitioning (s)
                Subscription Routing
                                                                               Matching (e)
       Connectivity




                                                                                                               e



                                                                         Event Routing
  subscribers             brokers           Event Partitioning (e)                                       publishers


                                           MINEMA Summer School -                                                24
                                       Klagenfurt (Austria) July 11-15, 2005
                                                                       Università di Roma “La Sapienza”
                                                                       Dipartimento di Informatica e Sistemistica



 Identification of intermediate routing solutions
Handling events: “Notification Routing” i.e., “bring e to the destinations”
                                          Subscription Partitioning (s)
              Subscription Routing
                                                                             Matching (e)
     Connectivity




                                                                                                             e

              Notification routing


                                                                       Event Routing
subscribers             brokers           Event Partitioning (e)                                       publishers


                                         MINEMA Summer School -                                                25
                                     Klagenfurt (Austria) July 11-15, 2005
                                                              Università di Roma “La Sapienza”
                                                              Dipartimento di Informatica e Sistemistica



Identification of intermediate routing solutions

                                 Subscription Partitioning
     Subscription Routing
                                                                    Matching




     Notification routing


                                                              Event Routing
                                 Event Partitioning (e)


                                MINEMA Summer School -                                                26
                            Klagenfurt (Austria) July 11-15, 2005
                                                  Università di Roma “La Sapienza”
                                                  Dipartimento di Informatica e Sistemistica




Basic Techniques for intermediate
routing solutions
• Filtering-based Routing [Carzaniga et al.
  2001]
  – Undirected Acyclic graph spanning all the brokers


• Rendez-Vous Routing
  – [Wang et al. 2002] based on dynamic partitioning
    of the event space among a set of brokers
  – [Castro et al 2002] based on DHT


                    MINEMA Summer School -                                                27
                Klagenfurt (Austria) July 11-15, 2005
                                                   Università di Roma “La Sapienza”
                                                   Dipartimento di Informatica e Sistemistica




    Filtering based routing
• Identifying as soon as possible events that are
  not interesting for any subscriber and arrest their
  diffusion
• Creating “diffusion paths” that lead to
  subscribers for the event
• Construction of a diffusion path requires routing
  info to be maintained at brokers
• Routing information consists of a set of filters
  (aggregate of subscriptions) that are reachable
  through that broker
                     MINEMA Summer School -                                                28
                 Klagenfurt (Austria) July 11-15, 2005
                                                      Università di Roma “La Sapienza”
                                                      Dipartimento di Informatica e Sistemistica




Filtering based routing: Three main phases
   • Subscription forwarding: subscriptions (filters)
     are propagated to every broker leaving state
     along the path
   • Matching notification follow (backwards) the
     path set by subscriptions
   • Reducing subscription propagation
      – Avoiding subscription propagation when a filter
        including the subscription has been already
        forwarded



                        MINEMA Summer School -                                                29
                    Klagenfurt (Austria) July 11-15, 2005
                                                                    Università di Roma “La Sapienza”
                                                                    Dipartimento di Informatica e Sistemistica




           SIENA Filtering-Based Routing
           Subscription Forwarding
s1: price > 600                                             s1:1

a                         s1:a                          2
                      1

                                                                                                    s1:2
                             s1:2
                                                                                               3
                                      5
    s1:1
           4                                          s1:3      6


                                                                                s1:3       7

                      8
               s1:5
                                                        s1:6       9
                                     MINEMA Summer School -                                                 30
                                 Klagenfurt (Austria) July 11-15, 2005
                                                                       Università di Roma “La Sapienza”
                                                                       Dipartimento di Informatica e Sistemistica




             SIENA Filtering-Based Routing
             Subscription Merging
 s1 covers s2                                                  s1:1
                                               splitter        s1:1
                                                               s2:5                s1 covers s2
                             s1:a
 a                           s1:a                          2
            splitter     1   s2:2


                                s1:2                                                                   s1:2
                                s1:2
                                s2:8                                                              3
                                         5
     s1:1
              4                                          s1:3      6


s2: price > 700                                                                    s1:3       7

                  s1:5   8
 b                s1:5
                  s2:b                                                9
                                                           s1:6
                                        MINEMA Summer School -                                                 31
                                    Klagenfurt (Austria) July 11-15, 2005
                                                                    Università di Roma “La Sapienza”
                                                                    Dipartimento di Informatica e Sistemistica




           SIENA Filtering-Based Routing
           Notification Delivery
                                                            s1:1
                                                            s2:5
                                                                                   n1 matches s1
                          s1:a                                                     n1 matches s2
a                                                       2
                      1   s2:2


                             s1:2                                                                   s1:2
                             s2:8                                                              3
                                      5
    s1:1
           4                                          s1:3      6


                                                                                s1:3       7

               s1:5   8                                       n1:
b              s2:b                                s1:6 9 price = 899
                                     MINEMA Summer School -                                                 32
                                 Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




   Filtering based routing

• Tradeoff between subscription redundancy
  and subscription flooding
• The more the brokers aware of any
  subscription the earlier notifications that do
  not match any subscription are filtered out
• Tradeoff between expressiveness of
  subscription language and scalability
   – Expressiveness complexity brings to flood filters
   – Limited complexity better scalability

                      MINEMA Summer School -                                                33
                  Klagenfurt (Austria) July 11-15, 2005
                                                          Università di Roma “La Sapienza”
                                                          Dipartimento di Informatica e Sistemistica




      Rendez Vous Routing
• Each event of the event space is owned by one or more
  (reliability reasons) brokers
• Three functions:
   – SN(): 2N                                            (rendez-vous nodes of )
   – EN(e): 2N                                            (rendez-vous nodes of e)
   – If e  SN() then SN()  EN(e)                      (intersection rule)
• Main characteristics:
   – Controlled subscriptions distribution
   – Controlled matching
   – Better load balance



                            MINEMA Summer School -                                                34
                        Klagenfurt (Austria) July 11-15, 2005
                                                             Università di Roma “La Sapienza”
                                                             Dipartimento di Informatica e Sistemistica




    Rendezvous-based routing

• Each node is responsible for a partition of the event space
    – Storing subscriptions, matching events



                                                                   σ    σ
              σ
                      e                                            σ    σ




                                                                        σ                   e


Problem: difficult to define mapping functions when the set of
                   nodes changes over time School -
                               MINEMA Summer                                                         35
                           Klagenfurt (Austria) July 11-15, 2005
                                                 Università di Roma “La Sapienza”
                                                 Dipartimento di Informatica e Sistemistica



Rendez-Vous routing based on DHT
•    A matching publisher & subscriber must come up
     with the same hash keys based on the content

                    Distributed Hash Table
    buckets




              distributed publish/subscribe system



                   MINEMA Summer School -                                                36
               Klagenfurt (Austria) July 11-15, 2005
                                                       Università di Roma “La Sapienza”
                                                       Dipartimento di Informatica e Sistemistica




Rendez-Vous routing based on DHT
•    A matching publisher & subscriber must come up
     with the same hash keys based on the content

                          Distributed Hash Table
    buckets


                         home node




       subscriber

      subscription

                         MINEMA Summer School -                                                37
                     Klagenfurt (Austria) July 11-15, 2005
                                                           Università di Roma “La Sapienza”
                                                           Dipartimento di Informatica e Sistemistica


Rendez-Vous routing based on DHT

•    A matching publisher & subscriber must come up
     with the same hash keys based on the content

                              Distributed Hash Table
    buckets


                             home node
                    subscription



       subscriber                                      publisher

                                                        publication

                             MINEMA Summer School -                                                38
                         Klagenfurt (Austria) July 11-15, 2005
                                                           Università di Roma “La Sapienza”
                                                           Dipartimento di Informatica e Sistemistica




Rendez-Vous routing based on DHT
•    A matching publisher & subscriber must come up
     with the same hash keys based on the content

                              Distributed Hash Table
    buckets


                             home node
                    subscription        publication



       subscriber                                      publisher



                             MINEMA Summer School -                                                39
                         Klagenfurt (Austria) July 11-15, 2005
                                                           Università di Roma “La Sapienza”
                                                           Dipartimento di Informatica e Sistemistica




Rendez-Vous routing based on DHT
•    A matching publisher & subscriber must come up
     with the same hash keys based on the content

                              Distributed Hash Table
    buckets


                             home node
                    subscription



       subscriber                                      publisher
                        publication


                             MINEMA Summer School -                                                40
                         Klagenfurt (Austria) July 11-15, 2005
                                                           Università di Roma “La Sapienza”
                                                           Dipartimento di Informatica e Sistemistica




Rendez-Vous routing [Baldoni et al 2005]
                    Application                                                Event space is
                                                                                mapped into
                                                                               the universe of
    sub()    unsub()    pub()      notify()                                      keys (fixed)



        Subs                    ak-mapping
                                                                       Stateless mapping:
    CB-pub/sub                                                     -Does not depend on
                                                                   execution history
                                                                   (subscriptions, node joins
    send() delivery()    join()      leave()
                                                                   and leaves)



                                kn-mapping                                         Overlay
                                                                                  maintains
    DHT                                                                         consistency of
                                                                                 KN mapping
                             MINEMA Summer School -                                                41
                         Klagenfurt (Austria) July 11-15, 2005
                                                        Università di Roma “La Sapienza”
                                                        Dipartimento di Informatica e Sistemistica




     Rendez Vous Routing
• Problem:
  – bottleneck at hash bucket nodes
     • Structuring subscribers as a multicast diffusion tree
  – Restrictions on the subscription language:
     • Mapping between multidimensional multi-typed subscriptions to
       the uni or bi-dimensional space of a structured overlay is not
       straightforward (e.g., string manipulation)


• Strong points:
  – Handle inherently dynamic changes in the overlay


                          MINEMA Summer School -                                                42
                      Klagenfurt (Austria) July 11-15, 2005
                                                  Università di Roma “La Sapienza”
                                                  Dipartimento di Informatica e Sistemistica




  Summary of routing

• Filtering based routing:
  – Order of hundreds of brokers
  – Managed environment
• Rendez-vous routing based on DHT
  – Order of thousands of nodes
  – Unmanaged environment




                    MINEMA Summer School -                                                43
                Klagenfurt (Austria) July 11-15, 2005
                                          Università di Roma “La Sapienza”
                                          Dipartimento di Informatica e Sistemistica




A few pub/sub systems




            MINEMA Summer School -                                                44
        Klagenfurt (Austria) July 11-15, 2005
                                                 Università di Roma “La Sapienza”
                                                 Dipartimento di Informatica e Sistemistica




  Pub/Sub Sysems: Tib/RV [Oki et al
  03]
• Topic Based
• Two level hierarchical architecture of brokers
  (deamons) on TCP/IP
• Event routing is realized through one diffusion
  tree per subject
• Each broker knows the entire network
  topology and current subscription
  configuration

                   MINEMA Summer School -                                                45
               Klagenfurt (Austria) July 11-15, 2005
                                                Università di Roma “La Sapienza”
                                                Dipartimento di Informatica e Sistemistica




  Pub/Sub systems: Gryphon [IBM 00]

• Content based
• Hierarchical tree from publishers to
  subscribers
• Filtering-based routing
• Mapping content-based to network level
  multicast



                  MINEMA Summer School -                                                46
              Klagenfurt (Austria) July 11-15, 2005
                                                     Università di Roma “La Sapienza”
                                                     Dipartimento di Informatica e Sistemistica




Pub/Sub Systems: SCRIBE [Castro et al.
02]
  •   Topic Based
  •   Based on DHT (Pastry)
  •   Rendez-vous event routing
  •   A random identifier is assigned to each topic
  •   The pastry node with the identifier closest to
      the one of the topic becomes responsible for
      that topic


                       MINEMA Summer School -                                                47
                   Klagenfurt (Austria) July 11-15, 2005
                                                Università di Roma “La Sapienza”
                                                Dipartimento di Informatica e Sistemistica




  MEGHDOOT

• Content Based
• Based on Structured Overlay CAN
• Mapping the subscription language and the
  event space to CAN space
• Subscription and event Routing exploit CAN
  routing algorithms



                  MINEMA Summer School -                                                48
              Klagenfurt (Austria) July 11-15, 2005
                                          Università di Roma “La Sapienza”
                                          Dipartimento di Informatica e Sistemistica




Mobile Environment




            MINEMA Summer School -                                                49
        Klagenfurt (Austria) July 11-15, 2005
                                                     Università di Roma “La Sapienza”
                                                     Dipartimento di Informatica e Sistemistica




    Potential Advantages of Pub/Sub for
    Mobile Wireless
•   Decoupling of publishers and subscribers aids
    mobility

•   Decoupling of publishers and subscribers aids
    disconnected operation

•   Multicast delivery can exploit intrinsic broadcast
    properties of wireless



                       MINEMA Summer School -                                                50
                   Klagenfurt (Austria) July 11-15, 2005
                                                  Università di Roma “La Sapienza”
                                                  Dipartimento di Informatica e Sistemistica




Impact of mobility: Information-Centric
Mobile Wireless Applications
 •   Consumer Alerts
 •   Location-Based Services
 •   Multiplayer Online Games
 •   Battlefield Awareness
 •   Distributed Sensor Networks
 •   Workflow management



                    MINEMA Summer School -                                                51
                Klagenfurt (Austria) July 11-15, 2005
                                                         Università di Roma “La Sapienza”
                                                         Dipartimento di Informatica e Sistemistica




     Scenarios of mobility

• One-hop mobile network
   – Centralized vs distributed
     dispatcher
   – JEDI 2001, Huang 2001


• Multi-hop mobile network
  (MANET)
   – No wired infrastructure
   – Frequent changes in
     topology (2002 – now…)


                           MINEMA Summer School -                                                52
                       Klagenfurt (Austria) July 11-15, 2005
                                                      Università di Roma “La Sapienza”
                                                      Dipartimento di Informatica e Sistemistica




One-hop wireless network
• Problems in distributed
  pub/sub architectures
  [Huang 2001]: failures,
  message losses and
  disconnections

• Important issues in a
  replicated pub-sub
  [Huang 2001]:
   – Orderedness
   – Consistency
   – Completeness


                        MINEMA Summer School -                                                53
                    Klagenfurt (Austria) July 11-15, 2005
                                                 Università di Roma “La Sapienza”
                                                 Dipartimento di Informatica e Sistemistica




  Mobile ad-hoc network: issues
• Costantly changing topology
• Unicast is expensive while broadcast is
  cheap
• 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., to improve performance of the
  event dispatching system reducing the
  complexity of expressiveness)
                   MINEMA Summer School -                                                54
               Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




  Frequent Questions

• Do we really need complex subscription
  languages for pub/sun over MANETs?

• What is the right MANET model??
  – Reconfiguration and a long period of stability or
  – Frequent reconfigurations and short period of
    stability
  – Partition or not partition???
     • Allowing partitions means a lot of memory on board!!


                      MINEMA Summer School -                                                55
                  Klagenfurt (Austria) July 11-15, 2005
                                                          Università di Roma “La Sapienza”
                                                          Dipartimento di Informatica e Sistemistica




     Architectural Model for Mobile ad-
     hoc networks

      Application
                          Application
        Pub/sub                                         Application

        Routing           PS-Routing                       Pub/sub

         MAC                   MAC                              MAC

[Anceaume et al 2002, [Mottola et al 2005,             [Huang et al 2002,
Picco et al 2003]     Bacon et al 2005]                Baldoni et al 2005,
                                                       Bahemi et al 2005]
                            MINEMA Summer School -                                                56
                        Klagenfurt (Austria) July 11-15, 2005
                                                           Università di Roma “La Sapienza”
                                                           Dipartimento di Informatica e Sistemistica




       Topological Reconfiguration
                     Assumption: the underlying tree is kept connected
                     and loop-free by some algorithm
  Application
                     SIENA is the target CB-Pub/Sub System
  CB Pub/sub
                     Target: rearrange route traversed by events
                     in response to changes in the topology of the
    Routing
                     network of dispatchers (brokers)
      MAC
                     Separation of concerns between connectivity layer
                     and event dispatching layer
[Picco et al 2003]


                             MINEMA Summer School -                                                57
                         Klagenfurt (Austria) July 11-15, 2005
                                                              Università di Roma “La Sapienza”
                                                              Dipartimento di Informatica e Sistemistica




       Topological Reconfiguration

                     Original topology of the
  Application        event dispatching layer


  CB Pub/sub
                      AB link breakage
    Routing

      MAC             CD link formation


[Picco et al 2003]


                                MINEMA Summer School -                                                58
                            Klagenfurt (Austria) July 11-15, 2005
                                                              Università di Roma “La Sapienza”
                                                              Dipartimento di Informatica e Sistemistica




       Topological Reconfiguration
                     Strawman approach:
                     • A and B trigger unsubscriptions
                     in their subtrees immediately after
                     link breakage
  Application        • C and D trigger subscriptions
                     immediately when link appears

  CB Pub/sub         Proposed approach:
                     • after link breakage, A and B
                     delay the triggerring of
    Routing          unsubscriptions in their subtrees
                     • C and D trigger subscriptions
                     immediately when link appears
      MAC
                     Rationale:
                     Subscriptions persist longer on the tree and upon reconnection
[Picco et al 2003]   subscriptions propagate only till the first splitter (executing the filter
                     merging)
                                MINEMA Summer School -                                                59
                            Klagenfurt (Austria) July 11-15, 2005
                                                          Università di Roma “La Sapienza”
                                                          Dipartimento di Informatica e Sistemistica




      Topological Reconfiguration

                  • Retrofitting reliability (events lost during
                    reconfiguration) through gossip-based algorithms
  Application
                  • What about partitioning or isolation??
                    [Anceaume et al. 2002] assumes the network does
 CB Pub/sub         not partition for a time long enough to maintain the
                    DAG
    Routing
                   • New approaches: Semi-deterministic routing (Costa
      MAC            et al 2005)
                      – Trading subscription diffusion for better reaction
                         to topology changes
[Picco et al 2003]    – Similar to ZRP in MANET

                            MINEMA Summer School -                                                60
                        Klagenfurt (Austria) July 11-15, 2005
                                                             Università di Roma “La Sapienza”
                                                             Dipartimento di Informatica e Sistemistica




        Integration Approach

                       Assumption: the underlying tree is kept connected
                       and loop-free by MAODV
  Application
                       Target: maintaining a tree-shaped overlay network
                       on top of the dynamic topology of a MANET
   PS-Routing
                       Integration between connectivity layer
                       and event dispatching layer
      MAC

[Mottola et al 2005]


                               MINEMA Summer School -                                                61
                           Klagenfurt (Austria) July 11-15, 2005
                                                             Università di Roma “La Sapienza”
                                                             Dipartimento di Informatica e Sistemistica




         Broadcast-Based approach

                      • Usage of multicast provided by the MAC
                      • [Huang et al. 2002]
Application              – Keep a pub/sub tree to disseminate events
                             • Same assumption as [Anceaume et al. 2002]

   Pub/sub            • [Bahemi et al 2005]
                         – Smart gossipping
    MAC                  – Local subscription
                         – Similar to eventual consistency (entropy algorithm)
                           in databases [Bayeaux, Demers et al. 94]
[Huang et al 2002,
Baldoni et al 2005,      – No assumption on frequency of reconfiguration
Bahemi et al 2005]

                               MINEMA Summer School -                                                62
                           Klagenfurt (Austria) July 11-15, 2005
                                                             Università di Roma “La Sapienza”
                                                             Dipartimento di Informatica e Sistemistica




         Broadcast-based approach
                   Motivation: a tree topology over a MANET is hard
                   to implement it (expecially when topology changes
                   become frequent)
  Application
             Assumption: structure-less (not requiring any logical
  CB Pub/sub network-wide structure and no link breakage detection)

     MAC           Autonomous behavior: (no need of nodes to cooperate
                      explicitly)
[Baldoni et al 2005]
                   Subscriptions are kept local

                   Result: good reaction to partitions
                               MINEMA Summer School -                                                63
                           Klagenfurt (Austria) July 11-15, 2005
                                                             Università di Roma “La Sapienza”
                                                             Dipartimento di Informatica e Sistemistica




         Gossip-based approach
              Basic observation: for any two brokers b and b’, it is
                 possible to define a sequence of brokers b1, .. bn,
                 such that
  Application 1. their distance from b strictly increase and their
                 distance to b’ strictly decrease.
  CB Pub/sub 2. bi and bi+1 are adjacent each other

     MAC           •   Do not rely on a positioning service (a beacon
                       message is sufficient to estimate the distance
[Baldoni et al 2005]   between two adjacent nodes)

                   •   The approach is fully distributed (each process
                       decide autonomously if relaying the message)
                               MINEMA Summer School -                                                64
                           Klagenfurt (Austria) July 11-15, 2005
                                                          Università di Roma “La Sapienza”
                                                          Dipartimento di Informatica e Sistemistica




        Broadcast-based approach
                  Basic beaconing Algorithm:
                  • Each broker periodically sends a beacon containing
                  its filter
 Application      • A broker receiving beacons from adjacent brokers
                  form a hint table
 CB Pub/sub
                     • The hint table contains for each row the last time
     MAC             the beacon has been received from a given broker.
                     This permits a broker to determine how many
[Baldoni et al 2005] beacons have been missed from another broker. This
                     value is set to:
                         •  if the two brokers never come in contact
                         • 0 if they are currently adiacent
                            MINEMA Summer School -                                                65
                        Klagenfurt (Austria) July 11-15, 2005
                                                         Università di Roma “La Sapienza”
                                                         Dipartimento di Informatica e Sistemistica




      Broadcast-based approach
Basic “descreasing distance” Algorithm:
• each event carries a destination list (the “estimated” list of brokers
   interested to that event)
•   Receiving an event e, a broker b goes in the “ready to forward
   state for e” if:
   (i) b is aware of some broker not mentioned in the destination list
        and matchnig the event or
   (ii) for some broker b’ contained in the destination list whose
        hint is greater than the one stored at b
• If “ready to forward state for e”, b schedules the actual forwarding
   of e with a delay proportional to the lowest hint applicable from
   the previou steps
• During the delay if b receives e from some other neighbors it
   drops the forwarding MINEMA Summer School -                    66
                       Klagenfurt (Austria) July 11-15, 2005
                                                         Università di Roma “La Sapienza”
                                                         Dipartimento di Informatica e Sistemistica




         Broadcast-based approach


  Application

  CB Pub/sub

     MAC

[Baldoni et al 2005]




                           MINEMA Summer School -                                                67
                       Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




  Comparison
• Topological reconfiguration
  – Not suitable for frequent topology changes (too
    much overhead for updating the filter information)
  – not suitable for partition or isolation (too much
    overhead) … this means no disconnected work
  – Alway need cooperations among brokers
• Broadcast-based
  –   Suitable for frequent topology changes
  –   Can adapt to partitions and isolations
  –   Expoit the broadcast nature of the environment
  –   Nodes do not need to cooperate

                      MINEMA Summer School -                                                68
                  Klagenfurt (Austria) July 11-15, 2005
                                                                Università di Roma “La Sapienza”
                                                                Dipartimento di Informatica e Sistemistica




Research Directions for pub/sub on MANETs
                            Capture fundamental problems
                            posed by dynamic behavior

Applications
Reference implementations                                    Qos definition and enforcement
Real deployments

                      Properties of sparse networks

                            But…most important

                            Please stop doing papers
                              on algorithms + sim
                                  MINEMA Summer School -                                                69
                              Klagenfurt (Austria) July 11-15, 2005
                                                Università di Roma “La Sapienza”
                                                Dipartimento di Informatica e Sistemistica




  Dynamic Distributed Systems
• Common problems among implementing
  pub/sub on mobile ad-hoc networks and
  realizing pub/sub on a structured overlay or
  on a dense sensor network
• Similar techniques have been used
• Dynamic behavior becomes crucial in modern
  distributed systems
• It would be interested to studying general
  solutions to such a common problem

                  MINEMA Summer School -                                                70
              Klagenfurt (Austria) July 11-15, 2005
                                                    Università di Roma “La Sapienza”
                                                    Dipartimento di Informatica e Sistemistica




 Thanks
Roberto Beraldi, Gianpaolo Cugola, Antonino Virgillito, Roman
Vitemberg, Mariangela Contenti, Carlo Marchetti, Sara Tucci
Piergiovanni, Leonardo Querzoni and thanks to many other
people that worked with me on the topic

I also have to thank David Rosemblum and Hans-Arno
Jacobsen for taking inspiration (…and a few slides) by some of
their presentations on the topic




                      MINEMA Summer School -                                                71
                  Klagenfurt (Austria) July 11-15, 2005
                                                                            Università di Roma “La Sapienza”
                                                                            Dipartimento di Informatica e Sistemistica




         A few references
Paolo Costa, Matteo Migliavacca, Gian Pietro Picco, Gianpaolo Cugola: Epidemic Algorithms for Reliable Content-
Based Publish-Subscribe: An Evaluation. ICDCS 2004: 552-561
Paolo Costa, Matteo Migliavacca, Gian Pietro Picco, Gianpaolo Cugola: Introducing reliability in content-based
publish-subscribe through epidemic algorithms. DEBS 2003
Gian Pietro Picco, Gianpaolo Cugola, Amy L. Murphy: Efficient Content-Based Event Dispatching in the Presence
of Topological Reconfiguration. ICDCS 2003: 234-243
Gianpaolo Cugola, Elisabetta Di Nitto, Alfonso Fuggetta: The JEDI Event-Based Infrastructure and Its Application
to the Development of the OPSS WFMS. IEEE Trans. Software Eng. 27(9): 827-850 (2001)
Eiko Yoneki, Jean Bacon: Content-Based Routing with On-Demand Multicast. ICDCS Workshops 2004: 788-793
Eiko Yoneki, Jean Bacon: Dynamic Publish/Subscribe in Mobile Peer-to-Peer Systems. OTM Workshops 2004: 1-
S. Baehni, C. S. Chhabra, R. Guerraoui, Mobility Friendly Publish/Subscribe, EPFL technical report 2005
Roberto Baldoni, Roberto Beraldi, Sara Tucci Piergiovanni, Antonino Virgillito: On the modelling of
publish/subscribe communication systems. Concurrency - Practice and Experience 17(12): 1471-1495 (2005)
Roberto Baldoni, Roberto Beraldi, Leonardo Querzoni, Antonino Virgillito: Subscription-Driven Self-Organization in
Content-Based Publish/Subscribe. ICAC 2004:
R. Baldoni, R. Beraldi, G. Cugola, M. Migliavacca, L. Querzoni, Structure-less Content-Based Routing in Mobile Ad
Hoc Networks (To appear) International Conference on Pervasive Services (ICPS '05), Santorini, Greece, July
2005
R. Baldoni, C. Marchetti, A. Virgillito, R. Vitenberg, Content-Based Publish/Subscribe over Structured Overlay
Networks To appear in Proceedings of the 25th International Conference on Distributed Computing Systems
(ICDCS '05), Columbus, Ohio, June 2005
P. Costa . G.P. Picco, Semi Probabilistic content based-pub-subscribe To appear in Proceedings of the 25th
International Conference on Distributed Computing Systems (ICDCS '05), Columbus, Ohio, June 2005




                                          MINEMA Summer School -                                                    72
                                      Klagenfurt (Austria) July 11-15, 2005
                                           Università di Roma “La Sapienza”
                                           Dipartimento di Informatica e Sistemistica




Other references




             MINEMA Summer School -                                                73
         Klagenfurt (Austria) July 11-15, 2005
                                           Università di Roma “La Sapienza”
                                           Dipartimento di Informatica e Sistemistica




Other references




             MINEMA Summer School -                                                74
         Klagenfurt (Austria) July 11-15, 2005