Message-based MVC Architecture - Community Grids Lab by linzhengnd

VIEWS: 4 PAGES: 53

									         Message-based MVC Architecture for
         Distributed and Desktop Applications

                                     Xiaohong Qiu




                Department of Electrical Engineering and Computer Science
                                   Syracuse University




March 2, 2005                         Xiaohong Qiu                          1
          Presentation Topics
          Background for My Research
          Architecture of Message-based MVC
          SVG Experiments
          Performance Analysis
          Collaboration Paradigms
          Conclusion and Future work


March 2, 2005           Xiaohong Qiu          2
                              Background
      General area is technology support for Synchronous and Asynchronous
    Resource Sharing.
             e-learning                            (e.g. video/audio conferencing)
             e-science                             (e.g. large-scale distributed computing)
             e-business                            (e.g. virtual organizations)
             e-entertainment                       (e.g. online game)


       Grids
    manage and share (typically asynchronously) resources (people, computers,
    data, applications etc.) or distributed services in a centralized fashion.

       Web Services
    define loosely coupled software components across internet interacting with
    messages.

       Peer-to-Peer Grids
    link services, resources and clients in dynamic decentralized fashion.
            The system consists of a sea of message-based Services (e.g. shared SVG as a Web Service)

            Services linked by publish/subscribe messaging infrastructure (e.g. NaradaBrokering)




March 2, 2005                                         Xiaohong Qiu                                      3
                                  Classic Grid Architecture

                                                                                                IBM




                                  Database                                   Database
                                                                                                                    Resources
                                                                     File
                                                  Comupting         Server                Supercomputer
                Laser Printer




                                                        Netsolv
                                                           e
                                                                               Security
                                                                                                                     Middle Tier
                                Computing                   Collaboration                                            Brokers Service
                                                                                 Compositio                          Providers
                                         Content
                                                                                    n
                                         Access

                                         Middle Tier becomes Web Services




                                                                                                                         Clients

                         Laptop                                                Desktop                       Java Ring
                                             Cellular             PDA                          Workstation
     Cellular                                phone
     Phone


March 2, 2005                                 A centralized organization
                                                       Xiaohong Qiu                                                           4
                                     Peer to Peer Grids


                                                  File                 Workstation
                                                 Server
                                         User Facing Web Service Interfaces                       Database
                    Laptop

                                                                                                    Peers
                                                      Brokers
                                                                                                                Java Ring
      PDA                                                                            Brokers
                               Brokers                     Event/Messag
                                                             e Brokers

                                   Event/Messag                                         Brokers
                                     e Brokers

                                         Service Facing Web Service Interfaces                                         IBM




                 Peers
 Laser Printer
                                                                                                                 Supercomputer


                    Database



                                                                                     Desktop         Cellular
                                           Cellular             Comupting                            Phone
                                           phone



March 2, 2005                             A democratic organization
                                                  Xiaohong Qiu                                                                   5
                Research on a generic model of
                    building applications
       Application domains
            Distributed (Web)
                 Service Oriented Architecture and Web Services
            Desktop (client)
                 Model-View-Controller (MVC) paradigm
            Internet collaboration
                 Hierarchical Web Service pipeline model

       Motivations
            CPU speed (Moore’s law) and network bandwidth (Gilder’s law) continue to
            improve bring fundamental changes
            Internet and Web technologies have evolved into a global information
            infrastructure for sharing of resources
            Applications getting increasingly sophisticated
                 Internet collaboration enabling virtual enterprises
                 large-scale distributed computing
            Requires new application architecture that is adaptable to fast technology
            changes with properties

March 2, 2005                                Xiaohong Qiu                                6
                     Summary of the situation
    The Internet has evolved into stability
         TCP/IP network stack dominating the communication protocol domain;
         IP forms the low-level sphere surrounding hardware network core

    Construction of distributed operating system over the Internet is not completed
         It keeps adding new functionalities to the general purpose platform
         One current effort focuses on building of messaging infrastructure tailored for disparate applications

    Evolution of application architectures
         client-server model
         Multi-tier (e.g. three-tier) model
         A variety of distributed model (e.g. Java RMI, CORBA, COM/DCOM, J2EE, .NET)
         Grids
         Peer-to-peer
         Web Services and SOA

    Web application deployment shows diverse directions but have common
    features
         User interfaces
         Services for the sharing of information and resources (e.g. through unicast and multicast of group
          communication)
         In the most general sense, collaboration is the core problem and service of Web applications, although
          “collaboration” usually refers to system with real-time synchronous and compelling time constraints

    Next generation of Web client should enable pervasive accessibility
         Ubiquitous availability to clients fro heterogeneous platforms (e.g. Windows, Linux, Unix, and PalmOS)
         Uniform Web interface that provides a platform with aggregation of multiple services
March 2, 2005                                   Xiaohong Qiu                                                       7
                   Architecture of network system

                                                                        PDA
                                                                                                                          IBM




                           Database
                                                           tem Applications               Gr
                                                       Sys                                   id c                   Supercomputer
                                                   ile            rk Web Service routi
                                                  F        n etwo                      ng         om
                                             d              Messaging Infrastructure                 p
                                          re
                                                                                                         ut

                                                        y
                                                                                                           in
                                         a




                                                                                              (S
                                                   rl a
                                      Sh


                                                                                                                g




                                                                                                OA
                                               ve
                                     P

                                              O




                                                                                                  P)
                                  P2




                                                                       router
                                                                     W




                                                                                                            ng Media
                                Shared W




                                                                     A




                                                                                                              SDL
                                                                Network          Core
                                  SSL




                                                                     N
                                                                     ATM




                                                                                                        P W
                                                                        switch
                                                                                                                                 File
                Cellular                                                                                                        Server




                                                                                                       a mi
                                      Te




                phone                                                  router
                                         lne




                                                                                                     FT
                                          hit




                                                        TC




                                                                                                  Stre
                                                                       IP           P         3
                                             eb




                                                 SM
                                              t




                                                    TP
                                                            P                    UD        32
                                                oa




                                                                                        H           ing
                                                                                                 nc
                                                   rd




                                                        HTT                         ls
                                               W
                                                eb           P Application protoco            re
                                                   Bro                                    nfe
                                                       w se                            Co
                                                            rs Multip
                                                                      layer game  A/V

                               Laptop                                                                       Workstation




                                                                      Desktop
