#!/bin/sh # TOPO: local (10.73.131.158) <--> peer (10.73.131.202) [hosts not netns] peer_run() { ssh root@10.73.131.202 "$@" # echo " - peer run: $@" # echo " - print any key to continue after it's done" # read } modprobe sctp echo "sctp sysctl memory control rmem:" echo "--------------------------------" echo "10 20 50 rmem limit ->" pkill sctp_test 2> /dev/null sysctl -w net.sctp.sctp_mem="10 20 50" sctp_test -H 10.73.131.158 -P 1234 -l > /dev/null 2>&1 & sleep 3 peer_run "time sctp_test -H 10.73.131.202 -P 8000 -h 10.73.131.158 -p 1234 -s -c 5 > /dev/null 2>&1" echo "" echo "20 50 100 rmem limit ->" pkill sctp_test 2> /dev/null sysctl -w net.sctp.sctp_mem="20 50 100" sctp_test -H 10.73.131.158 -P 1234 -l > /dev/null 2>&1 & sleep 3 peer_run "time sctp_test -H 10.73.131.202 -P 8000 -h 10.73.131.158 -p 1234 -s -c 5 > /dev/null 2>&1" echo "" echo "sctp sysctl memory control wmem:" echo "--------------------------------" peer_run "sctp_test -H 10.73.131.202 -P 8000 -l > /dev/null 2>&1 &" tc qdisc add dev eth0 root netem delay 50ms echo "10 20 50 wmem limit ->" sysctl -w net.sctp.sctp_mem="5 10 20" time sctp_test -h 10.73.131.202 -p 8000 -H 10.73.131.158 -P 1234 -s -c 5 > /dev/null 2>&1 echo "" echo "10 50 100 wmem limit ->" sysctl -w net.sctp.sctp_mem="10 50 100 ->" time sctp_test -h 10.73.131.202 -p 8000 -H 10.73.131.158 -P 1234 -s -c 5 > /dev/null 2>&1 echo "" tc qdisc delete dev eth0 root peer_run "pkill sctp_test 2>/dev/null"