[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

linux_networking: asmach | asmach_tutorials | multi_interface_roam | network_monitor_udp | wpa_supplicant | wpa_supplicant_node

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility. The client can be a ROS node, a standalone utility or a python class.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility or a ROS node. The client can be a ROS node, a standalone utility or a python class.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility or a ROS node. The client can be a ROS node, a standalone utility or a python class.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control | wpa_supplicant | wpa_supplicant_node

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility or a ROS node. The client can be a ROS node, a standalone utility or a python class.

linux_networking: access_point_control | asmach | asmach_tutorials | ddwrt_access_point | hostapd_access_point | ieee80211_channels | linksys_access_point | multi_interface_roam | network_control_tests | network_detector | network_monitor_udp | network_traffic_control

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility or a ROS node. The client can be a ROS node, a standalone utility or a python class.

Package Summary

Facilities to monitor a network connection by sending UDP packets from a client to a server, which bounces them back to the client. The client collects statistics on latency and loss. The server is a C standalone utility or a ROS node. The client can be a ROS node, a standalone utility or a python class.

  • Maintainer status: maintained
  • Maintainer: Devon Ash <dash AT clearpathrobotics DOT com>
  • Author: Blaise Gassend, Catalin Drula
  • License: BSD

Overview

A UDP-based system for measuring network link metrics such as bandwidth, latency and loss. It is highly configurable and versatile provides support for multiple concurrent link tests, one-way or round-trip measurements, constant or adaptive bandwidth rates and more.

MonitorSource and udpmonsink

The basic link measurements are implemented by the class MonitorSource (defined in udpmonclient.py) and the udpmonsink node. MonitorSource sends UDP packets at a specified rate to udpmonsink which timestamps them and echoes them back either via UDP or via ROS topic message.

MonitorSource records packets receive times and sorts them into latency bins based on their travel time. These latency bins can be periodically retrieved and information such as packet loss, average latency and bandwidth can be therefrom determined.

Multiple stream support is built in so multiple MonitorSources on the same ROS node can ping packets off the same udpmonsink.

For a ROS independent setup, udpmonserv can be used instead of udpmoncli. The former is not a ROS node, but rather a standalone UDP server. By default, MonitorSource does not use ROS messages for the return path and no ROS dependency is created on the class.

udpmonsourcenode.py

udpmonsourcenode is a node that implements an action server which receives link testing goals. It instantiates and collects statistics from multiple MonitorSources. Each source (i.e. link test) is independent of all others and can be parametrized differently in terms of bandwidth, latency bin thresholds, update (i.e. stats collection) interval and so on. It sends periodical feedback to the action client.

udpmonsourcenode also implements logic for adaptive bandwidth tests: link tests that strive to saturate a link in terms of bandwidth while maintaining latency and loss within specified thresholds.

Typically there would be one udpmonsourcenode.py node running on every machine in a test setup as each sourcenode supports any number of tests with destination sinks on different machines.

linktest.py

The linktest.py implements the action client for link tests, as well as logging and test control logic via three classes:

ROS API

udpmonsourcenode.py

Implements an action server which receives link testing goals. Tracks multiple concurrently running link tests and reports feedback periodically.

Parameters

duration (float, default: 0.0 (unlimited)) update_interval (float, default: 0.15 (stats are collected and reported every 150 ms)) bw (float, default: 5000000.0 (the default start bandwidth is 5 Mbit/s)) bw_type (char, default: 'c' (constant bandwidth test)) latency_threshold (float, default: 0.01 (10ms)) pktloss_threshold (float, default: 0.5 (0.5%)) tos (byte, default: 0x00) pktsize (int, default: 1500) ros_returnpath (boolean, default: False (return path is over UDP)) roundtrip (boolean, default: False (one-way measurements)) max_return_time (float, default: 0.0) rostopic_prefix (string, default: "") sink_ip (string, default: "") sink_port (int, default: 0) latency_bins (float[], default: [.005, .01, .025, .05, .075, .1] (the maximum allowed latency is 100ms)) latency (float) loss (float) bandwidth (float) latency_histogram (float)

udpmonsink

udpmonsink is a lightweight node that echoes back received packets either over UDP or as messages via a ROS topic named udpsink_feedback. It takes a single command-line argument: the UDP port it should listen on.

Command-line tools

udpmoncli.py can also be used stand-alone, independent of ROS with udpmonserv as in the example below:

# rosrun network_monitor_udp udpmonserv 12345

# rosrun network_monitor_udp udpmoncli.py 127.0.0.1 12345 10 1500
  0.501: 100   0   0   /   0   0   0   0 avg:   0.3 ms avgr:   0.3 ms loss:   0.00 %
  1.001: 100   0   0   /   0   0   0   0 avg:   0.3 ms avgr:   0.3 ms loss:   0.00 %
  1.501: 100   0   0   /   0   0   0   0 avg:   0.3 ms avgr:   0.3 ms loss:   0.00 %
  2.001: 100   0   0   /   0   0   0   0 avg:   0.4 ms avgr:   0.4 ms loss:   0.00 %
  2.501: 100   0   0   /   0   0   0   0 avg:   0.4 ms avgr:   0.4 ms loss:   0.00 %
  3.000: 100   0   0   /   0   0   0   0 avg:   0.4 ms avgr:   0.4 ms loss:   0.00 %

Usage example

The following launch file starts a source and a sink node as well as a bandwidth test node:

<launch>
<node name="sink" pkg="network_monitor_udp" type="udpmonsink" args="12345" output="screen"/>
<node name="source" pkg="network_monitor_udp" type="udpmonsourcenode.py" output="screen"/>
<node name="test_node" pkg="network_monitor_udp" type="sample_bwtest.py" required="true" output="screen"/>
</launch> 

The test node starts a link capacity test on the loopback interface and prints the resulting capacity:

import roslib; roslib.load_manifest('network_monitor_udp')
import rospy

from network_monitor_udp.linktest import UdpmonsourceHandle
from network_monitor_udp.linktest import LinkTest
from network_monitor_udp.msg import LinktestGoal

if __name__ == '__main__':
    rospy.init_node('test_node')
        
    source = UdpmonsourceHandle() 
    source.cancel_all_tests()

    try:
        print "Link capacity: %.2fMbit/s"%(source.get_link_capacity(sink_ip="127.0.0.1", sink_port=12345)/1e6)
    finally:
        source.cancel_all_tests()

Here's an example run:

# roslaunch launch_nodes.launch

[...]

core service [/rosout] found
process[sink-1]: started with pid [20043]
process[source-2]: started with pid [20044]
process[test_node-3]: started with pid [20055]
Link capacity: 68.71Mbit/s

More usage examples with more complex configurations can be found in the network_control_tests package.

Tips


2019-09-14 12:58