-
Notifications
You must be signed in to change notification settings - Fork 21
add Xena functionality #153
base: master
Are you sure you want to change the base?
Changes from all commits
6f90db7
3c659ca
42621af
85b8ffa
4d97a78
050879f
89118c7
ed504c6
bc470fd
5a9c848
5e5044f
b5ee509
855d51c
bbca7ff
ef6c516
13eb33d
aade65d
dfe32d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Xena2544ThroughputVerify | ||
This README covers XenaVerify.py and is intended primarily for debugging. For general documentation regarding Xena/trafficgen please refer to README-xena-trafficgen-integration.md | ||
|
||
## Setup: | ||
|
||
1. For linux Install Mono -> | ||
|
||
```bash | ||
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" | ||
``` | ||
|
||
```bash | ||
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/ | ||
``` | ||
|
||
```bash | ||
yum -y install mono-complete-5.8.0.127-0.xamarin.3.epel7.x86_64 | ||
``` | ||
|
||
2. If python 3 not installed, install python 3. For RHEL instructions are below-> | ||
|
||
``` | ||
cat <<'EOT' >> /etc/yum.repos.d/python34.repo | ||
|
||
[centos-sclo-rh] | ||
|
||
name=CentOS-7 - SCLo rh | ||
|
||
baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/ | ||
|
||
gpgcheck=0 | ||
|
||
enabled=1 | ||
|
||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo | ||
|
||
EOT | ||
``` | ||
|
||
# install python34 scl package | ||
|
||
```bash | ||
yum -y install rh-python34 rh-python34-python-tkinter | ||
``` | ||
|
||
# cleanup python 34 repo file | ||
|
||
```bash | ||
rm -f /etc/yum.repos.d/python34.repo | ||
``` | ||
|
||
3. Enable python34 -> `scl enable rh-python34 bash` | ||
|
||
4. Make sure Valkyrie2544.exe is present in the current folder (formerly Xena2544.exe) | ||
|
||
5. Copy your x2544 config file to the script folder | ||
|
||
## Arguments to run this script: | ||
|
||
* `-f <path_to_config_file>` : saved from Valkyrie2544.exe GUI with your config. | ||
|
||
* `[-s]` : enable smart search, if verify fails will resume the search at the half way point between the last verify attempt and the minimum search value. Otherwise it will just resume at the last verify attempt value minus the value threshhold. | ||
|
||
* `[-l <verify_length_in_seconds>]` : | ||
> Default : 7200 (2 hours) | ||
|
||
* `[-r <retry_attempts>]` : Maximum number of verify attempts for giving up | ||
> Default : 10 | ||
|
||
* `[-d]` : Enable debug mode | ||
|
||
* `[-p]` : Output PDF file. By default output of PDF report is disabled. Will cause a crash on linux usually as a pdf renderer is not installed. | ||
|
||
* `[-w]` : Enable windows mode. By default it will use the mono package to run the exe file. If running on windows this is not necessary. | ||
|
||
* `[-t <search_trial_duration_in_seconds>]` : Modify original config to use the duration specified. | ||
> Default : 0 | ||
|
||
* `[-k <packet_size>+]` : Customize packet sizes for throughput testing | ||
|
||
* `[-a <acceptable_loss>]` : Specify number of packages which can be lost as a percentage ([0 - 100]) | ||
|
||
* `[-v <save_file_name>]` : Save config file which was created with the new arguments passed to this command. | ||
> Default : `./2bUsed.x2544` | ||
|
||
* `[-i <initial_tput>]` : Specify initial rate for throughput test | ||
|
||
* `[-M <max_tput>]` : Specify maximum rate for throughput test | ||
|
||
* `[-m <min_tput>]` : Specify minimum rate for throughput test | ||
|
||
* `[-o <resolution_tput>]` : Specify resolution for throughput testing | ||
|
||
* `[-n <mac_address> [<mac_address>]]` : First MAC address becomes source of first active entity and destination for second (if two exist). Vice versa for the optional second argument. | ||
|
||
* `[-c <connection_ip> [<connection_ip>]]` : First IP address becomes source of first active entity and destination for second (if two exist). Vice versa for the optional second argument. | ||
|
||
* `[-u {1|1k|4k|10k|100k|1M}]` : Specify hardware modifier flows. Default behavior is to apply this to source and destination IP addresses | ||
* `[-b]` : Apply flows to both MAC and IP addresses (overrides `[-e]`) | ||
* `[-e]` : Apply flows to MAC addresses only | ||
|
||
* `--module` : Specify int corresponding to the Xena chassis module number. | ||
|
||
## Sample execution: | ||
|
||
> Runs a 60 second trial with a 600 second verify using the myconfig.x2544 configuration file. | ||
|
||
```bash | ||
python XenaVerify.py -f myconfig.x2544 -s -l 600 -t 60 | ||
``` | ||
|
||
#### Improvements to be done | ||
|
||
* Add debug logging | ||
|
||
* Add more customized options for modifying the running config |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# README - Xena/trafficgen integration (using Valkyrie2544) | ||
|
||
## Installation & Setup | ||
|
||
1. For Linux, install Mono (https://www.mono-project.com/): | ||
* Notes: | ||
* instructions are for CentOS/RHEL/Fedora, other distros please refer to https://www.mono-project.com/download/stable/#download-lin | ||
* commands should be run in a root shell or using `sudo` | ||
|
||
* Add Mono repo to system: | ||
```bash | ||
rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef" | ||
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo' | ||
``` | ||
|
||
* Install Mono: | ||
```bash | ||
yum install mono-complete -y | ||
``` | ||
|
||
2. Download the trafficgen git repository | ||
```bash | ||
git clone https://github.com/atheurer/trafficgen | ||
``` | ||
|
||
|
||
3. Obtain .x2544 config file & executable | ||
* Create a test config inside xena2544 utility on the xenaweb system (ask @ctrautma for IP if necessary) | ||
* Save config into the ftp folder off the c drive | ||
* Use FTP commands to download the config and the latest copy of Valkyrie2544.exe | ||
* Place both config and exe inside the trafficgen folder | ||
``` | ||
ftp 11.11.111.11 [user]/[pwd] | ||
bin | ||
get valkyrie2544.exe | ||
get <your config file> | ||
``` | ||
|
||
5. Install TRex | ||
* Within trafficgen, open `install-trex.sh` for editing | ||
* Make the following change: | ||
* original: `if curl --output ${tarfile} ${trex_url} && tar zxf ${tarfile}; then` | ||
* modified: ``if curl --insecure --output ${tarfile} ${trex_url} && tar zxf ${tarfile}; then`` | ||
* As root or using `sudo`, run: `./install-trex.sh` | ||
* After install completes, replace the following files with copies from test ZIP `fix_trex_install` (or make changes listed in Known Issues): | ||
* `trex_client.py` --> `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/trex_client.py` | ||
* `trex_conn.py` --> `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/trex_conn.py` | ||
* `trex_global_stats.py` --> `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/stats/trex_global_stats.py` | ||
Comment on lines
+39
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is TRex stuff included here? Also, lines 41-43 have been addressed directly in install-trex.sh. Also a bit confused as to the relevance/reason why lines 45-48 exist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The TRex inclusions are because of the following line from the beginning of binary-search.py: Importing everything from trex_tg_lib in turn kicks off a chain of other imports - end result is that without TRex installed on a system, binary search crashes. For the sake of clarity I'll address the other questions in their own respective comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, that makes sense. I'll have to think if there is a way to work around this. Having to install TRex when you aren't using it just seems so broken... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put together a patch that I think will solve these TRex dependency issues: Can you have somebody test if this patch allows the Valkrie2544 stuff (this PR) to work without having the TRex stuff present as is described in the proposed README files? |
||
|
||
6. Setup is complete, ready for testing | ||
|
||
|
||
## Usage | ||
|
||
* Run tests by issuing command line arguments to `binary-search.py` (see next section for syntax) | ||
* Ex: `python binary-search.py --traffic-generator valkyrie2544 --traffic-profile TestConfig1kflows.x2544 --validation-runtime 120 --search-runtime 60` | ||
|
||
* Each test, a config file will be generated (by default `2bUsed.x2544`) - manually reviewing this file is helpful when troubleshooting | ||
* This file will be automatically created if none exists | ||
* Once created, this file will be overwritten by each successive test run | ||
|
||
* Test information will be printed to terminal while running | ||
|
||
* Results reports can be output in CSV, XML, or PDF | ||
* Default: CSV and XML reports are generated | ||
* PDF reports should not be used on Linux | ||
|
||
## Command Parameters | ||
|
||
* `--traffic-generator valkyrie2544` : required to use Xena functionality | ||
|
||
* `--traffic-profile <path_to_config_file>` : saved from Valkyrie2544.exe GUI with your config. | ||
|
||
* `--valkyrie2544-smart_search` : enable smart search, if verify fails will resume the search at the half way point between the last verify attempt and the minimum search value. Otherwise the search will resume at the last verify attempt value, minus the value threshhold. | ||
|
||
* `--validation-runtime` : sets the length of verification in seconds | ||
> Default : 600 (10 minutes) | ||
|
||
* `--max-retries` : Maximum number of verify attempts before giving up | ||
> Default : 1 | ||
|
||
* `--valkyrie2544-pdf_output` : Output PDF report file. Disabled by default; will cause a crash on linux usually as a PDF renderer is not installed. | ||
|
||
* `--valkyrie2544-windows_mode` : Enable windows mode. By default the mono package will be used to run the .exe file. If running on Windows this is not necessary. | ||
|
||
* `--search-runtime` : Modify original config to use the duration specified. | ||
|
||
* `--valkyrie2544-packet_sizes` : Customize packet sizes for throughput testing | ||
|
||
* `--max-loss-pct` : Specify number of packages which can be lost as a percentage ([0 - 100]) (ex: a max loss rate of 5% would be written as `--max-loss-pct 5`) | ||
|
||
* `--valkyrie2544-save_file_name` : Save config file which was created with the new arguments passed to this command. | ||
> Default : `./2bUsed.x2544` | ||
|
||
* `--valkyrie2544-initial_tput` : Specify initial rate for throughput test (ex: a initial rate of 50% would be written as `--valkyrie2544-initial_tput 50`) | ||
|
||
* `--valkyrie2544-max_tput` : Specify maximum rate for throughput test (ex: a maximum rate of 95% would be written as `--valkyrie2544-max_tput 95`) | ||
> Default : 100.00 | ||
|
||
* `--min-rate` : Specify minimum rate % for throughput test (ex: a minimum rate of 60% would be written as `--min-rate 60`) | ||
|
||
* `--valkyrie2544-resolution_tput` : Specify resolution for throughput testing | ||
|
||
* `--src-macs`: MAC address that becomes source of first active entity and destination for second (if two exist). | ||
|
||
* `--dst-macs` : If specified, becomes destination of first active entity and source for second | ||
|
||
* `--src-ips` : IP address that becomes source of first active entity and destination for second (if two exist). | ||
|
||
* `--dst-ips` : If specified, becomes destination of first active entity (src-ips) and source for second | ||
|
||
* `--use-src-ip-flows` / `--use-dst-ip-flows` : Apply flows to both MAC and IP addresses (if enabled overrides MAC flows option). Invoking either src-ip or dst-ip, or both, yields the same result | ||
> Default : 1 | ||
|
||
* `--use-src-mac-flows` / `--use-dst-mac-flows` : Apply flows to MAC addresses only (overridden if IP flows are enabled). Invoking either src-mac or dst-mac, or both, yields the same result | ||
> Default: 1 | ||
|
||
* `--xena_module` : Specify int corresponding to the Xena chassis module number. | ||
|
||
## Known Issues | ||
* SyntaxError from `trex_client.py` | ||
* Open `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/trex_client.py` | ||
* Change line 1188 from: `self.conn.async.set_timeout_sec(timeout_sec)` to: `self.conn.async_.set_timeout_sec(timeout_sec)` | ||
|
||
* SyntaxError from `trex_conn.py` | ||
* Open `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/trex_conn.py` | ||
* Change line 36 from: `self.async = TRexSubscriber(self.ctx, self.rpc)` to: `self.async_ = TRexSubscriber(self.ctx, self.rpc)` | ||
* Change line 60 from: `self.async.disconnect()` to: `self.async_.disconnect()` | ||
* Change line 89 from: `self.async.barrier()` to: `self.async_.barrier()` | ||
* Change line 98 from: `return self.async.barrier(baseline = True)` to: `return self.async_.barrier(baseline = True)` | ||
* Change line 110 from: `self.async.set_as_zombie()` to: `self.async_.set_as_zombie()` | ||
* Change line 143 from: `return ( self.async.last_data_recv_ts is not None and ((time.time() - self.async.last_data_recv_ts) <= 3) )` to `return ( self.async_.last_data_recv_ts is not None and ((time.time() - self.async_.last_data_recv_ts) <= 3) )` | ||
* Change line 189 from: `rc = self.async.connect()` to `rc = self.async_.connect()` | ||
|
||
* SyntaxError from `trex_global_stats.py` | ||
* Open `/opt/trex/current/automation/trex_control_plane/interactive/trex/common/stats/trex_global_stats.py` | ||
* Change line 81 from: `("async_util.", "{0}% / {1}".format( format_threshold(round_float(self.client.conn.async.monitor.get_cpu_util()), [85, 100], [0, 85]),` to: `("async_util.", "{0}% / {1}".format( format_threshold(round_float(self.client.conn.async_.monitor.get_cpu_util()), [85, 100], [0, 85]),` | ||
* Change line 82 from: `format_num(self.client.conn.async.monitor.get_bps() / 8.0, suffix = "B/sec"))),` to: `format_num(self.client.conn.async_.monitor.get_bps() / 8.0, suffix = "B/sec"))),` | ||
Comment on lines
+120
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, what relevance does TRex have to Valkyrie2544? We don't have problems like this when running TRex so I'm confused about why this stuff is here and why these problems are being seen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Egads, I thought I had commented on this already - my apologies! Back at the end of August I wrote this README as a "setup from scratch" sort of guide, which presumed the user had nothing already installed or configured. I walked through the process using a fresh Fedora 32 install, and wrote down the bare minimum steps necessary just to get the Xena functionality working. (At the time of writing the patch) binary-search.py required that a user also install TRex in order to function (as mentioned in a previous comment). But even after installing TRex I still couldn't run binary-search.py due to several crash-inducing errors I'd never seen before. I still don't know why these problems suddenly popped up, but I eventually traced the errors back to the TRex library. Perhaps some update from Cisco unintentionally introduced a bug? I also can't rule out that the problem might have been self-inflicted from some flaw in my install/setup process. Whatever the cause, I found that binary-search.py would stop crashing (at least enough so that the Xena bits worked) if I made a few tweaks to the TRex install. Hacky? Absolutely. But I lacked the necessary knowledge or skills to sort this problem out (or the time to develop such competencies). So I wrote those workarounds into the README in the hopes they'd be "good-enough" for folks needing to use Xena in the short term, at least while the TRex dependency issues persisted. TLDR; the TRex changes were just duct tape and will hopefully become unneeded/irrelevant/obsolete and removed as soon as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything more generic we could say her that would be useful to other people who might try to use this?