MessagePassing Communication Analyzer By Poonam Bijlani CSE 775
Message-Passing Communication Analyzer By Poonam Bijlani CSE 775 - Distributed Objects Prof. Jim Fawcett
Project Overview l 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: 1. Singleton – one object for all clients 2. Single Call – one object created for each call to the server 3. Client Activated – one object for each client – Configuration files are used to establish any of the activation modes
Project Overview. . contd l Sponsors are implemented to prevent the communication object from timing out if it is implemented as singleton or client activated. l 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 User Interface I/P O/P Client Errors Proxy Marshal By. Ref Object Messages Server Errors Input and Output
GUI
Client Classes
Server Classes
Configuration files, Controls and Interfaces l l Configuration Files used 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 – Hi. Res Timer: Calculates the time, in microseconds, to send and receive a message from the client to the server and back. l Interfaces – ILease and ISponsor: Used for Lifetime management of Client Activated and Singleton Objects
Sponsors l . NET Remoting uses a lease-based form of distributed garbage collection to manage the lifetime of remote objects. l My. Client. Sponsor Class on the client side is used to renew the lease for Singleton and Client Activated objects after they have expired l The sponsor implements the ISponsor interface and registers the Sponsor using the Register( ) method of the ILease interface. l 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 l Queues – Send Queue – Receive Queue l 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 l Queues – Send Queue – Receive Queue – Blocking Queues implemented on both client and server to avoid wasting CPU cycles l Threads – Communication Thread- Takes care of communication – Worker Thread- Responsible for serving the Client’s requests
Communication Subsystem SERVER CLIENT Communication Thread RECIEVE Q SEND Q Main Thread Child Thread dequeues, processes request enqueues response XML MESSAGES RECIEVE Q Main Thread enqueues server requests/ notifications Receiver Thread SEND Q Singleton/ Single. Call/ Client. Activated Remotable Object
Client Activity Diagram
Server Activity
Event Trace Diagram
Singleton – 1 Client
Single Call – 1 Client
Client Activated – 1 Client
Comparative Graph- 1 Client
Singleton – Multi Client
Single Call – Multi Client
Client Activated – Multi Client
Comparative Graph- Multi Client
Uses l Calculate performance of distributed applications using messages up to 100 Kb eg. Chat Applications l Can be modified by using Pass. By. Reference file transfer to measure the performance of distributed file systems, eg. FTP l Can be used to compare speeds of different networks eg. Dial-up, Broadband etc.
Conclusion l A message passing communication analyzer was successfully built and implemented using. NET remoting l Further, it was operated in three modes: Singleton, Single Call and Client Activated l A Hi. Res 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. l Tests indicated that distributed applications where state preservation is not required, a client activated object should be preferred over Single Call. l Further choice of activation mode depends on the specific requirements of the application under consideration.
- Slides: 26