#### ASpath-tree v.4.2 - Released on Thu APR 17 2003, h.16:58:12 #### File: lib/route-stability.pl Last modified on Thu DEC 5 2002, h.22:05:28 # Routine to create the route stability page for the known 6bone pTLAs # and sTLAs sub create_stability_page { my ($filename, $type) = @_; my ($ptlaprefix, $viewlink, $unstab, $unav, $key, $name, $title, $history_reldir); if ($type eq "ptla") {$title = "6bone pTLAs: BGP route stability"} elsif ($type eq "stla") {$title = "sTLAs: BGP route stability"} else {return(1)} $history_reldir = substr($HISTORYHTMLDIR, length($HTMLDIR_LOCAL) + 1, length($HISTORYHTMLDIR) - length($HTMLDIR_LOCAL)); open(HTMLFILE,">".$filename); print HTMLFILE &header($title, 0); print HTMLFILE "\n"; if ($SITEPICTURE) { print HTMLFILE "\n"; } print HTMLFILE "\n"; print HTMLFILE "\n"; print HTMLFILE "
$title
Updated on $LONGDATE
\n"; print HTMLFILE "

\n"; if ($type eq "ptla") { print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE "\n"; foreach $key (sort {$PTLASTAB{$b} <=> $PTLASTAB{$a}} (keys(%PTLASTAB))) { unless ($PTLAUNAV{$key} == 1) { $PTLAINFO{$key} =~ /(\S+)\s+(\S+)/; $ptlaprefix = $1; $viewlink = "./$history_reldir/".$2.".html"; $unstab = &trunc_number($PTLASTAB{$key}*100, 1); $unav = &trunc_number($PTLAUNAV{$key}*100, 1); $name = &format_owner($key,0); print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE "\n"; } } foreach $key (sort {$PTLAUNAV{$a} <=> $PTLAUNAV{$b}} (keys(%PTLAUNAV))) { unless ($PTLAUNAV{$key} < 1) { $PTLAINFO{$key} =~ /(\S+)\s+(\S+)/; $ptlaprefix = $1; $viewlink = "./$history_reldir/".$2.".html"; $unstab = &trunc_number($PTLASTAB{$key}*100, 1); $unav = &trunc_number($PTLAUNAV{$key}*100, 1); $name = &format_owner($key,0); print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE ""; print HTMLFILE "\n"; } } print HTMLFILE "
OwnerpTLA PrefixInstabilityUnavailabilityDetails
$name$ptlaprefix$unstab\%$unav\%view
$name$ptlaprefix$unstab\%$unav\%view


Back to routing information page
This page displays a summary of the IPv6 BGP routing stability in the 6bone backbone during the last 24 hours. For each assigned pTLA, figures representing instability and unavailability of the correspondent route entry in the IPv6 BGP routing table are provided. pTLAs are sorted starting from the most unstable route entry.
These figures are calculated based on periodical snapshots of the IPv6 BGP routing table as follows: Clicking on \"view\" for each pTLA you can get more detailed information about routing stability in the last 24 hours. "; } else { print HTMLFILE "Owner"; print HTMLFILE "Prefix"; print HTMLFILE "Unstability"; print HTMLFILE "Unavailability"; print HTMLFILE "Details\n"; foreach $key (sort {$IANASTAB{$b} <=> $IANASTAB{$a}} (keys(%IANASTAB))) { unless ($IANAUNAV{$key} == 1) { $IANAINFO{$key} =~ /(\S+)\s+(\S+)/; $ptlaprefix = $1; $viewlink = "./$history_reldir/".$2.".html"; $unstab = &trunc_number($IANASTAB{$key}*100, 1); $unav = &trunc_number($IANAUNAV{$key}*100, 1); $name = &format_owner($key,1); print HTMLFILE "$name"; print HTMLFILE "$ptlaprefix"; print HTMLFILE "$unstab\%$unav\%"; print HTMLFILE "view\n"; } } foreach $key (sort {$IANAUNAV{$a} <=> $IANAUNAV{$b}} (keys(%IANAUNAV))) { unless ($IANAUNAV{$key} < 1) { $IANAINFO{$key} =~ /(\S+)\s+(\S+)/; $ptlaprefix = $1; $viewlink = "./$history_reldir/".$2.".html"; $unstab = &trunc_number($IANASTAB{$key}*100, 1); $unav = &trunc_number($IANAUNAV{$key}*100, 1); $name = &format_owner($key,1); print HTMLFILE "$name"; print HTMLFILE "$ptlaprefix"; print HTMLFILE "$unstab\%$unav\%"; print HTMLFILE "view\n"; } } print HTMLFILE " \n

Back to routing information page

\n


\n This page displays all the locally known sTLAs that are advertised inside the 6Bone backbone. For each IPv6 BGP route entry, figures representing instability and unavailability of are provided. Ruote entries are sorted starting from the most unstable route entry.
These figures are calculated based on periodical snapshots of the IPv6 BGP routing table as follows: Clicking on \"view\" for each sTLA you can get more detailed information about routing stability in the last 24 hours. "; } print HTMLFILE "
\n".&footer."
\n\n\n"; close(HTMLFILE); return(0); } # Routine to create HTML route stability files sub create_html_stability_detailfile { my ($filename, $prefix, $aspath, $sitename, $nunavail, $nchanges, $nsamples, @aspaths) = @_; my ($unav, $unstab); my ($currentaspath, $currentn, $perc, $asn, $separator, $truncname); my ($maxlen, $ncolumns, $ntcolumns, $key); my @asns = (); my %hints = (); open(HIFILE,">".$filename); print HIFILE &header("Last 24h $sitename history: $LONGDATE", 0); if ($sitename =~ /^[\-\?]/) {$sitename = ''} else {$sitename = "($sitename)"} print HIFILE "$prefix $sitename\n

