Git Product home page Git Product logo

lagscope's Introduction

lagscope

Summary

A Linux/Windows tool to measure the network transport layer latency.

Features

  • Support network transport layer latency measurement (round-trip latency).

  • Support specifying ping message size, and ping interval.

  • Support two test modes: test-duration mode and ping-iteration mode.

  • Support histogram reporting and percentile reporting.

  • Support interop test with Windows latte.exe.

  • Support running natively on both Linux and Windows Operating Systems.

Getting Started

Building & installing lagscope

Linux:

Install cmake & gcc and then run the following commands in "terminal shell".

./do-cmake.sh build
./do-cmake.sh install

lagscope is installed to /usr/local/bin/lagscope.

Windows:

Download Build Tools for Visual Studio; then install C++ build tools workload with default options and then run the following commands in "Developer Command Prompt".

.\do-cmake.bat build
.\do-cmake.bat install

lagscope is installed to C:\Program Files (x86)\Lagscope\bin\lagscope.

Usage

lagscope -h

Known issues

  • UDP is not supported.

Examples of how to run lagscope as a receiver

To measure the network TCP latency between two multi-core serves running Ubuntu 1604, NODE1 (192.168.4.1) and NODE2 (192.168.4.2).

On NODE1 (the receiver), run:

./lagscope -r

(Translation: Run lagscope as a receiver with default settings. See the output from ./lagscope -h for more details about the default settings.)

Example run Histogram

On NODE2 (the sender), run:

./lagscope -s192.168.4.1 -H -a10 -l1 -c98

(Translation: Run lagscope as a sender, with default test settings; report histogram value with customized factors.)

Example sender-side output from a given run:

simonxiao@NODE2:~/lagscope/src# ./lagscope -s192.168.4.1 -H -a10 -l1 -c98
lagscope 0.1.1
---------------------------------------------------------
13:19:44 INFO: New connection: local:13948 [socket:3] --> 192.168.4.1:6001
13:36:24 INFO: TEST COMPLETED.
13:36:24 INFO: Ping statistics for 192.168.4.1:
13:36:24 INFO:  Number of successful Pings: 1000000
13:36:24 INFO:  Minimum = 30.994us, Maximum = 8699.894us, Average = 54.063us
Interval(usec)   Frequency
      0          0
     10          0
     11          0
     12          0
     ...
     50          75086
     51          116062
     52          36401
     53          27288
     54          19781
     55          16578
     56          29390
     57          8965
     58          8980
     59          8812
     60          8418
     ...
    100          519
    101          472
    102          849
    103          324
    104          324
    105          327
    106          291
    107          288
    108          6107

Example run Percentile

On NODE2 (the sender), run:

./lagscope -s192.168.4.1 -P

(Translation: Run lagscope as a sender. Prints these percentiles of the latencies: 50%, 75%, 90%, 95%, 99%, 99.9%, 99.99%, 99.999%.)

Option for dumping the latency frequency table into a JSON file, run:

./lagscope -s192.168.4.1 -Platencies_table.json

(Translation: Run lagscope as a sender. Prints percentiles and dumps a latency frequency table into a JSON file)

Example sender-side output from a given run:

paulkim@NODE2:~/lagscope/src# ./lagscope -s192.168.4.1 -P
lagscope 0.1.2
---------------------------------------------------------
17:49:03 INFO: New connection: local:13948 [socket:3] --> 192.168.4.1:6001
17:50:37 INFO: TEST COMPLETED.
17:50:37 INFO: Ping statistics for 192.168.4.1:
17:50:37 INFO:  Number of successful Pings: 1000000
17:50:37 INFO:  Minimum = 72.002us, Maximum = 4552.126us, Average = 92.055us

Percentile       Latency(us)
     50%         80
     75%         102
     90%         113
     95%         142
     99%         210
   99.9%         410
  99.99%         2566
 99.999%         3921


paulkim@NODE2:~/lagscope/src# ./lagscope -s192.168.4.1 -Platencies_table.json
lagscope 0.1.2
---------------------------------------------------------
17:49:03 INFO: New connection: local:13948 [socket:3] --> 192.168.4.1:6001
17:50:37 INFO: TEST COMPLETED.
17:50:37 INFO: Ping statistics for 192.168.4.1:
17:50:37 INFO:  Number of successful Pings: 1000000
17:50:37 INFO:  Minimum = 72.002us, Maximum = 4552.126us, Average = 92.055us
17:50:38 INFO: Dumping latency frequency table into json file: latencies_table.json

Percentile       Latency(us)
     50%         80
     75%         102
     90%         113
     95%         142
     99%         210
   99.9%         410
  99.99%         2566
 99.999%         3921

Example run to dump all latency values into a csv file

On NODE2 (the sender), run:

./lagscope -s192.168.4.1 -Rlatencies_log.csv

(Translation: Run lagscope as a sender and dumps latencies into a csv file)

