Coder Social home page Coder Social logo

ethr's Introduction

Ethr Build Status

Ethr is a cross platform network performance measurement tool written in golang. The goal of this project is to provide a native tool for comprehensive network performance measurements of bandwidth, connections/s, packets/s, latency, loss & jitter, across multiple protocols such as TCP, UDP, HTTP, HTTPS, and across multiple platforms such as Windows, Linux and other Unix systems.

Ethr server in action

Ethr takes inspiration from existing open source network performance tools and builds upon those ideas. For Bandwidth measurement, it is similar to iPerf3, for TCP & UDP traffic. iPerf3 has many more options for doing such as throttled testing, richer feature set, while Ethr has support for multiple threads, that allows it to scale to 1024 or even higher number of connections, multiple clients communication to a single server etc. For latency measurements, it is similar to latte on Windows or sockperf on Linux.

Ethr provides more test measurements as compared to other tools, e.g. it provides measurements for bandwidth, connections/s, packets/s, latency, and TCP connection setup latency, all in a single tool. In the future, there are plans to add more features (hoping for others to contribute) as well as more protocol support to make it a comprehensive tool for network performance measurements.

Ethr is natively cross platform, thanks to golang, as compared to compiling via an abstraction layer like cygwin that may limit functionality. It hopes to unify performance measurement by combining the functionality of tools like iPerf3, ntttcp, psping, sockperf, and latte and offering a single tool across multiple platforms and multiple protocols.

Installation

Download

https://github.com/Microsoft/ethr/releases/latest

Linux

wget https://github.com/microsoft/ethr/releases/latest/download/ethr_linux.zip
unzip ethr_linux.zip

Windows Powershell

wget https://github.com/microsoft/ethr/releases/latest/download/ethr_windows.zip -OutFile ethr_windows.zip
Expand-Archive .\ethr_windows.zip -DestinationPath .

OSX

wget https://github.com/microsoft/ethr/releases/latest/download/ethr_osx.zip
unzip ethr_osx.zip

Building from Source

Note: go version 1.11 or higher is required building it from the source.

We use go-module to manage Ethr dependencies. for more information please check how to use go-modules!

git clone https://github.com/Microsoft/ethr.git
cd ethr
go build

If ethr is cloned inside of the $GOPATH/src tree, please make sure you invoke the go command with GO111MODULE=on!

Docker

Build image using command:

docker build -t microsoft/ethr .

Make binary:

Linux

docker run -e GOOS=linux -v $(pwd):/out microsoft/ethr make build-docker

Windows

docker run -e BINARY_NAME=ethr.exe -e GOOS=windows -v $(pwd):/out microsoft/ethr make build-docker

OS X

docker run -e BINARY_NAME=ethr -e GOOS=darwin -v $(pwd):/out microsoft/ethr make build-docker

Using go get

go get github.com/microsoft/ethr

Using ArchLinux AUR

