Commit 76e22cc0 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add info to ltmap file that indicates a link is droptail,red, or gred.

This is strictly information right now; it is not worth trying to make
linktest calculate the expected loss for a red or gred link, but at
least the error report will indicate it.

Also add a linktest version tag and send that to the output log.
parent c5abb71a
...@@ -12,6 +12,8 @@ use IO::Handle; ...@@ -12,6 +12,8 @@ use IO::Handle;
use English; use English;
use Socket; use Socket;
my $LINKTEST_VERSION = "1.0";
# #
# Linktest test script. This script is set up to run as root on # Linktest test script. This script is set up to run as root on
# experiment nodes. It is invoked by the Linktest daemon after the # experiment nodes. It is invoked by the Linktest daemon after the
...@@ -120,7 +122,8 @@ struct ( edge => { ...@@ -120,7 +122,8 @@ struct ( edge => {
dstip => '$', dstip => '$',
bw => '$', bw => '$',
delay => '$', delay => '$',
loss => '$'}); loss => '$',
queuetype => '$'});
struct ( host => { struct ( host => {
name => '$', name => '$',
...@@ -345,8 +348,9 @@ sleep(int(rand(5))); ...@@ -345,8 +348,9 @@ sleep(int(rand(5)));
&get_topo($topology_file) unless &is_special_node(); &get_topo($topology_file) unless &is_special_node();
&debug_top(); &debug_top();
my $msg = "Linktest Starting"; my $msg = "Linktest Version $LINKTEST_VERSION";
&sim_event(EVENT_LOG,$msg); &sim_event(EVENT_LOG, $msg);
&post_event(EVENT_REPORT, $msg);
&debug("\n$msg\n\n"); &debug("\n$msg\n\n");
if (defined($rtproto) && $rtproto eq RTPROTO_SESSION) { if (defined($rtproto) && $rtproto eq RTPROTO_SESSION) {
...@@ -1035,7 +1039,7 @@ sub static_rt_test { ...@@ -1035,7 +1039,7 @@ sub static_rt_test {
# #
# If the count gets too high, lets stop and wait. # If the count gets too high, lets stop and wait.
# #
if ($waitcount > 1) { if ($waitcount > 10) {
&debug("Pausing to wait for outstanding pings to clear ...\n"); &debug("Pausing to wait for outstanding pings to clear ...\n");
foreach my $name (keys(%waitlist)) { foreach my $name (keys(%waitlist)) {
...@@ -1105,7 +1109,8 @@ sub print_link { ...@@ -1105,7 +1109,8 @@ sub print_link {
$edge->dst . "-" . $edge->name; $edge->dst . "-" . $edge->name;
$str .= " (" . ($edge->bw / 1000000) . " Mbps, " . $str .= " (" . ($edge->bw / 1000000) . " Mbps, " .
$edge->delay . "ms, " . (100 * $edge->loss) . "% loss)"; $edge->delay . "ms, " . (100 * $edge->loss) . "% loss, " .
$edge->queuetype . ")";
return $str; return $str;
} }
...@@ -1135,7 +1140,9 @@ sub get_topo { ...@@ -1135,7 +1140,9 @@ sub get_topo {
$newHost->name($1); $newHost->name($1);
$newHost->visited(0); $newHost->visited(0);
$hostmap{$1} = $newHost; $hostmap{$1} = $newHost;
} elsif ( /^l (\S+)\s+(\S+)\s+(\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\S+)/) { }
elsif (/^l (\S+)\s+(\S+)\s+(\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\S+)\s+(\S+)/ ||
/^l (\S+)\s+(\S+)\s+(\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\S+)/) {
my $newEdge = new edge; my $newEdge = new edge;
$newEdge->name($6); $newEdge->name($6);
$newEdge->src($1); $newEdge->src($1);
...@@ -1145,6 +1152,7 @@ sub get_topo { ...@@ -1145,6 +1152,7 @@ sub get_topo {
$newEdge->bw($3); $newEdge->bw($3);
$newEdge->delay($4 * 1000); # units of ms $newEdge->delay($4 * 1000); # units of ms
$newEdge->loss($5); $newEdge->loss($5);
$newEdge->queuetype((defined($7) ? $7 : "droptail"));
push @links, $newEdge; push @links, $newEdge;
push @{ $hostmap{$newEdge->src}->links }, $newEdge; push @{ $hostmap{$newEdge->src}->links }, $newEdge;
push @{ $hostmap{$newEdge->dst}->links }, $newEdge; push @{ $hostmap{$newEdge->dst}->links }, $newEdge;
...@@ -1380,9 +1388,9 @@ sub wait_all { ...@@ -1380,9 +1388,9 @@ sub wait_all {
} }
# #
# The special node sends a signal to run_linktest, in case it is listening. # post_event sends an event to the ltevent process running on ops (the
# Mainly informational, but the COMPLETE message informs run_linktest.pl # controlling process for linktest). The REPORT events are displayed to
# that all exited properly. # the user.
# #
sub post_event { sub post_event {
my ($event,$args) = map { $1 if (/(.*)/) } @_; my ($event,$args) = map { $1 if (/(.*)/) } @_;
...@@ -1415,9 +1423,9 @@ sub post_event2 { ...@@ -1415,9 +1423,9 @@ sub post_event2 {
} }
# #
# The special node sends a signal to run_linktest, in case it is listening. # sim_event sends an event to the event scheduler. EVENT_LOG events
# Mainly informational, but the COMPLETE message informs run_linktest.pl # deposit their message into the event scheduler log file. Kinda silly
# that all exited properly. # if ya ask me!
# #
sub sim_event { sub sim_event {
my ($event,$args) = map { $1 if (/(.*)/) } @_; my ($event,$args) = map { $1 if (/(.*)/) } @_;
......
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