Commit 126ec2cb authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Change the names of the emulated/per-link delay routines as discussed

in email.

	proc tb-use-endnodeshaping {onoff} {}
	proc tb-force-endnodeshaping {onoff} {}
	proc tb-set-multiplexed {link onoff} {}
	proc tb-set-endnodeshaping {link onoff} {}
	proc tb-set-noshaping {link onoff} {}
parent e4c5275e
......@@ -159,6 +159,9 @@ LanLink instproc init {s nodes bw d type} {
# Allow user to control if link is emulated. Only links, not lans.
$self set emulated 0
# Allow user to turn of actual bw shaping on emulated links. Not lans.
$self set nobwshaping 0
# A simulated lanlink unless we find otherwise
$self set simulated 1
# Figure out if this is a lanlink that has at least
......@@ -490,11 +493,12 @@ LanLink instproc updatedb {DB} {
$self instvar widearea
$self instvar uselinkdelay
$self instvar emulated
$self instvar nobwshaping
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
foreach nodeport $nodelist {
set nodeportraw [join $nodeport ":"]
sql exec $DB "insert into virt_lans (pid,eid,vname,member,delay,rdelay,bandwidth,rbandwidth,lossrate,rlossrate,cost,widearea,emulated,uselinkdelay) values (\"$pid\",\"$eid\",\"$self\",\"$nodeportraw\",$delay($nodeport),$rdelay($nodeport),$bandwidth($nodeport),$rbandwidth($nodeport),$loss($nodeport),$rloss($nodeport),$cost($nodeport),$widearea,$emulated,$uselinkdelay)"
sql exec $DB "insert into virt_lans (pid,eid,vname,member,delay,rdelay,bandwidth,rbandwidth,lossrate,rlossrate,cost,widearea,emulated,uselinkdelay,nobwshaping) values (\"$pid\",\"$eid\",\"$self\",\"$nodeportraw\",$delay($nodeport),$rdelay($nodeport),$bandwidth($nodeport),$rbandwidth($nodeport),$loss($nodeport),$rloss($nodeport),$cost($nodeport),$widearea,$emulated,$uselinkdelay,$nobwshaping)"
}
}
......@@ -36,11 +36,11 @@ proc tb-set-link-simplex-params {link src delay bw loss} {}
proc tb-set-uselatestwadata {onoff} {}
proc tb-set-usewatunnels {onoff} {}
proc tb-set-wasolver-weights {delay bw plr} {}
proc tb-set-uselinkdelays {onoff} {}
proc tb-set-forcelinkdelays {onoff} {}
proc tb-set-link-emulated {link onoff} {}
proc tb-set-link-uselinkdelay {link onoff} {}
proc tb-set-lan-uselinkdelay {link onoff} {}
proc tb-use-endnodeshaping {onoff} {}
proc tb-force-endnodeshaping {onoff} {}
proc tb-set-multiplexed {link onoff} {}
proc tb-set-endnodeshaping {link onoff} {}
proc tb-set-noshaping {link onoff} {}
Class Program
......
......@@ -537,22 +537,22 @@ proc tb-set-usewatunnels {onoff} {
set usewatunnels $onoff
}
proc tb-set-uselinkdelays {onoff} {
proc tb-use-endnodeshaping {onoff} {
var_import ::GLOBALS::uselinkdelays
if {$onoff != 0 && $onoff != 1} {
perror "\[tb-set-uselinkdelays] $onoff must be 0/1"
perror "\[tb-use-endnodeshaping] $onoff must be 0/1"
return
}
set uselinkdelays $onoff
}
proc tb-set-forcelinkdelays {onoff} {
proc tb-force-endnodeshaping {onoff} {
var_import ::GLOBALS::forcelinkdelays
if {$onoff != 0 && $onoff != 1} {
perror "\[tb-set-forcelinkdelays] $onoff must be 0/1"
perror "\[tb-force-endnodeshaping] $onoff must be 0/1"
return
}
......@@ -581,27 +581,31 @@ proc tb-set-wasolver-weights {delay bw plr} {
#
# Control emulated for a link (lans not allowed yet).
#
proc tb-set-link-emulated {link onoff} {
proc tb-set-multiplexed {link onoff} {
if {[$link info class] != "Link"} {
perror "\[tb-set-link-emulated] $link is not a link."
perror "\[tb-set-multiplexed] $link is not a link."
return
}
$link set emulated $onoff
}
#
# Control linkdelays for lans and links
# For emulated links, allow bw shaping to be turned off
#
proc tb-set-link-uselinkdelay {link onoff} {
proc tb-set-noshaping {link onoff} {
if {[$link info class] != "Link"} {
perror "\[tb-set-link-uselinkdelay] $link is not a link."
perror "\[tb-set-noshaping] $link is not a link."
return
}
$link set uselinkdelay $onoff
$link set nobwshaping $onoff
}
proc tb-set-lan-uselinkdelay {link onoff} {
if {[$link info class] != "Lan"} {
perror "\[tb-set-lan-uselinkdelay] $link is not a lan."
#
# Control linkdelays for lans and links
#
proc tb-set-endnodeshaping {lanlink onoff} {
if {[$lanlink info class] != "Link" && [$lanlink info class] != "Lan"} {
perror "\[tb-set-endnodeshaping] $lanlink is not a link or a lan."
return
}
$link set uselinkdelay $onoff
......
......@@ -4,7 +4,7 @@
All rights reserved.
-->
<center>
<h2>Per-Link Delays and Shared Links</h2>
<h2>End Node Traffic Shaping and Multiplexed Links</h2>
</center>
<h3>Per-Link Delays:</h3>
......@@ -12,20 +12,20 @@ In order to conserve nodes, it is possible (when using FreeBSD) to
specify that instead of doing traffic shaping on separate delay nodes
(which eats up a node for every two links), it be done on the nodes
that are actually generating the traffic. Just like normal delay
nodes, per-link delays use IPFW to direct traffic into the proper
Dummynet pipe. On each node in a duplex link or lan, a set of ipfw
rules and Dummynet pipes is setup. As traffic enters or leaves your
node, ipfw looks at the packet and stuffs it into the proper Dummynet
pipe. At the proper time, Dummynet takes the packet and sends it on
its way. To specify this in your NS file, simply setup a normal link
or lan, and then mark it as wanting to use per-link delays. For
example:
nodes, end node (sometimes called per-link) traffix shaping uses IPFW
to direct traffic into the proper Dummynet pipe. On each node in a
duplex link or lan, a set of ipfw rules and Dummynet pipes is
setup. As traffic enters or leaves your node, ipfw looks at the packet
and stuffs it into the proper Dummynet pipe. At the proper time,
Dummynet takes the packet and sends it on its way. To specify this in
your NS file, simply setup a normal link or lan, and then mark it as
wanting to use end node traffic shaping. For example:
<code><pre>
set link0 [$ns duplex-link $nodeA $nodeD 50Mb 0ms DropTail]
set lan0 [$ns make-lan "nodeA nodeB nodeC" 0Mb 100ms]
tb-set-link-uselinkdelay $link0 1
tb-set-lan-uselinkdelay $lan0 1 </code></pre>
tb-set-endnodeshaping $link0 1
tb-set-endnodeshaping $lan0 1 </code></pre>
Please be aware though, that the kernel is different than the standard
kernel in a couple of ways.
......@@ -39,41 +39,53 @@ network stack; all incoming and outgoing packets are sent into ipfw to
be matched on.
</ul>
<h3>Shared Links:</h3>
Another feature we have added is <em>shared</em> (sometimes called
<em>emulated</em>) links. A shared link is one that can be multiplexed
over a physical link along with other shared links. Say your
If you would like to use end node traffic shaping globally, without
having to specify per link or lan, then you can put this in your NS
file:
<code><pre>
tb-use-endnodeshaping 1 </code></pre>
If you would like to specify non-shaped links, but perhaps control the
shaping parameters later (increase delay, decrease bandwidth, etc.)
after the experiment is swapped in, you can put this in your NS file:
<code><pre>
tb-force-endnodeshaping 1 </code></pre>
<h3>Multiplexed Links:</h3>
Another feature we have added is <em>multiplexed</em> (sometimes called
<em>emulated</em>) links. An emulated link is one that can be multiplexed
over a physical link along with other links. Say your
experimental nodes have just 1 physical interface (call it fxp0), but
you want to create two duplex links on it:
<code><pre>
set link0 [$ns duplex-link $nodeA $nodeB 50Mb 0ms DropTail]
set link1 [$ns duplex-link $nodeA $nodeC 50Mb 0ms DropTail]
tb-set-link-emulated $link0 1
tb-set-link-emulated $link1 1 </code></pre>
tb-set-multiplexed $link0 1
tb-set-multiplexed $link1 1 </code></pre>
Without shared links, your experiment would not be mappable since
Without multiplexed links, your experiment would not be mappable since
there are no nodes that can support the two duplex links that nodeA
requires; there is only one physical interface. Using shared links
requires; there is only one physical interface. Using multiplexed links
however, the testbed software will assign both links on NodeA to one
physical interface. That is because each duplex link is only 50Mbs,
while the physical link (fxp0) is 100Mbs. Of course, if your
application actually tried to use more than 50Mbs on each shared link,
application actually tried to use more than 50Mbs on each multiplexed link,
there would be a problem; a flow using more than its share on link0
would cause packets on link1 to be dropped when they otherwise would
not be. (<b>At this time, you cannot specify that a lan use shared
not be. (<b>At this time, you cannot specify that a lan use multiplexed
links</b>)
<br>
<br>
To prevent this problem, a shared link is automatically setup to use
To prevent this problem, a multiplexed link is automatically setup to use
per-link delays (discussed above). Each of the links in the above
example would get a set of DummyNet pipes restricting their bandwidth
to 50Mbs. Each link is forced to behave just as it would if the actual
link bandwidth were 50Mbs. The keeps the aggregate bandwidth to that
which can be supported by the underlying physical link (on fxp0,
100Mbs). Of course, the same caveats mentioned above for per-link
delays applies when using shared links.
delays applies when using multiplexed links.
<br>
<br>
......@@ -88,17 +100,18 @@ which creates a router and attaches it to 12 other nodes:
set node($i) [$ns node]
set link($i) [$ns duplex-link $node($i) $router 30Mb 10ms DropTail]
tb-set-link-emulated $link($i) 1
tb-set-multiplexed $link($i) 1
}
# Turn on routing.
$ns rtproto Static </code></pre>
Since each node on Emulab.Net has 4 100Mbs interfaces, the above
mapping would not be possible without the use of shared links.
However, since each link is defined to use 30Mbs, by using shared
links, the 12 links can be multiplexed over the four physical
Since each node on Emulab.Net has four 100Mbs interfaces, the above
mapping would not be possible without the use of multiplexed links.
However, since each link is defined to use 30Mbs, by using multiplexed
links, the 12 links can be shared over the four physical
interfaces, without oversubscribing the 400Mbs aggregate bandwidth
available to the node that is assigned to the router.
available to the node that is assigned to the router. <em> Note:
while it may sound a little like channel bonding, it is not!</em>
<h3>Technical Discussion:</h3>
......@@ -150,7 +163,7 @@ forwarded on to the next hop, if appropriate.
<br>
<br>
The addition of shared links complicates things further. To multiplex
The addition of multiplexed links complicates things further. To multiplex
several different links on a physical interface, one must use either
encapsulation (ipinip, vlan, etc) or IP interface aliases. We chose IP
aliases because it does not affect the MTU size. The downside of IP
......@@ -161,7 +174,7 @@ into. In other words, the rules used above:
ipfw add ... out xmit fxp0
ipfw add ... in recv fxp0 </code></pre>
Do not work because there are now multiple flows multiplexed onto the
do not work because there are now multiple flows multiplexed onto the
interface (multiple IPs) and so there is no way to distinguish which
flow. Consider a duplex link in which we use the first rule above.
If the packet is not addressed to a direct neighbor, the routing
......@@ -181,7 +194,7 @@ mask allows for matching when directly connected to a lan (a simplification).
<br>
<br>
Shared lans present even worse problems because of the need to figure
Multiplexed lans present even worse problems because of the need to figure
out which flow a incoming packet is part of. When a packet arrives at
an interface, there is nothing in the packet to indicate which IP
alias the packet was intended for (or which it came from) when the
......
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