Commit fc95184d authored by Matous Holinka's avatar Matous Holinka

duplicates removed

parent 4ac65362
[submodule "perf/violin"]
path = perf/violin
url = git://trezor.joja.cz/violin.git
log "multitab.log" all;
debug protocols all;
router id 1.1.1.1;
protocol static {
ipv4 { import all; };
route 1.1.1.1/32 via 55.55.55.5;
route 2.2.2.2/32 via 55.55.55.5;
route 6.5.4.2/32 unreachable;
}
protocol static {
ipv6 { import all; };
route 3f3f:5::/64 via fe80::d4c9:31ff:fedd:bfb5%du;
}
vpn4 table v4;
vpn6 table v6;
protocol static {
vpn4;
route 3:5 7.7.7.7/32 via 55.55.55.5 mpls 55;
route 4:4 6.6.0.0/16 via 55.55.55.5 mpls 55;
}
protocol static zezeze {
vpn6;
route 4:4 2001:0:66::/48 via 55.55.55.5 mpls 55;
route 5:6 2001:0:66::/48 via 55.55.55.5 mpls 55;
route 7:8 3f3f:5::/64 via fe80::d4c9:31ff:fedd:bfb5%du mpls 48;
route 7:7 ::/64 via 55.55.55.5 mpls 33;
}
protocol device {}
protocol bfd {
interface "du" {};
}
protocol bgp {
ipv4 { export all; import all; };
ipv6 { export all; import all; };
bfd;
vpn4 mpls { export all; import all;};
neighbor 55.55.55.99 as 65555;
local 55.55.55.55 as 65544;
}
protocol bgp {
ipv4 { export all; import all; };
ipv6 { export all; import all; };
bfd;
vpn4 mpls { export all; import all;};
neighbor 55.55.55.55 as 65544;
local 55.55.55.99 as 65555;
}
protocol babel {
ipv4 { import all; export all; };
interface "du" {};
}
protocol ospf {
ipv4 { import all; export all; };
area 0 { interface "du" { }; };
}
ipv4 table bagr;
protocol static {
ipv4 { table bagr; import all; };
route 3.1.1.1/32 via 55.55.55.5;
route 4.2.2.2/32 via 55.55.55.5;
}
flow4 table f4;
protocol static {
flow4;
route flow4 {
dst 10.0.0.0/8;
proto = 23;
dport > 24 && < 30 || 40..50,60..70,80;
sport > 24 && < 30 || = 40 || 50,60..70,80;
icmp type 80;
icmp code 90;
tcp flags 0x03/0x0f;
length 2048..65535;
dscp = 63;
fragment dont_fragment, is_fragment || !first_fragment;
} action { rate 64 GBps; };
route flow4 {
dst 12.0.0.0/32;
tcp flags ! 0/0x999;
} action { rate 6666 kbps; };
route flow4 {
dst 220.0.254.0/24;
tcp flags 0x99/0x999;
} action { last; rt 6145, 124395; };
route flow4 {
dst 220.0.254.192/28;
tcp flags ! 0xfff/0xfff;
} action { sample; dscp 13; };
route flow4 {
dst 15.0.0.0/8;
tcp flags ! 0x999/0x999;
} action { rate 123456 mBps; last; sample; };
route flow4 {
dst 11.0.0.0/8;
proto = 0x12;
sport > 0x5678 && < 0x9abc || 0xdef0 || 0x1234,0x5678,0x9abc..0xdef0;
dport = 50;
tcp flags 0x000/0xf00;
} action { rate 1084436 mbps; };
}
log "perftest.log" all;
protocol device {}
protocol perf perf_accept {
ipv4 { import all; };
exp from 10;
exp to 25;
repeat 7;
threshold min 1 ms;
threshold max 1234 ms;
}
ipv4 table xx;
protocol perf perf_multi {
ipv4 { import all; };
exp from 10;
exp to 25;
repeat 7;
threshold min 1 ms;
threshold max 1234 ms;
}
ipv4 table xxp;
template pipe pp { table xx; peer table xxp; import none; export none; }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
protocol pipe from pp { }
#!/bin/bash
set -e
LOC=$(dirname $0)
CONF=${1:-${LOC}/perf-test-all.conf}
./bird -lc $CONF -P perftest.pid
for p in $(./birdc -l show protocols | sed -rn 's/(\S+)\s+Perf\s+.*/\1/p'); do
./birdc -l enable $p
tail -f perftest.log | while read dd; do
echo $dd
case $dd in
*\ $p\ done\ with\ *) echo "protocol $p done"; break ;;
*\<BUG\>*) echo "something nasty happened"; break ;;
esac
done
./birdc -l disable $p
done
./birdc -l down
log "perftest.log" all;
router id 1.1.1.1;
protocol device {}
template perf pt {
disabled;
exp from 10;
exp to 26;
repeat 7;
threshold max 200 ms;
threshold min 1 ms;
}
function f_reject() {
reject;
}
define indirect = 6;
protocol perf perf_none from pt { ipv4 { import none; }; }
protocol perf perf_reject from pt { ipv4 { import filter { reject; }; }; }
protocol perf perf_false from pt { ipv4 { import where false; }; }
protocol perf perf_call from pt { ipv4 { import filter { f_reject(); }; }; }
filter f_assign_int_constant int x; { x = 5; reject; };
protocol perf perf_assign_int_constant from pt { ipv4 { import filter f_assign_int_constant; }; }
filter f_assign_ip_constant ip x; { x = 66.66.66.66; reject; };
protocol perf perf_assign_ip_constant from pt { ipv4 { import filter f_assign_ip_constant; }; }
filter f_assign_indirect int x; { x = indirect; reject; };
protocol perf perf_assign_indirect from pt { ipv4 { import filter f_assign_indirect; }; }
filter f_set_pref { preference = 64; reject; };
protocol perf perf_set_pref from pt { ipv4 { import filter f_set_pref; }; }
filter f_set_rta { scope = SCOPE_SITE; reject; };
protocol perf perf_set_rta from pt { ipv4 { import filter f_set_rta; }; }
filter f_set_ea { bgp_next_hop = 42.42.42.42; reject; };
protocol perf perf_set_ea from pt { ipv4 { import filter f_set_ea; }; }
filter f_get_pref int x; { preference = 64; x = preference; reject; };
protocol perf perf_get_pref from pt { ipv4 { import filter f_get_pref; }; }
filter f_get_rta ip x; { x = gw; reject; };
protocol perf perf_get_rta from pt { ipv4 { import filter f_get_rta; }; }
filter f_get_ea ip x; { bgp_next_hop = 42.42.42.42; x = bgp_next_hop; reject; };
protocol perf perf_get_ea from pt { ipv4 { import filter f_get_ea; }; }
filter f_construct_ec ec x; { x = (ro, 42, 42); reject; };
protocol perf perf_construct_ec from pt { ipv4 { import filter f_construct_ec; }; }
filter f_path_prepend0 { bgp_path = +empty+; reject; }
protocol perf perf_path_prepend0 from pt { ipv4 { import filter f_path_prepend0; }; }
filter f_path_prepend1 { bgp_path = +empty+; bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend1 from pt { ipv4 { import filter f_path_prepend1; }; }
filter f_path_prepend2 { bgp_path = +empty+; bgp_path.prepend(42); bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend2 from pt { ipv4 { import filter f_path_prepend2; }; }
filter f_path_prepend3 { bgp_path = +empty+; bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend3 from pt { ipv4 { import filter f_path_prepend3; }; }
filter f_path_prepend4 { bgp_path = +empty+; bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend4 from pt { ipv4 { import filter f_path_prepend4; }; }
filter f_path_prepend5 { bgp_path = +empty+; bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend5 from pt { ipv4 { import filter f_path_prepend5; }; }
filter f_path_prepend6 { bgp_path = +empty+; bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); bgp_path.prepend(42); reject; }
protocol perf perf_path_prepend6 from pt { ipv4 { import filter f_path_prepend6; }; }
attribute int p1;
attribute int p2;
attribute int p3;
attribute int p4;
attribute int p5;
attribute int p6;
filter f_custom1 { p1 = 42; reject; }
protocol perf perf_custom1 from pt { ipv4 { import filter f_custom1; }; }
filter f_custom2 { p1 = 42; p2 = 42; reject; }
protocol perf perf_custom2 from pt { ipv4 { import filter f_custom2; }; }
filter f_custom3 { p1 = 42; p2 = 42; p3 = 42; reject; }
protocol perf perf_custom3 from pt { ipv4 { import filter f_custom3; }; }
filter f_custom4 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; reject; }
protocol perf perf_custom4 from pt { ipv4 { import filter f_custom4; }; }
filter f_custom5 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; p5 = 42; reject; }
protocol perf perf_custom5 from pt { ipv4 { import filter f_custom5; }; }
filter f_custom6 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; p5 = 42; p6 = 42; reject; }
protocol perf perf_custom6 from pt { ipv4 { import filter f_custom6; }; }
filter f_ec_list0 { bgp_ext_community = --empty--; reject; };
protocol perf perf_ec_list0 from pt { ipv4 { import filter f_ec_list0; }; }
filter f_ec_list1 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); reject; };
protocol perf perf_ec_list1 from pt { ipv4 { import filter f_ec_list1; }; }
filter f_ec_list2 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); reject; };
protocol perf perf_ec_list2 from pt { ipv4 { import filter f_ec_list2; }; }
filter f_ec_list3 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); reject; };
protocol perf perf_ec_list3 from pt { ipv4 { import filter f_ec_list3; }; }
filter f_ec_list4 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); reject; };
protocol perf perf_ec_list4 from pt { ipv4 { import filter f_ec_list4; }; }
filter f_ec_list5 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); bgp_ext_community.add((rt, 46, 4246)); reject; };
protocol perf perf_ec_list5 from pt { ipv4 { import filter f_ec_list5; }; }
filter f_ec_list6 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); bgp_ext_community.add((rt, 46, 4246)); bgp_ext_community.add((rt, 47, 4247)); reject; };
protocol perf perf_ec_list6 from pt { ipv4 { import filter f_ec_list6; }; }
This diff is collapsed.
#!/usr/bin/perl
use common::sense;
my $n = int($ARGV[0]) or die "Argument must be an integer";
print <<EOF;
log "perftest.log" all;
router id 1.1.1.1;
protocol device {}
template perf pt {
disabled;
exp from 10;
exp to 26;
repeat 5;
threshold max 300 ms;
threshold min 5 ms;
}
function f_reject() {
reject;
}
protocol perf perf_none from pt { ipv4 { import none; }; }
protocol perf perf_reject from pt { ipv4 { import filter { reject; }; }; }
filter f_int int xxx; { xxx = 42; reject; }
filter f_ec ec xxx; { xxx = (rt, 42, 4242); reject; }
protocol perf perf_int from pt { ipv4 { import filter f_int; }; }
protocol perf perf_ec from pt { ipv4 { import filter f_ec; }; }
EOF
for (my $i=0; $i<$n; $i++) {
say "attribute int p$i;";
}
for (my $i=0; $i<=$n; $i++) {
say "filter f_custom$i {";
for (my $j=0; $j<$i; $j++) {
say "p$j = 42;";
}
say "reject; }";
say "protocol perf perf_custom$i from pt { ipv4 { import filter f_custom$i; }; }";
say "filter f_ec_list$i {";
# bgp_ext_community = --empty--; ";
for (my $j=0; $j<$i; $j++) {
say "bgp_ext_community.add((rt, 42, $j));";
}
say "reject; }";
say "protocol perf perf_ec$i from pt { ipv4 { import filter f_ec_list$i; }; }";
}
log "perftest.log" all;
router id 1.1.1.1;
protocol device {}
template perf pt {
disabled;
exp from 10;
exp to 26;
repeat 20;
threshold max 300 ms;
threshold min 5 ms;
}
function f_reject() {
reject;
}
protocol perf perf_none from pt { ipv4 { import none; }; }
protocol perf perf_reject from pt { ipv4 { import filter { reject; }; }; }
attribute int p1;
attribute int p2;
attribute int p3;
attribute int p4;
attribute int p5;
attribute int p6;
filter f_custom1 { p1 = 42; reject; }
protocol perf perf_custom1 from pt { ipv4 { import filter f_custom1; }; }
filter f_custom2 { p1 = 42; p2 = 42; reject; }
protocol perf perf_custom2 from pt { ipv4 { import filter f_custom2; }; }
filter f_custom3 { p1 = 42; p2 = 42; p3 = 42; reject; }
protocol perf perf_custom3 from pt { ipv4 { import filter f_custom3; }; }
filter f_custom4 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; reject; }
protocol perf perf_custom4 from pt { ipv4 { import filter f_custom4; }; }
filter f_custom5 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; p5 = 42; reject; }
protocol perf perf_custom5 from pt { ipv4 { import filter f_custom5; }; }
filter f_custom6 { p1 = 42; p2 = 42; p3 = 42; p4 = 42; p5 = 42; p6 = 42; reject; }
protocol perf perf_custom6 from pt { ipv4 { import filter f_custom6; }; }
filter f_ec_list0 { bgp_ext_community = --empty--; reject; };
protocol perf perf_ec_list0 from pt { ipv4 { import filter f_ec_list0; }; }
filter f_ec_list1 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); reject; };
protocol perf perf_ec_list1 from pt { ipv4 { import filter f_ec_list1; }; }
filter f_ec_list2 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); reject; };
protocol perf perf_ec_list2 from pt { ipv4 { import filter f_ec_list2; }; }
filter f_ec_list3 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); reject; };
protocol perf perf_ec_list3 from pt { ipv4 { import filter f_ec_list3; }; }
filter f_ec_list4 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); reject; };
protocol perf perf_ec_list4 from pt { ipv4 { import filter f_ec_list4; }; }
filter f_ec_list5 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); bgp_ext_community.add((rt, 46, 4246)); reject; };
protocol perf perf_ec_list5 from pt { ipv4 { import filter f_ec_list5; }; }
filter f_ec_list6 { bgp_ext_community = --empty--; bgp_ext_community.add((rt, 42, 4242)); bgp_ext_community.add((rt, 43, 4243)); bgp_ext_community.add((rt, 44, 4244)); bgp_ext_community.add((rt, 45, 4245)); bgp_ext_community.add((rt, 46, 4246)); bgp_ext_community.add((rt, 47, 4247)); reject; };
protocol perf perf_ec_list6 from pt { ipv4 { import filter f_ec_list6; }; }
This diff is collapsed.
log "test-roa-autochange.log" all;
router id 1.1.1.1;
debug protocols all;
protocol device {}
roa4 table r4t;
protocol static {
roa4 { table r4t; import all; };
route 64.0.0.0/8 max 16 as 65533;
# route 112.96.0.0/12 max 18 as 65534;
route 112.96.0.0/12 max 18 as 65533;
}
ipv4 table i4a;
ipv4 table i4aa;
ipv4 table i4valid;
ipv4 table i4invalid;
ipv4 table i4unknown;
protocol static {
ipv4 { table i4a; import all; };
route 64.0.0.0/7 unreachable { bgp_path.prepend(65533); };
route 64.0.0.0/9 unreachable { bgp_path.prepend(65533); };
route 64.0.64.0/20 unreachable { bgp_path.prepend(65533); };
route 64.64.0.0/16 unreachable { bgp_path.prepend(65533); };
route 10.20.30.40/32 unreachable { bgp_path.prepend(65533); };
route 64.64.64.64/32 unreachable { bgp_path.prepend(65533); };
route 112.97.0.0/16 unreachable { bgp_path.prepend(65533); };
route 112.96.128.0/17 unreachable { bgp_path.prepend(65533); };
route 112.96.128.0/19 unreachable { bgp_path.prepend(65533); };
route 112.96.112.0/24 unreachable { bgp_path.prepend(65533); };
}
protocol pipe {
table i4a;
peer table i4valid;
export where roa_check(r4t) = ROA_VALID;
}
protocol pipe {
table i4a;
peer table i4invalid;
export where roa_check(r4t) = ROA_INVALID;
}
protocol pipe {
table i4a;
peer table i4unknown;
export where roa_check(r4t) = ROA_UNKNOWN;
}
protocol pipe {
table i4a;
peer table i4aa;
export all;
}
# Run Bird with this config file to test route propagation.
router id 127.0.0.1;
log "test-route-handling.log" all;
debug protocols all;
protocol device {}
attribute int test4;
attribute int test2;
attribute int test3;
ipv4 table tab1;
ipv4 table tab2;
filter fx {
test4 = test4 + 1;
accept;
}
# Generate the routes to test
protocol static {
ipv4 {
table tab1;
export none;
import filter fx;
};
# Fix the nexthops to something real,
route 10.20.1.0/24 via "lo" { test4 = 64; };
}
# Pipe them somewhere else to test more filtering
protocol pipe p1 {
table tab1;
peer table tab2;
export filter fx;
}
# Run Bird with this config file to test route propagation.
router id 127.0.0.1;
log "test-route-handling.log" all;
debug protocols all;
protocol device {}
attribute int test1;
ipv4 table tab1;
ipv4 table tab2;
function myset(int pref; int rm; int igm; int honey; clist cl; int t1) {
preference = pref;
rip_metric = rm;
igp_metric = igm;
bgp_med = honey;
bgp_community = cl;
test1 = t1;
};
function set_init() {
myset(30, 42, 4, 123, -empty-, 65536);
}
function mycheck(string wh; int pref; int rm; int igm; int honey; clist cl; pair cladd; int t1) {
print "Check in ", wh, " for net ", net;
if (preference != pref) then {
print "Error in preference, is ", preference, " should be ", pref;
quitbird;
}
else print "Preference OK";
if (rip_metric != rm) then {
print"Error in rip_metric, is ", rip_metric, " should be ", rm;
quitbird;
}
else print "RIP metric OK";
if (igp_metric != igm) then {
print"Error in igp_metric, is ", igp_metric, " should be ", igm;
quitbird;
}
else print "IGP metric OK";
if (bgp_med != honey) then {
print"Error in bgp_med, is ", bgp_med, " should be ", honey;
quitbird;
}
else print "MED OK";
if (bgp_community != cl) then {
print"Error in bgp_community, is ", bgp_community, " should be ", cl;
quitbird;
}
else print "Community OK";
if (test1 != t1) then {
print"Error in test1, is ", test1, " should be ", t1;
quitbird;
}
else print "TEST1 OK";
myset(pref + 1, rm + 1, igm + 1, honey + 1, add(cl, cladd), test1 + 1);
print "Update OK";
accept;
};
# Generate the routes to test
protocol static {
ipv4 {
table tab1;
export none;
import filter {
if ( net ~ 10.20.0.0/22 ) then {
print("This message should repeat 3 times.");
}
mycheck("static", 30, 42, 4, 123, -empty-, (1, 2), 65536);
};
};
# Fix the nexthops to something real,
route 10.20.1.0/24 via "lo" { set_init(); };
route 10.20.2.0/24 via "lo" { set_init(); };
route 10.20.3.0/24 via "lo" { set_init(); };
route 10.20.4.0/24 via "lo" { set_init(); };
}
# Pipe them somewhere else to test more filtering
protocol pipe p1 {
table tab1;
peer table tab2;
export filter {
mycheck("p1", 31, 43, 5, 124, add(-empty-, (1, 2)), (3, 4), 65537);
};
}
# Run Bird with this config file to test route propagation.
router id 127.0.0.1;
log "test-route-handling-old.log" all;
debug protocols all;
protocol device {}
ipv4 table tab1;
ipv4 table tab2;
function myset(int pref; int rm; int igm; int honey; clist cl) {
preference = pref;
rip_metric = rm;
igp_metric = igm;
bgp_med = honey;
bgp_community = cl;
};
function set_init() {
myset(30, 42, 4, 123, -empty-);
}
function mycheck(string wh; int pref; int rm; int igm; int honey; clist cl; pair cladd) {
print "Check in ", wh, " for net ", net;
if (preference != pref) then {
print "Error in preference, is ", preference, " should be ", pref;
}
else print "Preference OK";
if (rip_metric != rm) then {
print"Error in rip_metric, is ", rip_metric, " should be ", rm;
}
else print "RIP metric OK";
if (igp_metric != igm) then {
print"Error in igp_metric, is ", igp_metric, " should be ", igm;
}
else print "IGP metric OK";
if (bgp_med != honey) then {
print"Error in bgp_med, is ", bgp_med, " should be ", honey;
}
else print "MED OK";
if (bgp_community != cl) then {
print"Error in bgp_community, is ", bgp_community, " should be ", cl;
}
else print "Community OK";
myset(pref + 1, rm + 1, igm + 1, honey + 1, add(cl, cladd));
print "Update OK";
accept;
};
# Generate the routes to test
protocol static {
ipv4 {
table tab1;
export none;
import filter {
if ( net ~ 10.20.0.0/22 ) then {
print("This message should repeat 3 times.");
}
mycheck("static", 30, 42, 4, 123, -empty-, (1, 2));