[net2-wg] CTP experiments
Omprakash Gnawali
gnawali at usc.edu
Fri May 25 10:25:29 PDT 2007
> From a few experiments, it became pretty clear that the current
> switch threshold is *way* too high. I think that to start to really
> nail down what these values should be, I need to run a long series of
> simulation experiments with different values, which we can then
> compare with real network results.
>
> For now, though, I found that changing the parameters to
>
> switch threshold = 0.2
> alpha = 0.5
> data window = 5
>
> was much more effective.
>
Alpha and data window are related parameters because they both control
how the packet arrival pattern is summarized. I wrote a simple script
to experiment with switching threshold, alpha, and data window
sizes. It seems that a large alpha AND a large data window is not
useful in the long run.
import random
from sys import *
# 50% pkt success
# regular pattern of 1, 0, 1, 0, ...
def pkt_arrival_on_off(n):
for i in range(n):
if i % 2 == 0:
yield True
else:
yield False
# 80% pkt success
# regular pattern of four 1's and one 0, ...
def pkt_arrival_1(n):
for i in range(n):
if i % 5 == 0:
yield False
else:
yield True
#80% pkt success
#random number generator
def pkt_arrival_2(n):
for i in range(n):
if random.random() > 0.05:
yield True
else:
yield False
nval = pkt_arrival_2(500)
window_size = 3
alpha = 0.2
est = newest = 10
threshold = 1.5
pktbuf = []
print "est, curest"
for v in nval:
pktbuf.append(v)
if len(pktbuf) == window_size:
if sum(pktbuf) == 0:
curest = len(pktbuf)
else:
curest = 1.0 * len(pktbuf) / sum(pktbuf)
newest = alpha * est + (1-alpha)*curest
if est - newest > threshold:
print "parent switched"
est = newest
print "%0.03f, %.03f" % (est, curest)
pktbuf = []
- om_p
More information about the net2-wg
mailing list