Commit 2cc8ce31 authored by Mike Hibler's avatar Mike Hibler
Browse files

Quicky hack to allow setup of "LAN model" via the -L option.

This gives shared BW to all destinations from each source.
parent cc529b83
#!/usr/bin/perl #!/usr/bin/perl
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2006 University of Utah and the Flux Group. # Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -59,6 +59,7 @@ my $outfile; ...@@ -59,6 +59,7 @@ my $outfile;
my $doelabaddrs = 1; my $doelabaddrs = 1;
my $remote = 0; my $remote = 0;
my $cloudonly = 0; my $cloudonly = 0;
my $lanonly = 0;
# Default values. Note: delay and PLR are round trip values. # Default values. Note: delay and PLR are round trip values.
my $DEF_BW = 10001; # Kbits/sec my $DEF_BW = 10001; # Kbits/sec
...@@ -92,7 +93,7 @@ my $now = time(); ...@@ -92,7 +93,7 @@ my $now = time();
# left are the required arguments. # left are the required arguments.
# #
my %options = (); my %options = ();
if (! getopts("S:no:rCd", \%options)) { if (! getopts("S:no:rCLd", \%options)) {
usage(); usage();
} }
if (defined($options{"n"})) { if (defined($options{"n"})) {
...@@ -115,6 +116,9 @@ if (defined($options{"d"})) { ...@@ -115,6 +116,9 @@ if (defined($options{"d"})) {
if (defined($options{"C"})) { if (defined($options{"C"})) {
$cloudonly = 1; $cloudonly = 1;
} }
if (defined($options{"L"})) {
$lanonly = 1;
}
if (defined($options{"S"})) { if (defined($options{"S"})) {
my $high = time(); my $high = time();
my $low = $high - (23 * 60 * 60); # XXX my $low = $high - (23 * 60 * 60); # XXX
...@@ -310,8 +314,10 @@ if (!$showonly) { ...@@ -310,8 +314,10 @@ if (!$showonly) {
write_info($outfile); write_info($outfile);
} elsif ($cloudonly) { } elsif ($cloudonly) {
send_cloud_events(); send_cloud_events();
} elsif ($lanonly) {
send_hybrid_events(1);
} else { } else {
send_hybrid_events(); send_hybrid_events(0);
} }
} }
...@@ -418,8 +424,9 @@ sub send_cloud_events() ...@@ -418,8 +424,9 @@ sub send_cloud_events()
# destinations. For I1 destinations, the computation is as in #2, # destinations. For I1 destinations, the computation is as in #2,
# the max per-path value for any of them. # the max per-path value for any of them.
# #
sub send_hybrid_events() sub send_hybrid_events($)
{ {
my ($I1only) = @_;
my %dstmap; my %dstmap;
foreach my $src (keys %shapeinfo) { foreach my $src (keys %shapeinfo) {
...@@ -429,7 +436,8 @@ sub send_hybrid_events() ...@@ -429,7 +436,8 @@ sub send_hybrid_events()
# #
# Loop over all destinations forming I2 pipes and keeping track # Loop over all destinations forming I2 pipes and keeping track
# of the max BW to all I1 nodes. # of the max BW to all I1 nodes. If I1only is non-zero, we treat
# everything as I1 (i.e., shared BW to all destinations).
# #
my @cmds; my @cmds;
foreach my $rec (@{$shapeinfo{$src}}) { foreach my $rec (@{$shapeinfo{$src}}) {
...@@ -441,7 +449,7 @@ sub send_hybrid_events() ...@@ -441,7 +449,7 @@ sub send_hybrid_events()
my $dtype = $dstmap{$dst}; my $dtype = $dstmap{$dst};
my $cmd = "DEST=$dst DELAY=$del PLR=$plr"; my $cmd = "DEST=$dst DELAY=$del PLR=$plr";
if ($stype eq "inet" || $dtype eq "inet") { if ($I1only || $stype eq "inet" || $dtype eq "inet") {
$gotinet = 1; $gotinet = 1;
if ($bw != $DEF_BW && $bw > $maxbw) { if ($bw != $DEF_BW && $bw > $maxbw) {
$maxbw = $bw; $maxbw = $bw;
......
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