March 2, 2005                                                     Xiaohong Qiu                                                           8
                         Our approach
   Explicit messaging replacing implicit messaging of traditional event listener paradigms

   Key idea is to generalize MVC with model and view communicating by messages with the
   messaging providing control mechanism

    Message-based MVC (M-MVC) paradigm integrates distributed, Web, and desktop applications

    SMMV and MMMV for general collaboration paradigms

    Prototyping monolithic SVG collaborations
        Shared SVG browser
        Share online chess game

    Decomposed SVG experiments and detailed performance measurements to test viability of loose
   coupling services message-based

    Specifically investigate
        M-MVC and MVC
        M-MVC and Web Applications (Services)
        M-MVC and collaboration (SMMV and MMMV paradigms)
        M-MVC and messaging infrastructure (NaradaBrokering middleware)



March 2, 2005                                 Xiaohong Qiu                                     9
          Related Technologies
   Batik SVG browser (an open source project from
   Apache that supports SVG 1.0)
      A presentation style application is representative and complex in nature (we
       experiments with multiplayer-online game with high interactivity and compelling
       time constraints)
      Similar applications includes Microsoft PowerPoint, Adobe Illustrator,
       Macromedia Flash

   SVG (W3C specifications for Scalable Vector Graphics)
      A language for describing 2D vector and mixed vector/raster graphics in XML.

   DOM (W3C specifications for Document Object Model)
      Programmatic interfaces for access and manipulate structured document object
      All modern browsers (approximately) support the W3C DOM
      DOM event model specifies event semantics and how to register event handlers
       and describe event flow through a tree structure


March 2, 2005                         Xiaohong Qiu                                       10
          Model-View-Controller (MVC) model



                                   Model

                Controller

                Mouse event          View
                Keyboard events
                                             Display




March 2, 2005                 Xiaohong Qiu             11
          Double-linked multiple-stage Web Services
             pipeline model of Web applications



        Object    Object’   Object’’       Object     Object
        Or WS     Or WS’    Or WS’’        Or View   Or Display




March 2, 2005               Xiaohong Qiu                          12
Architecture of Message-based MVC
        M-MVC is a general approach for building applications with a
        message-based paradigm

        It emphasizes a universal modularized service model with
        messaging linkage

        Converges desktop application, Web application, and Internet
        collaboration
            MVC and Web Services are fundamental architectures for desktop and Web
            applications
            Web Service pipeline model provides the general collaboration architecture for
            distributed applications
            M-MVC is a uniform architecture integrating the above models


        M-MVC allows automatic collaboration, which simplifies the
        architecture design

March 2, 2005                             Xiaohong Qiu                                       13
                Message-based MVC model


                               Model
                             Web Service
                                Sematic


                             High Level UI



                        Input port    Output port
                        Events as     Rendering as
                        messages      messages

                                Raw UI
                                Display
                             User Interface
                                 View
                    Messages contain control information

March 2, 2005                Xiaohong Qiu                  14
  A comparison of MVC and pipeline model in a
            case of SVG application
                         Model View Controller            Decomposition of SVG Browser


                                                                      Semantic
                                           Model

                                                         Events as                  Rendering as
                                                         messages                   messages

                     Controller
                                                                      High Level UI

                                                         Input port              Output port
                                            View

                                                         Events as                 Rendering as
                                                         messages                  messages

                                                                         Raw UI
                                                                         Display


                                         Display
                                                         Messages contain control information


                              a. MVC Model              b. Three-stage pipeline

                Reformulation of SVG to message-based MVC in a Web Service Model

March 2, 2005                                      Xiaohong Qiu                                    15
  Monolithic SVG Experiments
     Collaborative SVG Browser
         Teacher-Students scenario
         Static Shared SVG contents
         Dynamic Share SVG contents
          Hyperlink
           Interactivity and animation (JavaScript binding)

     Collaborative SVG Chess game
         Two players-multiple observers scenario
         Complex interactivity with game intelligence

March 2, 2005                         Xiaohong Qiu             16
Collaborative SVG Chess Game

                                  Players




 March 2, 2005     Xiaohong Qiu             Observers   17
  Making SVG collaborative by sharing of intercepted events via
       messaging broker with Publish/Subscribe scheme

                        Set up an event                                                                 Subscribe to
                                                                   Broker
                        class (topic)                                                                      the topic

                                                      Publish          to collaborative
                                                      an event         clients                         Facing
                                  Facing                                                                                  Facing
                                                                                                        Model
                                  Model
                                                                                   Application as Web Service
                  Application as Web Service
                                                                                                  JavaScript
                                JavaScript

                                                                                                       SVG DOM
                                 SVG DOM

                                                                                                       Facing
                                  Facing
                                                                                          Input port            Output port
                  Output port           Input port                                                               Rendering as
                Rendering as                   Event as messages                                                 messages
                messages
                                                                                                       GVT
                                  GVT


                                                                                                   Renderer
                                Renderer
                                                                                                       View
                                View
                                                                                          Participating client
                          Master client




