260 likes | 273 Views
Message-Passing Communication Analyzer By Poonam Bijlani CSE 775- Distributed Objects Prof. Jim Fawcett. Project Overview. The message passing Communication Analyzer is implemented as a two way communication subsystem using .NET Remoting. Xml Messages are passed between the client and server.
E N D
Message-Passing Communication AnalyzerByPoonam BijlaniCSE 775- Distributed ObjectsProf. Jim Fawcett
Project Overview • The message passing Communication Analyzer is implemented as a two way communication subsystem using .NET Remoting. • Xml Messages are passed between the client and server. • The system can be configured in any of the following activation modes: • Singleton – one object for all clients • Single Call – one object created for each call to the server • Client Activated – one object for each client • Configuration files are used to establish any of the activation modes
Project Overview..contd • Sponsors are implemented to prevent the communication object from timing out if it is implemented as singleton or client activated. • Average time to service a message is found by sending a stream of continuous messages between client and server.
Context Diagram Communication using .Net Remoting Xml Messages Messages I/P Marshal ByRef User Interface Input and Client Proxy Server Output O/P Object Errors Errors Errors Errors
Configuration files, Controls and Interfaces • Configuration Filesused to set the remoting infrastructure between client and server. Also used to set the activation model. • Controls • XML Generator: Generates XML messages of required size • HiRes Timer: Calculates the time, in microseconds, to send and receive a message from the client to the server and back. • Interfaces • ILease and ISponsor: Used for Lifetime management of Client Activated and Singleton Objects
Sponsors • .NET Remoting uses a lease-based form of distributed garbage collection to manage the lifetime of remote objects. • MyClientSponsor Class on the client side is used to renew the lease for Singleton and Client Activated objects after they have expired • The sponsor implements the ISponsor interface and registers the Sponsor using the Register( ) method of the ILease interface. • The Lease Manager calls the renewal( ) method to renew the lifetime of the objects. I have used a time span of 20 seconds which means that the Lease Manager renews the objects lease time by 20 seconds each time it calls the renewal ( ) method.
Client- Thread and Queues • Queues • Send Queue • Receive Queue • Threads • Main Thread- Handles GUI and queues request for server • Communication Thread: Takes care of communication • Receive Thread: De-queues messages posted by the communication thread and populates GUI
Server – Threads and Queues • Queues • Send Queue • Receive Queue • Blocking Queues implemented on both client and server to avoid wasting CPU cycles • Threads • Communication Thread- Takes care of communication • Worker Thread- Responsible for serving the Client’s requests
Communication Subsystem SERVER Communication Communication CLIENT Thread Thread RECIEVE Q Child Thread SEND Q dequeues, processes request enqueues Main Thread response XML MESSAGES RECIEVE Q Main Thread enqueues server Receiver requests/ Thread notifications SEND Q Singleton/ SingleCall/ ClientActivated Remotable Object
Uses • Calculate performance of distributed applications using messages up to 100Kb eg. Chat Applications • Can be modified by using PassByReference file transfer to measure the performance of distributed file systems, eg. FTP • Can be used to compare speeds of different networks eg. Dial-up, Broadband etc.
Conclusion • A message passing communication analyzer was successfully built and implemented using .NET remoting • Further, it was operated in three modes: Singleton, Single Call and Client Activated • A HiRes Timer was used to analyze the performance of the system with increasing message sizes for a single client and up to 8 clients for a single message size. • Tests indicated that distributed applications where state preservation is not required, a client activated object should be preferred over Single Call. • Further choice of activation mode depends on the specific requirements of the application under consideration.
Thank You Questions?