Example sender-side output from a given run:

paulkim@NODE2:~/lagscope/src# ./lagscope -s192.168.4.1 -Rlatencies_log.csv
lagscope 0.1.2
---------------------------------------------------------
19:38:31 INFO: New connection: local:13948 [socket:3] --> 192.168.4.1:6001
19:38:32 INFO: TEST COMPLETED.
19:38:32 INFO: Ping statistics for 192.168.4.1:
19:38:32 INFO:  Number of successful Pings: 1000000
19:38:32 INFO:  Minimum = 96.083us, Maximum = 2828.121us, Average = 147.913us
19:38:32 INFO: Dumping all latencies into csv file: latencies_log.csv

Save latency frequency table graph as an image file

Installation Requirements:

  • Python3
  • pip3

Library Dependencies:

  • matplotlib
  • pandas
  • numpy

To install libraries:

pip3 install matplotlib pandas numpy

Known Issue:

Missing module, tkinter, not installed with Python3.

To install tkinter:

sudo apt-get install python3-tk

Usage

python3 visualize_data.py -h

To Run

python3 visualize_data.py -json freq_table.json -img freq_graph.png

Example run:

paulkim@NODE2:~/lagscope/src# python3 visualize_data.py -json freq_table.json -img freq_graph.png
INFO: Graph construction from freq_table.json is in progress...
INFO: Graph construction completed
INFO: Graph created in: freq_graph.png

Related topics

  1. Latte -- The Windows tool for latency measurement

  2. NTTTCP-for-Linux

  3. Microsoft Server & Cloud Blog

  4. HyperV Linux Integrated Services Test

Terms of Use

By downloading and running this project, you agree to the license terms of the third-party application software, Microsoft products, and components to be installed.

The third-party software and products are provided to you by third parties. You are responsible for reading and accepting the relevant license terms for all software that will be installed. Microsoft grants you no rights to third party software.

License

The MIT License (MIT)

Copyright (c) 2016 Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

lagscope's People

Contributors

amayer5125 avatar jimsparkman avatar jurajama avatar lubaihua33 avatar microsoft-github-policy-service[bot] avatar msftgits avatar paulkim-microsoft avatar pedroperezmsft avatar santoshx avatar simonxiaoss avatar sunnyguoqq avatar tomswartz07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lagscope's Issues

how can i build a release configuration in Windows?

I've tried editing the do-cmake.bat to pass in -DCMAKE_BUILD_TYPE=Release when creating the build or --target Release in conjunction with the --build parameter but in either scenarios, it's creating a debug build which requires VCRUNTIME140D.dll. From what I've gathered, this DLL cannot be redistributed. Where can I find a release build so I only need to install the publicly available vcredist to run lagscope.exe for Windows?

lagscope reports lower RTT latency in VM (WSL2) than in Windows host if using lagscope as receiver, but vice versa when using latte as receiver

Running two individual experiments:
Running lagscope from WSL2 VM targeting a remote (windows) device.
Running lagscope from the Windows host (of WSL2) targeting the same remote device.

lagscope reports lower RTT latency from WSL2 than from the host. Ran several runs and they all show consistent result. The expected behavior should have been that the host has lower RTT latency than from the VM.

See attached logs below.
winHost_lagscope_100Kpings_run2log.txt
wsl2_lagscope_100Kpings_run2log.txt

I tried with 1M pings (default) and saw the same result as well.

However, using the ping cmd showing the opposite result i.e. the host reports lower RTT latency than the WSL2 VM, which appears expected behavior. See below attached.
winHost_ping_1000pings_32bytes_run0.txt
wsl2_ping_1000pings_32bytes_run0.txt

lagscope running on Windows reports negative min value

Running lagscope sending from one windows host machine to a remote windows host machine with below lagscope cmd, and the min value reports negative value, which appears affecting the average value calculation.
winHost_lagscope_rawdata_1Mpings_ErrorNegativeMinValue_run0.csv

Looking from the attached rawdata csv file, there is one ping (out of 1M) which report a huge latency value, which seems to be messing up the calculation.

Index Latency(us)
437555 2450296064


c:\Users\wilson\Downloads\Tools>lagscope.exe -s192.168.1.4 -H -a100 -l250 -c98 -RwinHost_lagscope_rawdata_run0.csv
winHost_lagscope_rawdata_1Mpings_ErrorNegativeMinValue_run0.csv

lagscope 1.0.0

16:04:28 INFO: New connection: local:25001 [socket:232] --> 192.168.1.4:6001
16:56:19 INFO: TEST COMPLETED.
16:56:19 INFO: Ping statistics for 192.168.1.4:
16:56:19 INFO: Number of successful Pings: 1000000
16:56:19 INFO: Minimum = -1844671232.470us, Maximum = 206354.400us, Average = 1246.071us
16:56:19 INFO: Dumping all latencies into csv file: winHost_lagscope_rawdata_run0.csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.