March 2, 2005                                              Xiaohong Qiu                                                            18
Collaborative SVG Event processing chart


                                             Semantic           Collaborative
           Raw UI       High Level UI         events               events
           events          events
                                                                   (e.g. Master
                                           (e.g. Application    Events which has
          (e.g. Mouse   (e.g. SVG/DOM       events such as
            and key                                            context information
                             events)          “capture” in     of collaboration and
            events)                          chess game)         information from
                                                                 previous stages)




                          Classes of Events in SVG
                          Around 60 detailed Events


March 2, 2005                       Xiaohong Qiu                                      19
Architecture of collaborative SVG browser on PC

                                                                                                                  Data to
                                                                                                                  other clients         R
                                                                                                                                             Master client
                                                                                                                                    F
                                                                                                                                            SVG browser 1
                                                                                                                  Control to/from
                                                                                                                                        I




                                                                         Event (Message) Service Infrastructure
                                                                                                                  XGSP                      O



                                                                                                                  Data from




                                                       NaradaBrokering
                                                                                                                  master client         R
                  XGSP          Control to/from                                                                                              Other client
              Session control                                                                                                       F
                                all SVG browsers                                                                                            SVG browser 2
                  Server                                                                                          Control to/from
                                in the collaborative                                                                                    I
                                                                                                                  XGSP                      O
                                session




                                                                                                                                                  •••
                                                                                                                  Data from
                                                                                                                  master client         R
                                                                                                                                             Other client
                                                                                                                                    F
                                                                                                                                            SVG browser n
                                                                                                                  Control to/from
                                                                                                                                        I
                                                                                                                  XGSP                      O




        This is monolithic SVG example
        Shows potential use of XGSP from GlobalMMCS project to
March 2,control collaborative applications
         2005                        Xiaohong Qiu                                                                                                            20
    Architecture of multiplayer game with SVG

                    XGSP
                                     Control to/from
                Session control
                    Server           SVG WS1,2, …, n




                                                                            Event (Message) Service Infrastructure
                  SVG WS 1                                                                                                             SVG display 1


                                  Rendering to                                                                       Rendering from




                                                          NaradaBrokering
                                  SVG display 2                                                                      SVG WS 2
                  SVG WS 2                                                                                                             SVG display 2

                                  Control to/from XGSP,                                                              Control to/from
                                  SVG display 2                                                                      SVG display 2
                      •••




                                                                                                                                           •••
                  SVG WS n                                                                                                             SVG display n




                    Internet         Control to/from
                     Game
                                     SVG WS1,2, …, n




                               This is decomposed SVG example

March 2, 2005                                 Xiaohong Qiu                                                                                             21
Decomposed SVG Experiments

    Convert a standalone application into
   distributed system by splitting Model and
   View.
    Where to split?
    How to split?
    How difficult to split?
    Is performance acceptable?
March 2, 2005       Xiaohong Qiu               22
  Three MVC approaches based on different communication mechanism
                 and interactive pattern between model and view



                                                                    Broker



                                                                    Pub/Sub
       Control




View             Model   View       Messages    Model      View                 Model




  a) classic                   b) request/response            c) publish/subscribe
(method-based)           (method-based or message-based)        (message-based)




March 2, 2005                        Xiaohong Qiu                                23
  Method-based MVC vs. message-based MVC

                                                             Broker




           register call back method
      A                                B        A                         B
            invoke call back method
            with event



            method based                                  message based




    What we are doing when we move from classic MVC (monolithic model)
    to M-MVC (decomposed model)


March 2, 2005                              Xiaohong Qiu                       24
      Decomposition of SVG browser into
             stages of pipeline
                                View                            Decomposition                       Model
                                                                    Point



                                              GVT tree’                            DOM tree’
                                                                                (after mutation)       SVG parser
                                       (GraphicsNode changes )
         Output (Renderer)
        (update image buffer)




                                                                                                                JavaScript
                                                                                                               (access and
                                                                                                              manipulate DOM
                                                                                                                 element)
                                               GVT tree                             DOM tree
                                                                                (before mutation)
                                        (GraphicsNode events)                     (DOM events)
         Input (UI events)
          (e.g. Mouse and
             key events)




    We analyzed flow of events in Batik to see where best to decompose into
    Model and View. There was no clear separation in original code
March 2, 2005                                             Xiaohong Qiu                                                         25
                     Important principals
   One should split at points where the original method based linkage
   involved serializable Java objects.
        Serialization is needed before the method arguments can be transported and this
        is familiar from Java RMI.

   “Spaghetti” classes implied that additional state information would
   need to be transmitted if we split at points where classes spanned
   interfaces from different modules.
        Batik often involved large classes that implemented many different interfaces.
        These interfaces often came from different parts of the program and crossed the
        possible stages mentioned above.

   Message-based MVC paradigm tends to force a more restrictive
   programming model
        All data are shared explicitly and not implicitly via interfaces crossing splitting
        lines.



March 2, 2005                            Xiaohong Qiu                                         26
  Implementation of Decomposed SVG Browser


               batch processing
               rendering request                     EventProcessor

JSVGCanvas                                                            NB                                       NB
                                                                                                               NB
Subscriber 2                             GVT
                                     Subscriber 2                     NB             NB event
                                                                                     NB event                                DOM
                                                                                                                          Subscriber 2
                                                                      client
                                                                      client                                   client
                                                                                                               client
  Rendering



                                                                                                                                          JavaScript
                                                                                                                                          Subscriber 2




JSVGCanvas                                              NB                                      NB
                                                                                                NB
Subscriber 2                             GVT
                                      Subscriber 2      NB                     NB event
                                                                               NB event                                       DOM
                                                                                                                           Subscriber 2
                                                       client                                   client
                                                                                                client
     Input                                             client


               vector events/event                                                                       EventProcessor
                  compression




                                     Figure 6.5 Decomposed SVG Browser in M-MVC paradigm




