-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aws experiment setting and commands
- Loading branch information
1 parent
219f705
commit 431f4ca
Showing
8 changed files
with
292 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Packet Drop Performance | ||
|
||
|
||
**TRex command** | ||
|
||
```bash | ||
trex> start -f stl/udp_for_benchmarks.py --port 0 -d 60 -m XXmpps -t packet_len=64,stream_count=XX | ||
``` | ||
|
||
## Linux | ||
|
||
### iptables raw | ||
|
||
Add rule | ||
```bash | ||
sudo iptables --table raw --insert PREROUTING --jump DROP --in-interface ens6 | ||
``` | ||
|
||
> Remember to specify the interface (-i) , else all interface will be matched | ||
> Since that also includes management interface , you might lose connection to machine | ||
List rule | ||
```bash | ||
sudo iptables --table raw --list | ||
``` | ||
|
||
Get packet count | ||
```bash | ||
sudo iptables --table raw --list -v | ||
``` | ||
|
||
Reset counter | ||
```bash | ||
sudo iptables --table raw --list -Z | ||
``` | ||
|
||
Use mmwatch tool by Cloudflare | ||
|
||
```bash | ||
mmwatch 'sudo iptables -t raw -L -v -n -x | head' | ||
``` | ||
|
||
To remove rule | ||
```bash | ||
sudo iptables -t raw -D PREROUTING -j DROP -i ens6 | ||
``` | ||
|
||
### iptables filter (with conntrack) | ||
|
||
Add rule | ||
```bash | ||
sudo iptables -I FORWARD -d 48.0.0.1/32 -p udp --dport 12 -j DROP | ||
``` | ||
|
||
Verify conntrack | ||
``` | ||
vagrant@xdp-DUT:~$ sudo conntrack -L | ||
conntrack v1.4.6 (conntrack-tools): 0 flow entries have been shown. | ||
``` | ||
|
||
Get packet count | ||
```bash | ||
sudo iptables --list -v | ||
``` | ||
|
||
Reset counter | ||
```bash | ||
sudo iptables --list -Z | ||
``` | ||
|
||
Use mmwatch tool by Cloudflare | ||
|
||
```bash | ||
mmwatch 'sudo iptables -L -v -n -x | head' | ||
``` | ||
|
||
To remove rule | ||
```bash | ||
sudo iptables -D FORWARD -d 48.0.0.1/32 -p udp --dport 12 -j DROP | ||
``` | ||
|
||
## XDP | ||
|
||
|
||
```bash | ||
sudo ./xdp_rxq_info --dev ens6 --action XDP_DROP | ||
``` | ||
|
||
|
||
|
||
## Repeat | ||
|
||
**Redirect Traffic to N core** | ||
```bash | ||
sudo ethtool -L ens6 combined N | ||
``` | ||
|
||
*N -> 1 to 6* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# CPU Usage | ||
|
||
|
||
**TRex command** | ||
|
||
```bash | ||
trex> start -f stl/udp_for_benchmarks.py --port 0 -m XXkpps -t packet_len=64,stream_count=1 | ||
``` | ||
|
||
**Turn off CPU1** | ||
```bash | ||
echo 0 > /sys/devices/system/cpu/cpu1/online | ||
``` | ||
> Never turn off cpu0! | ||
**Redirect Traffic to single core** | ||
```bash | ||
sudo ethtool -L ens6 combined 1 | ||
``` | ||
|
||
**mpstat command** | ||
```mpstat``` | ||
|
||
```bash | ||
mpstat -u -I SUM -P ALL 10 3 | ||
``` | ||
|
||
## Linux | ||
|
||
```bash | ||
sudo iptables --table raw --insert PREROUTING --jump DROP --in-interface ens6 | ||
``` | ||
|
||
## XDP | ||
|
||
|
||
```bash | ||
sudo ./xdp_rxq_info --dev ens6 --action XDP_DROP | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# Packet Forwading Performance | ||
|
||
Similar to packet drop | ||
|
||
**TRex command** | ||
|
||
```bash | ||
trex> start -f stl/udp_for_benchmarks.py --port 0 -m 1mpps -t packet_len=64,stream_count=XX | ||
``` | ||
|
||
## XDP | ||
|
||
Same NIC / and Different NIC | ||
|
||
// TODO validate the working of below command | ||
```bash | ||
sudo ./xdp_rxq_info --dev ens6 --action XDP_REDIRECT | ||
``` | ||
|
||
You can use XDP_TX to forward packets using the same NIC by which it was received | ||
You can use XDP_REDIRECT to forward packets to a different network interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Software Routing | ||
|
||
**TRex command** | ||
|
||
```bash | ||
trex> start -f stl/udp_multi_ip.py -t packet_len=64,stream_count=20000,port_count=1 --port 0 -m 100% | ||
``` | ||
|
||
## Linux | ||
|
||
Route everything through more specific route trick: | ||
|
||
ip r add 0.0.0.0/1 via 198.18.2.11 | ||
ip r add 128.0.0.0/1 via 198.18.2.11 | ||
|
||
|
||
## XDP | ||
|
||
|
||
```bash | ||
sudo ./xdp_fwd -D ens6 ens7 -S | ||
``` | ||
|
||
Verify | ||
|
||
Starting xdp_fwd program | ||
sudo ./xdp_fwd -D mlx5p1 mlx5p2 i40e1 | ||
|
||
|
||
## Measuring | ||
Measure throughput with ethtool_stats.pl | ||
|
||
Use ethtool_stats.pl | ||
https://github.com/netoptimizer/network-testing/blob/master/bin/ethtool_stats.pl | ||
|
||
|
||
## Repeat | ||
|
||
**Installing full route table** | ||
``` | ||
wget https://kau.toke.dk/xdp/all-bgp-routes-20180419.txt.xz | ||
xzcat all-bgp-routes-20180419.txt.xz | sudo ./read_route_table.sh 198.18.100.66 | ||
$ ip r | wc -l | ||
752147 | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
|
||
|
||
## tRex | ||
|
||
**Configure Interface** | ||
```bash | ||
sudo ./dpdk_setup_ports.py -i | ||
``` | ||
|
||
```yaml | ||
- version: 2 | ||
interfaces: ['00:06.0', '00:07.0'] | ||
port_info: | ||
- ip: 198.18.1.11 | ||
default_gw: 198.18.1.10 | ||
- ip: 198.18.2.11 | ||
default_gw: 198.18.2.10 | ||
|
||
platform: | ||
master_thread_id: 0 | ||
latency_thread_id: 1 | ||
dual_if: | ||
- socket: 0 | ||
threads: [2,3] | ||
``` | ||
``` | ||
cd /usr/lib/x86_64-linux-gnu/ | ||
ln -s -f libc.a liblibc.a | ||
``` | ||
|
||
Launch the TRex server in Stateless mode: | ||
|
||
```bash | ||
cd v3.XX | ||
vagrant@tRex:/opt/trex/v3.00$ sudo ./t-rex-64 -i | ||
``` | ||
|
||
Launch the TRex console | ||
|
||
```bash | ||
vagrant@tRex:/opt/trex/v3.00$ ./trex-console | ||
``` | ||
|
||
Start traffic | ||
``` | ||
trex> start -f stl/udp_for_benchmarks.py --port 0 -m 1mpps -t packet_len=64,stream_count=1 | ||
``` | ||
|
||
|
||
|
||
## DUT | ||
|
||
sudo echo 1 > /proc/sys/net/ipv4/ip_forward | ||
sudo route add -net 16.0.0.0 netmask 255.0.0.0 gw 198.18.1.11 | ||
sudo route add -net 48.0.0.0 netmask 255.0.0.0 gw 198.18.2.11 | ||
|
||
|
||
### XDP in ENI issue | ||
|
||
```bash | ||
# set MTU with in XDP prog limit | ||
ip link set dev <interface> mtu 3498 | ||
# Number of RX/TX queues must be half the available channels, make just 1 for 1 CPU. 2 for 2 CPU | ||
# Must be half of number of CPU fpr this to work | ||
ethtool -L <interface> combined 1 | ||
``` | ||
|