SWE 622 Exchange Project Team 1 Design Review Spring 2009 Yanyan Zhu Virat Kadaru Koji Hashimoto
description
Transcript of 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
• Project Design Overview• Design Issues/Questions• Planned Experiments• Implementation Plan
Agenda
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
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
• 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
Design Issues/Solutions
• Absence of global clock• Order of echos/late echos
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?
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
Tools used in evaluation - AspectJ - Systems will communicate over a VPN
Dependent variable- Change configuration files at client side
Performance Evaluation
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
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
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
• 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