March 2, 2005                                                     Xiaohong Qiu                                                                 27
                                    Implicit State


                   Broker                                                 Broker



   A
   A                                       B              A                                   B
  View



                    Shared state



         Conventional shared state model                      Separated component/service model




            Implicit state needs to be serialized and integrated into the
            service model.


March 2, 2005                                  Xiaohong Qiu                                       28
         The changes bring up issues that
         cause a challenge to the system
     Timing becomes a compelling issue
        With the separation of client and Web Service server, original assumption and
        design principle break

        The time scope drastically increases from tens of microsecond level (e.g. a Java
        method call) to a few milliseconds level (network latency plus system overhead).


     Object serialization is a must have toolkit
        Messages, as a linkage vehicle, contains component information from
        both sides and keep context same


    Synchronization is a factor to consider for context
   consistency

March 2, 2005                         Xiaohong Qiu                                      29
  Performance and Analysis
   Experiments with decomposed Batik SVG browser based on M-
 MVC model.

   The decomposed Model and View interact with event-based
 message via messaging broker provided by NaradaBrokering.

     Many variables are set for testing scenarios, which including
          locations of Model, View and event broker
          runtime environment (e.g. OS and network connection)

     Analysis
         Relationship of user interactions and structure of mouse events
         Performance of fine-grained mouse events
         Factors (network latency and computation overhead, thread
       scheduling etc.) that affect overall system performance

March 2, 2005                      Xiaohong Qiu                            30
                       Definition of typical events of distributed applications

        Applications                           MacroEvent                            MicroEvent

Email                                        writing an email                        a key stroke
Instant Messenger                      writing one line of message                   a key stroke
Shared File System (P2P)                    downloading a file                           n/a
Distributed Simulation                      messaging passing                            n/a
                               (exchanging a message between components)
Internet TV Broadcast                       one-way buffering                     inter-frame delay
(Streaming Media)
Video/Audio                         multi-way buffering (interactivity)           inter-frame delay
Conferencing
Shared Browser                             loading a new URL                 a mouse click on a hyperlink
Shared Whiteboard               drawing a new graphics component (e.g. a         a mouse movement
                                        rectangle, a line, a path)
Multiplayer Online Game                      moving a piece                      a mouse movement
(e.g. chess)
Parallel Computing                updating a region held in a single node          message passing
                                                                            (exchanging a message between
                                                                                     components)

    March 2, 2005                                  Xiaohong Qiu                                       31
            Summary of typical distributed applications and characteristics
                                         Content               avg. min level of             network connectivity features
                                                                 interactivity
        Application               type       Rendering        Macro        Micro     band-       latency    reliabili   connectivit
                                             complexity       Event        Event     width      tolerance      ty         y type
                                                                                                  level

Email                      text, image             low         min       milli sec   low        minutes        no        point-to-
                                                                                                or above                  point

Instant Messenger          text                    low         sec       milli sec   low         second        no       multicast

Shared File System (P2P)   byte stream             n/a         min          n/a      high       minutes        yes      multicast
                                                                                                or above

Distributed Simulation     byte                    n/a         sec          n/a      high        100’s         yes       point-to-
                           message                                                              millisecs                 point

Internet TV/Broadcast      image,                  high        sec        .033 sec   high        second        no       broadcast
                           sound

Video/Audio Conferencing   image,                  high        sec        .033 sec   high        100’s         no       multicast
                           sound                                                                millisecs

Shared Whiteboard          text, image             high        sec         milli     low          10’s         yes      multicast
                                                                           sec                  millisecs

Multiplayer Online Game    text,                   high        sec         milli     low          10’s         yes      multicast
                           image,                                          sec                  millisecs
                           sound

Parallel Computing         byte                    n/a         large      > 10       high         10           yes       point-to-
                           message                                       microsec              microsecs                  point

    March 2, 2005                                         Xiaohong Qiu                                                       32
                 Performance Testing and timing points

 View (Client)                                                        Notification service   Model (Service)
                                                                       (NaradaBrokering)




T4     Output                  T3 DOM tree’ T2                T1                                  Event           DOM tree’
                   GVT tree’                       Event                                        Processor
     (Rendering)                  (mirrored)     Processor                                                     (after mutation)

                                                                                                                                   JavaScript
                                                                           Broker

       Input                       DOM tree        Event
                                                         T0                                         Event          DOM tree
                   GVT tree
     (UI events)                  (mirrored)     Processor                                        Processor    (before mutation)
                                                              T0


                                                     Machine A            Machine B                                                Machine C




 T0: A given user event such as a mouse click that is sent from View to Model.
 T1: A given user event such as a mouse click can generate multiple associated DOM change
events transmitted from the Model to the View. T1 is the arrival time at the View of the first of these.
 T2: This is the arrival of the last of these events from the Model and the start of the processing of
the set of events in the GVT tree
 T3: This is the start of the rendering stage
 T4: This is the end of the rendering stage
March 2, 2005                                                    Xiaohong Qiu                                                            33
                         Average Performance of Mouse Events
                                 Mousedown         Average of all mouse events (mousedown, mousemove, and
                                   events                                  mouseup)
Test      Test scenarios       First return –     First return –     Last return –       End Rendering
                               Send time: T1-T0   Send time: T1-T0   Send time: T’1-     T4-T0 (microseconds)
                               (milliseconds)     (milliseconds)     T0 (milliseconds)
No     distance     NB         mean ±     Stdd    mean ±    stdde    mean ±     stdd     mean ±      stddev
                    location   error      ev      error     v        error      ev       error
1      Switch       Desktop    33.6 ±     14.8    37.9 ±    18.7     48.9±      23.7     294.0±      173.0
       connects     server                        2.1                2.7
                               3.0                                                       20.0
