Skip to content

Commit c9d8ca5

Browse files
flowgraph
1 parent 776af60 commit c9d8ca5

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

flowgraph-down.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
sudo kill $(cat pids)

flowgraph-up.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
PIDS=""
6+
7+
sudo pkt-gen -i netmap:pipe{1 -f tx -s 10.0.0.1:7000-10.0.0.1:7010 -d 10.0.0.1:8000-10.0.0.1:8004 &> /dev/null &
8+
PIDS="$PIDS $!"
9+
sleep 0.5
10+
sudo ./fe -i netmap:pipe}1 -i netmap:pipe{2 -i netmap:pipe{3 -p 8000 -p 8001 &
11+
PIDS="$PIDS $!"
12+
sleep 0.5
13+
sudo ./swap -i netmap:pipe}2 -i netmap:pipe{4 &
14+
PIDS="$PIDS $!"
15+
sleep 0.5
16+
sudo ./swap -i netmap:pipe}3 -i netmap:pipe{5 &
17+
PIDS="$PIDS $!"
18+
sleep 0.5
19+
sudo ./sink -i netmap:pipe}4 -p 7000 &
20+
PIDS="$PIDS $!"
21+
sleep 0.5
22+
sudo ./sink -i netmap:pipe}5 -p 7001 &
23+
PIDS="$PIDS $!"
24+
sleep 0.5
25+
26+
echo $PIDS > pids

flowgraph.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
================== NFV graph definition ==================
2+
3+
GEN1 -----> FE -----> SWAP1 ----> SINK1
4+
|
5+
-------> SWAP1 ----> SINK2
6+
7+
GEN1 = pkt-gen generating UDP packets with dst port range 8000-8004
8+
and src port range 7000-7010;
9+
FE = packets belonging to port 8000 are forwarded to SWAP1, while
10+
packets belonging to port 8001 are forwarded to SWAP2; all
11+
the other packets are dropped;
12+
SWAP = swaps UDP source and destination ports and forwards
13+
SINK = counts the number of packets received on a given UDP port.
14+
SINK1 counts the number of packets received on port 7000,
15+
while SINK2 counts the number of packets received ont port
16+
7001.
17+
18+
SINK1 and SWAP2 run in a VM, while GEN1, FE, SWAP1 and SINK2 run
19+
on the host.

0 commit comments

Comments
 (0)