\n"; print HIFILE "

\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n
Current status: "; if ($aspath eq "0") {print HIFILE "not present"} else {print HIFILE "route present"} print HIFILE "
Current AS Path: "; if ($aspath eq "0") {print HIFILE "none"} else {print HIFILE "$aspath"} print HIFILE "
\n

\n"; print HIFILE "Last 24 hour report
\n"; $unav = &trunc_number(($nunavail/$nsamples)*100, 1)."\%"; $unstab = &trunc_number(($nchanges/$nsamples)*100, 1)."\%"; print HIFILE "

\n\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "
Unavailability (n_path_unavailable_detections/n_samples)$unav($nunavail\/$nsamples)
Unstability (n_path_changes/n_samples)$unstab($nchanges\/$nsamples)
\n

\n"; print HIFILE "

Route distribution:\n"; print HIFILE "

\n"; $maxlen = 0; for (@aspaths) { /^\s*\S+\s+(\S+)/; $currentaspath = $1; @asns = split(/\//,$currentaspath); if (@asns > $maxlen) {$maxlen = @asns} } $ncolumns = 2*$maxlen; $ntcolumns = $ncolumns + 7; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; print HIFILE "\n"; undef %hints; for (@aspaths) { /^\s*(\S+)\s+(\S+)/; $currentn = $1; $currentaspath = $2; if ($currentn == 0) {next} $perc = &trunc_number(($currentn/$nsamples)*100, 1)."\%"; @asns = split(/\//,$currentaspath); print HIFILE ""; print HIFILE ""; print HIFILE ""; print HIFILE ""; print HIFILE ""; print HIFILE "\n"; print HIFILE "\n"; if ($currentaspath eq "0") { print HIFILE "\n"; } else { $separator = " "; foreach $asn (@asns) { $truncname = &format_asname($asn); if ($ASNAME{$asn} =~ /^AS\d+$/ && $HINTS{$asn}) {$hints{$asn} = $HINTS{$asn}}; print HIFILE "\n"; print HIFILE "\n"; $separator = "-"; } print HIFILE "\n"; } } print HIFILE "
Frequency  AS path 
$perc ($currentn/$nsamples Unavailable
$separator$truncname
\n

\n"; if (%hints) { print HIFILE "Hints:
\n"; foreach $key (keys(%hints)) { print HIFILE "$key: $hints{$key}
\n"; } print HIFILE "
\n"; } print HIFILE "


\n ".&footer." \n\n\n "; close(HIFILE); return(1); } (1); #### ASpath-tree v.4.2 - Released on Thu APR 17 2003, h.16:58:12 #### File: lib/route-stability.pl Last modified on Thu DEC 5 2002, h.22:05:28