2      Switch       High-      18.0 ±     2.8     18.9 ±    9.07     31.0 ±     17.6     123.0       91.2
       connects     end                           0.89               1.7
                    Desktop
                               0.57                                                      ± 8.9
                    server
3      Office       Linux      14.9 ±     2.8     21.0 ±    10.2     43.9 ±     20.5     414.0       185.0
       area         server                        1.3                2.6
                               0.65                                                      ± 24.0
4      Within-      Linux      20.0 ±     4.8     29.7 ±    13.6     49.5 ±     26.3     334.0       194.0
       City         cluster                       1.5                3.0
       (Campus      node
                               1.1                                                       ± 22.0
       area)        server
5      Inter-City   Solaris    17.0 ±     4.3     24.8 ±    12.8     48.4 ±     23.3     404.0       160.0
                    server                        1.6                3.0
                               0.91                                                      ± 20.0
6      Inter-City   Solaris    20.0 ±     6.4     29.6 ±    15.3     50.5 ±     26.0     337.0       189.0
                    server                        1.7                3.4                                  34
                               1.3                                                       ± 22.0
                                    Immediate bouncing back event
                                     Bouncing back     Average of all mouse events (mousedown, mousemove, and
                                         event                                 mouseup)
             Test scenarios
Test                                Bounce back –      First return –     Last return –       End Rendering
                                    Send time:         Send time: T1-T0   Send time: T’1-     T4-T0 (milliseconds)
                                    (milliseconds)     (milliseconds)     T0 (milliseconds)

No     distance      NB             mean ±     Stdde   mean ±     stdd    mean ±      stdd    mean ±        stddev
                     location       error      v       error      ev      error       ev      error
1      Switch        Desktop        36.8 ±     19.0    52.1 ±     19.4    68.0 ±      25.9    405.0 ±       159.0
       connects      server                            2.8                3.7
                                    2.7                                                       23.0
2      Switch        High-end       20.6 ±     12.3    29.5 ±     13.8    49.5 ±      29.4    158.0 ±       109.0
       connects      Desktop                           1.5                3.1
                     server
                                    1.3                                                       12.0
3      Office area   Linux          24.3 ±     11.0    36.3 ±     14.2    54.2 ±      21.9    364.0 ±       166.0
                     server                            1.9                2.9
                                    1.5                                                       22.0
4      Within-City   Linux          15.4 ±     7.6     26.9 ±     11.6    46.7 ±      20.6    329.0 ±       179.0
       (Campus       cluster node                      1.6                2.9
       area)         server
                                    1.1                                                       25.0
5      Inter-City    Solaris        18.1 ±     8.8     31.8 ±     14.5    54.6 ±      32.8    351.0 ±       179.0
                     server                            2.2                4.9
                                    1.3                                                       27.0
6      Inter-City    Solaris        21.7 ±     9.8     37.8 ±     19.3    55.6 ±      23.6    364.0 ±       176.0
                     server                            2.7                3.4
                                    1.4                                                       25.0          35
                     Basic NB performance in 2 hops and 4 hops

                                 2 hops                    4 hops
                         (View – Broker – View)            (View – Broker – Model –
Test                                                       Broker – View)
                               milliseconds                        milliseconds
No                    mean ± error                stddev   mean ± error       stddev
1                      7.65 ± 0.61                 3.78     13.4 ± 0.98           6.07
2                      4.46 ± 0.41                 2.53     11.4 ± 0.66           4.09
3                      9.16 ± 0.60                 3.69     16.9 ± 0.79           4.85
4                      7.89 ± 0.61                 3.76      14.1 ± 1.1           6.95
5                      7.96 ± 0.60                 3.68     14.0 ± 0.74           4.54
6                      7.96 ± 0.60                 3.67     16.8 ± 0.72           4.47




     March 2, 2005                        Xiaohong Qiu                               36
                           Observations I
   This client to server and back transit time is only 20% of the total processing time in
   the local examples.

   The overhead of the Web service decomposition is not directly measured in tests
   shown these tables

   The changes in T1-T0 in each row reflect the different network transit times as we
   move the server from local to organization locations.

   This overhead of NaradaBrokering itself is 5-15 milliseconds depending on the
   operating mode of the Broker in simple stand-alone measurements. It consists
   forming message objects, serialization and network transit time with four hops (client
   to broker, broker to server, server to broker, broker to client).

   The contribution of NaradaBrokering to T1-T0 is about 30 milliseconds in preliminary
   measurements due to the extra thread scheduling inside the operating system and
   interfacing with complex SVG application.

   We expect the main impact to be the algorithmic effect of breaking the code into two,
   the network and broker overhead, thread scheduling from OS.

March 2, 2005                          Xiaohong Qiu                                          37
                                        Comparison of performance results to
                                        highlight the importance of the client
 Events per        Message transit time in M-MVC Batik browser                                             Events per                          Message transit time in M-MVC Batik browser
16ms bin
  5                                                                                                         40
                                                                   all events                              5 ms bin                                                                                     all events
                                                          All Events event
                                                                mousedown
                                                                mouseup event
                                                                                                                                                                                           All Events   mousedown event
                                                                                                                                                                                                        mouseup event
14                                                                                                                          35
                                                          Mousedown
                                                                mousemove event
                                                                                                                                                                                           Mousedown    mousemove event


                                                          Mouseup                                                                                                                          Mouseup




                                                                                   number of events in 5 millisecond bins
12                                                                                                                          30

                                                          Mousemove                                                                                                                        Mousemove
10                                                                                                                          25



8                                                                                                                           20



