Commit fd3a6bc5 authored by Leigh Stoller's avatar Leigh Stoller

Add a couple of controls for trivial links and the amount of

multiplexing of nodes.
parent 8e9c6427
......@@ -150,6 +150,10 @@ LanLink instproc init {s nodes bw d type} {
# By default, a local link
$self set widearea 0
# Colocation is on by default, but this only applies to emulated links
# between virtual nodes anyway.
$self set trivial_ok 1
# Allow user to control whether link gets a linkdelay, if link is shaped.
# If not shaped, and user sets this variable, a link delay is inserted
# anyway on the assumption that user wants later control over the link.
......@@ -385,6 +389,7 @@ Link instproc updatedb {DB} {
$self instvar fromqueue
$self instvar nodelist
$self instvar src_node
$self instvar trivial_ok
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
......@@ -430,7 +435,7 @@ Link instproc updatedb {DB} {
set droptail_ [$linkqueue set drop-tail_]
set nodeportraw [join $nodeport ":"]
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_ where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_, trivial_ok=$trivial_ok where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
}
}
......@@ -438,6 +443,7 @@ Lan instproc updatedb {DB} {
$self next $DB
$self instvar nodelist
$self instvar linkq
$self instvar trivial_ok
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
......@@ -478,7 +484,7 @@ Lan instproc updatedb {DB} {
set droptail_ [$linkqueue set drop-tail_]
set nodeportraw [join $nodeport ":"]
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_ where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
sql exec $DB "update virt_lans set q_limit=$limit_, q_maxthresh=$maxthresh_, q_minthresh=$thresh_, q_weight=$q_weight_, q_linterm=$linterm_, q_qinbytes=${queue-in-bytes_}, q_bytes=$bytes_, q_meanpsize=$mean_pktsize_, q_wait=$wait_, q_setbit=$setbit_, q_droptail=$droptail_, q_red=$red_, q_gentle=$gentle_, trivial_ok=$trivial_ok where pid=\"$pid\" and eid=\"$eid\" and vname=\"$self\" and member=\"$nodeportraw\""
}
}
......
......@@ -42,6 +42,8 @@ proc tb-set-multiplexed {link onoff} {}
proc tb-set-endnodeshaping {link onoff} {}
proc tb-set-noshaping {link onoff} {}
proc tb-set-useveth {link onoff} {}
proc tb-set-allowcolocate {lanlink onoff} {}
proc tb-set-colocate-factor {factor} {}
Class Program
......
......@@ -207,6 +207,9 @@ namespace eval GLOBALS {
# Force link delays (where a delay would not otherwise be inserted)
variable forcelinkdelays 0
# Control multiplex_factor for the experiment. Crude.
variable multiplex_factor {}
# For remote nodes. The solver weights.
variable wa_delay_solverweight 1
variable wa_bw_solverweight 7
......
......@@ -239,6 +239,7 @@ Simulator instproc run {} {
var_import ::GLOBALS::wa_plr_solverweight
var_import ::GLOBALS::uselinkdelays
var_import ::GLOBALS::forcelinkdelays
var_import ::GLOBALS::multiplex_factor
# Fill out IPs
foreach obj [concat [array names lanlink_list]] {
......@@ -318,8 +319,12 @@ Simulator instproc run {} {
foreach prog [array names prog_list] {
$prog updatedb $DB
}
set mfactor ""
if { $multiplex_factor != {} } {
$mfactor = "multiplex_factor=$multiplex_factor, "
}
sql exec $DB "update experiments set forcelinkdelays=$forcelinkdelays,uselinkdelays=$uselinkdelays,usewatunnels=$usewatunnels,uselatestwadata=$uselatestwadata,wa_delay_solverweight=$wa_delay_solverweight,wa_bw_solverweight=$wa_bw_solverweight,wa_plr_solverweight=$wa_plr_solverweight where pid='$pid' and eid='$eid'"
sql exec $DB "update experiments set $mfactor forcelinkdelays=$forcelinkdelays,uselinkdelays=$uselinkdelays,usewatunnels=$usewatunnels,uselatestwadata=$uselatestwadata,wa_delay_solverweight=$wa_delay_solverweight,wa_bw_solverweight=$wa_bw_solverweight,wa_plr_solverweight=$wa_plr_solverweight where pid='$pid' and eid='$eid'"
sql endquery $DB
# This could probably be elsewhere.
......
......@@ -621,3 +621,31 @@ proc tb-set-endnodeshaping {lanlink onoff} {
}
$lanlink set uselinkdelay $onoff
}
#
# Crude control of colocation of virt nodes. Will be flushed when we have
# a real story. Sets it for the entire link or lan. Maybe set it on a
# per node basis?
#
proc tb-set-allowcolocate {lanlink onoff} {
if {[$lanlink info class] != "Link" && [$lanlink info class] != "Lan"} {
perror "\[tb-set-allowcolocate] $lanlink is not a link or a lan."
return
}
$lanlink set trivial_ok $onoff
}
#
# Another crude control. Allow override of multiplex factor that is listed
# in the node_types table.
#
proc tb-set-colocate-factor {factor} {
var_import ::GLOBALS::multiplex_factor
if {$factor < 1 || $factor > 100} {
perror "\[tb-set-colocate-factor] factor must be 1 <= factor <= 100"
return
}
set multiplex_factor $factor
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment