Skip to content

QuickStart

Andy Malakov edited this page Nov 21, 2013 · 36 revisions

General description of this tool can be found here.

Install

Download project sources. The following notes assume that you placed them into FIX_LATENCY_METER directory.

###1. Install Libpcap library Download and install libpcap.

  • Linux users: download and install libpcap. We tested with version 1.4.0. You need to extract .tar and build it. Installation instructions can be found on internet.

  • Windows users should install winpcap. We tested with version 4.1.3.

###2. Install jNetPcap Java wrapper

  • Download jNetPcap library release for your OS. We tested with version 1.4.r1425.

  • Copy native libraries from this library into FIX_LATENCY_METER\bin. Windows users need to copy jnetpcap.dll and jnetpcap-pcap100.dll. Linux users should copy libjnetpcap.so.

  • Copy jnetpcap.jar into FIX_LATENCY_METER\lib.

Compile

###Ant users Build using Apache Ant:

cd FIX_LATENCY_METER
ant build

Run

Live traffic monitoring

If your computer has multiple network adapters or VPN software, you need to obtain a list of network interfaces. Run bin\live-traffic.cmd without arguments:

cd bin
live-traffic

You will see an output like:

Network devices found:
#0: \Device\NPF_{0093D9BE-190D-4B59-BF8F-D9CE04004DBE} [Marvell Yukon Ethernet Controller.]
#1: \Device\NPF_{BC81C4FC-242F-4F1C-9DAD-EA9523CC992D} [Intel(R) PRO/100 VE Network Connection (Microsoft's Packet Scheduler) ]

You will need interface ID to setup live capture (zero-based index of adapter in the above list).

COMMAND LINE ARGUMENTS: -in: - Specifies inbound protocol handler. For example: -in:timebase -out: - Specifies outbound protocol handler. For example: -out:fix:299 -csv:filename - Specifies file name of output file will latencies stats. [Optional] -interface:N - Specifies index of interface to listen on. Default is 0. -filter: - Specifies LIBPCAP capture filter, for example: "(tcp src port 2509) or (tcp dst port 2508)"

Network devices found: #0: \Device\NPF_{0093D9BE-190D-4B59-BF8F-D9CE04004DBE} [Marvell Yukon Ethernet Controller.]

Command line arguments:

  1. Interface to monitor traffic on (let's use interface #0).
  2. Source port number for inbound traffic (2509).
  3. FIX Tag value containing correlation ID in inbound messages (We specified tag QuoteEntryID(299)).
  4. Destination port number for outbound traffic (2508).
  5. FIX Tag value containing correlation ID in outbound messages (We specified tag QuoteID(117)).
  6. Capture filter
  7. Optional parameter specifying CSV file to produce.

live-traffic 0 2509 299 2508 117 "(tcp src port 2509) or (tcp dst port 2508)" latency.csv

TODO: Generate capture filter automatically?

Captured traffic processing

This tool can also process previously captured network traffic. For example you can setup your own capture using Wireshark or TCPDump and later process it via this tool.

Command line syntax is similar

cd bin
filed-traffic -pcap:d:\projects\fix-latency-meter\data\timebase.pcap  -in:fix:299 -out:fix:117 -dir:2509:2508

##Known limitations

  • This tool cannot handle large FIX messages. That is we currently do not re-assemble large FIX messages that were split between multiple TCP packets. We assume that your network's layer maximum packet size (MTU) is large enough to fit FIX messages that you are capturing. This should be true for most FIX traffic, with exception of SecurityDefinition(d) and MarketData-Snapshot/FullRefresh(W) messages containing many repeating groups. Default MTU size on Windows is 1500 bytes and can be set in Windows registry.
  • This tool cannot process SSL-encrypted traffic. If your broker/market data provider requires SSL connection you can use STUNNEL gateway to unwrap SSL encryption.
Clone this wiki locally