6                                                                                                                           15

                                                                                                                                                                                      Configuration:
                                                                                                                                                                                      NB on View ; Model and View on tw o desktop PCs;
                                                                                                                                                                                      local sw itch netw ork connection;
4                                                                                                                           10                                                        NB version 0.97; TCP blocking protocol;
                                                                                                                                                                                      normal thread priority for NB;
                                                                                                                                                                                      JMS interface; no echo of messages from Model;


2                                                                                                                           5



0                                                                                                                           0
     0   10   20     30       40      50          60       70     80        90    100                                            0   10   20     30       40      50          60          70           80           90          100
                          minimum T1-T0 in milliseconds                                                                                               minimum T1-T0 in milliseconds

                                                                Time T1-T0 milliseconds

                                                                                      NB on View; Model and View on two
         NB on Model; Model and View on
                                                                                      desktop PCs with “high-end” graphics
         two desktop 1.5 Ghz PCs; local
                                                                                      Dell (3 Ghz Pentium) for View; 1.5 Ghz
         switch network connection.
          March 2, 2005                                                               Dell for
                                                                                 Xiaohong Qiu model; local switch network   38
                                                                                      connection.
                                   Comparison of performance results with
                                      Local and remote NB locations
Events per         Message transit time in M-MVC Batik browser                Events per                                                             Message transit time in M-MVC Batik browser
                                                                                   15
 ms bin
 5
20                                                                            5 ms bin                                                                                                                      all events
                                                                 all events
                                                          All Events
                                                                 mousedown event                                                                                                            All Events event
                                                                                                                                                                                                  mousedown
18                                                               mouseup event                                                                                                                    mouseup event

                                                          Mousedown
                                                                 mousemove event                                                                                                            Mousedown
                                                                                                                                                                                                  mousemove event

16
                                                          Mouseup                                                                                                                           Mouseup




                                                                                         number of events in 5 millisecond bins
14                                                        Mousemove                                                                                                                         Mousemove
                                                                                                                                  10

12


10


8
                                                                                                                                  5
6
                                                                                                                                                                                                  Configuration:
                                                                                                                                                                                                  NB on View ;netw ork connection;tw o d
                                                                                                                                                                                                  local sw itch Model and View on
4                                                                                                                                                                                                 NB version 0.97; TCP for NB; protocol
                                                                                                                                                                                                  normal thread priority blocking
                                                                                                                                                                                                  JMS interface; no echo of messages fr

2

                                                                                                                                  0
0                                                                                                                                      0   10   20     30       40      50          60       70            80          90         100
     0   10   20     30       40      50          60      70     80     90         100
                                                                                                                                                            minimum T1-T0 in milliseconds
                                 Time T1-T0 milliseconds
                          minimum T1-T0 in milliseconds



         NB on local 2-processor Linux              NB on 8-processor Solaris server
         server; Model and View on two 1.5          ripvanwinkle; Model and View on
         Ghz desktop PCs; local switch              two 1.5 Ghz desktop PCs; remote
         network 2005                               network connection through routers.
          March 2, connection.            Xiaohong Qiu                               39
                          Observations II
   One usually gets better performance moving the NaradaBrokering broker off the
desktops; the better broker performance (there are no scheduling overheads) outweighs the
increasing network overhead.

   The performance of NB on desktop server is not as good as that in fig 7.5 with NB on
“gridfarm1” machine running Linux server.

   The results in fig. 7.7 (“ripvanwinkle” with 100 miles round trip distance) generates similar
pattern as in fig. 7.5 (local connection) except with a slightly lower performance
corresponding to the greater network delay for “ripvanwinkle”.

  Our results show that use of windows desktops to run NaradaBrokering is never good
even when one uses a machine running the model and view with no network delay.

    Windows scheduling introduces delays of 10-20 millisecond overhead that is much
larger than the 1-2 millisecond delays coming from network transit within the extended
university campus and the similar intrinsic processing time needed by NaradaBrokering on
a clean Linux/UNIX machine.

   We have not looked at a Windows server (which has a different scheduling algorithm
from desktop Windows) for NaradaBrokering; this could be better than the desktop
Windows used in tests.
March 2, 2005                            Xiaohong Qiu                                       40
                                                            Message transit time in M-MVC Batik browser
                                         20
                                                                                                          all events
                                                                                                          mousedown event
                                         18                                                               mouseup event           This illustrates that
                                                                                                          mousemove event
                                                                                                                                  this type of HPC
                                         16
                                                                                                                                  engine can be used in
number of events in 5 millisecond bins




                                                                                                                                  Web Server mode
                                         14
                                                                                                                                  with each node
                                         12
                                                                                                                                  running different
                                                                                                                                  services. We are only
                                         10                                                                                       using one node and
                                                                                                                                  so this is not a
                                         8                                                                                        parallel computing
                                                                                                                                  application
                                         6


                                         4


                                         2


                                         0
                                              0   10   20     30       40      50          60      70     80     90         100
                                                                   minimum T1-T0 in milliseconds

                                         NB on one node of HPC Linux cluster; Model and View on two desktop PCs; routers
                                            March connection. A few events with timing greater than 100 milliseconds are not
                                         network 2, 2005                       Xiaohong Qiu                               41
                                         shown on the plot
                                                                             Comparison of performance results on 2
                                                                                     remote NB locations
                                          Events per
                                                             Message transit time in M-MVC Batik browser
                                                                                                                        Events per                                                             Message transit time in M-MVC Batik browser
                                                                                                                             15
                                          5
                                         30 ms bin                                                                      5 ms bin                                                                                                                  all events
                                                                                                           all events
                                                                                                    All Events
                                                                                                           mousedown event
                                                                                                                                                                                                                                      All Events event
                                                                                                                                                                                                                                            mousedown
                                                                                                                                                                                                                                            mouseup event
                                                                                                           mouseup event
                                                                                                    Mousedown
                                                                                                           mousemove event                                                                                                            Mousedown
                                                                                                                                                                                                                                            mousemove event
                                         25

                                                                                                    Mouseup                                                                                                                           Mouseup




                                                                                                                                   number of events in 5 millisecond bins
