OWL¶
- mflib.owl.check_owl_all(slice)¶
Prints the list of all running containers on all nodes in the slice.
- Parameters:
slice (fablib.Slice)
- mflib.owl.check_owl_prerequisites(slice)¶
Checks whether remote nodes have PTP and Docker required for running OWL.
- Parameters:
slice (fablib.Slice)
- mflib.owl.download_output(node, local_out_dir)¶
Download the contents of owl output directory on a remote node to the local owl output directory.
- Parameters:
node (fablib.Node) – remote node
local_out_dir (str) – /path/to/local/dir/under/which/pcaps/will/be/saved
- mflib.owl.get_node_ip_addr(slice, node_name)¶
Get the node (named ‘node_name’) experiment IP address. This IP is useful because the pcap file to send to InfluxDB is stored in the format of the sender’s IP address (“${node_ip}.pcap”).
- Parameters:
slice (fablib.Slice)
node_name (str)
- Returns:
IP addresses
- Return type:
str
- mflib.owl.nodes_ip_addrs(slice)¶
List the node experiment IP address for all nodes. This is particularly useful when using a (Measurement Framework) meas-node + meas_net since the returned dictionary will NOT include the meas_net addresses. It assumes each node has only one experiment interface.
- Parameters:
slice (fablib.Slice)
- Returns:
list of IP addresses
- Return type:
List[str]
- mflib.owl.pull_owl_docker_image(node, image_name)¶
Pull Docker OWL image to remote node.
- Parameters:
node (fablib.Node) – remote node
- mflib.owl.send_to_influxdb(node, pcapfile, img_name, influxdb_token=None, influxdb_org=None, influxdb_url=None, influxdb_bucket=None, desttype='local')¶
Send OWL pcap data to InfluxDB in a remote server. Invokes OWL container to call parse_and_send() in MF’s sock_ops/send_data.py.
- Parameters:
node (fablib.Node) – fablib Node object where pcap data will be sent to InfluxDB.
pcapfile (str) – Packet Capture file name.
img_name (str) – OWL Docker image name.
influxdb_token (str) – InfluxDB token string.
influxdb_org (str) – InfluxDB org name.
influxdb_url (str) – InfluxDB URL (if IP address, omit http and port; just have the IP address).
desttype – Destination type, or where InfluxDB server lives; “cloud” or “meas_node”.
influxdb_bucket (str) – InfluxDB bucket ID.
- mflib.owl.start_owl(slice, src_node, dst_node, img_name, probe_freq=1, no_ptp=False, outfile=None, duration=None, delete_previous_output=True, src_addr=None, dst_addr=None)¶
Start OWL on a given link defined by source and destination nodes.
- Parameters:
slice (fablib.Slice)
src_node (fablib.Node) – source (sender) node
dst_node (fablib.Node) – destination (capturer) node
img_name (str) – Docker image name
prob_freq (int) – (default=1) interval (sec) at which probe packets are sent
duration (int) – (default=None) how long (sec) to run OWL
no_ptp (bool) – (default=False) Set this to True only when testing the functionalities on non-PTP node
outfile (str) – /path/on/remote/node/to/ouput.pcap (if None, /home/rocky/owl-output/{dst_ip}.pcap)
delete_previous (bool) – (default=True) whether to delete all existing pcap files from previous runs
- Src_addr:
(default=None) Specify source IP address only if source node has more than 1 experiment interface
- Dst_addr:
(default=None) Specify destination IP address only if dest node has more than 1 experiment interface
- mflib.owl.start_owl_all(slice, img_name, probe_freq=1, outfile=None, duration=None, no_ptp=False, delete_previous=True)¶
Start OWL on all possible combination of nodes in the slice. It asssumes there is only 1 experimenter’s network interface on each node (exclu. meas-net interface)
- Parameters:
slice (fablib.Slice)
src_node (fablib.Node) – source (sender) node
dst_node (fablib.Node) – destination (capturer) node
img_name (str) – Docker image name
prob_freq (int) – (default=1) interval (sec) at which probe packets are sent
outfile (str) – /path/on/remote/node/to/ouput.pcap (if None, /home/rocky/owl-output/{dst_ip}.pcap)
duration (int) – (default=None) how long (sec) to run OWL
no_ptp (bool) – (default=False) Set this to True only when testing the functionalities on non-PTP node
delete_previous (bool) – (default=True) whether to delete all existing pcap files from previous runs
- mflib.owl.start_owl_capturer(slice, dst_node, img_name, outfile=None, duration=None, delete_previous=True, dst_addr=None, verbose=True)¶
Start OWL capturer inside a Docker container on a remote node by running owl_capturer.py. One container instance per node (sometimes serving multiple source nodes). Docker container name will be in the form of “owl-capturer_10.0.0.1”
- Parameters:
slice (fablib.Slice)
dst_node – destination (capturer) node
img_name (str) – Docker image name
outfile (str) – /path/on/remote/node/to/ouput.pcap (if None, /home/rocky/owl-output/{dst_ip}.pcap)
duration (int) – (default=None) how long (sec) to run OWL
delete_previous (bool) – (default=True) whether to delete all existing pcap files from previous runs
- Dst_addr:
(default=None) Specify destination IP address only if dest node has more than 1 experiment interface
- Verbose:
(default=False) if True, prints docker run command
- mflib.owl.start_owl_sender(slice, src_node, dst_node, img_name, probe_freq=1, duration=None, no_ptp=False, src_addr=None, dst_addr=None, verbose=True)¶
Start OWL sender inside a Docker container on a remote node by running owl_sender.py. Docker container name will be in the form of “owl-sender_10.0.0.1-10.0.1.1”
- Parameters:
slice (fablib.Slice)
src_node (fablib.Node) – source (sender) node
dst_node (fablib.Node) – destination (capturer) node
img_name (str) – Docker image name
prob_freq (int) – (default=1) interval (sec) at which probe packets are sent
duration (int) – (default=None) how long (sec) to run OWL
no_ptp (bool) – (default=False) Set this to True only when testing the functionalities on non-PTP node
- Src_addr:
(default=None) Specify source IP address only if source node has more than 1 experiment interface
- Dst_addr:
(default=None) Specify destination IP address only if dest node has more than 1 experiment interface
- Verbose:
(default=True) if True, prints docker run command
- mflib.owl.stop_influxdb_sender(dst_node)¶
Stops OWL InfluxDB container if there is one running on a remote node.
- Parameters:
dst_node (fablib.Node) – destination (capturer) node
- mflib.owl.stop_owl_all(slice)¶
Stop ALL running instances of OWL containers on all nodes in the slice
- Parameters:
slice (fablib.Slice)
- mflib.owl.stop_owl_capturer(slice, dst_node, dst_addr=None)¶
Stops OWL capturer container if there is one running on a remote node.
- Parameters:
slice (fablib.Slice)
dst_node (fablib.Node) – destination (capturer) node
- Dst_addr:
(default=None) Specify destination IP address only if dest node has more than 1 experiment interface
- mflib.owl.stop_owl_sender(slice, src_node, dst_node, src_addr=None, dst_addr=None)¶
Stops OWL sender container if there is one or more running on a remote node.
- Parameters:
slice (fablib.Slice)
src_node (fablib.Node) – source (sender) node
dst_node (fablib.Node) – destination (capturer) node
- Src_addr:
(default=None) Specify source IP address only if source node has more than 1 experiment interface
- Dst_addr:
(default=None) Specify destination IP address only if dest node has more than 1 experiment interface