Final paper-kerala_modified (Autosaved)

download Final paper-kerala_modified (Autosaved)

of 6

Transcript of Final paper-kerala_modified (Autosaved)

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    1/6

    Using Publish-Subscribe Model for Applications

    in Mobile Adhoc Network

    Swaroop R. Chougule

    Walchand College of Engineering ,

    Sangli

    [email protected]

    Prof. Mrs. M.A. SHAH

    Walchand College of Engineering ,

    Sangli

    [email protected]

    Prof. Dr SM.Deshpande

    Walchand College of Engineering ,

    Sangli

    [email protected]

    Abstract MANET is becoming an emerging trend to

    cope with radio communications capabilityandincreasing

    access to data in wireless network. The publish /subscribe

    messaging paradigm has a number of characteristics that

    make it very attractive in this internet world. These

    include scalability, efficiency, decoupling between

    publishing and subscribing entities, and the ability to

    integrate a wide variety of devices and systems. In this

    paper, we explore the application of the publish/subscribe

    messaging paradigm. We present application of MUSIC

    Shoppe which makes use of content based routing inpublish-subscribe paradigm. A middleware (REDS) is

    used for experimentation.

    Index Terms----MANET, Publish-Subscribe, ContentBased Routing (CBR), REDS

    I.INTRODUCTION

    A "Mobile Ad Hoc Network" (MANET) is an

    autonomous system of mobile routers (and nodes, associated

    hosts) connected by wireless links[1].The mobile nodes that

    are in range of each other can directly communicate, whereas

    others needs the aid of intermediate nodes to route theirpackets.

    MANETs have no central point of administration, nor are

    they supported by any fixed infrastructure. Instead, due to the

    routing capabilities of the nodes themselves, the network is

    self-organizing. Nodes that are not in each others radio rangemay communicate by means of multi-hop routing, in which

    nodes that interconnect the communication partners aid in the

    forwarding of data. Networking technologies and products

    now enable a high degree of connectivity across a large

    number of computers, applications, and users. In these

    environments, it is important to provide asynchronous

    communications for the class of distributed systems that

    operate in a loosely-coupled and autonomous fashion, and

    which require operational immunity from network failures.

    This requirement has been filled by various middleware

    products that are characterized as messaging, message

    oriented middleware (MOM), message queuing, or publish-

    subscribe.

    II. Need of Content Based Routing in MANET

    With the steady growth of consumer products such as

    Laptop, PDA which acts as wireless mobile routers,

    MANETs are becoming increasingly common and resources

    are shifting towards the edge of network For this purpose,

    need for efficient multi-hop routing protocols rises. Due to its

    volatile nature, communicating over a MANET is unreliable

    and takes a relatively long time, forming a highly unattractive

    networking environment.The problem occurred in MANETs is that traditional

    protocols i.e. whether it is in the application layer, networklayer etc are address-based and require that all

    communication partners know each other. All applications

    related ,that are mainly interested in what they exchange; notwith whom, in fact place a burden on routing that can often

    be avoided. Internet radio stations, peer-to-peer file sharing

    and group conferences are all examples of applications that

    are mainly interested in what they exchange; not with whom.

    Such applications may benefit from content-based routing

    (CBR).In conventional systems, the sender explicitly specifies the

    intended message recipients using a unicast or multicast address.Instead, in CBR the sender simply injects the message in thenetwork, which determines how to route it according to thenodes interests. These identify the relevant classes of messages

    based on their content, e.g., using key-value pairs or regularexpressions.

    There are many approaches of CBR to route content botheffectively (everyone gets the content they want) and

    efficiently (content only reaches those parts of a network

    where it is wanted). Systems are often compared by the

    percentage of subscribers that get what they want (called the

    completeness ratio), the percentage of messages that are

    received that are actually wanted (called the precision ratio)

    and the overhead that the systems routing scheme places on

    the network (this includes the forwarding of the content

    itself).

    III PUBLISH-SUBCRIBE SYSTEM

    Publish/subscribe (or pub/sub) is a messaging pattern

    where senders (publishers) of messages are not programmed

    to send their messages to specific receivers (subscribers).

    Rather, published messages are characterized into classes,

    without knowledge of what, if any, subscribers there may be.

    Subscribers express interest in one or more classes, and only

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    2/6

    receive messages that are of interest, without knowledge of

    what, if any, publishers there are. This decoupling of

    publishers and subscribers can allow for greater scalability

    and a more dynamic network topology.

    In a content-basedsystem, messages are only delivered to

    a subscriber, if the attributes or content of those messages

    match constraints defined by the subscriber. The subscriber isresponsible for classifying the messages.

    First we elaborate the terms related with this systema. Clients: They interact by publishing events and by

    subscribing to the classes of events they are interested in.

    b. Event dispatcher: It is a main component of the

    middleware. It collects all the subscription ad forwards the

    events to subscribe. It is responsible for collecting

    subscriptions and forwarding events to subscribers.

    Recently, many publish-subscribe middleware have

    become available, which differ along several dimensions.

    1. Subject-basedsystems, where subscriptions identify onlyclasses of events belonging to a given channel or subject.

    2. Content-based systems, where subscriptions contain

    expressions (called event patterns) that allow sophisticated

    matching on the event content. In this the selection of a

    message is determined entirely by the client, which usesexpressions (often called filters) that allow sophisticated

    matching on the message content. Clearly, the message

    format constraints the subscription language. For instance, if

    the message is simply a string, then regular expressions are

    the typical subscription language. Also, the expressive power

    of the subscription language impacts the inner working of themiddleware. For instance, as described in [5], under some

    conditions it is possible to detect that a filter is subsumed by

    an already existing one, or even to fuse together two filters

    into a more general one, thus reducing the matching space.

    In this paper we assume a content-based subscription

    language, as this represents the most general and challenging

    case. The architecture of the event dispatcher can be either

    centralized or distributed. In this paper, we uses distributedtype of architecture. In such middleware a set of dispatching

    servers are interconnected in an overlay network &

    cooperatively route subscription and event messages.

    The systems exploiting a distributed dispatcher can befurther classified according to the interconnection topology of

    dispatchers and the strategy exploited for message routing.

    There are two Publish-subscribe routing strategies:

    (a) Message forwarding

    (b) Subscription forwarding

    1. Message forwarding is a simplest approach in which

    brokers are connected to form unrooted tree. Publishers send

    messages to their associated broker, which forwards them to

    all other brokers by following the tree topology. Moreover,

    each broker keeps track of the subscriptions coming from thesoftware components directly attached to it into a local

    subscription table, which is used to determine the

    components, if any, that should receive incoming messages.

    Requests to unsubscribe from a given event pattern are

    handled and propagated analogously to subscriptions,

    although at each hop entries in the subscription table are

    removed rather than inserted. The main benefit of message

    forwarding is that it does not require subscriptions to be

    propagated.

    But it has some disadvantages that highest overhead at

    publishing time.

    2. Subscription Forwarding is an alternative and more

    widely used strategy which limits the overhead of messageforwarding by spreading knowledge about subscriptions

    beyond the firstbroker, i.e. the broker where the publisher is

    attached, along the un rooted tree connecting brokers.Specifically, when abroker receives a subscription from one

    of the application components connected to it, not only it

    stores the associatedpredicate into its subscription table as in

    message forwarding,but also it forwards such a predicate to

    the neighboringbrokers. During this propagation, each broker

    message forwarding,but also it forwards such a predicate to

    the neighboringbrokers. During this propagation, each broker

    behaves as a subscriber with respect to its neighbors. This

    process effectively sets up routes for messages through thereverse path followed by subscriptions. It has only one

    drawback is that it fills the subscription tables of each broker.

    But as compare to Message forwarding it is more

    advantageous because it offers the best performance at

    publishing time.To avoid confusion in the figure only brokers are shown,

    without clients in Fig 1. A) and B) the above strategies are

    compared by showing the same setting, characterized by a

    distributed dispatcher composed of 16 brokers. Two of them,

    namely S1 and S2, have components connected to them that

    subscribed to the same predicate, represented as a blackcolor, while broker S3 received a gray subscription. Colored

    arrows represent the content of subscription tables for the

    corresponding filters. Broker P published a message matching

    A) Message forwarding B) Subscription forwarding

    Fig.1 A) and B) indicates that the Publish-subscribe routing strategies.

    the black filter but not the gray one. The path followed by this

    message is shown through thick, directed lines, while black

    and gray arrows represent the content of subscription tables.

    More specifically, each broker has a colored arrow oriented

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    3/6

    towards another broker if it received the corresponding

    subscription from that broker. Figure 1(a) shows how

    message forwarding incurs in the highest overhead at

    publishing time, while it does not require subscriptions to be

    propagated. Subscription forwarding (Fig. 1(b)) fills the

    subscription tables of each broker but offers the best

    performance at publishing time.

    IV REDS MIDDLEWARE

    The basic requirements of todays' distributed systems are

    high degrees of decoupling and flexibility. One of the

    solution to tackle all these issues is to use publish-subscribe

    middleware. In this paper we provide the brief introduction to

    REDS (Reconfigurable Dispatching System) middleware

    which is basically meant for reconfiguration.

    REDS (REconfigurable Dispatching System) is a framework

    of Java classes to build publish-subscribe applications for

    large, dynamic networks. REDS provides the client API to

    write publish-subscribe applications and defines a general

    framework of components, with clearly defined interfaces, to

    build a distributed dispatcher organized as a set ofbrokers

    linked in an overlay dispatching network, which collaborateto route messages from publishers to subscribers. REDS is

    the first publicly available and implemented system expressly

    designed to tolerate arbitrary topological reconfigurations of

    the message dispatching network independently from the

    underlying networking scenario.

    The first approach of reconfiguration concerns the very

    configuration of the middleware architecture, and addresses

    the problem of enabling the selection of different mechanisms

    for different deployment scenarios. Thus, for instance, it is

    possible to select the routing strategy (or network transport,

    or matching semantics, and so on) that is most appropriate for

    the application at hand. Moreover, proper extension

    mechanisms are in place that enables programmers to definetheir own variants, if needed.

    The second reconfiguration approach concerns instead thedynamic reconfiguration of the topology of the message

    dispatching network, and therefore addresses the needs of

    highly dynamic systems where the topology of the network

    undergoes continuous change (e.g., mobile and peer-to-peer

    systems). This second form of reconfiguration will be

    embedded in some of the components we develop for

    scenarios in wireless networks. Here, classes used in current

    REDS middleware are briefly explored, dispatching service-It

    provides methods to open a connection with a REDS broker,

    close it, get the identifier associated with the connection,

    subscribe to and unsubscribe from a set of messages, get

    messages dispatched to the component, and publish newmessages.Filter interface- It defines a method matches that is

    supposed to be redefined with the filtering logic specified by

    the implementing class. In addition, the methods hash code

    and equals are used internally by REDS brokers to store and

    compare filters.

    Fig.2. Present REDS middleware Architecture

    Comparable interface -This represents filters that can be

    covered by others according to some notion of partial

    ordering. Transport- (Transport and neighbor) this layer

    provides the mechanisms used to transport messages,

    (un)subscriptions, and any other kind of broker specificcontrol message through the network. Moreover, it also hides

    the mechanisms used to address and access brokers and

    clients, and to setup the dispatching network in case the

    dispatcher is distributed.Routing - (Core, Router, Neighbored

    and ConnectionManager and SubscriptionTable) CORE-the

    interface Core abstracts the central component of a REDS

    broker mediating the communication among the other

    components, which therefore do not have direct visibility of

    each other CONNECTIONMANAGER - the

    ConnectionManager interface describes the component in

    charge of managing the overlay dispatching network.

    SUBSCRIPTION TABLE-SubscriptionTable providesmethods for inserting and removing filters, as well as for

    selectively retrieve the filters that are relevant to a given

    neighbor or set of neighbors, or those matching a given

    message. NEIGHBOURSET-A convenience class provided

    as a way to simplify the task of accessing, from within the

    routing components, information concerned with the brokers

    neighbors represented by Neighbor instances. SimpleCore-

    The class implements a basic core that delegates all its

    operations to the other components, i.e., the Router and the

    ConnectionManager, without any additional processing.

    Generic Table -The class implements the SubscriptionTableinterface by maintaining a list of all the filters received for

    each neighbor. DeferredUnSubCM -This class implements

    the deferred unsubscription strategy described in [7], but does

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    4/6

    not provide any mechanism to attempt reconnection of the

    overlay network in presence of link failures.

    ManetDeferredUnSubCM - It adopts the same strategy for

    reconciling subscription tables, but includes also a

    mechanism [24] to repair the overlay network, inspired by the

    MAODV multicast protocol [31] and geared towards mobile

    ad hoc networks.

    V. EVALUATION

    1. Experimentation Setup:We have performed the experiments using seven

    desktop PCs connected in wired network. Different

    scenarios have been developed, that uses five number of

    brokers, single publisher and varying number of

    subscribers. Results are analyzed depending on No. of

    messages received and time of arraival.

    The Music shopee application we developed is

    analysed for subscription forwarding behaviour. Here

    message published is list of artists and their hindi songs.Subscribers have selected artists according to their choice. As

    a result of content based routing mechanism Songs of given

    choice have been reached to individual subscribers. A

    publication is allowed to traverse the system only if there are

    data sinks, or subscribers, who are interested in the data.Subscribers indicate their interest using subscription

    messages which are detailed below. If there are no interested

    subscribers, the publication is dropped. A publication may

    also contain an optional payload, which is a blob of binary

    data. The payload is delivered to subscribers, but cannot be

    referenced in a subscription constraintBefore a publisher can issue publications, it must supply

    a template that specifies constraints on the publications it will

    produce. These templates are expressed via advertisement

    messages. In a sense, an advertisement is analogous to a

    database schema or a programming language type.

    The language model is based on the traditional [attribute,

    operator, value] predicates used in several other content-

    based publish/subscribes systems. In this,each messageconsists of a message header and a message body. The header

    includes a unique message identifier, the mes-sage type

    (publication, advertisement, subscription, or notification).The

    content and for-mats of each message type are detailed below.Data producers, or publishers, encapsulate their data in

    publication messages which consist of a comma separated set

    of [attribute, value] pairs. Each publication message includes

    a mandatory tuple describing the class of the message.

    The class attribute provides a guaranteed selective

    predicate for matching, similar to the topic in topic-based

    publish/subscribe systems.

    A publication that conveys

    information about a music shopee listing may look as

    follows:

    Before a publisher can issue publications, it must supplya template that specifies constraints on the publications it will

    produce. These templates are expressed via advertisement

    messages. In a sense, an advertisement is analogous to a

    database schema or a programming language type, and can

    specify the type and ranges for each attribute as shown in the

    following example:

    A:[class:HINDI][ARTIST:@string][PAYLOAD:@string][

    RATING:1-5] [YEAR: YYYY] [BITRATE: int]

    The above advertisement indicates that the publisher will publish data related to HINDI songs with its artist, year,

    rating and bitrates available. An advertisement is said to

    induce publications: the attribute set of an inducedpublication is a subset of attributes defined in the associated

    advertisement, and the values of each attribute in an induced

    publication must satisfy the predicate constraint defined in the

    advertisement. Note that a publisher may only issue

    publications that are induced by an advertisement it has sent.

    Two possible publications P1 and P2 induced by the above

    advertisement are listed below, while P3 is not induced by the

    advertisement due to the extra attribute film.

    P1: class: HINDI][ARTIST:A][PAYLOAD:AB]P2: [class: HINDI]

    [ARTIST:A][PAYLOAD:AB][YEAR:1989]

    P3: [class: HINDI][ARTIST:A],[FILM:xx]

    Subscribers express their interests in receiving publication

    messages by issuing subscriptions which specify predicateconstraints on matching publications.

    S: [class: HINDI][ARTIST:YHOO][PAYLOAD: @string]

    Similar to publications, each subscription message has a

    mandatory predicate specifying the class of the message, with

    the remaining predicates specifying constraints on other

    attributes [8].A publication is said to match a subscription, if all

    predicates in the subscription are satisfied by some [attribute,

    value] pair in the publication. For instance, the above

    subscription is matched by publications of all songs by artist

    A. A subscription is said to cover another subscription, if

    and only if any publication that matches the latter also

    matches the former. That is, the set of publications matching

    the covering subscription is a superset of those matching thecovered subscription.

    The Following graphs indcates results for different

    scenarios. In the first scenario we considered single

    publisher, no. of brokers and single subscriber. The publisher has published 100 messages. The graph (3.a)

    shows time delay for messages to reach to the desired

    subscriber.

    In second scenario, we considered single subscriber and

    publisher performing the same operations using the

    previous parameters but with increased number of hops in

    between. The results have been compared with previous one

    and plotted as shown in the fig. 3 (b). The graph shows that

    that the delay occured in forwarding messages in second

    scenario was more than first one.Finally, running the third scenario by considering many

    brokers,many clients and publisher attracts the same

    explanation about routing strategy.Its results are also shown

    in the fig 5(c).

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    5/6

    Fig. 3.a) One Subscriber and One publisher

    Fig. 3. b) Two subscriber and One publisher

    Fig. 3. c) Many subscriber and Many Brokers

    The above graph showa result of operation. The

    masseges published by publisher are first broadcasted to all

    the brokers in wired nework.After publishing, the subscriber

    subscribes to only those masseges he/she is interested in.

    And based on connection topology betweeen them the

    contents are routed to subscriber.

    The encouraging results presented above in wired networkhave prompted us to develop the similar scenario in wireless

    network. In our experiments, eight users participated by

    carrying a laptop equipped with an 802.11g wireless card

    configured in ad hoc mode and without any encryption. The

    measured communication range was about 35 m. Users

    moved in a 60 _ 150 m area in a park behind our department.

    Therefore, the resulting network scenario was rather sparse.

    Each user was instructed to move according to the Random

    Waypoint mobility pattern, randomly choosing a target point

    within the test area and walking toward it along a straight line

    and with constant speed. Upon reaching the target, the userstopped for a random time between20 seconds and 60

    seconds and then repeated the process. Traffic was generated

    by a client installed on each laptop, publishing between 1 and24 msg/s.Subscriptions were allowed to change dynamically.The work is in progress and the preliminary results are encourage

    ing.

    CONCLUSION

    From the above results it, can be seen that the delivery

    time depends on the number of hops or the hop distance

    between publisher and subscriber. Additional time is required

    due to lookup in the subscription table to match the data

    received from neighbour against the appropriate filter.The

    message format for the data sent by the publisher gives theefficient way to handle the issue of subscription matching. It

    also facilitates the subscriber to subscribe to particular fields

    in the messages being received.The REDS system providesmechanism for reconfiguration in case of link or node failure

    so this will be useful in case of wireless network where the

    nodes are mobile.

    VI.ACKNOWLEDGMENT

    REDS is part of larger research collaboration with Paolo

    Costa, Davide Frey, Matteo Migliavacca, Luca Mottola, and

    Amy L. Murphy. Moreover, REDS developers include

    Fabrizio Buzzi, Sandro Calzoni, Kubilai Hernandez, andAlessandro Monguzzi. The authors are deeply obliged with

    all of the aforementioned people, especially to Prof.

    Gianpaolo Cugola for his valuable discussion and guidance

    about the topic of paper.

    This work is supported by the AICTE under Research

    Promotion Scheme (RPC) in 2008-09.

    VII.REFERENCES

    [1] C.-K. Toh. Ad hoc Mobile Wireless Networks . Prentice Hall PTR,Upper Saddle River, 2002.

    [2] Roberto Baldoni, Roberto Beraldi, Leonardo Querzoni, GianpaoloCugola, Matteo Migliavacca. Content -Based Routing in Highly

    Dynamic Mobile Ad Hoc Networks, October 24 2005

    [3] Gianpaolo Cugola and Gian Pietro Picco .REDS: A ReconfigurableDispatching System. Dipartimento di Elettronica e Informazione,

    Politecnico di Milano, Italy.

    [4] Gian Pietro Picco ,Gianpaolo Cugola ,Amy L. Murphy. EfficientContent- Based Event Dispatching in the Presence of Topological

    Reconfiguration. [5] Gianpaolo Cugola ,Gian Pietro Picco . REDS: A Reconfigurable

    Dispatching System

    [6] Luca Mottola, Gianpaolo Cugola, and Gian Pietro Picco.A Self

    Repairing Tree Topology Enabling Content -Based Routing in MobileAd Hoc Networks.

    [7] Laurea thesis of:Luca Mottola ,id. 644048, Advisor: Prof. G.P.

    Picco,Co-advisor: Prof. G. Cugola .Overlay Management for Publish-

    Subscribe in Mobile Environments. Academic year 2003-2004

    [8] Hans-Arno Jacobsen, Alex Cheung, Guoli Li, Balasubramaneyam

    Maniymaran, Vinod Muthusamy, Reza Sherafat Kazemzadeh The

    PADRES Publish/Subscribe System

  • 8/7/2019 Final paper-kerala_modified (Autosaved)

    6/6