0
I'm trying to write a simple script that can detect dips in network traffic (both bandwidth and latency in both directions) between 2 arbitrary hosts in my network over time. Is there a tool to do this?
If needed, I plan to write a couple of client/server scripts in bash to perform this testing using nc
(netcat), but if a pre-existing solution captures what I'm trying to do, please let me know.
First, I'll determine how much data I can send in 1 second between my arbitrary hosts. We'll call this the "payload". Initial tests show the payload to be ~50 MB.
Then I'll execute the following:
- Client sends the payload to the server.
- When the server receives the entire payload, it will immediately respond by sending a payload to the client.
- When the client receives the entire payload, it will sleep for 30 seconds. Go to 1.
By doing so, I will receive the following data (bidirectional bandwidth & latency):
- By recording the
time
to execute thenc
from client to server in (1), I will get the bandwidth sending data from client to server. - By recording the
time
to execute thenc
from server to client in (2), I will get the bandwidth sending data from the server to the client. - Somehow I'll determine packet latency, perhaps using a monitoring tool or diff-ing the timestamps between the first packet of the payload sent from the source and the first packet of the payload received on the destination.
iperf (not to be confused with netperf) works great for testing bandwidth in nearly exactly the way I described (using arguments appropriately =
time iperf -c <ip> -t 1 -r -i 30
), but it does not test for latency. For testing latency without ICMP, I'm usinghping -S
– Michael Altfield – 2016-02-02T00:17:54.373