OCEAN Demo Nachiket Acharya OCEAN Demo Demo Implementation

  • Slides: 19
Download presentation
OCEAN Demo Nachiket Acharya

OCEAN Demo Nachiket Acharya

OCEAN Demo • Demo Implementation of OCEAN • Component Implementation – Communication – TSM

OCEAN Demo • Demo Implementation of OCEAN • Component Implementation – Communication – TSM – Auction – No Security, Negotiation and Accounting

How to Start ? • ‘Java Run. OCEAN’ • It starts the application and

How to Start ? • ‘Java Run. OCEAN’ • It starts the application and listens for broadcasts and requests • you can buy, buy sell and stopsell • exit gracefully

When it is Started OCEANNode Command Line Interpreter Listen for Broadcasts Listen on Network

When it is Started OCEANNode Command Line Interpreter Listen for Broadcasts Listen on Network for Communication From Other nodes Port: 21117 Threads Network Multicast IP: 228. 5. 6. 7 Port: 6789

sell • Asks for Sell Rate per second and responds to broadcasts from buyers

sell • Asks for Sell Rate per second and responds to broadcasts from buyers • Multi-Threaded – can accept multiple buyers • If sell’ed sell again, asks for new Sell Rate per second

sell (continued…) OCEANNode set RATE_PER_SECOND respond to broadcasts Network

sell (continued…) OCEANNode set RATE_PER_SECOND respond to broadcasts Network

buy • Sends out a broadcast for the advertisement of requirement of resources •

buy • Sends out a broadcast for the advertisement of requirement of resources • Waits for 5 seconds for all the sellers to respond • Displays a list of sellers responded along with their IP addresses and Rate Information • Prompts for seller IP address

buy (continued) • Transfers ‘OCEANJob’ object to selected buyer • Waits for the response

buy (continued) • Transfers ‘OCEANJob’ object to selected buyer • Waits for the response from the buyer in a thread – non-blocking remote execution • Displays the Output to the user.

buy (continued) OCEANNode 3. Ask for seller IP 4. Migrate Job to selected seller

buy (continued) OCEANNode 3. Ask for seller IP 4. Migrate Job to selected seller 5. Intiate a thread to Wait for response 2. Initiate a thread to wait for responses From other OCEANnodes 1. Send Broadcast Network

stopsell • Zeros the Sell Rate per Second • Stops responding to any more

stopsell • Zeros the Sell Rate per Second • Stops responding to any more broadcasts from buyers • Doesn’t affect current tasks execution

stopsell (continued) OCEANNode set RATE_PER_SECOND to zero Stop responding to broadcasts Network

stopsell (continued) OCEANNode set RATE_PER_SECOND to zero Stop responding to broadcasts Network

exit • On the seller side, checks if the seller is active in executing

exit • On the seller side, checks if the seller is active in executing buyers task – YES – gives a message and doesn’t exit – NO – Exits gracefully • Exits on the buyer side.

Architecture of the System • class OCEANObject to communicate between any two OCEAN Nodes

Architecture of the System • class OCEANObject to communicate between any two OCEAN Nodes – Encapsulates • • code (integer) – to distinguish at the receiver side value (float) – to respond float values job (OCEANJob) – to migrate tasks Methods to operate on these data objects

Architecture (continued) • class OCEANJob to migrate taks – Implements interface Xinterface • public

Architecture (continued) • class OCEANJob to migrate taks – Implements interface Xinterface • public void remote() • public void local(OCEANObject) – Encapsulates • Two methods – remote() – executes at the seller side – local() – utilize the results set by the execution of remote() » Executes at the buyer side – Implementation forced by ‘Implementation of Xinterface’ • Data members on demand

Architecture (continued) OCEANObject int code float value OCEANJob job OCEANJob Data members – according

Architecture (continued) OCEANObject int code float value OCEANJob job OCEANJob Data members – according to need remote() local()

Architecture (continued) • class Sender and Receiver to encapsulate the function of sending and

Architecture (continued) • class Sender and Receiver to encapsulate the function of sending and receiving – Threaded classes • class OCEANAuction to contain static value of RATE_PER_SECOND • class OCEANSeller to represent various instance of Seller – Executes the remote method of OCEANJob object

Architecture (continued) • class Command. Line. Interpreter interprets the command initiates the appropriate execution

Architecture (continued) • class Command. Line. Interpreter interprets the command initiates the appropriate execution • Multithreaded architecture – does not block waiting for something • Broadcasting to the group for cheapest rates offered

Programming Effort • Atleast three threads running in the system at any time •

Programming Effort • Atleast three threads running in the system at any time • A separate thread for each execution of a remote task • 1100 lines of Java Code distributed over 8 classes and 1 Interface • 2 Weeks part-time effort

Thank you

Thank you