Skip to content

Commit

Permalink
Add aws experiment setting and commands
Browse files Browse the repository at this point in the history
  • Loading branch information
naveenrajm7 committed Nov 30, 2022
1 parent 219f705 commit 431f4ca
Show file tree
Hide file tree
Showing 8 changed files with 292 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Baseline speed


## c5n.xlarge

iperf3

```bash
Expand Down Expand Up @@ -133,4 +136,12 @@ Removing all streams from port(s) [0._]: [SUCCESS]
Attaching 1 streams to port(s) [0._]: [SUCCESS]
Starting traffic on port(s) [0._]: [FAILED]
start - Port 0 : *** Expected L1 B/W: '16.8 Gbps' exceeds port line rate: '16.384 Gbps'
```
```



======================================

## c5n.18large


98 changes: 98 additions & 0 deletions exp-setup/aws/bench/01drop.md
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*
40 changes: 40 additions & 0 deletions exp-setup/aws/bench/02cpu-drop.md
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
```

22 changes: 22 additions & 0 deletions exp-setup/aws/bench/03forward.md
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
46 changes: 46 additions & 0 deletions exp-setup/aws/bench/04route.md
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
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


## tRex

start -f stl/udp_for_benchmarks.py --port 0 -m 24mpps -t packet_len=64,stream_count=1
Expand Down Expand Up @@ -46,3 +45,8 @@ rx_queue_index 0:0 582609 0
rx_queue_index 0:sum 582609
```




===================================================

Empty file.
69 changes: 69 additions & 0 deletions exp-setup/aws/exp-settings.md
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
```

0 comments on commit 431f4ca

Please sign in to comment.