-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started with DAQ
In this tutorial you will download and install DAQ. You will then run the first test with virtual ethernet ports and subsequently move to testing a single device and multiple devices in parallel.
The pre-requisites for this tutorial are a Debian based Linux distribution (Debian GNU/Linux 9.4 Stretch is the recommended one) and the git tool. If you don't have it yet, open a terminal window and install it with the following command:
sudo apt install git
The first step to install DAQ is to download its source code from the DAQ github repository:
git clone https://github.com/faucetsdn/daq.git
Once the software is downloaded, go to the DAQ folder
cd daq
and run the installation with this command:
sudo bin/setup_base
The setup_base
command installs a minimum set of basic packages, including docker and Open vSwitch,
sudo bin/setup_dev
The setup_dev
command installs the development environment dependencies, including python3, various network tools, a Java development kit and specific versions of Mininet and Faucet. The setup of the development environment is required to work with mudacl
, the MUD ACL genenerator.
Once the base and development software packages are installed, build DAQ with the following command:
sudo cmd/build
This program is likely to take a long time to execute, so go get yourself a cup of your favourite hot or cool beverage.
If you want to monitor the build progress, look inside the build folder. The build command outputs several log files that you can show in the command line, for instance with the following command:
tail -f build/docker_build.aardvark
Once DAQ has been built, execute this command to run the DAQ tests for the first time.
sudo cmd/run -s
This command creates the local
directory and copies the misc/system_base.conf
file into it with the new name local/system.conf
.
It then activates Open vSwitch, configures Faucet with a single virtual ethernet port (faux
) and executes the tests. The option -s
stands for "single shot" and executes the tests only once.
If all goes well, the console will show something similar to the log below. In this case we have installed DAQ in the /opt/daq
directory.
No local/system.conf found, copying defaults from misc/system_base.conf...
Loading config from local/system.conf
run_mode is local
Clearing previous reports...
Loading config from local/system.conf
Release version 0.9.0
cleanup='echo cleanup'
intf_names=faux
run_mode=local
site_description='Baseline Configuration'
skip_autostart=
startup_cmds=misc/startup_base.cmd
ovsdb-server is running with pid 28200
ovs-vswitchd is running with pid 20342
Sourcing misc/startup_base.cmd...
DAQ autostart cmd/faux
Loading config from local/system.conf
Launching faux ...
Clensing old container daq-faux
DAQ autoclean docker kill daq-faux
Removing old interface faux
Adding new interface to 9099...
Done with faux device launch.
Entering virtual python environment...
Using python3 at /opt/daq/venv/bin/python3
Executing: python3 -u daq/daq.py /opt/daq/local/system.conf -s
processing arg: /opt/daq/local/system.conf
Reading config from /opt/daq/local/system.conf
Reading config from misc/system.conf
processing arg: -s
INFO:daq:configuration map: {'run_mode': 'local', 'startup_cmds': 'misc/startup_base.cmd', 'single_shot': True, 'site_description': 'Baseline Configuration', 'intf_names': 'faux'}
INFO:daq:pid is 9184
INFO:gcp:No gcp_cred credential specified in config
INFO:runner:Reading test definition file misc/host_tests.conf
INFO:runner:Configured with tests ['pass', 'fail', 'ping', 'bacnet', 'nmap', 'mudgee']
INFO:network:Activating faucet topology...
INFO:topology:No device_specs file specified, skipping...
INFO:topology:Writing network config to inst/faucet.yaml
INFO:topology:Starting faucet...
INFO:network:Creating ovs sec with dpid/port 2/7
INFO:network:Added switch link pri-eth1 <-> sec-eth7
INFO:network:Attaching device interface faux on port 1.
INFO:network:Attaching device interface sec-2 on port 2.
INFO:network:Attaching device interface sec-3 on port 3.
INFO:network:Attaching device interface sec-4 on port 4.
INFO:network:Attaching device interface sec-5 on port 5.
INFO:network:Attaching device interface sec-6 on port 6.
INFO:network:Starting mininet...
INFO:mininet:*** Configuring hosts
INFO:mininet:*** Starting controller
INFO:mininet:controller
INFO:mininet:*** Starting 2 switches
INFO:mininet:pri
INFO:mininet:sec
INFO:mininet:...
INFO:runner:Waiting for system to settle...
INFO:runner:Entering main event loop.
INFO:runner:If this blocks for too long, check inst/faucet.log for errors
INFO:runner:Port 1 dpid 2 is now active True
INFO:runner:System port 7 on dpid 2 is active True
INFO:runner:Port 1 dpid 2 learned 9a:02:57:1e:8f:00
INFO:runner:Gateway for device group 9a02571e8f00 not found, initializing base 1...
INFO:gateway:Initializing gateway 9a02571e8f00 as gw01/10
INFO:gateway:Adding networking host gw01 on port 10 at 10.0.0.1
INFO:gateway:Added dummy target dummy01 on port 11 at 10.0.0.2
INFO:dhcp:DHCP monitor gw01 waiting for replies...
INFO:runner:Test ping gw01->dummy01
INFO:runner:Test ping gw01->dummy01
INFO:runner:Test ping dummy01->gw01
INFO:runner:Test ping dummy01->192.168.84.1
INFO:runner:Test ping gw01->dummy01 from 192.168.84.1
INFO:gateway:Attaching target 1 to gateway group 9a02571e8f00
INFO:host:Creating report as inst/report_9a02571e8f00_2018-11-24T22:32:58.txt
INFO:runner:Target port 1 registered 9a:02:57:1e:8f:00
INFO:host:Target port 1 initializing...
INFO:network:Creating mirror pair mirror-01 <-> mirror-01-ext at 1001
INFO:host:Target port 1 startup pcap capture
INFO:network:Directing traffic for 9a:02:57:1e:8f:00 on port 1: True
INFO:topology:Cleared port acls for port 1
INFO:host:Target port 1 activating as 9a:02:57:1e:8f:00
INFO:runner:DHCP notify 9a:02:57:1e:8f:00 is 10.20.63.37 on gw01 (None)
INFO:host:Target port 1 dhcp_result 10.20.63.37
INFO:runner:Test ping gw01->10.20.63.37
INFO:runner:Test ping gw01->10.20.63.37
INFO:runner:Test ping gw01->10.20.63.37 from 192.168.84.1
INFO:host:Target port 1 monitor scan complete
INFO:host:Target port 1 done with base.
INFO:host:Target port 1 background scan for 20 seconds...
INFO:host:Target port 1 scan complete
INFO:host:Target port 1 monitor scan complete
INFO:docker:Target port 1 PASSED test pass
INFO:docker:Target port 1 FAILED test fail with error 1: None
INFO:docker:Target port 1 PASSED test ping
INFO:docker:Target port 1 PASSED test bacnet
INFO:runner:DHCP notify 9a:02:57:1e:8f:00 is 10.20.63.37 on gw01 (None)
INFO:docker:Target port 1 PASSED test nmap
INFO:docker:Target port 1 PASSED test mudgee
INFO:host:Target port 1 no more tests remaining
INFO:host:Finalizing report inst/report_9a02571e8f00_2018-11-24T22:32:58.txt
INFO:gcp:Ignoring report upload: not configured
INFO:runner:Target port 1 finalize: [] (target set not active)
INFO:runner:Target port 1 cancel 9a:02:57:1e:8f:00 (#1/0).
INFO:network:Directing traffic for 9a:02:57:1e:8f:00 on port 1: False
INFO:topology:Cleared port acls for port 1
INFO:host:Target port 1 terminate, trigger False
INFO:network:Deleting mirror pair mirror-01 <-> mirror-01-ext
INFO:gateway:Detach target 1 from gateway group 9a02571e8f00
INFO:runner:Retiring target gateway 1, 9a:02:57:1e:8f:00, 9a02571e8f00, 1
INFO:gateway:Terminating gateway 9a02571e8f00
WARNING:runner:Suppressing future tests because test done in single shot.
INFO:runner:Remaining target sets: []
WARNING:runner:No active ports remaining: ending test run.
INFO:mininet:*** Stopping 1 controllers
INFO:mininet:controller
INFO:mininet:*** Stopping 1 links
INFO:mininet:.
INFO:mininet:*** Stopping 2 switches
INFO:mininet:pri
INFO:mininet:sec
INFO:mininet:*** Stopping 1 hosts
INFO:mininet:gw01
INFO:mininet:*** Done
INFO:runner:Done with runner.
INFO:daq:DAQ runner returned 0
Cleanup docker kill daq-faux
daq-faux
Done with run, exit 0
After successfully exiting the test, DAQ will have created a report in the inst
folder. In this case the report is named inst/report_9a02571e8f00_2018-11-24T22:32:58.txt
, showing the ethernet MAC address and report date in the name.
The local/system.conf
is the configuration file to use to set up the DAQ network topology and some of the run time configuration variables without having to put them in the command line.
DAQ supports many topologies categories, as documented in the reference page on Network Topologies: emulation, adapter, test lab, tiered and production.
In the previous section, DAQ configured and executed the tests on an emulated network interface (named faux
), as indicated by this output line:
INFO:network:Attaching device interface faux on port 1.
We'll now proceed to configure DAQ to use a physical USB ethernet network adapter.
Once the adapter is plugged into the USB port, it will add a network interface.
Identify it using the ifconfig
command:
sudo ifconfig
See below an example of the output, showing the network interface has been registered as enx000ec6c32a6f
.
...
enx000ec6c32a6f: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::20e:c6ff:fec3:2a6f prefixlen 64 scopeid 0x20<link>
ether 00:0e:c6:c3:2a:6f txqueuelen 1000 (Ethernet)
RX packets 1233820 bytes 83057697 (79.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2698368 bytes 204281978 (194.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
...
Replace the intf_names=faux
line with intf_names=enx000ec6c32a6f in local/system.conf.
This configuration file is well documented and you can also take this opportunity to modify the site_description
# Base configuration file for DAQ.
# Load defaults.
source misc/system.conf
# Upstream dataplane port from the external (secondary) switch.
# Not strictly necessary, but included for illustrative purposes.
sec_port=4
# CSV separated list of names to assign to external switch interfaces.
intf_names=enx000ec6c32a6f