i need assistance performing reliable speed monitoring per port. I have ISP issues with unreliable download speed that I'm trying to prove their fault so i have scripted speedtest running once per hour, and I'm trying to compare that result to traffic monitor from ether1 port (which is uplink) to show that no other traffic is being sent out. I'm using python routeros_api package with following function from script:
Code: Select all
...
def getRes(api, iface):
monitor_traffic = api.get_binary_resource('/interface').call('monitor-traffic',{'interface': iface.encode(), 'once': b' '})
ul = monitor_traffic[0]['tx-bits-per-second'].decode()
dl = monitor_traffic[0]['rx-bits-per-second'].decode()
return {"mikrotik": {"interface": iface, "upload": float(ul), "download": float(dl)}}
while True:
...
res = getRes(api, "ether1")
...
time.sleep(1)
...
Code: Select all
{'mikrotik': {'interface': 'ether1', 'upload': 182416.0, 'download': 48272.0}}
{'mikrotik': {'interface': 'ether1', 'upload': 21680.0, 'download': 23840.0}}
{'mikrotik': {'interface': 'ether1', 'upload': 50720.0, 'download': 36864.0}}
- Traffic displayed by result obtained from API should be equal to speedtest.net result or higher - up to the speed I'm paying for (120mbps)
Actual outcome:
- Very often that speed is displayed higher than 120mbps and up to 200mbps - which is a lot above my limit - which is unreal. And traffic before and after speedtest is steady so the network is not utilized before actually running speedtest. (give or take 1-2mbps)
I'm not sure how displayed result is that much higher and I'm trying to figure out that discrepancy and need more reliable method of monitoring port speed.
I've also tried using flow - sending data to elasticsearch and visualizing using Kibana but the data sent by flow is in bytes rather than bits and cannot really use it to compare to speedtest result.