SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

13
SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto Stephanie Buchner

description

SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto Stephanie Buchner. Agenda. Project Design Overview Design Issues/Questions Planned Experiments Implementation Plan. Project Design Overview. Design Modules: Middleware - PowerPoint PPT Presentation

Transcript of SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Page 1: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

SWE 622 Exchange ProjectTeam 1 Design Review

Spring 2009

Yanyan ZhuVirat Kadaru

Koji HashimotoStephanie Buchner

Page 2: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

• Project Design Overview• Design Issues/Questions• Planned Experiments• Implementation Plan

Agenda

Page 3: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Design Modules:• Middleware

• Only job is to connect, send and receive messages.• Does not care about type of message being sent.• Has threads for sending, receiving, detecting connection failure etc.• Notifies trader/exchange of connection or delivery failure

• Trader• Each Trader is an Independent process• Has a reference to its own Middleware instance.• Maintains a list of Order echo’s received.

• Exchange• Each Exchange is an Independent process.• Has a reference to its own Middleware instance.• Maintains a list of Goods currently sold being sold and previous

orders processed.

• Messages• Many types of messages (order, echo, offset, etc)• Contains a super class ‘Message’ which acts as a header• Each message type (order, echo, etc) is a sub class of Message

Project Design Overview

Page 4: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Exchange

List of GoodsList of Traders

Project Design Overview

RMI

Send(async.)

Receive(callback)

List of OrdersList of Exchanges

Sending

Thread

ConnectionThread

Trader

Middleware

PToP

HeartbeatThread

ProcessingThread

ReceivingThread

ConnectionFailed(callback)

: rmi/p2p

: msg

Page 5: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

• OrderGenerator• Generates orders automatically at a

desired frequency• Can be stopped or started at anytime

• Configuration• Contains information about the exchanges• Type of communication (RMI/PToP)• Other information like IP and port of RMI

registry etc.

Project Design Overview

Page 6: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Design Issues/Solutions

• Absence of global clock• Order of echos/late echos

Page 7: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Design Issues/Solutions

• Absence of global clock– Which one has the correct time or which one to follow?– All nodes do not communicate with each other

• Solution– Each trader maintains an offset relative to each exchange that it is

connected to– Actual communication begins only after the offset is applied

• Other issues– How many samples of the offset should be taken?– Should they be averaged?– What about max and min values?

Page 8: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Trader’s List of Order Echoes – Verify Requirement: • Display all order echoes in the order they were

processed.• Some echoes may be outstanding (late) and may

not appear on the list. (A later order may appear, an earlier order is not on the list yet.)

• When a late echo appears, place in correct order. Mark as stale if > 10 seconds late.

Design Issue

Page 9: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Tools used in evaluation - AspectJ - Systems will communicate over a VPN

Dependent variable- Change configuration files at client side

Performance Evaluation

Page 10: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Measure the latency between issuing an orderand the last trader receiving its echo- Conduct this evaluation at client application level- Assumption: Trader Ti issues an order to Exchange Ey

- Get Ti’s time t(Ti) before issuing order- Get last Offset value (Oxy) between Tx (Trader x) and Ey

(Exchange y) before t(Ti) with (1<=x<=n), n:=trader number- Get each Tx’s time t(Tx) after receiving echo for Ti’s order A- The latency := Max( t(Tx) - Oxy)

Performance Evaluation Issue 1

1<=x<=n

Page 11: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Measure the latency between trader’s failureand the last exchange stopping order echoes- Conduct this evaluation at client application level- Both Trader and Exchange applications register listeners to

the Middleware, and middleware heartbeat each other- Assumption: Trader Ti goes down- Get last Offset value (Oiy) between Ti and Ey with(1<=y<=m),

m:= exchange number- Manually record Ti’s failure time ft(Ti)- Get the time st(Ey) when Ey decides to stop echoing to Ti

- The latency := Max(st(Ey)-Oiy)

Performance Evaluation Issue 2

1<=y<=m

Page 12: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

Calculate Clock Skew- Not using Global Network Protocol.- Trader and Exchange send offset messages periodically- Get all Offset values (Oxyτ) between Tx and Ey at τ time unit- Average Clock skew := AVG (Oxyτ – Oxyτ +1)- Maximum Clock skew := MAX (Oxyτ – Oxyτ +1) - The frequency of calculation is not decided yet.

Performance Evaluation Issue 3

Page 13: SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto

• Roles and ResponsibilitiesTrader – Virat and StephanieExchange – KojiMiddleware – Koji, allExperiments – Yanyan, all

Implementation Plan

3/22 3/29 4/5 4/12 4/19 4/26 4/30

CodingTesting

CodingExperiment

Presentation

Prj2

Prj3

• Development Timeline

Prototype Implementation

Evaluation Experiment