4th International Conference in Central Europe    on .NET Technologies             Transparent Mobility of      Distribute...
Contents             > Background & Motivation             > Search Agents case study             > OOAttachments approach...
Background> Previous work in Component-Based Aspect-Oriented  Software Architectures> A characteristic is that the compone...
Motivation> To transfer previous experience in attachments to  connect objects, instead of aspect-oriented  components> To...
Motivation> For example, it can be used by Client & Server  architectures to manage both location changes in a  transparen...
State of the art> This problem has been dealt in Mobile Agent Systems  Most of them are built on Java:     Aglets, Nomads...
Strong vs Weak Mobility         Strong Mobility                          Weak MobilityAgent processes are interrupted in  ...
Contents             > Background & Motivation             > Search Agents case study             > OOAttachments approach...
SearchAgents case study> There are a lot of resources over the Internet from  which we want to collect distributed informa...
SearchAgent implementation                                   >   The inheritance is not limited: we do not                ...
Contents             > Background & Motivation             > Search Agents case study             > The OOAttachments appr...
The OOAttachments approach> Features:     Objects can move autonomously among computers without      having to take into ...
The OOAttachments approach   > Objects are connected through entities called     Attachments                              ...
How it works: Communication                             Host A                                                           H...
How it works: Communication                                                              Host A                           ...
How it works: Communication> Inter-object communication is a very frequent operation: it must be as faster as possible> Co...
How it works: Mobility> The MoveObject service performs several steps:     The object to be moved and its communication p...
How it works: Mobility> Client behaviour:     If it has service requests being processed, the mobility process      waits...
Contents             > Background & Motivation             > Search Agents case study             > The OOAttachments appr...
Conclusions & Future work> An application can be easily adapted to benefit from  these features:     Objects do not have ...
Questions                                   2130/05/200 .NET Technologies 2006
Upcoming SlideShare
Loading in …5
×

Transparent Mobility of Distributed Objects using .NET

310 views

Published on

These slides presents a research line where we explored the support for code mobility and runtime software migration among systems. We developed a prototype in .NET Remoting (in 2006) to support transparent code mobility of distributed objects.

Our approach was based on separating the distribution and mobility concerns from the source code that contains the application logic in entities called attachments. Thus, attachments were high-level proxies responsible for creating communication channels and that were capable of managing dynamic location changes without affecting the objects in the case of mobility. This approach was implemented using a case study. The response time of distributed communication provided by our approach has been tested and compared with the remote communication provided by the primitives of .NET Remoting.