number of events in 5 millisecond bins




                                                                                                    Mousemove                                                                                                                         Mousemove
                                                                                                                                                                            10
                                         20




                                         15




                                         10                                                                                                                                 5




                                         5                                                                                                                                                                                              Configuration: and View on tw o de
                                                                                                                                                                                                                                        NB on View ;netw ork connection;
                                                                                                                                                                                                                                        local sw itch Model
                                                                                                                                                                                                                                        normal thread priority blocking
                                                                                                                                                                                                                                        NB version 0.97; TCP for NB; protocol;
                                                                                                                                                                                                                                        JMS interface; no echo of messages fro



                                         0                                                                                                                                  0
                                              0    10   20     30       40      50          60      70     80     90         100                                                 0   10   20     30       40      50          60       70        80          90         100
                                                                    minimum T1-T0 in milliseconds                                                                                                     minimum T1-T0 in milliseconds
                                                                                                    Time T1-T0 milliseconds

                                                  NB on 8-processor Solaris server                                           NB on 8-processor Solaris server
                                                  complexity; Model and View on                                              ripvanwinkle; Model and View on two
                                                  two desktop PCs; remote network                                            desktop PCs; remote network
                                                    March 2, 2005
                                                  connection through routers.                                       Xiaohong Qiu
                                                                                                                             connection through routers.      42
              Distribution of the mean of mouseup events                                                                                                          Distribution of the mean of mousemove events
 4                                                                                                                                                          6
                            NB on Model                                                                                                                                                                        NB on Model
                            NB on View                                                                                                                                                                         NB on View
                            NB on ripvanwrinkle                                                                                                                                                                NB on ripvanwrinkle
3.5
                                                                                                                                                            5

                      Mean Mouseup




                                                                                                                 number of events in 0.5 millisecond bins
 3
                                                                                                                                                                      Mean Mousemove
                                                                                                                                                            4
2.5



 2                                                                                                                                                          3


1.5
                                                                                                                                                            2

 1


                                                                                                                                                            1
0.5



 0                                                                                                                                                          0
  36     38   40    42     44         46                                           48   50    52     54     56                                               15               20                          25                         30
                                milliseconds                                             Distribution of the mean of mousedown events                                                      milliseconds
                                         8
                                                                                                                                                                     NB on Model

       Events                                                                  7
                                                                                                                                                                     NB on View
                                                                                                                                                                     NB on ripvanwrinkle

       Per 0.5 ms                                                                                                                                                                                    NB on Ripvanwinkle
                                    number of events in 0.5 millisecond bins




                                                                               6


                                                                                               Mean Mousedown                                                                                        NB on View
                                                                               5
                                                                                                                                                                                                     NB on Model
                                                                               4

                                                                                                                                                                                                     15 runs each
                                                                               3
                                                                                                                                                                                                     split over
         Mean ms                                                               2                                                                                                                     3 days

         March 2, 2005                                                         1
                                                                                                          Xiaohong Qiu                                                                                                  43
                                                                               0
             Distribution of the standard deviation of mouseup events                                                                                                                        Distribution of the standard deviation of mousemove events
 4                                                                                                                                                                              7
             NB on Model
          Standard Deviation
             NB on View
                                                                                                                                                                                              NB on Model
                                                                                                                                                                                         Standard Deviation
                                                                                                                                                                                           NB on View
3.5          NB on ripvanwrinkle                                                                                                                                                           NB on ripvanwrinkle
          Mouseup                                                                                                                                                               6
                                                                                                                                                                                         Mousemove




                                                                                                                                     number of events in 0.5 millisecond bins
 3
                                                                                                                                                                                5


2.5
                                                                                                                                                                                4

 2

                                                                                                                                                                                3
1.5


                                                                                                                                                                                2
 1


                                                                                                                                                                                1
0.5



 0                                                                                                                                                                              0
      8     9      10     11     12         13                                            14       15    16        17           18                                                  4            6          8        10             12   14       16      18
                                      milliseconds                                                                                                                                                                     milliseconds
                                                                                          Distribution of the standard deviation of mousedown events
                                                                                  6
          Events                                                                                          NB on Model
                                                                                                        Standard
                                                                                                          NB on View

          Per 0.5 ms                                                              5
                                                                                                          NB on ripvanwrinkle

                                                                                                                                                                                                                             NB on Ripvanwinkle
                                                                                                        Deviation
                                       number of events in 0.5 millisecond bins




                                                                                                        Mousedown                                                                                                            NB on View
                                                                                  4
                                                                                                                                                                                                                             NB on Model
                                                                                  3

                                                                                                                                                                                                                          15 runs each
            Mean ms
                                                                                  2                                                                                                                                       split over
                                                                                                                                                                                                                          3 days
                                                                                  1

            March 2, 2005                                                                                            Xiaohong Qiu                                                                                                                44
                                                                                  0
                                                                                      2        4           6               8                                                            10           12         14
                     Observations III

   Ripvanwinkle ALWAYS Better

   Means and Standard Deviations do not vary much from run to run

   Mouse Down has larger standard deviation when NB on Model

   Note Mouse Down has least model processing

   NB-Model and NB-View similar except for Mouse Down where NB-View
   better

   In an exploratory run with NB running over the local network on a Dell PC
   with Window XP (heavy loaded), we found very poor performance. For
   example, the mean of the mousedown event was 92 milliseconds compared
   to 16 milliseconds on ripvanwinkle