Assuming you are using yay (https://github.com/Jguer/yay):

yay -S ethr

Publishing Nuget package

Follow the topic Building from Source to build ethr.exe

Modify ethr.nuspec to add new release version

vim ethr.nuspec

Create a nuget package(like Ethr.0.2.1.nupkg)

nuget.exe pack ethr.nuspec

Upload the package to nuget.org.

Usage

Simple Usage

Help:

ethr -h

Server:

ethr -s

Server with Text UI:

ethr -s -ui

Client:

ethr -c <server ip>

Examples:

// Start server
ethr -s

// Start client for default (bandwidth) test measurement using 1 thread
ethr -c localhost

// Start bandwidth test using 8 threads
ethr -c localhost -n 8

// Start connections/s test using 64 threads to server 10.1.0.11
ethr -c 10.1.0.11 -t c -n 64

// Run Ethr server on port 9999
./ethr -s -port 9999

// Measure TCP connection setup latency to ethr server on port 9999
// Assuming Ethr server is running on server with IP address: 10.1.1.100
./ethr -c 10.1.1.100 -p tcp -t pi -d 0 -4 -port 9999

// Measure TCP connection setup latency to www.github.com at port 443
./ethr -x www.github.com:443 -p tcp -t pi -d 0 -4

// Measure TCP connection setup latency to www.github.com at port 443
// Note: Here port 443 is driven automatically from https
./ethr -x https://www.github.com -p tcp -t pi -d 0 -4

// Measure ICMP ping latency to www.github.com
sudo ./ethr -x www.github.com -p icmp -t pi -d 0 -4

// Run measurement similar to mtr on Linux
sudo ./ethr -x www.github.com -p icmp -t mtr -d 0 -4

// Measure packets/s over UDP by sending small 1-byte packets
./ethr -c 172.28.192.1 -p udp -t p -d 0

Known Issues & Requirements

Windows

For ICMP related tests, Ping, TraceRoute, MyTraceRoute, Windows requires ICMP to be allowed via Firewall. This can be done using PowerShell by following commands. However, use this only if security policy of your setup allows that.

// Allow ICMP packets via Firewall for IPv4
New-NetFirewallRule -DisplayName "ICMP_Allow_Any" -Direction Inbound -Protocol ICMPv4 -IcmpType Any -Action Allow  -Profile Any -RemotePort Any

// Allow ICMP packets via Firewall for IPv6
New-NetFirewallRule -DisplayName "ICMPV6_Allow_Any" -Direction Inbound -Protocol ICMPv6 -IcmpType Any -Action Allow  -Profile Any -RemotePort Any

In addition, for TCP based TraceRoute and MyTraceRoute, Administrator mode is required, otherwise Ethr won't be able to receive ICMP TTL exceeded messages.

Linux

For ICMP Ping, ICMP/TCP TraceRoute and MyTraceRoute, privileged mode is required via sudo.

Complete Command Line

Common Parameters

	-h 
		Help
	-no 
		Disable logging to file. Logging to file is enabled by default.
	-o <filename>
		Name of log file. By default, following file names are used:
		Server mode: 'ethrs.log'
		Client mode: 'ethrc.log'
	-debug 
		Enable debug information in logging output.
	-4 
		Use only IP v4 version
	-6 
		Use only IP v6 version

Server Mode Parameters

In this mode, Ethr runs as a server, allowing multiple clients to run
performance tests against it.
	-s 
		Run in server mode.
	-ip <string>
		Bind to specified local IP address for TCP & UDP tests.
		This must be a valid IPv4 or IPv6 address.
		Default: <empty> - Any IP
	-port <number>
		Use specified port number for TCP & UDP tests.
		Default: 8888
	-ui 
		Show output in text UI.

Client Mode Parameters

In this mode, Ethr client can only talk to an Ethr server.
	-c <server>
		Run in client mode and connect to <server>.
		Server is specified using name, FQDN or IP address.
	-b <rate>
		Transmit only Bits per second (format: <num>[K | M | G])
		Only valid for Bandwidth tests. Default: 0 - Unlimited
		Examples: 100 (100bits/s), 1M (1Mbits/s).
	-cport <number>
		Use specified local port number in client for TCP & UDP tests.
		Default: 0 - Ephemeral Port
	-d <duration>
		Duration for the test (format: <num>[ms | s | m | h]
		0: Run forever
		Default: 10s
	-g <gap>
		Time interval between successive measurements (format: <num>[ms | s | m | h]
		Only valid for latency, ping and traceRoute tests.
		0: No gap
		Default: 1s
	-i <iterations>
		Number of round trip iterations for each latency measurement.
		Only valid for latency testing.
		Default: 1000
	-ip <string>
		Bind to specified local IP address for TCP & UDP tests.
		This must be a valid IPv4 or IPv6 address.
		Default: <empty> - Any IP
	-l <length>
		Length of buffer to use (format: <num>[KB | MB | GB])
		Only valid for Bandwidth tests. Max 1GB.
		Default: 16KB
	-n <number>
		Number of Parallel Sessions (and Threads).
		0: Equal to number of CPUs
		Default: 1
	-p <protocol>
		Protocol ("tcp", "udp", "http", "https", or "icmp")
		Default: tcp
	-port <number>
		Use specified port number for TCP & UDP tests.
		Default: 8888
	-r 
		For Bandwidth tests, send data from server to client.
	-t <test>
		Test to run ("b", "c", "p", "l", "cl" or "tr")
		b: Bandwidth
		c: Connections/s
		p: Packets/s
		l: Latency, Loss & Jitter
		pi: Ping Loss & Latency
		tr: TraceRoute
		mtr: MyTraceRoute with Loss & Latency
		Default: b - Bandwidth measurement.
	-tos 
		Specifies 8-bit value to use in IPv4 TOS field or IPv6 Traffic Class field.
	-w <number>
		Use specified number of iterations for warmup.
		Default: 1
	-T <string>
		Use the given title in log files for logging results.
		Default: <empty>		

External Mode Parameters

In this mode, Ethr talks to a non-Ethr server. This mode supports only a
few types of measurements, such as Ping, Connections/s and TraceRoute.
	-x <destination>
		Run in external client mode and connect to <destination>.
		<destination> is specified in URL or Host:Port format.
		For URL, if port is not specified, it is assumed to be 80 for http and 443 for https.
		Example: For TCP - www.microsoft.com:443 or 10.1.0.4:22 or https://www.github.com
		         For ICMP - www.microsoft.com or 10.1.0.4
	-cport <number>
		Use specified local port number in client for TCP & UDP tests.
		Default: 0 - Ephemeral Port
	-d <duration>
		Duration for the test (format: <num>[ms | s | m | h]
		0: Run forever
		Default: 10s
	-g <gap>
		Time interval between successive measurements (format: <num>[ms | s | m | h]
		Only valid for latency, ping and traceRoute tests.
		0: No gap
		Default: 1s
	-ip <string>
		Bind to specified local IP address for TCP & UDP tests.
		This must be a valid IPv4 or IPv6 address.
		Default: <empty> - Any IP
	-n <number>
		Number of Parallel Sessions (and Threads).
		0: Equal to number of CPUs
		Default: 1
	-p <protocol>
		Protocol ("tcp", or "icmp")
		Default: tcp
	-t <test>
		Test to run ("c", "cl", or "tr")
		c: Connections/s
		pi: Ping Loss & Latency
		tr: TraceRoute
		mtr: MyTraceRoute with Loss & Latency
		Default: pi - Ping Loss & Latency.
	-tos 
		Specifies 8-bit value to use in IPv4 TOS field or IPv6 Traffic Class field.
	-w <number>
		Use specified number of iterations for warmup.
		Default: 1
	-T <string>
		Use the given title in log files for logging results.
		Default: <empty>		

Status

Protocol Bandwidth Connections/s Packets/s Latency Ping TraceRoute MyTraceRoute
TCP Yes Yes NA Yes Yes Yes Yes
UDP Yes NA Yes No NA No No
ICMP No NA NA NA Yes Yes Yes

Platform Support

Windows

Tested: Windows 10, Windows 7 SP1

Untested: Other Windows versions

Linux

Tested: Ubuntu Linux 18.04.1 LTS, OpenSuse Leap 15

Untested: Other Linux versions

OSX

Tested: OSX is tested by contributors

Other

No other platforms are tested at this time

Todo List

Todo list work items are shown below. Contributions are most welcome for these work items or any other features and bugfixes.

  • Test Ethr on other Windows versions, other Linux versions, FreeBSD and other OS
  • Support for UDP latency, TraceRoute and MyTraceRoute

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.

ethr's People

Contributors

boyan-soubachov avatar der-onkel avatar fsouza avatar gbmsft avatar girishmotwani avatar ipankajg avatar julianxhokaxhiu avatar lylex avatar masahiro331 avatar mattn avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar mikeroyal avatar mingrammer avatar msftgits avatar nxadm avatar pgmsft avatar piotrzarycki avatar radu-matei avatar rishi1999 avatar scrollins avatar shmsr avatar ssambi avatar t-tomalak avatar u5surf avatar urnas avatar vearutop avatar vicky01anand avatar wmnsk avatar zhaojh329 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  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  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  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

ethr's Issues

ubuntu build failed

in my ubuntu

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial

go version

go version go1.6.2 linux/amd64

and I want to build Ethr

➜  Ethr git:(master) go build
# github.com/Microsoft/Ethr
./client.go:326: undefined: sort.SliceStable
./server.go:334: undefined: sort.SliceStable
./stats.go:34: undefined: sort.SliceStable
./utils.go:224: undefined: syscall.RawConn
./utils.go:228: ct.SyscallConn undefined (type *net.TCPConn has no field or method SyscallConn)
➜  Ethr git:(master)

As we can see,sort.SliceStable is not supported by go version 1.6.2, it is supported until go1.8. So, It will be better if you can add some guidance about go version or other which is supported by Ethr

MacOS Support - go build fails (779d5c1)

MacOS(Mojave)10.14.1 (18B75)
go1.11.2 darwin/amd64 (homebrew)
ITerm2 Build 3.2.6

$ go build
./serverui.go:88:2: undefined: hideCursor
./serverui.go:89:2: undefined: blockWindowResize
./stats.go:33:2: undefined: getNetDevStats
./stats.go:37:2: undefined: getTcpStats

-4 and -6 parameters are unrecognizable by ethr

Hello!

Subj.

Despite on -4 and -6 parameters, described in README.md file in Common Parameters paragraph, they are unrecognizable by ethr and are not displayed in help-info on -h key and when ethr is given without parameters.

Use-cases I've tested on: ./ethr -4 - s and ./ethr -4 -c <server_IP_to_connect_to>. Both of them return ethr's help-info.

Thanks!

Suggestion about using cobra cli

Now it has just simple cli arguments, how about using a modern cli command such as cobra for the future
If you want to build only pure golang without additional libraries or external dependencies, you can ignore this suggestion.

Error: could not get network stats

Hello.
The latest version built from f0074ae shows errors when launched as server:
could not get network stats
And also statistics section is empty when launched in UI mode.
Tested on Ubuntu 18.04

Build Failure

after a fresh git clone
doing go build fails with the following error

./serverui.go:89:2: undefined: hideCursor
./serverui.go:90:2: undefined: blockWindowResize
./stats.go:33:2: undefined: getNetDevStats
./stats.go:37:2: undefined: getTcpStats

Reverse Mode

There is some way to a client to send packets to a server instead server to client?

In a simpler way, there a way to a client do upload, instead of download?

Thanks!

Support for HTTP requests/s

This needs work to do HTTP requests from multiple threads to see how many requests/s it can push. This would be useful for testing performance of middle boxes like firewalls, proxies etc.

vs. iperf?

How does this compare to the "standard", meaning iperf3?
May i suggest you add a few words about that to the README? This isn't about which is better, it's more about how is this different.

Export metrics

Any plans to support exporting the metrics to Prometheus ?

Would allow this to be deployed to servers to track network stats over time. Quite useful.

TCP Latency test are not supported for external client mode

I'm getting the following error when trying to execute a tcp latency test

root@myserver:~# ethr -6 -c haproxy:9999 -m x -t l -n 25
Error: "Latency" test for "TCP" is not supported.

Please use "ethr -h" for ethr command line arguments.

According to the status, it says that latency tests are supported

Socket connection leak

Environment

Ethr version v0.1

  • Linux 4.14.81-coreos Container Linux by CoreOS 1911.4.0 Rhyolite Container Linux by CoreOS 1911.4.0 (Rhyolite)
  • Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz GenuineIntel GNU/Linux

What happend ?

Network performance degraded after socket reached CPU core limit. User have to restart server process to have normal performance data.

The connections will stuck at CLOSE_WAIT state after each test ran. This will reduce almost half the bandwidth, which in our case, bandwidth have gone done from 8 GBit/s to 5 GBit/s

Output of netstat -noa

tcp6	   0	  0 :::9999                 :::*                    LISTEN	117950/./ethr
tcp6  2861521	   0 10.33.3.25:9999         10.33.3.23:53702        CLOSE_WAIT  117950/./ethr
tcp6  2528001      0 10.33.3.25:9999         10.33.3.23:53762        CLOSE_WAIT  117950/./ethr
tcp6  2846801	   0 10.33.3.25:9999         10.33.3.23:53644        CLOSE_WAIT  117950/./ethr

How to reproduce

  1. Start server with ethr -s
  2. Watch network connection with watch 'netstat -noa | grep 9999'
  3. Start client connection with ethr -c <ip_address>, and repeat this multiple times, you should see the result after it reaches CPU core count on the server machine.

Use golang log module

Shouldnt we use golang log module in order to have better logs, so we can see line number and file of message?

openSUSE Leap 15 (server) + Ubuntu 18.04 and Win 7 (clients)

Hello!

README.md can be updated -- have successfully tested on openSUSE Leap 15 (as a server) + Ubuntu 18.04 and Windows 7 SP 1 ( as the clients).

Binaries were downloaded from links of Download section.

Here left is openSUSE Leap 15 machine and Ubuntu 18.04 on the right hand.
imag1288

Ubuntu 18.04 + Windows 7 SP 1 (from virtual machine).
imag1289

Thanks!

Enhance external mode TCP ping support

  • Better goroutine synchronization for exit tracking
  • Code cleanup for handling of warmup run
  • Support for custom number of warmup connections
  • Support for custom sleep between successive connections
  • Option to select -4 or -6 to force IP version
  • Logging the results in json format

Export metrics

Any plans to support exporting the metrics to Prometheus ?

Would allow this to be deployed to servers to track network stats over time. Quite useful.

Bandwidth tests for buffer size/packet size

What's the behavior supposed to be for the buffer parameter on a bandwidth test?
I've been taking tcpdumps thinking that it would increase the actual packet size but that doesnt seem to be the case. My test looks like

ethr -c ethr-server -t b -i 1 -l 40mb -d 5s
ethr -c ethr-server -t b -i 1 -l 2gb -d 5s

The packet length ramps up from 64 to 22848 and never changes based on what buffer size I give it. I saw an issue that was closed #16. I'm curious as to how one would go about crafting a packet size or what the buffer size is doing. If there is no way to do this, would you guys be open to PRs implementing that functionality? Thanks

Specify packet size

Hi

It is very useful to test bandwidth on different packet sizes. So it will be best to have special option for that.

Also, as idea: auto-test bandwidth with different packet sizes: 64, 128, 256...1500 or even jumbo frames.

centos6.5 ethr error

CentOS release 6.5 (Final)

[root@node172 ethr]# ./ethr -s
Listening on 9999 for TCP bandwidth tests
Listening on 9998 for TCP conn/s tests
Listening on 9996 for TCP latency tests
Listening on 9899 for HTTP bandwidth tests
Listening on 9799 for HTTPS bandwidth tests
Listening on 9896 for HTTP latency tests
Listening on 8888 for control plane
panic: runtime error: slice bounds out of range

goroutine 88 [running]:
github.com/microsoft/ethr/internal/stats.buildNetDevStat(0xc0012c4180, 0x7f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/sumscope/ethr/internal/stats/linux.go:84 +0x3f8
github.com/microsoft/ethr/internal/stats.osStats.GetNetDevStats(0x0, 0x0, 0x0, 0x0, 0x0)
/opt/sumscope/ethr/internal/stats/linux.go:60 +0x302
main.getNetworkStats(0xa7b100, 0x50f7a5cd, 0xa5e5a0, 0x50ed975a, 0x0, 0x0)
/opt/sumscope/ethr/stats.go:19 +0x3f
main.emitStats()
/opt/sumscope/ethr/stats.go:115 +0x133
main.startStatsTimer.func1(0xc000fc6500)
/opt/sumscope/ethr/stats.go:86 +0x3b
created by main.startStatsTimer
/opt/sumscope/ethr/stats.go:82 +0x66

[root@node172 ethr]# ./ethr -c "172.16.73.153"
Connecting to host [172.16.73.153], port 9999
[ 6] local 172.16.75.172 port 48967 connected to 172.16.73.153 port 9999


[ ID] Protocol Interval Bits/s
[ 6] TCP 000-001 sec 701.18M
panic: runtime error: slice bounds out of range

goroutine 1341 [running]:
github.com/microsoft/ethr/internal/stats.buildNetDevStat(0xc000f70280, 0x7f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000045e30, 0x6)
/opt/sumscope/ethr/internal/stats/linux.go:84 +0x3f8
github.com/microsoft/ethr/internal/stats.osStats.GetNetDevStats(0x0, 0x0, 0x0, 0x0, 0x0)
/opt/sumscope/ethr/internal/stats/linux.go:60 +0x302
main.getNetworkStats(0xa7b100, 0x5fb9733c, 0xa5e5a0, 0x5faf3302, 0x0, 0x0)
/opt/sumscope/ethr/stats.go:19 +0x3f
main.emitStats()
/opt/sumscope/ethr/stats.go:115 +0x133
main.startStatsTimer.func1(0xc000f56140)
/opt/sumscope/ethr/stats.go:86 +0x3b
created by main.startStatsTimer
/opt/sumscope/ethr/stats.go:82 +0x66

Consider lower-casing repository

For case-sensitive file systems, having the name title-cased can have some unexpected effects. For example currently, if Ethr is installed with go install github.com/Microsoft/Ethr the resulting binary is named Ethr, so examples refering to executing ethr don't work. Tab-completing from e also won't work, of course.

Add support for HTTP latency testing

This would be useful for testing performance of middle boxes like firewalls, proxies etc. This should be similar to TCP latency tests that measure request/response latency.

Final summary on server and client sides

Hello!

It'll be useful to have final, extended, summary on server and client sides instead of current brief.

E.g. for ethr -s :

Ending Bandwidth test from <client_IP>
Min: %min_value
Max: %max_value
Avg: %avg_value
Dur: %duration

E.g. for ethr -c <server_IP>:

Ethr done.
Min: %min_value
Max: %max_value
Avg: %avg_value
Dur: %duration

Doable?

Thanks!

Client error when testing more than one instance with same server

Clients : Android 8 / Android 9 Pie
Server : Ubuntu Server 18.04

Compiled from latest commit : 65627a0

Steps to reproduce:

Start the server
Initialize the first client with ethr -c IP -p udp
Initialize the second client with ethr -c IP -p -r udp

second client will print this output:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x23a5e4]

goroutine 1 [running]:
main.establishSession(0x100000001, 0x3e8000000001, 0x1000003e8, 0x4420010890, 0xf, 0x44200b6070, 0x34f4c0, 0x442005fb10)
/root/go/src/ethr/client.go:74 +0x4a4
main.runClient(0x100000001, 0x3e8000000001, 0x1000003e8, 0x2540be400, 0x0, 0x7fc9bfa873, 0xd)
/root/go/src/ethr/client.go:28 +0xc0
main.main()
/root/go/src/ethr/ethr.go:374 +0x708

Then the server will be waiting forever for the UDP packets.

One more thing, when client sends the UDP packets, it will fill the pipe , in my case client tried to send 1Gbit of data in one try.

Is UDP bandwidth test supported?

Thanks for making this great tool. I am using this to test some UDP traffic. This is not exactlly an issue, just want to get some confirmations. It is marked in the status that UDP bandwidth is YES(I believe this indicates that UDP bandwidth test is supported). But UDP bandwidth is also mentioned in the TODO list. I want to use this bandwidth test feature for UDP. Can someone please help clarify if this is supported or not?

  • Support for UDP bandwidth & latency testing
Protocol Bandwidth Connections/s Packets/s Latency
TCP Yes Yes No Yes
UDP Yes NA Yes No

Results on Mac differ greatly from results on Linux on the same network, Mac results are 20x higher than expected.

I am running a UDP bandwidth test on two devices on my network, testing speed to an external server I have set up.

My internet connection is pretty stable at ~300Mb/s and I'm on wireless so the Linux results seem accurate, the Mac OS results are pretty far off though.

This is the command I am running.
ethr -c {external} -t b -p udp -l 8kb

These are the results.
Ubuntu 19.10:

[ ID]   Protocol    Interval      Bits/s
[  6]     UDP      000-001 sec   217.98M
[  6]     UDP      001-002 sec   223.49M
[  6]     UDP      002-003 sec   234.50M
[  6]     UDP      003-004 sec   241.34M
[  6]     UDP      004-005 sec   239.42M
[  6]     UDP      005-006 sec   235.07M
[  6]     UDP      006-007 sec   239.17M
[  6]     UDP      007-008 sec   219.14M
[  6]     UDP      008-009 sec   222.78M
[  6]     UDP      009-010 sec   220.67M

Mac OS 10.14.6:

[ ID]   Protocol    Interval      Bits/s
[ 12]     UDP      000-001 sec     5.62G
[ 12]     UDP      001-002 sec     5.99G
[ 12]     UDP      002-003 sec     6.01G
[ 12]     UDP      003-004 sec     6.12G
[ 12]     UDP      004-005 sec     6.09G
[ 12]     UDP      005-006 sec     6.16G
[ 12]     UDP      006-007 sec     6.13G
[ 12]     UDP      007-008 sec     6.12G
[ 12]     UDP      008-009 sec     6.15G

IP version output to display (server side)

Hello!

IP version output to display, when server side is in use. E.g.:

./ethr -4 -s
Accepting IP version: ipv4
Listening on 9999 for TCP bandwidth tests
Listening on 9998 for TCP conn/s tests
Listening on 9996 for TCP latency tests
Listening on 9899 for HTTP bandwidth tests
Listening on 9799 for HTTPS bandwidth tests
Listening on 8888 for control plane
./ethr -6 -s
Accepting IP version: ipv6
Listening on 9999 for TCP bandwidth tests
Listening on 9998 for TCP conn/s tests
Listening on 9996 for TCP latency tests
Listening on 9899 for HTTP bandwidth tests
Listening on 9799 for HTTPS bandwidth tests
Listening on 8888 for control plane
./ethr -4 -6 -s
Accepting IP version: ipv4, ipv6
Listening on 9999 for TCP bandwidth tests
Listening on 9998 for TCP conn/s tests
Listening on 9996 for TCP latency tests
Listening on 9899 for HTTP bandwidth tests
Listening on 9799 for HTTPS bandwidth tests
Listening on 8888 for control plane
./ethr -s
Accepting IP version: ipv4, ipv6
Listening on 9999 for TCP bandwidth tests
Listening on 9998 for TCP conn/s tests
Listening on 9996 for TCP latency tests
Listening on 9899 for HTTP bandwidth tests
Listening on 9799 for HTTPS bandwidth tests
Listening on 8888 for control plane

Can be useful for dropping specified packets from client side. Personally, after some tests I have 0.5 ratio of initial connections due to multiple TCP6 CLOSE_WAIT connections (12 hours) in ss -tunlp output.

Suggestion about main package split, add test code.

Hello ! I like this project.

I want to contribute this project.

but it is difficult.

I think ethr has big main package.

Further, ethr doesn't have test code.

I think open source project should have test code.

Test code makes it easy to contribute and makes it guessing that main intending of project. then contributer can proper pull request.

And I think It can be split logger, server, client, ui, util, etc package.

Bad error message when bad duration passed in

When I try the client, I find it raises a bad error message when I pass in a bad duration for -d option, e.g. ./Ethr -c 10.29.96.153 -d 10.

And the error message is Invalid value "%!s(*string=0xc000097cc0)" specified for parameter "-d".

UDP performance on server side

Hi.
I am running a UDP network performance test with ethr.
The client reports sending speed, but the server reports only 0 bits/s. Why is that?

UDP/TCP ports 4200-4300 are open, so the traffic should pass. The same experiment with HTTP works well.

I need to know the speed of receiving,

Server

ethr -s -ports control=4287,tcp=4299,udp=4201,http=4289,https=4288

[RemoteAddress]  Proto   Bits/s   Conn/s    Pkt/s   Latency 
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
[**.**.***.***]    UDP        0
Ending Bandwidth test from **.**.***.***

Client

ethr -c IP -n 1 -p udp -t b -ports control=4287,tcp=4299,udp=4201,http=4289,https=4288 -l 64KB

[ ID]   Protocol    Interval      Bits/s
[  6]     UDP      000-001 sec     1.90G
[  6]     UDP      001-002 sec     1.89G
[  6]     UDP      002-003 sec     1.89G
[  6]     UDP      003-004 sec     1.89G
[  6]     UDP      004-005 sec     1.89G
[  6]     UDP      005-006 sec     1.89G
[  6]     UDP      006-007 sec     1.89G
[  6]     UDP      007-008 sec     1.89G
[  6]     UDP      008-009 sec     1.89G
[  6]     UDP      009-010 sec     1.89G

Modularize code for various protocols

The code needs to be modularized to have interface for protocols and handlers for running Bandwidth/Latency/CPS/PPS tests for those protocols. Right now the code is not using clean abstractions.

For example, we should have something like:
type ethrProto interface{
func runBandwidthTest(param…)
func runLatencyTest(param…)
}

type ethrProtoTcp struct {
}

func (p *ethrProtoTcp) runBandwidth(param…) {
}

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.