This work was presented in the 4th International Conference on .NET Technologies, Pilsen, Czech Republic, May-June 2006. The paper is available here: http://issi.dsic.upv.es/publications/articles_table?view=188

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Transparent Mobility of Distributed Objects using .NET

  1. 1. 4th International Conference in Central Europe on .NET Technologies Transparent Mobility of Distributed Objects using .NET Cristóbal Costa, Nour Ali, Carlos Millan, Jose A. Carsí
  2. 2. Contents > Background & Motivation > Search Agents case study > OOAttachments approach > Conclusions 230/05/200 .NET Technologies 2006
  3. 3. Background> Previous work in Component-Based Aspect-Oriented Software Architectures> A characteristic is that the components neglect distributed nor local references of their partners> Transparent entities called Attachments are responsible of:  Interconnecting components  Providing transparent mobility and communication Node1 Node2 Component1 Component2 Attachments 330/05/200 .NET Technologies 2006
  4. 4. Motivation> To transfer previous experience in attachments to connect objects, instead of aspect-oriented components> To provide a library to support the development of transparent mobility of distributed objects> These features must be provided:  A non intrusive and transparent way of programming  Code should not be precompiled nor preprocessed  Efficiency 430/05/200 .NET Technologies 2006
  5. 5. Motivation> For example, it can be used by Client & Server architectures to manage both location changes in a transparent way> Why the client object has to worry about its server? Server Client 530/05/200 .NET Technologies 2006
  6. 6. State of the art> This problem has been dealt in Mobile Agent Systems Most of them are built on Java:  Aglets, Nomads, MobJeX, Voyager, JADE, ProActive, …> There are few approaches on .NET but still in development  MAPNET, Nomad, EtherYatri.NET> Common characteristics of these approaches:  Agents are defined by means of inheritance.  In most of them, the agent has to define all its functionality in one method (usually “Run”) with a specific signature  Events are captured by overriding inherited methods  Communication among agents is realized: by using generic proxies (like “AgentProxy”), by passing messages, or by implementing specific services 630/05/200 .NET Technologies 2006
  7. 7. Strong vs Weak Mobility Strong Mobility Weak MobilityAgent processes are interrupted in The programmer must take carea transparent way of their processesIn order to implement strong mobility It is the programmer who savesthe ability of thread serialization is processes information before movingrequired. and restores it after moving.Two main alternatives: As no customization is needed, the By extending the Framework solution is more portable (e.g. JavaThreads [Bouchenak03]) → New releases of the Framework would make it useless By preprocessing the source or binary code (e.g. Brakes [Truyen00]) → Less eficiency 730/05/200 .NET Technologies 2006
  8. 8. Contents > Background & Motivation > Search Agents case study > OOAttachments approach > Conclusions 830/05/200 .NET Technologies 2006
  9. 9. SearchAgents case study> There are a lot of resources over the Internet from which we want to collect distributed information> The search grows as a tree, so we need to be able to explore the resources dynamically in a distributed way A B E C D> Our solution: to send only a few agents capable of establishing transparent mobile communications  Network resources are not overloaded, as there only are a few agents travelling through the network  Agents can exchange new subsearches without realizing where the others are  They are completely autonomous: they only come back with the results, so the sender could have been disconnected during the process (e.g. mobile clients) 930/05/200 .NET Technologies 2006
  10. 10. SearchAgent implementation > The inheritance is not limited: we do not have to inherit from a specific class to benefit from mobility > By this way, an object is made remotely accessible to others > A specific interface can be specified to restrict offered services > An object obtains a reference of a remote object by specifying its ID and current location > The remote reference is a transparent proxy that provides all the remote methods > By this way, an object moves itself to another host > There are no need to use specific methods and signatures for being called when object mobility finishes > Parameters can also be provided (e.g. for providing initialization information) 1030/05/200 .NET Technologies 2006
  11. 11. Contents > Background & Motivation > Search Agents case study > The OOAttachments approach > Conclusions 1130/05/200 .NET Technologies 2006
  12. 12. The OOAttachments approach> Features:  Objects can move autonomously among computers without having to take into account how distributed communications with other objects are performed  Since a connection is established, location-awareness is provided  No need for a centralized infrastructure to manage mobility and object registration services  Dynamic code generation and reflection is combined in order to be able of calling code dynamically, so code precompilation is not needed> Constraints:  Weak mobility is provided, so objects must take care of their threads before moving  In order to establish the first connection, a client object needs to know where the server object is located  Each mobile object must be marked as Serializable  The middleware must be running in each computer 1230/05/200 .NET Technologies 2006
  13. 13. The OOAttachments approach > Objects are connected through entities called Attachments Host A Host B [Serializable] [Serializabl e] Attachment «generated-code» AttachmentServ er Serv er-AttClient objectName: string IDeserializationCallback 1 «NonSerialized» objRef: object Search Search [Serializable] objType: T ype AttachmentClient attClientsURLs: string [0..*] (ArrayList) methodInformation: MethodInfo [1..*] serverIsMovi ng: bool parentType: stri ng serverURL: string AttachmentServer(objRef, objectName, objType) Agent 1 Agent 2 serviceIsConsum ing: bool[] BeginServerMobility() : void EndServerMobility(objectReference) : void Process(methodID, args) : object BeginClientMobility() : void EndClientMobili ty() : void [NonSerialized] 1 StopProcessingServices() : void MarshalByRefObject AttachmentServ erMediator [NonSerialized] 1 methodsList: Delegate[] MarshalByRefObject AttachmentClientMediator RegisterClient(attClientURL) : MethodInfo[1..*] ServerM obilityBegan() : void UnRegisterClient(attClientURL) : void ServerM obilityEnded(newURL) : void RedirectService(methodID, args) : objectClient behaviour: Server behaviour:It invokes “NotifyNewLocation” Object layer It offers the “NotifyNewLocation” serviceClient behaviour: Server behaviour:provided by the AttachmentClient Attachments layer provided by the AttachmentServer .NET Remoting layer > Attachments are created through the AttachmentsManager class 13 30/05/200 .NET Technologies 2006
  14. 14. How it works: Communication Host A Host B Attachment Search Search Agent 1 Agent 2> Server-behaviour is defined by> Server-behaviour is defined by AttachmentServ er [Serializable] the AttachmentServer object the AttachmentServer object objectName: string «NonSerialized» objRef: object objType: Type  Incoming request services are forwarded Incoming request services are forwarded attClientsURLs: string [0..*] (ArrayList) serverIsMoving: bool towards the server object towards the server object AttachmentServer(objRef, objectName, objType)  It notifies about mobility to its connected It notifies about mobility to its connected BeginServerMobility() : void EndServerMobility(objectReference) : void objects objects  One entity is serializable (Marshal By One entity is serializable (Marshal By [NonSerialized]1 MarshalByRefObject Value), so its state can be migrated, and Value), so its state can be migrated, and AttachmentServ erMediator the other is accessible remotely (Marshal the other is accessible remotely (Marshal methodsList: Delegate[] By Reference) By Reference) RegisterClient(attClientURL) : MethodInfo[1..*] UnRegisterClient(attClientURL) : void RedirectService(methodID, args) : object 14 30/05/200 .NET Technologies 2006
  15. 15. How it works: Communication Host A Host B Attachment Search Search Agent 1 Agent 2 [Serializable] «generated-code» Serv er-AttClient > Client-behaviour is defined by the > Client-behaviour is defined by theIDeserializationCallback 1 [Serializable] AttachmentClient object AttachmentClient object AttachmentClient methodInformation: MethodInfo [1..*] > Composed by: > Composed by: parentType: string serverURL: string  A runtime generated proxy (MSIL) of the A runtime generated proxy (MSIL) of the serviceIsConsuming: bool[] remote object remote object Process(methodID, args) : object BeginClientMobility() : void  A remote accessible object which allows A remote accessible object which allows EndClientMobility() : void StopProcessingServices() : void to be notified about server mobility to be notified about server mobility [NonSerialized]  A serializable object that A serializable object that 1 MarshalByRefObject manages the attachmentClient state, manages the attachmentClient state, AttachmentClientMediator forwards services to the attachmentServer forwards services to the attachmentServerServerMobilityBegan() : voidServerMobilityEnded(newURL) : void 15 30/05/200 .NET Technologies 2006
  16. 16. How it works: Communication> Inter-object communication is a very frequent operation: it must be as faster as possible> Communication is established dynamically on demand, so dynamic code invocation must be used  Its performance is: Reflection < Delegates << Direct Calls (code generation)> We dynamically generate code on establishing a connection in order to reduce these costs> Total introduced communication costs:  3 direct calls + 1 dynamic invocation (through delegates) ≈ +11% 1630/05/200 .NET Technologies 2006
  17. 17. How it works: Mobility> The MoveObject service performs several steps:  The object to be moved and its communication processes (attachments) are packaged in a MobilityPackage object  This is serialized and transferred to the target host  Before unpacking, it is checked whether the required assemblies are available. If not, they are downloaded from the source host  The information is unpacked and, when communication processes are restored, the transferred object runs by invoking its specified method  If anything fails, all information is restored properly> Simultaneous mobility is also supported  An object can move to another host while other objects, that are connected to it, are being moved at the same time> The mobility process depends on the role of the object to be moved 1730/05/200 .NET Technologies 2006
  18. 18. How it works: Mobility> Client behaviour:  If it has service requests being processed, the mobility process waits until they finish properly (weak mobility)  When mobility finishes, object state is restored, including its connections with remote objects> Server behaviour:  Before moving, pending requests from client objects must finish first  New requests from client objects are blocked (at the attachment level) until mobility finishes.  When mobility finishes, all communication processes are restored and client requests are processed 1830/05/200 .NET Technologies 2006
  19. 19. Contents > Background & Motivation > Search Agents case study > The OOAttachments approach > Conclusions 1930/05/200 .NET Technologies 2006
  20. 20. Conclusions & Future work> An application can be easily adapted to benefit from these features:  Objects do not have to take into account what communication technology is used  Objects benefit from transparent (weak) mobility and distributed communications in a non-intrusive way  After establishing a connection, location-awareness of connected objects is provided> Further work:  Adaptability to Service-Oriented infrastructures, such as WCF  To provide security features to validate incoming code, such as by signing assemblies and by establishing trusted relations> OpenSource project home page: http://workspaces.gotdotnet.com/OOAttachments 2030/05/200 .NET Technologies 2006
  21. 21. Questions 2130/05/200 .NET Technologies 2006

×