Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
dcb76e71
Commit
dcb76e71
authored
Nov 27, 2001
by
Leigh B. Stoller
Browse files
Change bandwidth handling to Kbs instead of Mbs. Still some minor
problems with assign though, which uses Mbs. Do that in next step.
parent
ccb6de90
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/assign_wrapper.in
View file @
dcb76e71
...
...
@@ -105,8 +105,8 @@ sub printdb {
# interfacespeed is indexed by type and contains the bandwidth.
# delaynodes is indexed by link name and contains [delay,bw,loss]
# portbw is indexed by virtual nodeport and contains the bandwidth
# of that port. Note that the bandwidth of a port is one of 100
# or 10. For LANs with other bandwidths the port speed will be
# of that port. Note that the bandwidth of a port is one of 100
000 (100Mbs)
# or 10
000 (10 Mbs)
. For LANs with other bandwidths the port speed will be
# 100 and a delay node will be inserted.
#
# Delay node names:
...
...
@@ -175,7 +175,7 @@ while (($vname,$member,$delay,$bandwidth,$lossrate) = $result->fetchrow_array) {
push
(
@
{
$lans
{
$vname
}},
$member
);
$delayinfo
{"
$vname
:
$member
"}
=
[
$delay
,
$bandwidth
,
$lossrate
];
(
$node
,
$port
)
=
split
("
:
",
$member
);
if
(
$bandwidth
==
10
)
{
if
(
$bandwidth
==
10
000
)
{
$portbw
{
$member
}
=
10
;
}
else
{
$portbw
{
$member
}
=
100
;
...
...
@@ -207,7 +207,7 @@ foreach $lan (keys(%lans)) {
join
("
",
@$sharks
)
.
"
)
\n
";
$sharkshelfid
++
;
$sharkshelves
{
$shelfid
}
=
$sharks
;
$delayinfo
{"
$lan
:
$shelfid
:uplink
"}
=
[
0
,
100
,
0.0
];
$delayinfo
{"
$lan
:
$shelfid
:uplink
"}
=
[
0
,
100
000
,
0.0
];
push
(
@$realmembers
,"
$shelfid
:uplink
");
$nodes
{
$shelfid
}
=
"
shark-shelf
";
}
...
...
@@ -262,9 +262,9 @@ foreach $lan (keys(%lans)) {
$bw
=
&min
(
$bw0
,
$bw1
);
$bandwidth
=
&getbandwidth
(
&min
(
$bw0
,
$bw1
));
if
((
$delay
>
$delaythresh
)
||
((
$bw
!=
100
)
&&
(
$bw
!=
10
))
||
((
$bw
!=
100
000
)
&&
(
$bw
!=
10
000
))
||
((
$delaywithswitch
==
0
)
&&
((
$bw
!=
100
)
&&
((
$sharks
==
0
)
||
(
$nonsharks
>
1
))))
||
((
$bw
!=
100
000
)
&&
((
$sharks
==
0
)
||
(
$nonsharks
>
1
))))
||
(
$loss
!=
0
))
{
$delayname
=
"
tbsdelay
$delayid
";
$delaynodes
{"
linksdelaysrc/
$lan
"}
=
[
$delay
,
$bw
,
$loss
];
...
...
@@ -290,9 +290,9 @@ foreach $lan (keys(%lans)) {
# XXX The expression below should be modified for better bandwidth support.
# Probably needs to happen post assign somehow.
if
((
$delay
>
$delaythresh
)
||
((
$bw
!=
100
)
&&
(
$bw
!=
10
))
||
((
$bw
!=
100
000
)
&&
(
$bw
!=
10
000
))
||
((
$delaywithswitch
==
0
)
&&
((
$bw
!=
100
)
&&
((
$sharks
==
0
)
||
(
$nonsharks
>
1
))))
||
((
$bw
!=
100
000
)
&&
((
$sharks
==
0
)
||
(
$nonsharks
>
1
))))
||
(
$loss
!=
0
))
{
$delayname
=
"
tbdelay
$delayid
";
$delaynodes
{"
linkdelaysrc/
$lan
/
$member
"}
=
[
$delay
,
$bw
,
$loss
];
...
...
@@ -886,8 +886,11 @@ sub min {
# getbandwidth(bw)
# Returns the lowest ok bandwidth that is greater than or equal to
# the one passed.
#
# XXX The targetbandwidth is in Kbs, but interface types in Mbs.
#
sub
getbandwidth
{
my
$targetbandwidth
=
$_
[
0
];
my
$targetbandwidth
=
$_
[
0
]
/
1000
;
my
$bandwidth
;
my
$best
=
10000000000
;
foreach
$bandwidth
(
keys
(
%okbandwidths
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment