SWE 622- Distributed Systems - PowerPoint PPT Presentation

About This Presentation
Title:

SWE 622- Distributed Systems

Description:

For business transactions, the messages are line based and each ... Unplug the network cable. Shutdown the NIC, Network switch etc. Simulate Network latency ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 16
Provided by: csg8
Learn more at: https://cs.gmu.edu
Category:

less

Transcript and Presenter's Notes

Title: SWE 622- Distributed Systems


1
  • SWE 622- Distributed Systems
  • Project Phase I
  • Eric Barnes, David Chang, David Nelson
  • Fisayo Oluwadiya, Xiang Shen

2
Architecture
3
(No Transcript)
4
(No Transcript)
5
Message Format I
  • For business transactions, the messages are line
    based and each field is separated by a colon. The
    format is
  • OpexchangeNametraderNameproductquantityprice
    timeStamp
  • For example
  • Trader Messages
  • sellExchange1Trader2product_one043.530
  • buyExchange2Trader1product_two3400
  • Exchange Messages
  • sellExchange1Trader2product_one0123.4512372
    37965973
  • buyExchange1Trader2product_one756123.451237
    237970443

6
Message Format II
  • For clock synchronization , the messages are line
    based and each field is separated by a colon as
    well. The format is
  • Time request from trader to exchange
  • timeexchangeNametraderNametime
  • Time response from exchange to trader
  • timetime
  • For example
  • Trader Messages
  • timeE1T21237237964619
  • Exchange Messages
  • time1237237964534

7
Synchronization
  • Problem Traders (clients) need to determine the
    age of a message from Exchanges (servers).
  • Clocks are not guaranteed to be synchronized.
  • There may be non-trivial latency in the network
  • A solution is needed to determine clock-skew and
    network latency to compensate.

8
Synchronization
  • Clients will query Servers for timestamps.
  • Client will take a timestamp, and send a message
    to server for server time.
  • Server will take a timestamp upon receipt and
    immediately send it back to and the original
    client.
  • Client takes another timestamp upon receipt of
    the server response.
  • Client will calculate the network latency and
    clock skew.
  • Network latency will be one half of the
    difference between the two client timestamps.
  • Clock Skew will be the difference between the
    average of the two client timestamps and the
    server timestamp.
  • Client will maintain the clock skews for the
    Servers it receives messages from and use those
    values to determine message age.

9
Synchronization Mechanism
Server
Client
t1
t2
t3
  • After acknowledgement message has been received
    from the server, client will have client
    timestamps for t1 and t3, and a server timestamp
    for t2.
  • Client will assume that the network latency is
    approximately symmetrical, and that the server
    processing time is negligible.
  • The clock offset will be calculated by
    t2-(t1t3)/2.
  • This value will be stored in the client and used
    to determine message age.

10
Implementation For Synchronization
  • Assuming the server processing time is
    negligible.
  • Samples are taken every 5 seconds.
  • Each sample is averaged by three requests.
  • Only the latest sample is saved.

11
Deployment For Evaluation
  • More than one Exchange will be created
  • More than one trader will be created
  • Exchanges and traders will be deployed to team
    members laptops and/or GMU servers such as
    mason.gmu.edu or zeus.ite.gmu.edu

12
Test Cases For Exchange
  1. Exchange comes online and is ready to accept sell
    requests
  2. Exchange receives first sell order
  3. Exchange receives first buy order
  4. Exchange is already selling a product and
    receives another selling order and successfully
    processes it within set time limit
  5. Exchange is currently processing a buy order and
    receives another and successfully processes it
    within set time limit
  6. Exchange is shutdown after processing all orders
  7. Exchange shuts down normally
  8. Exchange crashes

13
Test Cases For Trader
  1. Trader comes online and is ready to send buy/sell
    orders
  2. Trader sends buy order
  3. Trader sends sell order
  4. Trader receives confirmation for buy/sell order
  5. Trader doesnt receive confirmation for buy/sell
    order within expected time limit
  6. Trader is unable to connect to Exchange
  7. Trader shuts down normally
  8. Trader crashes

14
Fault Simulation
  • Simulate clock skew
  • Modify the system clocks for exchanges and
    traders
  • Simulate Exchange/Trader failure
  • Use kill or task manager to terminate exchanges
    and traders
  • Simulate Network failure
  • Unplug the network cable
  • Shutdown the NIC, Network switch etc.
  • Simulate Network latency
  • Connect the trader and exchange via a SOCKS proxy
    server
  • Use open source server such as Simple SOCKS
    Server for Perl
  • Modify the code and randomly sleep a few seconds
    before forwarding the packets

15
Methods For Verification
  • Manually run the system and use our eye balls
  • Check the log files for verification
  • Possible automation via scripting, such as using
    Perl Win32GuiTest etc.
Write a Comment
User Comments (0)
About PowerShow.com