March 2, 2005                    Xiaohong Qiu                              45
    Summary of message-based MVC
   Provision of a universal paradigm with a service model converging
   desktop applications, Web applications, and Internet collaboration

   Web applications built on messages can achieve important features
   such as scalability

   The message-based approach is an indispensable part of the big
   picture of system design with a separate intermediate messaging
   layer
        Reduce deployment overhead of applications
        Increase portability of application by decoupling application architecture
        with underlying platforms

   It conforms to service oriented architecture with loosely coupled
   messages linkage, which we expect to have an increasingly
   important role for reusability, interoperability, and scalability

March 2, 2005                       Xiaohong Qiu                                46
SMMV vs. MMMV as MVC interactive patterns
                                                                Model 1   Model 2   Model m-1   Model m




                     Model




   View 1   View 2           View n-1   View n                  View 1    View 2    View n-1    View n




  a) Single Model Multiple View                                 b) Multiple Model Multiple View

  SIMD– A single control unit dispatches instructions to each processing unit.
  MIMD– Each processor is capable of executing a different program independent of the other
 processors. It enables asynchronous processing.
  SMMV generalizes the concept of SIMD
  MMMV generalizes the concept of MIMD
  In practice, SMMV and MMMV patterns can be applied in both asynchronous and synchronous
 applications, thus form general collaboration paradigms.

 March 2, 2005                                   Xiaohong Qiu                                             47
 Collaboration Paradigms
  Monolithic Collaboration
       All participating components are formed as replications of an existing application without
      explicit break up into a separate Model and View component as required by the Web service
      architecture.
         Works through interception of the events on a master application and allows messaging
      broker to multicast them to the collaborating clients.
            CGL applications of PowerPoint, OpenOffice and data visualization

   Web Service Collaboration framework
       Shared input port ─ replicated Web Service
            CGL applications including A/V conferencing, shared whiteboard, text chats and SVG chess
       Shared output port
            CGL shared display application

 SMMV and MMMV collaboration model (integration of desktop and distributed
models)
       SMMV ─ decomposed Model and View with multiple clients sharing a single Model
      component.
            Instructor led learning
       MMMV ─ decomposed Model and View with multiple models each driving its own separate
      View. It enables ubiquity with the customization done from the Model at server side.
            Participatory learning



March 2, 2005                                         Xiaohong Qiu                                      48
                                  Monolithic collaboration
                                                   NaradaBrokering



                                        SVG         SVG         SVG            SVG
                                       browser     browser     browser        browser
                                        master      master
                                                    other       master
                                                                other          other
                                                                               master
                                        client      client      client         client




                              Identical programs receiving identical events




      Collaboration paradigms deployed with M-MVC model

                                                                                          NaradaBrokering
                      Model
                 as Web Service

                                                                     Model              Model           Model        Model
                                                                     as WS              as WS           as WS        as WS

                 NaradaBrokering

                                                                     Broker             Broker              Broker   Broker



        View     View         View        View                       View               View                View     View
        master   other        other       other                      master              other              other     other
        client   client       client      client                     client              client             client    client



                                                                                             MMMV
                   SMMV
March 2, 2005                                                Xiaohong Qiu                                                      49
          Summary of Contributions
   Proposing an “explicit Message-based MVC” paradigm (MMVC) as the general
   architecture of Web applications

   Demonstrating an approach of building “collaboration as a Web service” through
   monolithic SVG experiments.
        As an example, we present architecture for three types of collaboration ─ monolithic, thin
         client, and interactive client.

   Bridging the gap between desktop and Web application by leveraging the existing
   desktop application with a Web service interface through “MMVC in a
   publish/subscribe scheme”.
        As an experiment, we convert a desktop application into a distributed system by modifying
         the architecture from method-based MVC into message-based MVC.

   Proposing Multiple Model Multiple View and Single Model Multiple View collaboration
   as the general architecture of “collaboration as a Web service” model.

   Identifying some of the key factors that influence the performance of message-
   based Web applications especially those with rich Web content and high client
   interactivity and complex rendering issues.

March 2, 2005                               Xiaohong Qiu                                              50
        Questions Answered
   Can MVC be implemented in a message-based fashion?
   What principles are there to govern the decomposition of a given application
   into M-MVC components?
   What is the performance of the message-based MVC and what factors
   influence it?
   How does M-MVC depend on the operating system, the application,
   machines and network?
   What is the relationship of collaboration and Web services with M-MVC
   paradigm?
   What is the way to define state and state changes in collaborative
   applications?
   How easy is it to convert an existing application to message-based MVC?
   What are the architectural and implementation principles to be used in
   building applications from scratch in a message-based MVC paradigm?


March 2, 2005                     Xiaohong Qiu                               51
                Future Work
    Analyze performance in other cases (Linux clients, Windows
   servers)
    Optimize Performance with closer integration with NaradaBrokering
   and cleaner data structures
      What is best publish-subscribe architecture for M-MVC?

    Apply M-MVC to other applications (e.g. OpenOffice)

   Use of Web Service specifications (WSRP, WS- Management) to
   define M-MVC

    Use of XGSP in Collaborative SMMV and MMMV

March 2, 2005                 Xiaohong Qiu                         52
                     Reference
         Thesis for download
      http://grids.ucs.indiana.edu/~xqiu/dissertation.html

        Thesis project
        http://grids.ucs.indiana.edu/~xqiu/research.html

         Publications and Presentations
         http://grids.ucs.indiana.edu/~xqiu/publication.html

         NaradaBrokering Open Source Messaging System
        http://www.naradabrokering.org

         Information about Community Grids Lab project and publications
         http://grids.ucs.indiana.edu/ptliupages/


March 2, 2005                     Xiaohong Qiu                            53

								
To top