4 # Description: Trace the route path to a node using two methods: TCP-related ICMP errors, and TTL expiry.
5 # Then match the two paths to see that they concord. If there's a slight difference, it's probably OK given that
6 # some routers might support one type of error but not the other, and that the routes are not guaranteed to be the
8 # Dependencies: tcptraceroute, traceroute, which
9 # Author: sapanb@cs.princeton.edu
14 # ********************************************************************************
18 # The node that we're going to trace route. It's probably a good idea to change it
19 # periodically so that we don't harass the same host.
20 my $guineapig="vini-veritas.net";
22 # Location of traceroute, tcptraceroute
23 my $ttraceroute=`which tcptraceroute 2>/dev/null`;
24 my $traceroute=`which traceroute 2>/dev/null`;
31 if ($traceroute !~ /^\//) {
32 $traceroute=`which tracepath 2>/dev/null`;
36 if (!-e "$ttraceroute") {
37 print $ttraceroute."\n";
38 print "[OOPS] TCPtraceroute not found. Installing... \n";
39 system("yum -y tcptraceroute");
40 if (!-e "$ttraceroute") {
41 print "[FAILED] TCPtraceroute could not be installed. Test failed.\n";
45 print "Found tcptraceroute. Good.\n";
48 if ($traceroute !~ /^\//) {
49 die("[FAILED] Please install traceroute in the slice before running this test\n");
52 sub open_tcptraceroute {
53 my $cmdline="sudo $ttraceroute $guineapig 2>&1";
59 if (/\((\d+\.\d+\.\d+\.\d+)\)/) {
69 my $cmdline="$traceroute $guineapig 2>&1";
75 if (/\((\d+\.\d+\.\d+\.\d+)\)/) {
91 } elsif ($tr{$_}==2) {
95 return ($single,$double);
99 print "[FAILED] Timed out waiting.\n";
115 print "[SUCCESS] traceroutes succeeded, singles: $s, doubles: $d\n";
118 print "[FAILED] traceroutes returned different results: $s, $d\n";
122 print "Generating connections...\n";
123 $SIG{ALRM}=\&alhandler;