GithubHelp home page GithubHelp logo

netperftest's Introduction

NetPerfTest Tool(s)

Description

NetPerfTest is a collection of tools used to generate tests, run tests and collect network configuration, and performance statistics for diagnosis of networking performance issues.

Pre-Requisites

The goal here is to collect networking perf stats involving the Source and Destination machines that are needing diagnosis. To accomplish this, we will leverage multiple Powershell scripts. In order to be able to run Powershell scripts, we must set the powershell Execution Policy

Powershell.exe Set-ExecutionPolicy RemoteSigned -Force

Commands Generation

Now that our pre-requisites have been met, we can start the testing process. First, we must generate a bunch of relevant networking tests between these machines. Create a folder that will hold the output of these scripts, say: C:\Temp\MyDirectoryForTesting. Now that the folder is created, we're ready to generate the commands using the PERFTEST cmdlet :

.\PERFTEST.PS1 -DestIp DestinationMachineIP -SrcIP SourceMachineIP -OutDir "C:\Temp\MyDirectoryForTesting"

Note that the PERFTEST cmdlet generate the commands under a subdirectory msdbg.CurrentMachineName.perftest

The default configuration for the commands are outlined in Toolname.Config.json. If you would like you use a different configuration, pass in the name of the configuration. If you would like to make your own configuration, the name of the configuration must start with the toolname and can be added to the respective json file. Refer to Toolname.Config.md for more information on creating json configs.

.\PERFTEST.PS1 -DestIp DestinationMachineIP -SrcIP SourceMachineIP -OutDir "C:\Temp\MyDirectoryForTesting" -Config 'Detail'

Setup

Before proceeding to run the commands/tests that were generated above, we must enable Powershell Remoting. To setup the machine(s), please run the following command on each machine you wish to test (example: Destination and Source machine)

SetupTearDown.ps1 -Setup

We also have a cleanup script that we recommend you run after collecting the results (more on that below, in the Cleanup section)

Running the tool, collecting results

We are now at the phase where we will run the tests against the Source and Destination Machines and collect results for offline troubleshooting. The scripts use Powershell Remoting to kick off commands on the two machines to perform the networking tests. You will need to provide the same Source and Destination IPs as you did for commands generation. In addition you must provide the path to the directory of commands that was generated in the Commands Generation phase above. Ex: msdbg.CurrentMachineName.perftest

RunPerfTool was created as a powershell module with the idea of flexibility with its invocation (invoking from another script versus standalone invocations, etc)

We will thus need to import the Module like this: Import-Module -Force .\runPerftool.psm1 We will then invoke a single function in this module that will process all the commands and run them and gather the results. For further help with this function, run Get-Help ProcessCommands

The command to run tests is:

ProcessCommands -DestIp DestinationMachineIP -SrcIp SourceMachineIP -CommandsDir C:\Temp\MyDirectoryForTesting\msdbg.CurrentMachineName.perftest -SrcIpUserName SrcDomain\SrcUserName -DestIpUserName DestDomain\DestUserName

You will be prompted for password for both credentials. It is a Secure-string so your password will not be displayed or stored in clear text at any point.

Import-Module -Force .\runPerftool.psm1
ProcessCommands -DestIp DestinationMachineIP -SrcIp SourceMachineIP -CommandsDir C:\Temp\MyDirectoryForTesting\msdbg.CurrentMachineName.perftest -SrcIpUserName SrcDomain\SrcUserName -DestIpUserName DestDomain\DestUserName
For further help run 
Get-Help ProcessCommands

Once the script is complete, you should see the zip files from DestinationMachineIp and SourceMachineIP machines under the CommandsDir folder you specified (ex: C:\Temp\MyDirectoryForTesting\msdbg.CurrentMachineName.perftest)

At this point you are done! Don't forget to share the folder contents and run Cleanup step below.

Cleanup

After finishing running the relevant tests, it is recommended to run the cleanup script to undo the steps that were done in the Setup stage. To cleanup the machine(s), run the following command on each machine you leveraged for testing (Destination and Source machine)

SetupTearDown.ps1 -Cleanup

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

netperftest's People

Contributors

amao9098 avatar dcuomo avatar lgonzalez876 avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar omarcardona avatar tmolenh avatar vidyas00 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

Watchers

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

netperftest's Issues

ntttcp.exe udp commands are using the -w switch without the -a flag, causing an error

ntttcp.exe udp commands are using the -w switch without the -a flag, causing an error. Removing -w switch fixes the error.

ERROR: VerifyArgs failed: No support for WSA APIs with sync, GetLastError: 131 - An attempt was made to move the file pointer before the beginning of the file.
if (flags.wsa_flag && !flags.async_flag) {
PrintError(FUNCTION, "No support for WSA APIs with sync");
}

Need to fix latte command error (some commands are using -dump flag without -i flag)

The below commands are failing with error "-dump can be specified only for iteration (-i) based tests"

latte.exe -sa -c -a 172.16.1.4:50000 -t 10 -hist -hc 98 -hl 10 -tcp -snd b -so -dump C:\temp\msdbg.VM1.perftest\latte\tcp.t10.b.data.txt > C:\temp\msdbg.VM1.perftest\latte\tcp.t10.b.txt

latte.exe -sa -c -a 172.16.1.4:50000 -t 10 -hist -hc 98 -hl 10 -tcp -snd b -group 0 -rio -riopoll 100000000000 -so -dump C:\temp\msdbg.VM1.perftest\latte\tcp.t10.b.OPT.data.txt > C:\temp\msdbg.VM1.perftest\latte\tcp.t10.b.OPT.txt

latte.exe -sa -c -a 172.16.1.4:50000 -t 10 -hist -hc 98 -hl 10 -udp -snd b -so -dump C:\temp\msdbg.VM1.perftest\latte\udp.t10.b.data.txt > C:\temp\msdbg.VM1.perftest\latte\udp.t10.b.txt

latte.exe -sa -c -a 172.16.1.4:50000 -t 10 -hist -hc 98 -hl 10 -udp -snd b -group 0 -rio -riopoll 100000000000 -so -dump C:\temp\msdbg.VM1.perftest\latte\udp.t10.b.OPT.data.txt > C:\temp\msdbg.VM1.perftest\latte\udp.t10.b.OPT.txt

If an extra "/" is added to end of path used as a parameter for PERFTEST.PS1 or ProcessCommands, tests still run but fail to generate data without an error

If this is done, commands are misgenerated as follows (extra \):
[08/02/2021 15:11] Invoking Cmd - Machine: 192.168.200.80 Command: C:\Users\Administrator\Desktop\testTest\msdbg.WIN-PL5ABG8TFOC.perftest\\Receiver\ntttcp.exe -r -m 1,*,192.168.200.80 -l 65536 -a 2 -v -wu 2 -cd 2 -sp -p 50000 -t 10 -xml C:\Users\Administrator\Desktop\testTest\msdbg.WIN-

Is there any way to add multiple ports?

Trying to add multiple ports (dual port, bidirectional test) is there any way? noticed that we cannot
add multiple -DestIP and -Srclp .\PERFTEST.PS1 -DestIp 192.168.1.2 -SrcIp 192.168.1.3 -OutDir "C:\temp"

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.