Commit bca66466 authored by Kevin Atkinson's avatar Kevin Atkinson

Implement front-end parts for backfill changes. Added the following

NS commands:
  tb-set-link-backfill <link> <bw>
  tb-set-link-simplex-backfill <link> <src node> <bw>
  tb-set-lan-backfill <lan> <bw>
  tb-set-node-lan-backfill <node> <lan> <bw>
  tb-set-lan-simplex-backfill <lan> <node> <tobw> <frombw>
for now the tbres/FBSD410-DEL-BACKFILL image needs to be used.
parent f51d925c
......@@ -615,7 +615,7 @@ my %memberof = ();
# delaylinks stores the actual link delay info, converted from the
# virt delay params above. It is indexed by link name and contains a
# [delay,bw,loss] array for each direction. The final member of the
# [delay,bw,backfill,loss] array for each direction. The final member of the
# array is an indicator of whether the info is there strictly for a
# trivial link (linkdelay inserted only when assign makes link trivial).
my %delaylinks = ();
......@@ -1868,15 +1868,15 @@ foreach $plink (keys(%plinks)) {
$protolandst->AddMember($nodeC, $portC);
$protolandst->AddMember($nodeD, $portD);
my ($member0,$delay,$bandwidth,$lossrate,
$member1,$rdelay,$rbandwidth,$rlossrate) = @{$delaylinks{$plink}};
my ($member0,$delay,$bandwidth,$backfill,$lossrate,
$member1,$rdelay,$rbandwidth,$rbackfill,$rlossrate) = @{$delaylinks{$plink}};
$nodedelays{$delayid++} = [$nodeB,$portB,$portD,$lan,
$member0,$delay,$bandwidth,$lossrate,
$member1,$rdelay,$rbandwidth,$rlossrate];
$member0,$delay,$bandwidth,$backfill,$lossrate,
$member1,$rdelay,$rbandwidth,$rbackfill,$rlossrate];
printdb " Delay: \[$nodeB,$portB,$portD,$lan," .
"$delay,$bandwidth,$lossrate,$rdelay,$rbandwidth," .
"$rlossrate,$nodeportA,$nodeportC\]\n";
"$delay,$bandwidth,$backfill,$lossrate,$rdelay,$rbandwidth," .
"$rbackfill,$rlossrate,$nodeportA,$nodeportC\]\n";
#
# Setup portmap using virt members in plink name.
......@@ -1940,14 +1940,14 @@ foreach $plink (keys(%plinks)) {
$protolanlink->AddMember($nodeA, $portA);
$protolanlink->AddMember($nodeB, $portB);
my ($member0,$delay,$bandwidth,$loss,
$member1,$rdelay,$rbandwidth,$rloss) = @{$delaylinks{$plink}};
my ($member0,$delay,$bandwidth,$backfill,$loss,
$member1,$rdelay,$rbandwidth,$rbackfill,$rloss) = @{$delaylinks{$plink}};
$nodedelays{$delayid++} = [$nodeB,$portB,$portD,$lan,
$member0,$delay,$bandwidth,$loss,
$member1,$rdelay,$rbandwidth,$rloss];
$member0,$delay,$bandwidth,$backfill,$loss,
$member1,$rdelay,$rbandwidth,$rbackfill,$rloss];
printdb " Delays: \[$nodeB,$portB,$portD,$lan," .
"$delay,$bandwidth,$loss,$rdelay,$rbandwidth,$rloss," .
"$delay,$bandwidth,$backfill,$loss,$rdelay,$rbandwidth,$rbackfill,$rloss," .
"$nodeportA,$nodeportC\]\n";
$portmap{$virtA} = $portA;
......@@ -2048,8 +2048,8 @@ foreach $plink (keys(%plinks)) {
printdb " $virtB = $portB\n";
if ($delaylinks{$plink}) {
my ($member0,$delay,$bandwidth,$loss,
$member1,$rdelay,$rbandwidth,$rloss,$trivonly) =
my ($member0,$delay,$bandwidth,$backfill,$loss,
$member1,$rdelay,$rbandwidth,$rbackfill,$rloss,$trivonly) =
@{$delaylinks{$plink}};
if (!$trivonly || $trivonly && $trivial) {
......@@ -2057,16 +2057,16 @@ foreach $plink (keys(%plinks)) {
# Two entries, one for each side of the duplex link.
#
$linkdelays{$delayid++} = [$nodeA,$portA,$lan,$member0,
$delay,$bandwidth,$loss,
$delay,$bandwidth,$backfill,$loss,
undef,undef,undef,0];
$linkdelays{$delayid++} = [$nodeB,$portB,$lan,$member1,
$rdelay,$rbandwidth,$rloss,
$rdelay,$rbandwidth,$rbackfill,$rloss,
undef,undef,undef,0];
printdb " LinkDelay: \[$nodeA,$portA,$nodeB,$portB," .
"$lan,$delay,$bandwidth,$loss,$rdelay,".
"$rbandwidth,$rloss,$trivonly\]\n";
"$lan,$delay,$bandwidth,$backfill,$loss,$rdelay,".
"$rbackfill,$rbandwidth,$rloss,$trivonly\]\n";
}
}
#
......@@ -2203,8 +2203,8 @@ foreach $plink (keys(%plinks)) {
printdb " $virtA = $portA\n";
if ($delaylinks{$plink}) {
my ($member0,$delay,$bandwidth,$loss,
$member1,$rdelay,$rbandwidth,$rloss,$trivonly) =
my ($member0,$delay,$bandwidth,$backfill,$loss,
$member1,$rdelay,$rbandwidth,$rbackfill,$rloss,$trivonly) =
@{$delaylinks{$plink}};
if (!$trivonly || $trivonly && $trivial) {
......@@ -2212,12 +2212,12 @@ foreach $plink (keys(%plinks)) {
# One entry, comprising each side of the link to lan.
#
$linkdelays{$delayid++} = [$nodeA,$portA,$lan,$member0,
$delay,$bandwidth,$loss,
$rdelay,$rbandwidth,$rloss,1];
$delay,$bandwidth,$backfill,$loss,
$rdelay,$rbandwidth,$rbackfill,$rloss,1];
printdb " LinkDelay: \[$nodeA,$portA," .
"$lan,$delay,$bandwidth,$loss,$rdelay,".
"$rbandwidth,$rloss,$trivonly\]\n";
"$lan,$delay,$bandwidth,$backfill,$loss,$rdelay,".
"$rbandwidth,$rbackfill,$rloss,$trivonly\]\n";
}
}
#
......@@ -2364,8 +2364,8 @@ foreach my $lan (keys(%virt_lans)) {
foreach $delayid (keys(%nodedelays)) {
# So r* indicates int1->int0 and others are int0->int1
my ($pnode,$int0,$int1,$vname,
$member0,$delay,$bandwidth,$lossrate,
$member1,$rdelay,$rbandwidth,$rlossrate) = @{$nodedelays{$delayid}};
$member0,$delay,$bandwidth,$backfill,$lossrate,
$member1,$rdelay,$rbandwidth,$rbackfill,$rlossrate) = @{$nodedelays{$delayid}};
# ipfw pipe number so we can control it remotely.
my $pipe0 = physnodenextpipe($pnode);
......@@ -2399,8 +2399,8 @@ foreach $delayid (keys(%nodedelays)) {
DBQueryFatal("insert into delays " .
" (pid,eid,exptidx,node_id,vname,noshaping,iface0,iface1" .
",vnode0,pipe0,delay0,bandwidth0,lossrate0" .
",vnode1,pipe1,delay1,bandwidth1,lossrate1" .
",vnode0,pipe0,delay0,bandwidth0,backfill0,lossrate0" .
",vnode1,pipe1,delay1,bandwidth1,backfill1,lossrate1" .
",q0_limit,q0_maxthresh,q0_minthresh,q0_weight,q0_linterm" .
",q0_qinbytes,q0_bytes,q0_meanpsize,q0_wait,q0_setbit" .
",q0_droptail,q0_red,q0_gentle" .
......@@ -2409,8 +2409,8 @@ foreach $delayid (keys(%nodedelays)) {
",q1_droptail,q1_red,q1_gentle)" .
" values ('$pid','$eid','$experiment_idx','$pnode','$vname' ".
",$noshaping,'$int0','$int1'".
",'$vnode0',$pipe0,$delay,$bandwidth,$lossrate".
",'$vnode1',$pipe1,$rdelay,$rbandwidth,$rlossrate".
",'$vnode0',$pipe0,$delay,$bandwidth,$backfill,$lossrate".
",'$vnode1',$pipe1,$rdelay,$rbandwidth,$rbackfill,$rlossrate".
",$q0_limit,$q0_maxthresh,$q0_minthresh,$q0_weight,$q0_linterm".
",$q0_qinbytes,$q0_bytes,$q0_meanpsize,$q0_wait,$q0_setbit".
",$q0_droptail,$q0_red,$q0_gentle".
......@@ -2438,15 +2438,15 @@ foreach $delayid (keys(%nodedelays)) {
#
DBQueryFatal("insert into delays" .
" (pid,eid,exptidx,node_id,vname,noshaping,iface0,iface1," .
" vnode0,pipe0,delay0,bandwidth0,lossrate0," .
" vnode1,pipe1,delay1,bandwidth1,lossrate1," .
" vnode0,pipe0,delay0,bandwidth0,backfill0,lossrate0," .
" vnode1,pipe1,delay1,bandwidth1,backfill1,lossrate1," .
" q0_limit,q0_maxthresh,q0_minthresh,q0_weight,q0_linterm," .
" q0_qinbytes,q0_bytes,q0_meanpsize,q0_wait,q0_setbit," .
" q0_droptail,q0_red,q0_gentle,q1_limit,q1_qinbytes) " .
" values ('$pid','$eid','$experiment_idx','$pnode','$vname', ".
" $noshaping,'$int0','$int1',".
" '$vnode0',$pipe0,$delay,$bandwidth,$lossrate,".
" '$vnode1',$pipe1,$rdelay,$rbandwidth,$rlossrate,".
" '$vnode0',$pipe0,$delay,$bandwidth,$backfill,$lossrate,".
" '$vnode1',$pipe1,$rdelay,$rbandwidth,$rbackfill,$rlossrate,".
" $q0_limit,$q0_maxthresh,$q0_minthresh,$q0_weight,$q0_linterm,".
" $q0_qinbytes,$q0_bytes,$q0_meanpsize,$q0_wait,$q0_setbit,".
" $q0_droptail,$q0_red,$q0_gentle,2,0)");
......@@ -2489,9 +2489,10 @@ foreach $delayid (keys(%nodedelays)) {
# queues associated with output side (to the switch) of a link.
#
foreach $delayid (keys(%linkdelays)) {
# backfill unsupported for linkdelays so ignore its entry in linkdelays
my ($pnode,$iface,$lan,$member,
$delay,$bandwidth,$lossrate,
$rdelay,$rbandwidth,$rlossrate,$islan) = @{$linkdelays{$delayid}};
$delay,$bandwidth,undef,$lossrate,
$rdelay,$rbandwidth,undef,$rlossrate,$islan) = @{$linkdelays{$delayid}};
# ipfw pipe numbers so we can control it remotely.
my $pipe = physnodenextpipe($pnode);
......@@ -4270,10 +4271,12 @@ sub LoadVirtLans()
my $delay = $rowref->{"delay"};
my $bandwidth = $rowref->{"bandwidth"};
my $est_bandwidth = $rowref->{"est_bandwidth"};
my $backfill = $rowref->{"backfill"};
my $lossrate = $rowref->{"lossrate"};
my $rdelay = $rowref->{"rdelay"};
my $rbandwidth = $rowref->{"rbandwidth"};
my $rest_bandwidth = $rowref->{"rest_bandwidth"};
my $rbackfill = $rowref->{"rbackfill"};
my $rlossrate = $rowref->{"rlossrate"};
my $widearea = $rowref->{"widearea"};
my $isemulated = $rowref->{"emulated"};
......@@ -4322,10 +4325,12 @@ sub LoadVirtLans()
[ $delay,
$bandwidth,
$est_bandwidth,
$backfill,
$lossrate,
$rdelay,
$rbandwidth,
$rest_bandwidth,
$rbackfill,
$rlossrate ];
#
......@@ -4410,8 +4415,8 @@ sub virtlantopbw($$) {
my ($virtlan, $member) = @_;
my $node = (split(":",$member))[0];
my ($delay,$bw,$ebw,$loss,
$rdelay,$rbw,$rebw,$rloss) = virtlandelayinfo($virtlan,$member);
my ($delay,$bw,$ebw,$backfill,$loss,
$rdelay,$rbw,$rebw,$rbackfill,$rloss) = virtlandelayinfo($virtlan,$member);
# Return the estimated bw if it was given; otherwise, return the normal
# bandwidth,
......@@ -4957,8 +4962,8 @@ sub CreateTopFile()
$lannodes{"fakelan/$lan"} = 1;
foreach $member (@members) {
my $plink = "fakelan/$lan/$member";
my ($delay,$bw,$ebw,$loss,
$rdelay,$rbw,$rebw,$rloss) = virtlandelayinfo($lan,$member);
my ($delay,$bw,$ebw,$backfill,$loss,
$rdelay,$rbw,$rebw,$rbackfill,$rloss) = virtlandelayinfo($lan,$member);
my ($top_bw, $top_rbw) = virtlantopbw($lan,$member);
my ($node) = (split(":",$member))[0];
......@@ -4977,20 +4982,22 @@ sub CreateTopFile()
$node0 = (split(":",$nodeport0))[0];
$node1 = (split(":",$nodeport1))[0];
my ($delay0,$bw0,$ebw0,$loss0,
$rdelay0,$rbw0,$rebw0,$rloss0)
my ($delay0,$bw0,$ebw0,$backfill0,$loss0,
$rdelay0,$rbw0,$rebw0,$rbackfill0,$rloss0)
= virtlandelayinfo($lan, $nodeport0);
my ($delay1,$bw1,$ebw1,$loss1,
$rdelay1,$rbw1,$rebw1,$rloss1)
my ($delay1,$bw1,$ebw1,$backfill1,$loss1,
$rdelay1,$rbw1,$rebw1,$rbackfill1,$rloss1)
= virtlandelayinfo($lan, $nodeport1);
# Here the r's aregoing to be 1->0 and the others 0->1
$delay = $delay0+$rdelay1;
$loss = 1-(1-$loss0)*(1-$rloss1);
$bw = &min($bw0,$rbw1);
$backfill = &max($backfill0,$rbackfill1);
$rdelay = $rdelay0+$delay1;
$rloss = 1-(1-$rloss0)*(1-$loss1);
$rbw = &min($rbw0,$bw1);
$rbackfill = &max($rbackfill0,$backfill1);
$bandwidth = &getbandwidth($node0,$lan,$bw);
$rbandwidth = &getbandwidth($node1,$lan,$rbw);
......@@ -5127,8 +5134,8 @@ sub CreateTopFile()
if ($nobwshaping) {
$bw = $rbw = 0;
}
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$loss,
$nodeport1,$rdelay,$rbw,$rloss, 0];
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$backfill,$loss,
$nodeport1,$rdelay,$rbw,$rbackfill,$rloss, 0];
printdb "Delay link $plink = " .
join(" ",@{$delaylinks{$plink}}) . "\n";
......@@ -5137,8 +5144,8 @@ sub CreateTopFile()
my $delayname = "tbsdelay" . $delayid++;
my $plink = "linksdelaysrc/$lan/$nodeport0,$nodeport1";
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$loss,
$nodeport1,$rdelay,$rbw,$rloss,
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$backfill,$loss,
$nodeport1,$rdelay,$rbw,$rbackfill,$rloss,
0];
my $delayos = "";
......@@ -5189,8 +5196,8 @@ sub CreateTopFile()
# trivial link.
#
if (!$nobwshaping && !virtlanallsim($lan)) {
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$loss,
$nodeport1,$rdelay,$rbw,$rloss,1];
$delaylinks{$plink} = [$nodeport0,$delay,$bw,$backfill,$loss,
$nodeport1,$rdelay,$rbw,$rbackfill,$rloss,1];
}
}
if ($fixall ne '') {
......@@ -5203,8 +5210,8 @@ sub CreateTopFile()
$expt_stats{"lans"} += 1;
$lannodes{"lan/$lan"} = 1;
foreach $member (@members) {
my ($delay,$bw,$ebw,$loss,
$rdelay,$rbw,$rebw,$rloss) = virtlandelayinfo($lan, $member);
my ($delay,$bw,$ebw,$backfill,$loss,
$rdelay,$rbw,$rebw,$rbackfill,$rloss) = virtlandelayinfo($lan, $member);
($node) = (split(":",$member))[0];
# Need to know about tracing on a per queue basis, since the
......@@ -5308,8 +5315,8 @@ sub CreateTopFile()
$bw = $rbw = 0;
}
$delaylinks{$plink} =
[$member,$delay,$bw,$loss,
$member,$rdelay,$rbw,$rloss,0];
[$member,$delay,$bw,$backfill,$loss,
$member,$rdelay,$rbw,$rbackfill,$rloss,0];
print(TOPFILE "link $plink $node lan/$lan " .
max($top_bw,$top_rbw) . " 0 0 $protocol" .
......@@ -5325,8 +5332,8 @@ sub CreateTopFile()
my $plink = "linkdelaysrc/$lan/$member";
$delaylinks{$plink} =
[$member,$delay,$bw,$loss,
$member,$rdelay,$rbw,$rloss,0];
[$member,$delay,$bw,$backfill,$loss,
$member,$rdelay,$rbw,$rbackfill,$rloss,0];
print TOPFILE "node $delayname delay " .
"$delay_osid_desire\n";
......@@ -5375,8 +5382,8 @@ sub CreateTopFile()
# a trivial link.
#
if (!$nobwshaping) {
$delaylinks{$plink} = [$member,$delay,$bw,$loss,
$member,$rdelay,$rbw,$rloss,1];
$delaylinks{$plink} = [$member,$delay,$bw,$backfill,$loss,
$member,$rdelay,$rbw,$rbackfill,$rloss,1];
}
}
if ($fixsrc0) {
......
......@@ -186,71 +186,85 @@ foreach my $lan (keys(%virt_lans)) {
my $member0 = $virt_lans{$lan}->{"MEMBERS"}->{$members[0]};
my $member1 = $virt_lans{$lan}->{"MEMBERS"}->{$members[1]};
my $node0 = $member0->{"vnode"};
my $delay0 = $member0->{"delay"};
my $loss0 = $member0->{"lossrate"};
my $bw0 = $member0->{"bandwidth"};
my $rdelay0 = $member0->{"rdelay"};
my $rloss0 = $member0->{"rlossrate"};
my $rbw0 = $member0->{"rbandwidth"};
my $node0 = $member0->{"vnode"};
my $delay0 = $member0->{"delay"};
my $loss0 = $member0->{"lossrate"};
my $bw0 = $member0->{"bandwidth"};
my $backfill0 = $member0->{"backfill"};
my $rdelay0 = $member0->{"rdelay"};
my $rloss0 = $member0->{"rlossrate"};
my $rbw0 = $member0->{"rbandwidth"};
my $rbackfill0 = $member0->{"rbackfill"};
my $qtype0 = "droptail";
if ($member0->{"q_red"}) {
$qtype0 = ($member0->{"q_gentle"} ? "gred" : "red");
}
my $node1 = $member1->{"vnode"};
my $delay1 = $member1->{"delay"};
my $loss1 = $member1->{"lossrate"};
my $bw1 = $member1->{"bandwidth"};
my $rdelay1 = $member1->{"rdelay"};
my $rloss1 = $member1->{"rlossrate"};
my $rbw1 = $member1->{"rbandwidth"};
my $qtype1 = "droptail";
my $node1 = $member1->{"vnode"};
my $delay1 = $member1->{"delay"};
my $loss1 = $member1->{"lossrate"};
my $bw1 = $member1->{"bandwidth"};
my $backfill1 = $member1->{"backfill"};
my $rdelay1 = $member1->{"rdelay"};
my $rloss1 = $member1->{"rlossrate"};
my $rbw1 = $member1->{"rbandwidth"};
my $rbackfill1 = $member1->{"rbackfill"};
my $qtype1 = "droptail";
if ($member1->{"q_red"}) {
$qtype1 = ($member1->{"q_gentle"} ? "gred" : "red");
}
# ebw stands for effective bandwith, it is bw - backfill
my $delay = ($delay0+$rdelay1) / 1000.0 ;
my $loss = 1-(1-$loss0)*(1-$rloss1);
my $bw = &min($bw0,$rbw1) * 1000;
my $backfill = &max($backfill0,$rbackfill1) * 1000;
my $ebw = $bw - $backfill;
my $rdelay = ($rdelay0+$delay1) / 1000.0;
my $rloss = 1-(1-$rloss0)*(1-$loss1);
my $rbw = &min($rbw0,$bw1) * 1000;
my $rbackfill = &max($rbackfill0,$backfill1) * 1000;
my $rebw = $rbw - $rbackfill;
printf $LTOUT
"l $node0 $node1 $bw %.4f %.6f $lan $qtype0\n", $delay, $loss;
"l $node0 $node1 $ebw %.4f %.6f $lan $qtype0\n", $delay, $loss;
printf $LTOUT
"l $node1 $node0 $rbw %.4f %.6f $lan $qtype1\n", $rdelay, $rloss;
"l $node1 $node0 $rebw %.4f %.6f $lan $qtype1\n", $rdelay, $rloss;
}
else {
foreach my $memb0 (@members) {
my $member0 = $virt_lans{$lan}->{"MEMBERS"}->{$memb0};
my $node0 = $member0->{"vnode"};
my $delay0 = $member0->{"delay"};
my $loss0 = $member0->{"lossrate"};
my $bw0 = $member0->{"bandwidth"};
my $node0 = $member0->{"vnode"};
my $delay0 = $member0->{"delay"};
my $loss0 = $member0->{"lossrate"};
my $bw0 = $member0->{"bandwidth"};
my $backfill0 = $member0->{"backfill"};
foreach my $memb1 (@members) {
next
if ($memb0 eq $memb1);
my $member1 = $virt_lans{$lan}->{"MEMBERS"}->{$memb1};
my $node1 = $member1->{"vnode"};
my $rdelay1 = $member1->{"rdelay"};
my $rloss1 = $member1->{"rlossrate"};
my $rbw1 = $member1->{"rbandwidth"};
my $member1 = $virt_lans{$lan}->{"MEMBERS"}->{$memb1};
my $node1 = $member1->{"vnode"};
my $rdelay1 = $member1->{"rdelay"};
my $rloss1 = $member1->{"rlossrate"};
my $rbw1 = $member1->{"rbandwidth"};
my $rbackfill1 = $member1->{"rbackfill"};
my $qtype1 = "droptail";
if ($member1->{"q_red"}) {
$qtype1 = ($member1->{"q_gentle"} ? "gred" : "red");
}
# ebw stands for effective bandwith, it is bw - backfill
my $delay = ($delay0+$rdelay1) / 1000.0;
my $loss = 1-(1-$loss0)*(1-$rloss1);
my $bw = &min($bw0,$rbw1) * 1000;
my $backfill = &max($backfill0,$rbackfill1) * 1000;
my $ebw = $bw - $backfill;
printf $LTOUT
"l $node0 $node1 $bw %.4f %.6f $lan $qtype1\n",
"l $node0 $node1 $ebw %.4f %.6f $lan $qtype1\n",
$delay, $loss;
}
}
......
......@@ -256,6 +256,8 @@ LanLink instproc init {s nodes bw d type} {
$self instvar rbandwidth
$self instvar ebandwidth
$self instvar rebandwidth
$self instvar backfill
$self instvar rbackfill
$self instvar delay
$self instvar rdelay
$self instvar loss
......@@ -274,6 +276,8 @@ LanLink instproc init {s nodes bw d type} {
# Note - we don't set defaults for ebandwidth and rebandwidth - lack
# of an entry for a nodepair indicates that they should be left NULL
# in the output.
set backfill($nodepair) 0
set rbackfill($nodepair) 0
set delay($nodepair) [expr $d / 2.0]
set rdelay($nodepair) [expr $d / 2.0]
set loss($nodepair) 0
......@@ -695,6 +699,8 @@ Link instproc updatedb {DB} {
$self instvar rbandwidth
$self instvar ebandwidth
$self instvar rebandwidth
$self instvar backfill
$self instvar rbackfill
$self instvar delay
$self instvar rdelay
$self instvar loss
......@@ -768,7 +774,7 @@ Link instproc updatedb {DB} {
set nodeportraw [join $nodeport ":"]
set fields [list "vname" "member" "mask" "delay" "rdelay" "bandwidth" "rbandwidth" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "encap_style" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok" "protocol" "vnode" "vport" "ip" "mustdelay"]
set fields [list "vname" "member" "mask" "delay" "rdelay" "bandwidth" "rbandwidth" "backfill" "rbackfill" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "encap_style" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok" "protocol" "vnode" "vport" "ip" "mustdelay"]
# Treat estimated bandwidths differently - leave them out of the lists
# unless the user gave a value - this way, they get the defaults if not
......@@ -796,7 +802,7 @@ Link instproc updatedb {DB} {
lappend fields "fixed_iface"
}
set values [list $self $nodeportraw $netmask $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $encap $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok $protocol $node $port $ip $mustdelay]
set values [list $self $nodeportraw $netmask $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $backfill($nodeport) $rbackfill($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $encap $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok $protocol $node $port $ip $mustdelay]
if { [info exists ebandwidth($nodeport)] } {
lappend values $ebandwidth($nodeport)
......@@ -837,6 +843,8 @@ Lan instproc updatedb {DB} {
$self instvar rbandwidth
$self instvar ebandwidth
$self instvar rebandwidth
$self instvar backfill
$self instvar rbackfill
$self instvar delay
$self instvar rdelay
$self instvar loss
......@@ -930,7 +938,7 @@ Lan instproc updatedb {DB} {
set is_accesspoint 1
}
set fields [list "vname" "member" "mask" "delay" "rdelay" "bandwidth" "rbandwidth" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "encap_style" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok" "protocol" "is_accesspoint" "vnode" "vport" "ip" "mustdelay"]
set fields [list "vname" "member" "mask" "delay" "rdelay" "bandwidth" "rbandwidth" "backfill" "rbackfill" "lossrate" "rlossrate" "cost" "widearea" "emulated" "uselinkdelay" "nobwshaping" "encap_style" "q_limit" "q_maxthresh" "q_minthresh" "q_weight" "q_linterm" "q_qinbytes" "q_bytes" "q_meanpsize" "q_wait" "q_setbit" "q_droptail" "q_red" "q_gentle" "trivial_ok" "protocol" "is_accesspoint" "vnode" "vport" "ip" "mustdelay"]
# Treat estimated bandwidths differently - leave them out of the lists
# unless the user gave a value - this way, they get the defaults if not
......@@ -958,7 +966,7 @@ Lan instproc updatedb {DB} {
lappend fields "fixed_iface"
}
set values [list $self $nodeportraw $netmask $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $encap $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok $protocol $is_accesspoint $node $port $ip $mustdelay]
set values [list $self $nodeportraw $netmask $delay($nodeport) $rdelay($nodeport) $bandwidth($nodeport) $rbandwidth($nodeport) $backfill($nodeport) $rbackfill($nodeport) $loss($nodeport) $rloss($nodeport) $cost($nodeport) $widearea $emulated $uselinkdelay $nobwshaping $encap $limit_ $maxthresh_ $thresh_ $q_weight_ $linterm_ ${queue-in-bytes_} $bytes_ $mean_pktsize_ $wait_ $setbit_ $droptail_ $red_ $gentle_ $trivial_ok $protocol $is_accesspoint $node $port $ip $mustdelay]
if { [info exists ebandwidth($nodeport)] } {
lappend values $ebandwidth($nodeport)
......
......@@ -84,6 +84,11 @@ proc tb-set-node-id {vnode myid} {}
proc tb-set-link-est-bandwidth {srclink args} {}
proc tb-set-lan-est-bandwidth {lan bw} {}
proc tb-set-node-lan-est-bandwidth {node lan bw} {}
proc tb-set-link-backfill {srclink args} {}
proc tb-set-link-simplex-backfill {link src bw} {}
proc tb-set-lan-backfill {lan bw} {}
proc tb-set-node-lan-backfill {node lan bw} {}
proc tb-set-lan-simplex-backfill {lan node tobw frombw} {}
proc tb-set-node-plab-role {node role} {}
proc tb-set-node-plab-plcnet {node lanlink} {}
proc tb-set-dpdb {onoff} {}
......
......@@ -571,6 +571,10 @@ proc parse_bw {bspec {islink 1}} {
return $val
}
proc parse_backfill {bspec} {
return [parse_bw $bspec 0]
}
# parse_delay dspec
# This takes a delay specifier in the form of <amt><unit> where <unit>
# is any of s, ms, ns. If no unit is given then seconds (s) is
......
......@@ -570,6 +570,64 @@ proc tb-set-link-est-bandwidth {srclink args} {
}
}
# This takes two possible formats:
# tb-set-link-backfill <link> <bw>
# tb-set-link-backfill <src> <dst> <bw>
proc tb-set-link-backfill {srclink args} {
if {[llength $args] == 2} {
set dst [lindex $args 0]
set bw [lindex $args 1]
set sim [$srclink set sim]
set reallink [$sim find_link $srclink $dst]
if {$reallink == {}} {
perror "\[tb-set-link-backfill] No link between $srclink and $dst."
return
}
} else {
if {[$srclink info class] != "Link"} {
perror "\[tb-set-link-backfill] $srclink is not a link."
return
}
set reallink $srclink
set bw [lindex $args 0]
}
$reallink instvar bandwidth
$reallink instvar backfill
$reallink instvar rbackfill
foreach pair [array names bandwidth] {
set backfill($pair) [parse_bw $bw]
set rbackfill($pair) [parse_bw $bw]
}
}
# This takes two possible formats:
# tb-set-link-backfill <link> <src> <bw>
proc tb-set-link-simplex-backfill {link src bw} {
var_import ::TBCOMPAT::FLOAT
if {[$link info class] != "Link"} {
perror "\[tb-set-link-simplex-backfill] $link is not a link."
return
}
if {[$src info class] != "Node"} {
perror "\[tb-set-link-simplex-backfill] $src is not a node."
return
}
set port [$link get_port $src]
if {$port == {}} {
perror "\[tb-set-link-simplex-params] $src is not in $link."
return
}
set np [list $src $port]
foreach nodeport [$link set nodelist] {
if {$nodeport != $np} {
set onp $nodeport
}
}
set realbw [parse_bw $bw]
$link set backfill($np) $realbw
$link set rbackfill($onp) $realbw
}
proc tb-set-lan-loss {lan lossrate} {
var_import ::TBCOMPAT::FLOAT
if {[$lan info class] != "Lan"} {
......@@ -604,6 +662,21 @@ proc tb-set-lan-est-bandwidth {lan bw} {
}
}
proc tb-set-lan-backfill {lan bw} {
if {[$lan info class] != "Lan"} {
perror "\[tb-set-lan-backfill] $lan is not a lan."
return
}
$lan instvar bandwidth
$lan instvar backfill
$lan instvar rbackfill
foreach pair [array names bandwidth] {
set backfill($pair) [parse_bw $bw]
set rbackfill($pair) [parse_bw $bw]
}
}
proc tb-set-node-lan-delay {node lan delay} {
if {[$node info class] != "Node"} {
perror "\[tb-set-node-lan-delay] $node is not a node."
......@@ -659,6 +732,23 @@ proc tb-set-node-lan-est-bandwidth {node lan bw} {
$lan set ebandwidth([list $node $port]) [parse_bw $bw]
$lan set rebandwidth([list $node $port]) [parse_bw $bw]
}
proc tb-set-node-lan-backfill {node lan bw} {
if {[$node info class] != "Node"} {
perror "\[tb-set-node-lan-backfill] $node is not a node."
return
}
if {[$lan info class] != "Lan"} {
perror "\[tb-set-node-lan-backfill] $lan is not a lan."